Пример #1
0
        public void FuzzProfileByTypeNotAFuzzProfile()
        {
            var annotation = new FuzzTestMethodAttribute
            {
                FuzzProfileType = typeof(object),
            };

            Assert.ThrowsException <ArgumentException>(() => annotation.FuzzProfile);
        }
Пример #2
0
        public void FuzzProfileByType()
        {
            var annotation = new FuzzTestMethodAttribute
            {
                FuzzProfileType = typeof(UnitTestFuzzProfile),
            };

            Assert.IsInstanceOfType(annotation.FuzzProfile, typeof(UnitTestFuzzProfile));
        }
Пример #3
0
        private TestResult[] TestMethodInvocationResults <TTest>()
            where TTest : notnull, new()
        {
            var attribute         = new FuzzTestMethodAttribute();
            var fuzzClassInstance = new TTest();
            var method            = CreateTestMethodMock(fuzzClassInstance);

            return(attribute.Execute(method));
        }
Пример #4
0
        private TTest TestMethodInvocationClass <TTest>(int iterations = 20, IFuzzProfile?profile = null)
            where TTest : notnull, new()
        {
            var attribute = new FuzzTestMethodAttribute()
            {
                Iterations = iterations,
            };

            if (profile != null)
            {
                attribute.FuzzProfile = profile;
            }

            var fuzzClassInstance = new TTest();
            var method            = CreateTestMethodMock(fuzzClassInstance);

            attribute.Execute(method);

            return(fuzzClassInstance);
        }