Skip to content

Commit 4c48021

Browse files
committed
Add tests for mail SQL Util validations
1 parent 7161299 commit 4c48021

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using Microsoft.Azure.Commands.Sql.Services;
2+
using Microsoft.WindowsAzure.Commands.ScenarioTest;
3+
using System;
4+
using System.Collections.Generic;
5+
using System.Text;
6+
using Xunit;
7+
8+
namespace Microsoft.Azure.Commands.Sql.Test.UnitTests
9+
{
10+
public class AzureSqlUtilTests
11+
{
12+
[Fact]
13+
[Trait(Category.AcceptanceType, Category.CheckIn)]
14+
public void MailValidation()
15+
{
16+
Assert.True(Util.AreEmailAddressesInCorrectFormat(new[] {
17+
18+
19+
"[email protected]"}), "Valid email addresses are flagged as invalid");
20+
Assert.False(Util.AreEmailAddressesInCorrectFormat(new[] { "kuku" }), "Invalid mail address not detected");
21+
Assert.False(Util.AreEmailAddressesInCorrectFormat(new[] { "kuku@microsoft" }), "Invalid mail address not detected");
22+
Assert.False(Util.AreEmailAddressesInCorrectFormat(new[] { "@micorsoft.com", "[email protected]" }), "One fauly mail address should fail the lot");
23+
}
24+
}
25+
}

0 commit comments

Comments
 (0)