Exemplo n.º 1
0
        public async Task WhenHandlingCommand_ThenAddTodoWithProperData()
        {
            // Arrange
            var request = Create();

            // Act
            await sut.Handle(request, default);

            // Assert
            todoRepositoryMock.Verify(x => x.AddAsync(It.Is <Todo>(x =>
                                                                   x.Title == request.Title &&
                                                                   x.Description == request.Description &&
                                                                   x.CompletionDate == request.CompletionDate &&
                                                                   x.Priority == x.Priority &&
                                                                   x.Status == TodoStatus.Todo)), Times.Once);
        }
Exemplo n.º 2
0
        public void CallHandle()
        {
            var handler = new AddTodoCommandHandler();

            var ex = Assert.Throws <NotImplementedException>(() => handler.Handle(new AddTodoCommand()));

            Assert.IsType(typeof(NotImplementedException), ex);
        }