Last active
July 12, 2019 08:40
-
-
Save MongkonEiadon/fc0662351c51c87dc8032d1361cffe7f to your computer and use it in GitHub Desktop.
Sample model and the manager
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DepositsManagerTest : TestFor<DepositsManager> | |
{ | |
[SetUp] | |
public void Setup() { } | |
[Test] | |
public void QueryService_ShouldRecevied_GetAccountQuery_WithNormalStyle() | |
{ | |
// arrange | |
var mockQueryService = new Mock<IBookingQueryService>(); | |
var mockCommandService = new Mock<IBookingCommandService>(); | |
var manager = new DepositsManager(mockCommandService.Object, mockQueryService.Object); | |
// act | |
manager.Deposits(1234, 5000); | |
// assert | |
mockQueryService.Verify(x => x.GetAccountQuery(1234), Times.Once); | |
} | |
[Test] | |
public void QueryService_ShouldRecevied_GetAccountQuery_WithTestForStyle() | |
{ | |
// arrange | |
var mockQueryService = InjectMock<IBookingQueryService>(); | |
// act | |
CreateSut().Deposits(1234, 5000); | |
// assert | |
mockQueryService.Verify(x => x.GetAccountQuery(1234), Times.Once); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment