private static PlayerTestsRunResult GetTestsRunResultFor(Func <ITestMethod, bool> filter)
        {
            var kataConfiguration       = new Configuration();
            var goldenTestType          = kataConfiguration.GetKataTestsType();
            var kataImplementationTypes = kataConfiguration.GetKataImplementationTypes().ToArray();
            var testMethodsRetriever    = new CustomTestMethodsRetriever(filter);
            var playerTestsRunner       = new PlayerTestsRunner <IStringCalculator>(
                goldenTestType, kataImplementationTypes, testMethodsRetriever);
            var result = playerTestsRunner.Run();

            return(result);
        }
Exemple #2
0
        public void Run_GivenTestMethodWithExpectedExceptionAttribute_ShouldSetHasExpectedExceptionAttributeToTrue()
        {
            //---------------Set up test pack-------------------
            var playerTestsRunner = new PlayerTestsRunner <IStringCalculator>(typeof(PlayerTestStringCalculator),
                                                                              new[] {
                typeof(Player_StringCalculator_AtLevel0),
                typeof(Player_StringCalculator_AtLevel1)
            });
            //---------------Assert Precondition----------------

            //---------------Execute Test ----------------------
            var playerTestsRunResult = playerTestsRunner.Run();

            //---------------Test Result -----------------------
            Assert.IsTrue(playerTestsRunResult.HasExpectedExceptionAttribute);
        }