Ejemplo n.º 1
0
        public void AllCoverageReports_Given_WithTestReports_IsNotNull_AND_HasALotOfReports_ShouldSuccess()
        {
            var mockWarewolfWorkflow = new Mock <IWarewolfWorkflow>();

            mockWarewolfWorkflow.Setup(o => o.WorkflowNodes)
            .Returns(_workflow_Three_Nodes);

            var sut = new AllCoverageReports
            {
                EndTime = DateTime.Now
            };

            var coverageReports = new WorkflowCoverageReports(mockWarewolfWorkflow.Object);

            coverageReports.Add(_test_One_CoverageModelTo);
            coverageReports.Add(_test_One_CoverageModelTo);
            sut.Add(coverageReports);

            var coverageReports_1 = new WorkflowCoverageReports(mockWarewolfWorkflow.Object);

            coverageReports_1.Add(_test_One_CoverageModelTo);
            coverageReports_1.Add(_test_One_CoverageModelTo);
            sut.Add(coverageReports_1);

            Assert.IsNotNull(sut.StartTime);
            Assert.IsNotNull(sut.EndTime);
            var sss = sut.TotalReportsCoverage;

            Assert.AreEqual(33, sut.TotalReportsCoverage, "code for safety; this should return zero not NaN");
            Assert.AreEqual(2, sut.WithTestReports.ToList().Count, "should be initialized");
        }
Ejemplo n.º 2
0
        public void AllCoverageReports_Given_WithTestReports_IsNull_Default_ShouldNotReturnNaN()
        {
            var mockWarewolfWorkflow = new Mock <IWarewolfWorkflow>();

            var sut = new AllCoverageReports
            {
                EndTime = DateTime.Now
            };

            sut.Add(new WorkflowCoverageReports(mockWarewolfWorkflow.Object)
            {
                //should something unfavorable ever happen, zero make more sense then NaN in this context
            });

            Assert.IsNotNull(sut.StartTime);
            Assert.IsNotNull(sut.EndTime);
            Assert.AreEqual(0, sut.TotalReportsCoverage, "code for safety; this should return zero not NaN");
            Assert.AreEqual(0, sut.WithTestReports.ToList().Count, "should be initialized");
        }