public async Task GetAsync_GetEmptyBoardList() { // Arrange var expected = new List <Board>(); var issueDataAccess = new Mock <IBoardDataAccess>(); issueDataAccess.Setup(x => x.GetAsync()).ReturnsAsync(expected); var issueGetService = new BoardGetService(issueDataAccess.Object); // Act var result = await issueGetService.GetAsync(); // Assert result.Should().Equal(expected); }
public async Task GetAsync_GetBoard() { // Arrange var board = new Board(); var boardIdentity = new Mock <IBoardIdentity>(); var boardDataAccess = new Mock <IBoardDataAccess>(); boardDataAccess.Setup(x => x.GetAsync(boardIdentity.Object)).ReturnsAsync(board); var boardGetService = new BoardGetService(boardDataAccess.Object); // Act var result = await boardGetService.GetAsync(boardIdentity.Object); // Assert result.Should().Equals(board); }
public async Task GetAsync_BoardDoesntExist() { // Arrange var fixture = new Fixture(); var id = fixture.Create <int>(); var boardIdentity = new Mock <IBoardIdentity>(); boardIdentity.Setup(x => x.Id).Returns(id); var board = new Board(); var boardDataAccess = new Mock <IBoardDataAccess>(); var boardGetService = new BoardGetService(boardDataAccess.Object); // Act var result = boardGetService.GetAsync(boardIdentity.Object); // Assert result.Should().Equals(board); }