Exemple #1
0
        public ActionResult AddPolicy(long customerId)
        {
            CustomerResponse customer = CustomerApplicationService.ReadCustomerById(customerId);

            List <PolicyResponse> policies = PolicyApplicationService.ReadPolicies();

            ViewBag.FullName       = customer.apellidos + " " + customer.nombres;
            ViewBag.CustomerId     = customer.id;
            ViewBag.Identification = customer.identificacion;
            ViewBag.policies       = new SelectList(policies, nameof(PolicyResponse.id), nameof(PolicyResponse.nombre));
            return(View("~/Views/Customers/AddPolicy.cshtml"));
        }
        public void readPolicyOkTest()
        {
            Mock <IPolicyDomainService> mock = new Mock <IPolicyDomainService>();

            mock.Setup(x => x.ReadPolicies()).Returns(getTSegPolizaList());
            PolicyApplicationService test = new PolicyApplicationService(mock.Object);
            var response = test.ReadPolicies();

            Assert.IsTrue(response.Count > 0);
        }
        public ActionResult Policies()
        {
            List <PolicyResponse> model = PolicyApplicationService.ReadPolicies();

            return(View(model));
        }