-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
15 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,6 @@ public void CreateUser_WithIdAndEmailAndCountry_AllAttributesShouldContainsPasse | |
var user = new User("id") | ||
{ | ||
Email = "[email protected]", | ||
|
||
Country = "US" | ||
}; | ||
|
||
|
@@ -25,12 +24,17 @@ public void CreateUser_WithIdAndEmailAndCountry_AllAttributesShouldContainsPasse | |
|
||
Assert.IsTrue(actualAttributes.TryGetValue(nameof(User.Email), out var s)); | ||
Assert.AreEqual("[email protected]", s); | ||
Assert.AreEqual("[email protected]", user.GetAttribute(nameof(User.Email))); | ||
|
||
Assert.IsTrue(actualAttributes.TryGetValue(nameof(User.Country), out s)); | ||
Assert.AreEqual("US", s); | ||
Assert.AreEqual("US", user.GetAttribute(nameof(User.Country))); | ||
|
||
Assert.IsTrue(actualAttributes.TryGetValue(nameof(User.Identifier), out s)); | ||
Assert.AreEqual("id", s); | ||
Assert.AreEqual("id", user.GetAttribute(nameof(User.Identifier))); | ||
|
||
Assert.AreEqual(3, actualAttributes.Count); | ||
} | ||
|
||
[TestMethod] | ||
|
@@ -41,9 +45,7 @@ public void UseWellKnownAttributesAsCustomProperties_ShouldNotAppendAllAttribute | |
var user = new User("id") | ||
{ | ||
Email = "[email protected]", | ||
|
||
Country = "US", | ||
|
||
Custom = | ||
{ | ||
{ "myCustomAttribute", "myCustomAttributeValue"}, | ||
|
@@ -59,13 +61,17 @@ public void UseWellKnownAttributesAsCustomProperties_ShouldNotAppendAllAttribute | |
|
||
// Assert | ||
|
||
Assert.IsTrue(actualAttributes.TryGetValue(nameof(User.Identifier), out var s)); | ||
Assert.AreEqual("id", s); | ||
Assert.AreNotEqual("myIdentifier", s); | ||
Assert.IsTrue(actualAttributes.TryGetValue(nameof(User.Email), out var s)); | ||
Assert.AreEqual("id@example.com", s); | ||
Assert.AreEqual("[email protected]", user.GetAttribute(nameof(User.Email))); | ||
|
||
Assert.IsTrue(actualAttributes.TryGetValue(nameof(User.Country), out s)); | ||
Assert.AreEqual("US", s); | ||
Assert.AreNotEqual("United States", s); | ||
Assert.AreEqual("US", user.GetAttribute(nameof(User.Country))); | ||
|
||
Assert.IsTrue(actualAttributes.TryGetValue(nameof(User.Identifier), out s)); | ||
Assert.AreEqual("id", s); | ||
Assert.AreEqual("id", user.GetAttribute(nameof(User.Identifier))); | ||
|
||
Assert.IsTrue(actualAttributes.TryGetValue(nameof(User.Email), out s)); | ||
Assert.AreEqual("[email protected]", s); | ||
|
@@ -89,9 +95,7 @@ public void UseWellKnownAttributesAsCustomPropertiesWithDifferentNames_ShouldApp | |
var user = new User("id") | ||
{ | ||
Email = "[email protected]", | ||
|
||
Country = "US", | ||
|
||
Custom = | ||
{ | ||
{ attributeName, attributeValue} | ||
|
@@ -108,6 +112,7 @@ public void UseWellKnownAttributesAsCustomPropertiesWithDifferentNames_ShouldApp | |
|
||
Assert.IsTrue(actualAttributes.TryGetValue(attributeName, out var s)); | ||
Assert.AreEqual(attributeValue, s); | ||
Assert.AreEqual(attributeValue, user.GetAttribute(attributeName)); | ||
} | ||
|
||
[DataTestMethod()] | ||
|
@@ -122,5 +127,6 @@ public void CreateUser_ShouldSetIdentifier(string identifier, string expectedVal | |
|
||
Assert.AreEqual(expectedValue, user.Identifier); | ||
Assert.AreEqual(expectedValue, user.GetAllAttributes()[nameof(User.Identifier)]); | ||
Assert.AreEqual(expectedValue, user.GetAttribute(nameof(User.Identifier))); | ||
} | ||
} |