public void ThrowWhen_NoBoard() { //Arrange var fakeProvider = new FakeBoardProvider(); var list = new List <string>(); var sut = new ListAllBoardsCommand(list, fakeProvider); //Act & Assert Assert.ThrowsException <ArgumentException>(() => sut.Execute()); }
public void BoardCreation_Execute_Less_Params_ThrowEx() { //Arrange var list = new List <string>(); var fakeBoardProvider = new FakeBoardProvider(); var sut = new CreateBoardCommand(list, fakeBoardProvider); //Act & Assert Assert.ThrowsException <ArgumentException>(() => sut.Execute(), "Parameters count is not valid!"); }
public void BoardCreation_Execute_BoardWithSameNameAlreadyExists_ThrowEx() { //Arrange Commons.currentTeam = new Team("FakeTeamName"); var list = new List <string>() { "BoardName" }; var fakeBoardProvider = new FakeBoardProvider(); fakeBoardProvider.Add(new Board("BoardName")); var sut = new CreateBoardCommand(list, fakeBoardProvider); Assert.ThrowsException <ArgumentException>(() => sut.Execute(), "Board with name BoardName already exists." + Environment.NewLine + $"You can see all available boards with command listboards."); }
public void CreateBoardSuccess() { //Arrange Commons.currentTeam = new Team("FakeTeamName"); var list = new List <string>() { "BoardName" }; var fakeBoardProvider = new FakeBoardProvider(); var sut = new CreateBoardCommand(list, fakeBoardProvider); //Act var result = sut.Execute(); //Assert Assert.IsTrue(result.StartsWith("Created Board")); }
public void ListAllBoards_Success() { //Arrange var fakeProvider = new FakeBoardProvider(); var listParams = new List <string>(); var board1 = new Board("Board1"); var board2 = new Board("Board2"); fakeProvider.Add(board1); fakeProvider.Add(board2); var sut = new ListAllBoardsCommand(listParams, fakeProvider); //Act var result = sut.Execute(); //Assert Assert.IsTrue(result.StartsWith($"Board1")); }