public void CheckAllTestsAreInPlace() { var implTypes = ChallengeHelpers.GetIncorrectImplementationTypes(); var testedImpls = ChallengeHelpers.GetIncorrectImplementationTests() .Select(t => t.CreateStatistics()) .ToArray(); foreach (var impl in implTypes) { Assert.NotNull(testedImpls.SingleOrDefault(t => t.GetType().FullName == impl.FullName), "Single implementation of tests for {0} not found. Regenerate tests with test above!", impl.FullName); } }
private static IEnumerable <ImplementationStatus> GetIncorrectImplementationsResults( ITestRunner testRunner, IEnumerable <Type> implementations) { var implTypeToTestsType = ChallengeHelpers.GetIncorrectImplementationTests() .ToDictionary(t => t.CreateStatistics().GetType(), t => t.GetType()); foreach (var implementation in implementations) { var failed = GetFailedTests(testRunner, implementation, implTypeToTestsType[implementation]) .ToArray(); yield return(new ImplementationStatus(implementation.Name, failed)); } }
private static IList <ImplementationStatus> GetIncorrectImplementationsResults( ITestRunner testRunner, IEnumerable <Type> implementations) { var result = new List <ImplementationStatus>(); var implTypeToTestsType = ChallengeHelpers.GetIncorrectImplementationTests() .ToDictionary(t => t.CreateStatistics().GetType(), t => t.GetType()); foreach (var implementation in implementations) { var failed = GetFailedTests(testRunner, implementation, implTypeToTestsType[implementation]) .ToList(); var name = implementation.Name.PadRight(20, ' '); result.Add(new ImplementationStatus(name, failed.Count)); } return(result); }