Esempio n. 1
0
        public void FuzzProfileByValue()
        {
            var annotation = new FuzzDataAttribute
            {
                FuzzProfile = new UnitTestFuzzProfile(),
            };

            Assert.IsType <UnitTestFuzzProfile>(annotation.FuzzProfile);
        }
Esempio n. 2
0
        public void FuzzProfileByType()
        {
            var dataAttribute = new FuzzDataAttribute()
            {
                FuzzProfileType = typeof(UnitTestFuzzProfile),
            };

            Assert.IsType <UnitTestFuzzProfile>(dataAttribute.FuzzProfile);
        }
Esempio n. 3
0
        public void FuzzProfileByTypeNotAFuzzProfile()
        {
            var annotation = new FuzzDataAttribute
            {
                FuzzProfileType = typeof(object),
            };

            Assert.Throws <ArgumentException>(() => annotation.FuzzProfile);
        }
Esempio n. 4
0
        public void TestIterations([UniformIntGenerator(Min = 0, Max = 100)] int iterations)
        {
            var testMethod    = typeof(FuzzDataAttributeTest).GetMethod(nameof(TestIterations)) !;
            var dataAttribute = new FuzzDataAttribute()
            {
                Iterations = iterations,
            };

            var results = dataAttribute.GetData(testMethod);

            Assert.Equal(results.Count(), iterations);
        }