public void Map() { // Act var result = _policyMapper.Map(_policy); // Assert Assert.IsInstanceOfType(result, typeof(PolicyModel)); }
public void Map() { var result = _policyMapper.Map(_policy); Assert.IsInstanceOfType(result, typeof(PolicyModel)); Assert.AreEqual("Bob", result.NameOfOwner); Assert.AreEqual("7", result.PolicyId); }
public void Map() { var policyMapper = new PolicyMapper(); var policy = new Policy(); var policyModel = policyMapper.Map(policy); Assert.IsInstanceOfType(policyModel, typeof(PolicyModel)); }
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); }
public virtual Response Process(SessionActivity sessionActivity) { var policy = _policyMiner.Mine(sessionActivity); var validation = _policyValidator.Validate(policy); if (validation == false) { return(new Response { Message = "Failed validation", Successful = false }); } var policyModel = _policyMapper.Map(policy); var responseModel = _policySender.Send(policyModel); var response = _responseMapper.Map(responseModel); return(response); }
public virtual Response Process(SessionActivity sessionActivity) { var policy = _policyMiner.Mine(sessionActivity); var valid = _policyValidator.Validate(policy); if (!valid) { Response failedResponse = new Response { Successful = false, Message = "This response is not valid" }; return(failedResponse); } var policyModel = _policyMapper.Map(policy); var responseModel = _policySender.Send(policyModel); var response = _responseMapper.Map(responseModel); return(response); }