コード例 #1
0
        /// <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);
        }
コード例 #2
0
        /// <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;
        }
コード例 #3
0
        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;
        }
コード例 #4
0
        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;
        }