Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion OptimizelySDK.Tests/Assertions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ public static void AreEqual(Experiment expected, Experiment actual)
Assert.AreEqual(expected.GroupId, actual.GroupId);
Assert.AreEqual(expected.GroupPolicy, actual.GroupPolicy);
Assert.AreEqual(expected.Id, actual.Id);
Assert.AreEqual(expected.IsExperimentRunning, actual.IsExperimentRunning);
Assert.AreEqual(expected.isRunning, actual.isRunning);
Assert.AreEqual(expected.IsInMutexGroup, actual.IsInMutexGroup);
Assert.AreEqual(expected.Key, actual.Key);
Assert.AreEqual(expected.LayerId, actual.LayerId);
Expand All @@ -500,13 +500,42 @@ public static void AreEqual(Experiment expected, Experiment actual)
AreEquivalent(expected.Variations, actual.Variations);
}

public static void AreEqual(ExperimentCore expected, ExperimentCore actual)
{
if (expected == null && actual == null)
{
return;
}

Assert.IsNotNull(expected, "Expected ExperimentCore should not be null");
Assert.IsNotNull(actual, "Actual ExperimentCore should not be null");

Assert.AreEqual(expected.AudienceConditions, actual.AudienceConditions);
Assert.AreEqual(expected.AudienceConditionsList, actual.AudienceConditionsList);
Assert.AreEqual(expected.AudienceConditionsString, actual.AudienceConditionsString);
AreEquivalent(expected.AudienceIds, actual.AudienceIds);
Assert.AreEqual(expected.AudienceIdsList, actual.AudienceIdsList);
Assert.AreEqual(expected.AudienceIdsString, actual.AudienceIdsString);
Assert.AreEqual(expected.Id, actual.Id);
Assert.AreEqual(expected.isRunning, actual.isRunning);
Assert.AreEqual(expected.Key, actual.Key);
Assert.AreEqual(expected.LayerId, actual.LayerId);
Assert.AreEqual(expected.Status, actual.Status);
AreEquivalent(expected.TrafficAllocation, actual.TrafficAllocation);
AreEquivalent(expected.VariationIdToVariationMap, actual.VariationIdToVariationMap);
AreEquivalent(expected.VariationKeyToVariationMap, actual.VariationKeyToVariationMap);
AreEquivalent(expected.Variations, actual.Variations);
}

#endregion Experiment

#region FeatureDecision

public static void AreEqual(FeatureDecision expected, FeatureDecision actual)
{
AreEqual(expected.Experiment, actual.Experiment);
AreEqual(expected.Variation, actual.Variation);
Assert.AreEqual(expected.Source, actual.Source);
}

#endregion FeatureDecision
Expand Down
Loading
Loading