public void CreateUpliftVanKernel_Always_ReturnsUpliftVanKernelWrapper()
        {
            // Setup
            IMacroStabilityInwardsKernelFactory factory = MacroStabilityInwardsKernelWrapperFactory.Instance;

            // Call
            IUpliftVanKernel upliftVanKernel = factory.CreateUpliftVanKernel(new MacroStabilityInput());

            // Assert
            Assert.IsInstanceOf <UpliftVanKernelWrapper>(upliftVanKernel);
        }
Exemple #2
0
 public IEnumerable <MacroStabilityInwardsKernelMessage> Validate()
 {
     try
     {
         IUpliftVanKernel upliftVanKernel = CreateUpliftVanKernel();
         return(MacroStabilityInwardsKernelMessagesCreator.Create(upliftVanKernel.Validate().ToArray()));
     }
     catch (UpliftVanKernelWrapperException e)
     {
         throw new UpliftVanCalculatorException(e.Message, e);
     }
 }
Exemple #3
0
        private IUpliftVanKernel CalculateUpliftVan()
        {
            IUpliftVanKernel upliftVanKernel = CreateUpliftVanKernel();

            try
            {
                upliftVanKernel.Calculate();
            }
            catch (UpliftVanKernelWrapperException e)
            {
                throw new UpliftVanCalculatorException(e.Message, e, MacroStabilityInwardsKernelMessagesCreator.Create(e.Messages));
            }

            return(upliftVanKernel);
        }
Exemple #4
0
        public UpliftVanCalculatorResult Calculate()
        {
            IUpliftVanKernel upliftVanKernel = CalculateUpliftVan();

            return(new UpliftVanCalculatorResult(
                       UpliftVanSlidingCurveResultCreator.Create(upliftVanKernel.SlidingCurveResult),
                       UpliftVanCalculationGridResultCreator.Create(upliftVanKernel.UpliftVanCalculationGridResult),
                       MacroStabilityInwardsKernelMessagesCreator.Create(upliftVanKernel.CalculationMessages),
                       new UpliftVanCalculatorResult.ConstructionProperties
            {
                FactorOfStability = upliftVanKernel.FactorOfStability,
                ForbiddenZonesXEntryMin = upliftVanKernel.ForbiddenZonesXEntryMin,
                ForbiddenZonesXEntryMax = upliftVanKernel.ForbiddenZonesXEntryMax
            }));
        }