Exemplo n.º 1
0
        public void ImportBoard_ShouldReturnNull_IfInvalidFile()
        {
            var importService = new ImportService(_userRepositoryMock.Object, _userBoardRepositoryMock.Object, _mapper, _obfuscatorMock.Object);

            var result = importService.ImportBoard(CreateFormFileDto(INVALID_FILENAME), USER_ID);

            Assert.IsNull(result);
        }
Exemplo n.º 2
0
        public void ImportBoard_ShouldReturnProperStatistics_IfBoardWithListsCardsAndComments()
        {
            var importService = new ImportService(_userRepositoryMock.Object, _userBoardRepositoryMock.Object, _mapper, _obfuscatorMock.Object);

            var result = importService.ImportBoard(CreateFormFileDto(BOARD_WITH_LISTS_CARDS_AND_COMMENTS_FILENAME), USER_ID);

            Assert.AreEqual(EXPECTED_NUMBER_OF_ITEMS, result.ListsCount);
            Assert.AreEqual(EXPECTED_NUMBER_OF_ITEMS, result.CardsCount);
            Assert.AreEqual(EXPECTED_NUMBER_OF_ITEMS, result.CommentsCount);
            Assert.AreEqual(CUSTOM_BOARD_NAME, result.UserBoard.Board.Name);
            Assert.AreEqual(USER_ID, result.UserBoard.UserId);
        }
Exemplo n.º 3
0
        public void ImportBoard_ShouldReturnProperStatisctics_IfBoardWithoutListsInFile()
        {
            var importService = new ImportService(_userRepositoryMock.Object, _userBoardRepositoryMock.Object, _mapper, _obfuscatorMock.Object);

            var result = importService.ImportBoard(CreateFormFileDto(EMPTY_BOARD_FILENAME), USER_ID);

            Assert.AreEqual(0, result.ListsCount);
            Assert.AreEqual(0, result.CardsCount);
            Assert.AreEqual(0, result.CommentsCount);
            Assert.AreEqual(CUSTOM_BOARD_NAME, result.UserBoard.Board.Name);
            Assert.AreEqual(USER_ID, result.UserBoard.UserId);
        }