Example #1
0
        public async Task Generate_ShouldHaveOneFailTestForDivisionNotDeclared()
        {
            var methods = new CalculatorSnapshotMethods()
            {
                Addition       = true,
                Division       = false,
                Multiplication = true,
                Subtraction    = true,
            }.GetMethods();
            var results = await Generator.GenerateResults(Data, MockSnapshots.GetLastCalculatorSnpahostName(),
                                                          Assignment, methods);

            Assert.AreEqual(1, results.Count(r => !r.Passed));
        }
Example #2
0
        public async Task Generate_ShouldReturnSameNumberOfTestsAsTestProject()
        {
            var methods = new CalculatorSnapshotMethods()
            {
                Addition       = true,
                Division       = true,
                Multiplication = true,
                Subtraction    = true,
            }.GetMethods();
            var results = await Generator.GenerateResults(Data, MockSnapshots.GetLastCalculatorSnpahostName(),
                                                          Assignment, methods);

            Assert.AreEqual(Assignment.TestProject.UnitTests.Count, results.Count);
        }
Example #3
0
        public async Task Generate_ShouldReturnPassedForAllTests()
        {
            var methods = new CalculatorSnapshotMethods()
            {
                Addition       = true,
                Division       = true,
                Multiplication = true,
                Subtraction    = true,
            }.GetMethods();
            var results = await Generator.GenerateResults(Data, MockSnapshots.GetLastCalculatorSnpahostName(),
                                                          Assignment, methods);

            foreach (var result in results)
            {
                Assert.IsTrue(result.Passed);
            }
        }