Beispiel #1
0
        public void ShouldRegisterPlanWhenPlanIsValid()
        {
            var commandPlan = new CreatePlanCommand();

            commandPlan.Id                        = Guid.NewGuid();
            commandPlan.NameField                 = "Plano de Aposentadoria AlphaPrev";
            commandPlan.Abreviation               = "AlphaPrev";
            commandPlan.Description               = "Plano Criado para os empregados da empresa Alpha";
            commandPlan.Active                    = true;
            commandPlan.Cnpb                      = 4598483201;
            commandPlan.AmountAnnualBenefits      = 12;
            commandPlan.AmountAnnualContributions = 12;
            commandPlan.CountEmployeeContribution = false;
            commandPlan.Effecive                  = DateTime.Now;
            commandPlan.Inclusion                 = DateTime.Now;
            commandPlan.RegulationNew             = true;
            commandPlan.ReservationSpecialVirtual = false;
            commandPlan.SalaryAdjustmentMonth     = 2;
            commandPlan.TypePlan                  = Domain.Enums.EPlanType.Pension;
            commandPlan.MonthlyProcessing         = true;

            var handler = new PlanHandler(new FakePlanRepository(), new FakeEmailService());
            var result  = handler.Handle(commandPlan);

            Assert.AreNotEqual(null, result);
            Assert.AreEqual(true, handler.Valid);
        }
        public async Task <IActionResult> Create([FromBody] CreatePlanInput input)
        {
            var result = _handler.Handle(input);

            return(await ApiResponse(result));
        }