コード例 #1
0
 public void ReturnsEmptyTextIfSummaryIsNull()
 {
     var mockSummaryFormatter = new Mock<ISummaryFormatter>().Object;
     var abnfOutPutProducer = new AbnfOutputProducer(mockSummaryFormatter);
     var outPut = abnfOutPutProducer.GetSummaryAsText(null);
     Assert.IsTrue(string.IsNullOrEmpty(outPut));
 }
コード例 #2
0
 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));
 }
コード例 #3
0
 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));
 }