-
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.
* Align config json error handling of EvaluateLogHelper with error reporting of RolloutEvaluator * Improve naming * Improve User Object tests * Allow leading/trailing whitespace in length prefix for (NOT) STARTS/ENDS WITH ANY OF comparators to align behavior with other SDKs * Correct grammar mistake * Make naming of UserComparator members consistent * Add tests for some number parsing edge cases * Adjust terminology to docs (eliminate the usage of term 'match' in the context of conditions) * Bump version
- Loading branch information
Showing
8 changed files
with
134 additions
and
108 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
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
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))); | ||
} | ||
} |
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
Oops, something went wrong.