public void ReturnsEmptyTextIfSummaryIsNull() { var mockSummaryFormatter = new Mock<ISummaryFormatter>().Object; var abnfOutPutProducer = new AbnfOutputProducer(mockSummaryFormatter); var outPut = abnfOutPutProducer.GetSummaryAsText(null); Assert.IsTrue(string.IsNullOrEmpty(outPut)); }
public void ReturnsEmptyTextIfSummaryIsInvalid() { var mockSummry = new Mock<ISummary>(); mockSummry.SetupGet(x => x.InvalidInput).Returns(true); var mockSummaryFormatter = new Mock<ISummaryFormatter>().Object; var abnfOutPutProducer = new AbnfOutputProducer(mockSummaryFormatter); var outPut = abnfOutPutProducer.GetSummaryAsText(mockSummry.Object); Assert.IsTrue(string.IsNullOrEmpty(outPut)); }
public void ReturnsOutputAsExpectedWithValidInput() { var mockSummry = GetMocSummary(); var mockSummaryFormatter = new Mock<ISummaryFormatter>(); mockSummaryFormatter.Setup(sum => sum.GetFormattedSummary(mockSummry.Object,' ')).Returns("12 8 3 1 12 12 445 322 123 TRUE"); var abnfOutPutProducer = new AbnfOutputProducer(mockSummaryFormatter.Object); var outPut = abnfOutPutProducer.GetSummaryAsText(mockSummry.Object); var expectedOutput = "12 8 3 1 12 12 445 322 123 TRUE"; Assert.That(expectedOutput, Is.EqualTo(outPut)); }