/// <summary> /// Get the requested solution for this case /// </summary> /// <param name="solutionId"></param> /// <param name="caseDto"></param> /// <returns></returns> public virtual MortgageSolutionDto GetSolution(Guid solutionId, CaseDto caseDto) { var owner = _ownerRepository.GetOwner(caseDto.Owner.Id); var targetCase = owner.GetCase(caseDto.Id); var solution = targetCase.GetSolution(solutionId); return (MortgageSolutionDto) _IntermediaryAdaptor.AdaptSolution(solution); }
/// <summary> /// Return a list of solutions for the case /// </summary> /// <param name="caseDto"></param> /// <returns></returns> public virtual List<SolutionSummaryDto> ListSolutionsForCase(CaseDto caseDto) { // get the user var owner = _ownerRepository.GetOwner(caseDto.Owner.Id); var solutions = owner.GetCase(caseDto.Id).ListSolutions(); // convert the DTOs into domain objects var summaries = _IntermediaryAdaptor.AdaptionSolutionSummary(solutions); return summaries; }
public void RetrieveRateSwitchSolutionDetail() { var bindings = new DefaultBindings(); var service = IntermediaryFactory.GetModellingService(bindings); var owner = new IntermediaryUserDto("Fred Jones", "fsa1234", Guid.NewGuid()); var targetCase = new CaseDto(Guid.NewGuid(), owner); var solutionDetail = service.GetSolution(new Guid("2386D309-EAE1-47CD-BE03-1064E3CC5AE8"), targetCase); Assert.IsNotNull(solutionDetail, "Should have had a solution"); Assert.IsNotNull(solutionDetail.Products, "Should have had some products returned"); Assert.IsTrue(solutionDetail.Products.Count == 1, "Only one product on this solution"); Assert.IsNotNull(solutionDetail.Requirement, "should have a requirement"); Assert.IsInstanceOfType(solutionDetail.Requirement, typeof(MortgageRequirementDto), "Should be a mortgage requirement"); Assert.AreEqual("122222", ((MortgageRequirementDto)solutionDetail.Requirement).AccountToSwitch, "Rate switch should be populated"); return; }
public void RetrieveSolutionSummary() { var bindings = new DefaultBindings(); var service = IntermediaryFactory.GetModellingService(bindings); var owner = new IntermediaryUserDto("Fred Jones", "fsa1234", Guid.NewGuid()); var targetCase = new CaseDto(Guid.NewGuid(), owner); var summaries = service.ListSolutionsForCase(targetCase); Assert.IsNotNull(summaries, "Should have had some summaries back"); Assert.IsTrue(summaries.Count > 0, "Should have had some summaries returned"); return; }