Guest User

Untitled

a guest
Jun 19th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. [Test]
  2. public void MessageBoxShow_should_be_callable_indirectly()
  3. {
  4. using (new IndirectionsContext())
  5. {
  6. // Arrange
  7. var mockMessageBox = new Mock<IndirectionFunc<string, DialogResult>>();
  8. mockMessageBox.Setup(_ => _(string.Empty)).Returns(DialogResult.OK);
  9.  
  10. PMessageBox.ShowString().Body = mockMessageBox.Object;
  11.  
  12. // Act
  13. MessageBox.Show("This is a message");
  14.  
  15. // Assert
  16. mockMessageBox.Verify(_ => _("This is a message"));
  17. }
  18. }
Add Comment
Please, Sign In to add comment