Exemplo n.º 1
0
 public void EqualsUsesDeepEqualityForArrays()
 {
     TypeBehavior.CheckEqualsAndHashCode(
         () => LdValue.BuildArray().Add("a")
         .Add(LdValue.BuildArray().Add("b").Add("c").Build())
         .Build(),
         () => LdValue.BuildArray().Add("a").Build(),
         () => LdValue.BuildArray().Add("a").Add("b").Add("c").Build(),
         () => LdValue.BuildArray().Add("a")
         .Add(LdValue.BuildArray().Add("b").Add("x").Build())
         .Build()
         );
 }
Exemplo n.º 2
0
 public void TestEqualsAndHashCodeForPrimitives()
 {
     TypeBehavior.CheckEqualsAndHashCode(
         // each value in this list should be unequal to all the other values and equal to itself
         () => LdValue.Null,
         () => LdValue.Of(true),
         () => LdValue.Of(false),
         () => LdValue.Of(1),
         () => LdValue.Of(2),
         () => LdValue.Of("a"),
         () => LdValue.Of("b")
         );
 }
 public void TestEqualityAndHashCode()
 {
     TypeBehavior.CheckEqualsAndHashCode(
         // each value in this list should be unequal to all the other values and equal to itself
         () => EvaluationReason.OffReason,
         () => EvaluationReason.FallthroughReason,
         () => EvaluationReason.FallthroughReason.WithInExperiment(true),
         () => EvaluationReason.RuleMatchReason(0, "rule1"),
         () => EvaluationReason.RuleMatchReason(0, "rule1").WithInExperiment(true),
         () => EvaluationReason.RuleMatchReason(0, "rule1").WithBigSegmentsStatus(BigSegmentsStatus.Stale),
         () => EvaluationReason.RuleMatchReason(1, "rule2"),
         () => EvaluationReason.PrerequisiteFailedReason("a"),
         () => EvaluationReason.PrerequisiteFailedReason("b"),
         () => EvaluationReason.ErrorReason(EvaluationErrorKind.FlagNotFound),
         () => EvaluationReason.ErrorReason(EvaluationErrorKind.Exception)
         );
 }
Exemplo n.º 4
0
 public void EqualsUsesDeepEqualityForObjects()
 {
     TypeBehavior.CheckEqualsAndHashCode(
         () => LdValue.BuildObject()
         .Add("a", "b")
         .Add("c", LdValue.BuildObject().Add("d", "e").Build())
         .Build(),
         () => LdValue.BuildObject()
         .Add("a", "b")
         .Build(),
         () => LdValue.BuildObject()
         .Add("a", "b")
         .Add("c", LdValue.BuildObject().Add("d", "e").Build())
         .Add("f", "g")
         .Build(),
         () => LdValue.BuildObject()
         .Add("a", "b")
         .Add("c", LdValue.BuildObject().Add("d", "f").Build())
         .Build()
         );
 }