예제 #1
0
        public void DescribeMismatch_appends_item()
        {
            var matcher         = new TestMatcher();
            var descriptionMock = new Mock <IDescription>();

            descriptionMock.Setup(d => d.AppendText(It.IsAny <string>())).Returns(descriptionMock.Object);
            const string item = "item";

            matcher.DescribeMismatch(item, descriptionMock.Object);

            descriptionMock.Verify(d => d.AppendText("was "), Times.Once);
            descriptionMock.Verify(d => d.AppendValue(item), Times.Once);
        }
예제 #2
0
        public void DescribeMismatch_appends_item()
        {
            var matcher     = new TestMatcher();
            var description = MockRepository.GenerateStub <IDescription>();

            description.Stub(d => d.AppendText(Arg <string> .Is.Anything)).Return(description);
            const string item = "item";

            matcher.DescribeMismatch(item, description);

            description.AssertWasCalled(d => d.AppendText("was "));
            description.AssertWasCalled(d => d.AppendValue(item));
        }