コード例 #1
0
        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"));
        }
コード例 #2
0
        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.");
        }