public void FuzzProfileByTypeNotAFuzzProfile() { var annotation = new FuzzTestMethodAttribute { FuzzProfileType = typeof(object), }; Assert.ThrowsException <ArgumentException>(() => annotation.FuzzProfile); }
public void FuzzProfileByType() { var annotation = new FuzzTestMethodAttribute { FuzzProfileType = typeof(UnitTestFuzzProfile), }; Assert.IsInstanceOfType(annotation.FuzzProfile, typeof(UnitTestFuzzProfile)); }
private TestResult[] TestMethodInvocationResults <TTest>() where TTest : notnull, new() { var attribute = new FuzzTestMethodAttribute(); var fuzzClassInstance = new TTest(); var method = CreateTestMethodMock(fuzzClassInstance); return(attribute.Execute(method)); }
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); }