Ejemplo n.º 1
0
        public void DeleteBoard_ProvideEmptyId_ErrorReturned()
        {
            var ctx          = GetContext();
            var boardStorage = new BoardStorage(ctx);

            var deleteResult = boardStorage.DeleteBoardAsync(new Board {
                Id = Guid.Empty
            });

            Assert.False(deleteResult.Result.IsSuccess);
            Assert.NotEmpty(deleteResult.Result.ErrorReason);
        }
Ejemplo n.º 2
0
        public void DeleteBoard_DeleteExistentBoard_BoardDeleted()
        {
            var boardToDelete = new Board {
                Title = "Title", Id = Guid.NewGuid()
            };
            var ctx = GetContext();

            ctx.Boards.Add(boardToDelete);
            ctx.SaveChanges();
            var boardStorage = new BoardStorage(ctx);

            var deleteResult = boardStorage.DeleteBoardAsync(boardToDelete);

            Assert.NotNull(deleteResult);
            Assert.True(deleteResult.Result.IsSuccess);
            Assert.Null(ctx.Boards.Find(boardToDelete.Id));
        }