Пример #1
0
        public void IgnoredProperties_prevents_testing_specified_properties()
        {
            var sut = new ClassTester(new TestTypeWBadProperty());

            sut.IgnoredProperties.Add("CantCreateInstanceProperty");
            sut.TestProperties();
        }
Пример #2
0
        public void Simple_stuff_works()
        {
            var tester = new ClassTester(new MethodSignature(typeof(int), typeof(string)));

            tester.IgnoredConstructors.Add(new MethodSignature(typeof(ParameterInfo[])));

            tester.TestConstructors();
            tester.TestProperties();
        }
Пример #3
0
        public void TestProperties_throws_error_when_cant_generate_2_different_property_values()
        {
            var mockTypeFactory = new Mock <ITypeFactory>();

            mockTypeFactory.Setup(factory => factory.CanCreateInstance(It.IsAny <Type>())).Returns(value: true);
            mockTypeFactory.Setup(factory => factory.CreateRandomValue(typeof(int))).Returns(value: -1);
            var sut = new ClassTester(new TestTypeWINotifyPropertyChanged(), mockTypeFactory.Object);

            Assert.Throws <InvalidOperationException>(() => sut.TestProperties());
        }
        public void Properties_work()
        {
            var classTester = new ClassTester(new TransitionDetails <SaleState, SaleEvent>("test"
                                                                                           , new StateDetails <SaleState, SaleEvent>(SaleState.Open)
                                                                                           , SaleEvent.AddItem));

            classTester.TestConstructors();
            //classTester.TestEquality();
            classTester.TestProperties();
        }
Пример #5
0
        public void TestProperties_tests_properties()
        {
            var sut = new ClassTester(new TestType());

            sut.TestProperties();
        }