public void Service_Sala_Deveria_Excluir_Sala_Corretamente() { _sala = ObjectMother.GetSalaComId(); _repository .Setup(f => f.Excluir(It.IsAny <int>())); _service.Excluir(_sala); _repository.Verify(f => f.Excluir(_sala.Id)); }
public void Integration_Deletar_Sala_Corretamente() { _sala = ObjectMother.GetSalaComId(); _service.Excluir(_sala); Sala recebido = _service.Get(_sala.Id); recebido.Should().BeNull(); }
public void SalaIntegracaoSistema_Adicionar_DeveSerValido() { //Cenário Sala sala = ObjectMother.ObterSalaValida(); sala.Id = 0; //Ação Sala salaResultado = _salaService.Adicionar(sala); //Verificar salaResultado.Should().NotBeNull(); salaResultado.Id.Should().BeGreaterThan(0); salaResultado.Nome.Should().Be(sala.Nome); salaResultado.Lugar.Should().Be(sala.Lugar); Sala salaGet = _salaService.Obter(salaResultado.Id); salaResultado.Id.Should().Be(salaGet.Id); _salaService.Excluir(salaResultado); }
public void SalaService_Excluir_DeveSerValido() { //Cenário Sala sala = ObjectMother.ObterSalaValida(); sala.Id = 1; _mockSalaRepositorio.Setup(rp => rp.Excluir(sala)); //Ação _salaService.Excluir(sala); //Verificar _mockSalaRepositorio.Verify(rp => rp.Excluir(sala)); }