Пример #1
0
        public void PermiteAdicionarUmSegundoAgendamentoDeDescarregamentoParaMesmaPlacaSeOPrimeiroEstiverRealizado()
        {
            Quota quota = DefaultObjects.ObtemQuotaDeDescarregamento();
            AgendamentoDeDescarregamento agendamentoDeDescarregamento = quota.InformarAgendamento(new AgendamentoDeDescarregamentoSalvarVm()
            {
                IdQuota       = quota.Id,
                IdAgendamento = 0,
                Placa         = "IMN2420",
                NotasFiscais  = new List <NotaFiscalVm>
                {
                    DefaultObjects.ObtemNotaFiscalVmComPesoEspecifico(50),
                    DefaultObjects.ObtemNotaFiscalVmComPesoEspecifico(51)
                }
            });

            agendamentoDeDescarregamento.Realizar();

            quota.InformarAgendamento(new AgendamentoDeDescarregamentoSalvarVm()
            {
                IdQuota       = quota.Id,
                IdAgendamento = 0,
                Placa         = "IMN2420",
                NotasFiscais  = new List <NotaFiscalVm>
                {
                    DefaultObjects.ObtemNotaFiscalVmComPesoEspecifico(52),
                    DefaultObjects.ObtemNotaFiscalVmComPesoEspecifico(53)
                }
            });

            Assert.AreEqual(2, quota.Agendamentos.Count);
            Assert.AreEqual(2, quota.Agendamentos.Count(x => x.Placa == "IMN2420"));
        }