public void setUp() { funcionario = new FuncionarioFactory().criarFuncionario("Jhon Doe", "doe", "123456", "", "41617099864"); sessaoLogin = new SessaoLoginMock(funcionario); tipoIntervaloFactory = new TipoIntervaloFactory(new NomeIntervaloJaExisteSpecification(new TipoIntervaloMockRepository())); tipoAlmoco = tipoIntervaloFactory.criarTipoIntervalo("ALMOÇO"); }
public void AddIntervalo(TipoIntervalo intervalo) { if (!intervalos.Contains(intervalo)) { intervalos.Add(intervalo); } }
public ExportExcelService(RelatorioPonto relatorio, List <DiaRelatorioViewModel> dias, ITipoIntervaloRepository tipoIntervaloRepository) { this.relatorio = relatorio; this.dias = dias; this.tipoIntervaloRepository = tipoIntervaloRepository; this.tipoAlmoco = tipoIntervaloRepository.findByName("ALMOÇO"); }
private bool podeSairIntervalo(TipoIntervalo tipoIntervalo) { if (ponto.intervaloFoiRegistrado(tipoIntervalo)) { var intervalo = ponto.getIntervalo(tipoIntervalo); return(!intervalo.Saida.HasValue); //Se não houver saída, então pode registrar } return(false); }
public void GetNotas_Deve_Retornar_Notas_Dos_Acordes(TipoIntervalo intervalo, TipoNota nota) { Acorde acorde = new Acorde { Tonica = TipoNota.DO }; acorde.AddIntervalo(intervalo); Assert.Contains(nota, acorde.GetNotas()); }
public virtual Intervalo getIntervalo(TipoIntervalo tipoIntervalo) { try { return(Intervalos.Single(x => x.TipoIntervalo.Nome.Equals(tipoIntervalo.Nome))); } catch (InvalidOperationException) { throw new IntervaloNaoRegistradoException(tipoIntervalo); } }
private void registrarIntervalo(TipoIntervalo tipoIntervalo) { try { pontoService.registrarIntervalo(tipoIntervalo, ponto); } catch (Exception ex) { showMessageBox(ex.Message, "Não foi possível completar a operação", MessageBoxButton.OK, MessageBoxImage.Error); } }
public virtual void registrarIntervalo(TipoIntervalo tipoIntervalo, IDataHoraStrategy dataHoraStrategy) { if (intervaloFoiRegistrado(tipoIntervalo)) { var intervalo = getIntervalo(tipoIntervalo); if (intervalo.Saida.HasValue) { throw new IntervaloJaRegistradoException(tipoIntervalo); } intervalo.Saida = dataHoraStrategy.getDataHoraAtual().TimeOfDay; } else { if (algumIntervaloEmAberto()) { throw new IntervaloEmAbertoException(getIntervaloEmAberto()); } Intervalos.Add(new Intervalo(tipoIntervalo, dataHoraStrategy.getDataHoraAtual().TimeOfDay)); } }
public IntervaloNaoRegistradoException(TipoIntervalo tipoIntervalo) : base(string.Format("O intervalo de {0} não foi iniciado", tipoIntervalo.Nome)) { this.TipoIntervalo = tipoIntervalo; }
public uint save(TipoIntervalo tipoIntervalo) { listRep.Add(tipoIntervalo); return((uint)listRep.Count); }
public uint save(TipoIntervalo tipoIntervalo) { throw new NotImplementedException(); }
public void registrarIntervalo(TipoIntervalo tipoIntervalo, DiaTrabalho ponto) { ponto.registrarIntervalo(tipoIntervalo, dataHoraStrategy); pontoRepository.save(ponto); }
public IntervaloJaRegistradoException(TipoIntervalo tipo) : base(string.Format("O horário de {0} já foi registrado", tipo.Nome)) { this.TipoIntervalo = tipo; }
public virtual bool intervaloFoiRegistrado(TipoIntervalo tipoIntervalo) { return(Intervalos.Any(x => x.TipoIntervalo.Nome.Equals(tipoIntervalo.Nome))); }
private bool podeEntrarIntervalo(TipoIntervalo tipoIntervalo) { return(!ponto.algumIntervaloEmAberto() && !ponto.intervaloFoiRegistrado(tipoIntervalo)); }