Guest User

Untitled

a guest
Jun 20th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. [Test]
  2. public void SomeOtherTest()
  3. {
  4. //Arrange
  5. var mock = new Mock<IFoo>();
  6. var sut = new SystemUnderTest(mock.Object); //never liked doing it this way...
  7. mock.Setup(m => x.Bar()).Returns("A whole bunch of ceremonial syntax..");
  8. //Act
  9. sut.DoSomething();
  10. //Assert
  11. mock.Verify(m => m.Baz()); //Baaaaah, more laaaaambdas
  12. }
  13.  
  14. [Test]
  15. public void NSubTest()
  16. {
  17. var mock = Substitute.For<IFoo>();
  18. var sut = new SystemUnderTest(mock); //much nicer!
  19. mock.Bar().Returns("Look ma! No lambdas!");
  20.  
  21. sut.DoSomething();
  22.  
  23. mock.Received().Baz();
  24. }
Add Comment
Please, Sign In to add comment