Beispiel #1
0
        public void ProperlyCaptureParams()
        {
            var collector = new CoverageCollector();

            var start = new TestSessionStartArgs
            {
                Configuration = CoverageCollector.GetVsTestSettings(true, null, "Stryker.Core.UnitTest.TestRunners")
            };
            var mock = new Mock <IDataCollectionSink>(MockBehavior.Loose);

            collector.Initialize(mock.Object);

            collector.TestSessionStart(start);
            collector.TestCaseStart(new TestCaseStartArgs(new TestCase("theTest", new Uri("xunit://"), "source.cs")));
            MutantControl.CaptureCoverage.ShouldBeTrue();
        }
Beispiel #2
0
        public void ProperlySelectMutant()
        {
            var collector = new CoverageCollector();

            var mutantMap = new Dictionary <int, IList <string> >()
            {
                [0] = new List <string>()
            };

            var start = new TestSessionStartArgs
            {
                Configuration = CoverageCollector.GetVsTestSettings(false, mutantMap, this.GetType().Namespace)
            };
            var mock = new Mock <IDataCollectionSink>(MockBehavior.Loose);

            collector.Initialize(mock.Object);

            collector.TestSessionStart(start);

            collector.TestCaseStart(new TestCaseStartArgs(new TestCase("theTest", new Uri("xunit://"), "source.cs")));

            MutantControl.ActiveMutant.ShouldBe(0);
        }