Пример #1
0
 public static void IsValue <T>(ValueTypeTraits traits)
 {
     if (!ValueObjectWhiteList.Contains <T>())
     {
         var activator   = ValueObjectActivator.FreshInstance(typeof(T), Generator);
         var constraints = CreateConstraintsBasedOn(typeof(T), traits, activator);
         XAssert.TypeAdheresTo(constraints);
     }
 }
        public static void ShouldHaveValueSemantics(
            Func <T>[] equalInstances,
            Func <T>[] otherInstances,
            IKnowWhatValueTraitsToCheck traits)
        {
            equalInstances.Should().NotBeNullOrEmpty();
            otherInstances.Should().NotBeNullOrEmpty();
            var type = typeof(T);

            if (!ValueObjectWhiteList.Contains(type))
            {
                var constraints = ValueObjectConstraints
                                  .AssertionConstraints
                                  .ForValueSemantics(type, equalInstances, otherInstances, traits);
                AssertionConstraintsEngine.TypeAdheresTo(constraints);
            }
        }