public async Task Deve_Criar_Projeto_Valido() { var service = new ProjectService(_validationService, _uow, _projectRepository); var project = ProjectModelTest.GetProject(); await service.Create(project); await _projectRepository.Received().CreateAsync(Arg.Any<Project>()); await _uow.Received().CommitAsync(); Assert.True(_validationService.IsValid()); }
public async Task Deve_Alterar_Projeto_Valido() { _projectRepository.GetByIDAsync(Arg.Any<Guid>()).Returns(await Task.FromResult(ProjectTest.GetProject())); var service = new ProjectService(_validationService, _uow, _projectRepository); var project = ProjectModelTest.GetProject(); await service.Update(project, Guid.NewGuid()); await _projectRepository.Received().UpdateAsync(Arg.Any<Project>()); await _uow.Received().CommitAsync(); Assert.True(_validationService.IsValid()); }