public void readPolicyByIdWithoutResultTest()
        {
            Mock <IPolicyDomainService> mock = new Mock <IPolicyDomainService>();

            mock.Setup(x => x.ReadPolicyById(It.IsAny <long>())).Returns(getTSegPolizaNull());
            PolicyApplicationService test = new PolicyApplicationService(mock.Object);
            var response = test.ReadPolicyById(100);

            Assert.IsTrue(response == null);
        }
        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 void deletePolicyOkTest()
        {
            Mock <IPolicyDomainService> mock = new Mock <IPolicyDomainService>();

            mock.Setup(x => x.DeletePolicy(It.IsAny <TSeg_Polizas>())).Returns(1);
            PolicyApplicationService test = new PolicyApplicationService(mock.Object);
            var response = test.DeletePolicy(1);

            Assert.IsTrue(response > 0);
        }
        public void createPolicyOkTest()
        {
            Mock <IPolicyDomainService> mock = new Mock <IPolicyDomainService>();

            mock.Setup(x => x.CreatePolicy(It.IsAny <TSeg_Polizas>())).Returns(getTSegPoliza());
            PolicyApplicationService test = new PolicyApplicationService(mock.Object);
            var response = test.CreatePolicy(getPolicyRequest());

            Assert.IsTrue(response.id > 0);
        }
 public ReportsController(PolicyApplicationService policyApplicationService)
 {
     _policyApplicationService = policyApplicationService;
 }
Exemplo n.º 6
0
 public PoliciesController()
 {
     PolicyApplicationService             = new PolicyApplicationService();
     CoveringTypeApplicationService       = new CoveringTypeApplicationService();
     PolicyCoveringTypeApplicationService = new PolicyCoveringTypeApplicationService();
 }
Exemplo n.º 7
0
 public CustomersController()
 {
     CustomerApplicationService       = new CustomerApplicationService();
     PolicyApplicationService         = new PolicyApplicationService();
     CustomerPolicyApplicationService = new CustomerPolicyApplicationService();
 }
 public PoliciesController(PolicyApplicationService policyApplicationService)
 {
     _policyApplicationService = policyApplicationService;
 }