コード例 #1
0
        public void Teste_SalaRepositorio_DeletarSalaComIdInvalido_DeveSerThrowException()
        {
            _sala    = ObjectMother.RetorneSalaExistenteOk();
            _sala.Id = 0;
            Action action = () => _repositorio.Deletar(_sala);

            action.Should().Throw <IdentifierUndefinedException>();
        }
コード例 #2
0
 public void Deletar(Sala sala)
 {
     if (sala.Id <= 0)
     {
         throw new IdentifierUndefinedException();
     }
     if (_eventoServico.CarregarPorSala(sala.Id).Count() > 0)
     {
         throw new SalaRelacionadaComEventoException();
     }
     _salaRepositorio.Deletar(sala);
 }