public PolicyResponse CreatePolicy(PolicyRequest policyRequest)
        {
            TSeg_Polizas policy    = PolicyMapper.TransformPolicyRequestToTSegPoliza(policyRequest);
            TSeg_Polizas policyOut = PolicyDomainService.CreatePolicy(policy);

            return(policyOut != null?PolicyMapper.TransformTSegPolizaToPolicyResponse(policyOut) : null);
        }
 public PolicyProcessor(PolicyMiner policyMiner, PolicyValidator policyValidator, PolicyMapper policyMapper, ResponseMapper responseMapper, PolicySender policySender)
 {
     _policyMiner     = policyMiner;
     _policyMapper    = policyMapper;
     _policyValidator = policyValidator;
     _policySender    = policySender;
     _responseMapper  = responseMapper;
 }
Пример #3
0
        protected override void ParseArgs(string[] args)
        {
            var parsedArgs = ArgumentParser.ParseUpdate(args);

            treeish = (string)parsedArgs["treeish"];
            verbose = (bool)parsedArgs["verbose"];
            policy  = PolicyMapper.GetLocalChangesPolicy(parsedArgs);
        }
        public void Map()
        {
            var policyMapper = new PolicyMapper();
            var policy       = new Policy();

            var policyModel = policyMapper.Map(policy);

            Assert.IsInstanceOfType(policyModel, typeof(PolicyModel));
        }
Пример #5
0
        protected override void ParseArgs(string[] args)
        {
            Helper.RemoveOldKey(ref args, "-n", Log);

            var parsedArgs = ArgumentParser.ParseUpdateDeps(args);

            configuration    = (string)parsedArgs["configuration"];
            mergedBranch     = (string)parsedArgs["merged"];
            localBranchForce = (bool)parsedArgs["localBranchForce"];
            verbose          = (bool)parsedArgs["verbose"];
            policy           = PolicyMapper.GetLocalChangesPolicy(parsedArgs);
        }
Пример #6
0
        public void Setup()
        {
            _policy = new Policy
            {
                OwnerName    = "Bob",
                PolicyNumber = "7"
            };

            _policyModel = new PolicyModel();

            _policyMapper = new PolicyMapper();
        }
 public int UpdatePolicy(PolicyRequest policyRequest)
 {
     try
     {
         TSeg_Polizas policy = PolicyMapper.TransformPolicyRequestToTSegPoliza(policyRequest);
         PolicyDomainService.UpdatePolicy(policy);
         return(1);
     }
     catch (Exception e)
     {
         return(-1);
     }
 }
        public Response Process(SessionActivity sessionActivity)
        {
            var policyMiner = new PolicyMiner();
            var policy      = policyMiner.Mine(sessionActivity);

            var policyMapper = new PolicyMapper();
            var policyModel  = policyMapper.Map(policy);

            var policySender  = new PolicySender();
            var responseModel = policySender.Send(policyModel);

            var responseMapper = new ResponseMapper();
            var response       = responseMapper.Map(responseModel);

            return(response);
        }
Пример #9
0
        protected override void ParseArgs(string[] args)
        {
            Helper.RemoveOldKey(ref args, "-n", Log);

            var parsedArgs = ArgumentParser.ParseGet(args);

            module = (string)parsedArgs["module"];
            if (string.IsNullOrEmpty(module))
            {
                throw new CementException("You should specify the name of the module");
            }

            treeish       = (string)parsedArgs["treeish"];
            configuration = (string)parsedArgs["configuration"];
            mergedBranch  = (string)parsedArgs["merged"];
            verbose       = (bool)parsedArgs["verbose"];
            policy        = PolicyMapper.GetLocalChangesPolicy(parsedArgs);
        }
Пример #10
0
        public void Setup()
        {
            _policy = new Policy();

            _policyMapper = new PolicyMapper();
        }
Пример #11
0
        public PolicyResponse ReadPolicyById(long id)
        {
            TSeg_Polizas poliza = PolicyDomainService.ReadPolicyById(id);

            return(poliza != null?PolicyMapper.TransformTSegPolizaToPolicyResponse(poliza) : null);
        }
Пример #12
0
        public List <PolicyResponse> ReadPolicies()
        {
            List <TSeg_Polizas> policies = PolicyDomainService.ReadPolicies();

            return(policies.Count > 0 ? PolicyMapper.TransformTSegPolizasToPolicyResponseList(policies) : new List <PolicyResponse>());
        }
Пример #13
0
        public override void Setup()
        {
            _policy = new Policy();

            _policyMapper = new PolicyMapper();
        }