You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: OptimizelySDK.Tests/UtilsTests/ExperimentUtilsTest.cs
+15-15Lines changed: 15 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2019, Optimizely
2
+
* Copyright 2019-2020, Optimizely
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -64,7 +64,7 @@ public void TestIsUserInExperimentReturnsTrueWhenAudienceUsedInExperimentNoAttri
64
64
65
65
LoggerMock.Verify(l =>l.Log(LogLevel.DEBUG,@"Evaluating audiences for experiment ""feat_with_var_test"": [""3468206648""]"),Times.Exactly(2));
66
66
LoggerMock.Verify(l =>l.Log(LogLevel.DEBUG,@"Starting to evaluate audience ""3468206648"" with conditions: [""not"",{""name"":""input_value"",""type"":""custom_attribute"",""match"":""exists""}]"),Times.Exactly(2));
67
-
LoggerMock.Verify(l =>l.Log(LogLevel.INFO,$@"Audience ""3468206648"" evaluated to TRUE"),Times.Exactly(2));
67
+
LoggerMock.Verify(l =>l.Log(LogLevel.DEBUG,$@"Audience ""3468206648"" evaluated to TRUE"),Times.Exactly(2));
68
68
LoggerMock.Verify(l =>l.Log(LogLevel.INFO,@"Audiences for experiment ""feat_with_var_test"" collectively evaluated to TRUE"),Times.Exactly(2));
69
69
}
70
70
@@ -83,17 +83,17 @@ public void TestIsUserInExperimentReturnsFalseIfNoAudienceInORConditionPass()
83
83
84
84
LoggerMock.Verify(l =>l.Log(LogLevel.DEBUG,@"Evaluating audiences for experiment ""feat_with_var_test"": [""3468206642"",""3988293898"",""3988293899"",""3468206646"",""3468206647"",""3468206644"",""3468206643""]"),Times.Once);
85
85
LoggerMock.Verify(l =>l.Log(LogLevel.DEBUG,@"Starting to evaluate audience ""3468206642"" with conditions: [""and"", [""or"", [""or"", {""name"": ""house"", ""type"": ""custom_attribute"", ""value"": ""Gryffindor""}]]]"),Times.Once);
86
-
LoggerMock.Verify(l =>l.Log(LogLevel.INFO,@"Audience ""3468206642"" evaluated to FALSE"),Times.Once);
86
+
LoggerMock.Verify(l =>l.Log(LogLevel.DEBUG,@"Audience ""3468206642"" evaluated to FALSE"),Times.Once);
87
87
LoggerMock.Verify(l =>l.Log(LogLevel.DEBUG,@"Starting to evaluate audience ""3988293899"" with conditions: [""and"",[""or"",[""or"",{""name"":""favorite_ice_cream"",""type"":""custom_attribute"",""match"":""exists""}]]]"),Times.Once);
88
-
LoggerMock.Verify(l =>l.Log(LogLevel.INFO,@"Audience ""3988293899"" evaluated to FALSE"),Times.Once);
88
+
LoggerMock.Verify(l =>l.Log(LogLevel.DEBUG,@"Audience ""3988293899"" evaluated to FALSE"),Times.Once);
89
89
LoggerMock.Verify(l =>l.Log(LogLevel.DEBUG,@"Starting to evaluate audience ""3468206646"" with conditions: [""and"",[""or"",[""or"",{""name"":""lasers"",""type"":""custom_attribute"",""match"":""exact"",""value"":45.5}]]]"),Times.Once);
90
-
LoggerMock.Verify(l =>l.Log(LogLevel.INFO,@"Audience ""3468206646"" evaluated to FALSE"),Times.Once);
90
+
LoggerMock.Verify(l =>l.Log(LogLevel.DEBUG,@"Audience ""3468206646"" evaluated to FALSE"),Times.Once);
91
91
LoggerMock.Verify(l =>l.Log(LogLevel.DEBUG,@"Starting to evaluate audience ""3468206647"" with conditions: [""and"",[""or"",[""or"",{""name"":""lasers"",""type"":""custom_attribute"",""match"":""gt"",""value"":70}]]]"),Times.Once);
92
-
LoggerMock.Verify(l =>l.Log(LogLevel.INFO,@"Audience ""3468206647"" evaluated to FALSE"),Times.Once);
92
+
LoggerMock.Verify(l =>l.Log(LogLevel.DEBUG,@"Audience ""3468206647"" evaluated to FALSE"),Times.Once);
93
93
LoggerMock.Verify(l =>l.Log(LogLevel.DEBUG,@"Starting to evaluate audience ""3468206644"" with conditions: [""and"",[""or"",[""or"",{""name"":""lasers"",""type"":""custom_attribute"",""match"":""lt"",""value"":1.0}]]]"),Times.Once);
94
-
LoggerMock.Verify(l =>l.Log(LogLevel.INFO,@"Audience ""3468206644"" evaluated to FALSE"),Times.Once);
94
+
LoggerMock.Verify(l =>l.Log(LogLevel.DEBUG,@"Audience ""3468206644"" evaluated to FALSE"),Times.Once);
95
95
LoggerMock.Verify(l =>l.Log(LogLevel.DEBUG,@"Starting to evaluate audience ""3468206643"" with conditions: [""and"",[""or"",[""or"",{""name"":""should_do_it"",""type"":""custom_attribute"",""match"":""exact"",""value"":true}]]]"),Times.Once);
96
-
LoggerMock.Verify(l =>l.Log(LogLevel.INFO,@"Audience ""3468206643"" evaluated to FALSE"),Times.Once);
96
+
LoggerMock.Verify(l =>l.Log(LogLevel.DEBUG,@"Audience ""3468206643"" evaluated to FALSE"),Times.Once);
97
97
LoggerMock.Verify(l =>l.Log(LogLevel.INFO,@"Audiences for experiment ""feat_with_var_test"" collectively evaluated to FALSE"),Times.Once);
98
98
}
99
99
@@ -112,7 +112,7 @@ public void TestIsUserInExperimentReturnsTrueIfAnyAudienceInORConditionPass()
112
112
113
113
LoggerMock.Verify(l =>l.Log(LogLevel.DEBUG,@"Evaluating audiences for experiment ""feat_with_var_test"": [""3468206642"",""3988293898"",""3988293899"",""3468206646"",""3468206647"",""3468206644"",""3468206643""]"),Times.Once);
114
114
LoggerMock.Verify(l =>l.Log(LogLevel.DEBUG,@"Starting to evaluate audience ""3468206642"" with conditions: [""and"", [""or"", [""or"", {""name"": ""house"", ""type"": ""custom_attribute"", ""value"": ""Gryffindor""}]]]"),Times.Once);
115
-
LoggerMock.Verify(l =>l.Log(LogLevel.INFO,@"Audience ""3468206642"" evaluated to TRUE"),Times.Once);
115
+
LoggerMock.Verify(l =>l.Log(LogLevel.DEBUG,@"Audience ""3468206642"" evaluated to TRUE"),Times.Once);
116
116
LoggerMock.Verify(l =>l.Log(LogLevel.INFO,@"Audiences for experiment ""feat_with_var_test"" collectively evaluated to TRUE"),Times.Once);
117
117
}
118
118
@@ -143,18 +143,18 @@ public void TestIsUserInExperimentReturnsFalseIfAnyAudienceInANDConditionDoesNot
143
143
144
144
LoggerMock.Verify(l =>l.Log(LogLevel.DEBUG,@"Evaluating audiences for experiment ""audience_combinations_experiment"": [""and"",[""or"",""3468206642"",""3988293898""],[""or"",""3988293899"",""3468206646"",""3468206647"",""3468206644"",""3468206643""]]"),Times.Once);
145
145
LoggerMock.Verify(l =>l.Log(LogLevel.DEBUG,@"Starting to evaluate audience ""3468206642"" with conditions: [""and"", [""or"", [""or"", {""name"": ""house"", ""type"": ""custom_attribute"", ""value"": ""Gryffindor""}]]]"),Times.Once);
146
-
LoggerMock.Verify(l =>l.Log(LogLevel.INFO,@"Audience ""3468206642"" evaluated to TRUE"),Times.Once);
146
+
LoggerMock.Verify(l =>l.Log(LogLevel.DEBUG,@"Audience ""3468206642"" evaluated to TRUE"),Times.Once);
147
147
LoggerMock.Verify(l =>l.Log(LogLevel.DEBUG,@"Starting to evaluate audience ""3988293899"" with conditions: [""and"",[""or"",[""or"",{""name"":""favorite_ice_cream"",""type"":""custom_attribute"",""match"":""exists""}]]]"),Times.Once);
148
-
LoggerMock.Verify(l =>l.Log(LogLevel.INFO,@"Audience ""3988293899"" evaluated to FALSE"),Times.Once);
148
+
LoggerMock.Verify(l =>l.Log(LogLevel.DEBUG,@"Audience ""3988293899"" evaluated to FALSE"),Times.Once);
149
149
LoggerMock.Verify(l =>l.Log(LogLevel.DEBUG,@"Starting to evaluate audience ""3468206646"" with conditions: [""and"",[""or"",[""or"",{""name"":""lasers"",""type"":""custom_attribute"",""match"":""exact"",""value"":45.5}]]]"),Times.Once);
150
-
LoggerMock.Verify(l =>l.Log(LogLevel.INFO,@"Audience ""3468206646"" evaluated to FALSE"),Times.Once);
150
+
LoggerMock.Verify(l =>l.Log(LogLevel.DEBUG,@"Audience ""3468206646"" evaluated to FALSE"),Times.Once);
151
151
LoggerMock.Verify(l =>l.Log(LogLevel.DEBUG,@"Starting to evaluate audience ""3468206647"" with conditions: [""and"",[""or"",[""or"",{""name"":""lasers"",""type"":""custom_attribute"",""match"":""gt"",""value"":70}]]]"),Times.Once);
152
-
LoggerMock.Verify(l =>l.Log(LogLevel.INFO,@"Audience ""3468206647"" evaluated to FALSE"),Times.Once);
152
+
LoggerMock.Verify(l =>l.Log(LogLevel.DEBUG,@"Audience ""3468206647"" evaluated to FALSE"),Times.Once);
153
153
LoggerMock.Verify(l =>l.Log(LogLevel.DEBUG,@"Starting to evaluate audience ""3468206644"" with conditions: [""and"",[""or"",[""or"",{""name"":""lasers"",""type"":""custom_attribute"",""match"":""lt"",""value"":1.0}]]]"),Times.Once);
154
-
LoggerMock.Verify(l =>l.Log(LogLevel.INFO,@"Audience ""3468206644"" evaluated to FALSE"),Times.Once);
154
+
LoggerMock.Verify(l =>l.Log(LogLevel.DEBUG,@"Audience ""3468206644"" evaluated to FALSE"),Times.Once);
155
155
LoggerMock.Verify(l =>l.Log(LogLevel.DEBUG,@"Starting to evaluate audience ""3468206643"" with conditions: [""and"",[""or"",[""or"",{""name"":""should_do_it"",""type"":""custom_attribute"",""match"":""exact"",""value"":true}]]]"),Times.Once);
156
156
LoggerMock.Verify(l =>l.Log(LogLevel.DEBUG,@"Audience condition {""type"":""custom_attribute"",""match"":""exact"",""name"":""should_do_it"",""value"":true} evaluated to UNKNOWN because no value was passed for user attribute ""should_do_it"""),Times.Once);
157
-
LoggerMock.Verify(l =>l.Log(LogLevel.INFO,@"Audience ""3468206643"" evaluated to UNKNOWN"),Times.Once);
157
+
LoggerMock.Verify(l =>l.Log(LogLevel.DEBUG,@"Audience ""3468206643"" evaluated to UNKNOWN"),Times.Once);
158
158
LoggerMock.Verify(l =>l.Log(LogLevel.INFO,@"Audiences for experiment ""audience_combinations_experiment"" collectively evaluated to FALSE"),Times.Once);
0 commit comments