Esempio n. 1
0
        public void BeTrueForTypeWithArrays()
        {
            var ctors = new Dictionary <Type, Func <object> >
            {
                { typeof(NonDefaultConstructor), () => new NonDefaultConstructor(5) }
            };
            var result = HasStructural.Equality(typeof(HasArrays), ctors);

            Assert.True(result);
        }
Esempio n. 2
0
        public void BeTrueForComplexTypeThatImplementsStructuralEqualityWithConstructorPassedIn()
        {
            var ctors = new Dictionary <Type, Func <object> >
            {
                { typeof(NonDefaultConstructor), () => new NonDefaultConstructor(5) }
            };
            var result = HasStructural.Equality(typeof(SomeComplexClass), ctors);

            Assert.True(result);
        }
Esempio n. 3
0
        public void BeTrueForTypeThatImplementsStructuralEqualityWithConstructorPassedIn()
        {
            var ctors = new Dictionary <Type, Func <object> >
            {
                { typeof(OtherClassWithEquality), () => new OtherClassWithEquality {
                      SomeNumber = 789
                  } },
            };
            var result = HasStructural.Equality(typeof(OtherClassWithEquality), ctors);

            Assert.True(result);
        }
Esempio n. 4
0
        public void BeFalseForBasicTypeWithConstructorPassed()
        {
            var ctors = new Dictionary <Type, Func <object> >
            {
                { typeof(AnotherClass), () => new AnotherClass {
                      SomeNumber = 11, SomeString = "12", someChar = (char)13, someByte = 14
                  } }
            };

            var result = HasStructural.Equality(typeof(AnotherClass), ctors);

            Assert.False(result);
        }
Esempio n. 5
0
        public void SupportStructuralEquality()
        {
            var hasEquality = HasStructural.Equality(typeof(VersionInfo));

            Assert.True(hasEquality);
        }
Esempio n. 6
0
        public void BeTrueForTypeThatImplementsStructuralEquality()
        {
            var result = HasStructural.Equality(typeof(OtherClassWithEquality));

            Assert.True(result);
        }
Esempio n. 7
0
        public void BeFalseForBasicType()
        {
            var result = HasStructural.Equality(typeof(AnotherClass));

            Assert.False(result);
        }