Esempio n. 1
0
        public void GivenCalculateWhenCartItemWithPromotionThenCallApply()
        {
            var cartItem = new CartItem(new Item()
            {
                Sku = "1", UnitPrice = 1.13m
            }, 2);
            decimal         expectedTotalPrice = 77.77m;
            List <CartItem> items = new List <CartItem>()
            {
                cartItem
            };

            Mock <IPromotion> _mockPromotion = new Mock <IPromotion>();

            _mockPromotion.Setup(a => a.Apply(cartItem, It.IsAny <Func <CartItem, decimal> >())).Callback(() => cartItem.SetLineTotal(expectedTotalPrice));

            _mockPromotionProvider.Setup(a => a.Find(cartItem)).Returns(_mockPromotion.Object);

            var sut        = new PricingEngine(_mockPromotionProvider.Object);
            var totalPrice = sut.Calculate(items);

            _mockPromotion.Verify(a => a.Apply(cartItem, It.IsAny <Func <CartItem, decimal> >()), Times.Once);

            totalPrice.Should().Be(expectedTotalPrice);
        }
Esempio n. 2
0
        public void WhenInputsAreNormal_RunNormally()
        {
            IList <ProductSpec> specs = new List <ProductSpec>()
            {
                new ProductSpec("mp3player", SupplyDemandIndicator.High, SupplyDemandIndicator.High),
                new ProductSpec("ssd", SupplyDemandIndicator.Low, SupplyDemandIndicator.Low)
            };
            IList <CompetitorProduct> compList = new List <CompetitorProduct>()
            {
                new CompetitorProduct("ssd", "W", 11.0),
                new CompetitorProduct("ssd", "X", 12.0),
                new CompetitorProduct("mp3player", "X", 60.0),
                new CompetitorProduct("mp3player", "Y", 20.0),
                new CompetitorProduct("mp3player", "Z", 50.0),
                new CompetitorProduct("ssd", "V", 10.0),
                new CompetitorProduct("ssd", "Y", 11.0),
                new CompetitorProduct("ssd", "Z", 12.0),
            };

            IPricingEngine  engine = new PricingEngine();
            IList <Product> prods  = engine.DoPricing(specs, compList).ToList();

            Assert.AreEqual(12.1,
                            prods.Where(prod => prod.Spec.ProductCode == "ssd").FirstOrDefault().Price,
                            "Not equal");
        }
Esempio n. 3
0
        public void GivenCalculateWhenMultipleCartItemsSomeWithPromotionsThenCalculateCorrectly()
        {
            var cartItem = new CartItem(new Item()
            {
                Sku = "1", UnitPrice = 1.13m
            }, 1);
            var cartItem1 = new CartItem(new Item()
            {
                Sku = "2", UnitPrice = 2.63m
            }, 2);
            decimal         promotionValueSet  = 1.11m;
            decimal         expectedTotalPrice = promotionValueSet + (cartItem1.Item.UnitPrice * cartItem1.Quantity);
            List <CartItem> items = new List <CartItem>()
            {
                cartItem,
                cartItem1
            };

            Mock <IPromotion> _mockPromotion = new Mock <IPromotion>();

            _mockPromotion.Setup(a => a.Apply(cartItem, It.IsAny <Func <CartItem, decimal> >())).Callback(() => cartItem.SetLineTotal(promotionValueSet));

            _mockPromotionProvider.Setup(a => a.Find(cartItem)).Returns(_mockPromotion.Object);

            var sut        = new PricingEngine(_mockPromotionProvider.Object);
            var totalPrice = sut.Calculate(items);

            _mockPromotion.Verify(a => a.Apply(cartItem, It.IsAny <Func <CartItem, decimal> >()), Times.Once);

            totalPrice.Should().Be(expectedTotalPrice);
        }
Esempio n. 4
0
            /// <summary>
            /// Gets maximum retail price from trade agreement.
            /// </summary>
            /// <param name="salesLine">The sales line.</param>
            /// <param name="context">The request context.</param>
            /// <returns>Maximum retail price from trade agreement.</returns>
            public decimal GetMaximumRetailPriceFromTradeAgreement(SalesLine salesLine, RequestContext context)
            {
                if (salesLine == null)
                {
                    throw new ArgumentNullException("salesLine");
                }

                decimal quantity = this.salesTransaction.ActiveSalesLines.Where(x => (x.ItemId == salesLine.ItemId) && (x.InventoryDimensionId == salesLine.InventoryDimensionId)).Sum(x => x.Quantity);

                if (quantity == decimal.Zero)
                {
                    quantity = 1;
                }

                if (!salesLine.BeginDateTime.IsValidAxDateTime())
                {
                    salesLine.BeginDateTime = context.GetNowInChannelTimeZone();
                }

                PriceResult priceResult = PricingEngine.GetActiveTradeAgreement(
                    this.pricingDataManager,
                    DiscountParameters.CreateAndInitialize(this.pricingDataManager),
                    this.channelConfiguration.Currency,
                    salesLine,
                    quantity,
                    this.customerId,
                    this.priceGroup,
                    salesLine.BeginDateTime);

                this.maxRetailPrice = priceResult.MaximumRetailPriceIndia;

                return(this.maxRetailPrice);
            }
Esempio n. 5
0
        public void If_PriceCombination_And_Scan_Random_9A7B_Then_Price_is_530()
        {
            IPricingEngine pe = new PricingEngine(
                new List <IPricingRule> {
                new QuantityPricingRule("A", 50),
                new QuantityPricingRule("A", 3, 130),
                new QuantityPricingRule("A", 5, 190),
                new QuantityPricingRule("B", 30),
                new QuantityPricingRule("B", 2, 45),
                new QuantityPricingRule("B", 4, 85)
            });

            ICheckout co = new Checkout(pe);

            for (int i = 0; i < 7; i++)
            {
                co.Scan("A");
                co.Scan("B");
            }
            for (int i = 0; i < 2; i++)
            {
                co.Scan("A");
            }

            decimal price         = co.GetTotalPrice();
            decimal expectedPrice = 530;

            Assert.AreEqual(expectedPrice, price);
        }
 public void setPricingEngine(PricingEngine engine)
 {
     NQuantLibcPINVOKE._CalibrationHelper_setPricingEngine(swigCPtr, PricingEngine.getCPtr(engine));
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Esempio n. 7
0
 public void setPricingEngine(PricingEngine arg0)
 {
     NQuantLibcPINVOKE.Instrument_setPricingEngine(swigCPtr, PricingEngine.getCPtr(arg0));
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Esempio n. 8
0
        static void Main(string[] args)
        {
            //// create new customer
            var customer = new Person("Era", "Azana", new Address("212 Baker St.", "London", "United Kingdom", 16));
            //// create a new policy with effective date
            var policy = new Policy(DateTime.Today, DateTime.Today.AddYears(1));

            //// create 2 new Cars and add each coverage
            var car1 = new Vehicle(2016,
                                   "Honda",
                                   "Accord",
                                   10000,
                                   Color.BLUE,
                                   new List <Coverage>()
            {
                new Coverage(CoverageType.BOD),
                new Coverage(CoverageType.LIA),
            });         //75 x 2



            var car2 = new Vehicle(2015, "Nissan", "Almera", 25000, Color.RED,
                                   new List <Coverage>()
            {
                new Coverage(CoverageType.BOD),
                new Coverage(CoverageType.LIA)
            });                                                       //75
            var car3 = new Vehicle(2016, "Mitsubishi", "Montero", 12500, Color.RED, new List <Coverage>()
            {
                new Coverage(CoverageType.COMP),
                new Coverage(CoverageType.LIA)
            });                                   //75


            //// Add to the insured Vehicles
            policy.Vehicles.Add(car1);
            policy.Vehicles.Add(car2);
            policy.Vehicles.Add(car3);

            //// create 2 new drivers
            var driver1 = new Person("John", "Watson", new Address("212 Baker St.", "London", "United Kingdom", 16));
            var driver2 = new Person("Sherlock", "Holmes", new Address("212 Baker St.", "London", "United Kingdom", 16));

            //// create spouse instance for insured driver
            var wifey = new Person("Jane", "Abbington", new Address("212 Baker St.", "London", "United Kingdom", 16));

            //// add the policyholder, spouse and drivers to the insured driver
            policy.Drivers.Add(customer);
            policy.Drivers.Add(wifey);
            policy.Drivers.Add(wifey);
            // policy.Drivers.Add(driver1);
            // policy.Drivers.Add(driver2);

            var priceEngine = new PricingEngine().pricePolicy(policy);

            Console.WriteLine(policy);
            Console.WriteLine(priceEngine);
        }
Esempio n. 9
0
        public void If_PricingEngine_Has_No_PricingRules_For_A_Then_TotalPrice_For_A_Is_0()
        {
            IPricingEngine pe = new PricingEngine();

            decimal price         = pe.GetItemTotalPrice("A", 3);
            decimal expectedPrice = 0;

            Assert.AreEqual(expectedPrice, price);
        }
Esempio n. 10
0
            /// <summary>
            /// This method will calculate the prices for the whole sales transaction.
            /// </summary>
            /// <param name="salesTransaction">Sales transaction.</param>
            /// <param name="pricingDataManager">Provides access to the pricing data to the pricing calculation.</param>
            /// <param name="currencyAndRoundingHelper">Currency and rounding helper.</param>
            /// <param name="customerPriceGroup">Customer price group.</param>
            /// <param name="currencyCode">Current code.</param>
            /// <param name="activeDate">Active date time offset for price.</param>
            /// <remarks>Parallel processing has been disabled, but we leave parameter here for backward compatibility.</remarks>
            public static void CalculatePricesForTransaction(
                SalesTransaction salesTransaction,
                IPricingDataAccessor pricingDataManager,
                ICurrencyOperations currencyAndRoundingHelper,
                string customerPriceGroup,
                string currencyCode,
                DateTimeOffset activeDate)
            {
                if (salesTransaction == null)
                {
                    throw new ArgumentNullException("salesTransaction");
                }

                if (pricingDataManager == null)
                {
                    throw new ArgumentNullException("pricingDataManager");
                }

                if (currencyAndRoundingHelper == null)
                {
                    throw new ArgumentNullException("currencyAndRoundingHelper");
                }

                ISet <long> catalogIds = PriceContextHelper.GetCatalogIds(salesTransaction);
                IEnumerable <AffiliationLoyaltyTier> affiliationLoyaltyTiers = PriceContextHelper.GetAffiliationLoyalTierIds(salesTransaction);

                ISet <string> itemIds      = PriceContextHelper.GetItemIds(salesTransaction);
                PriceContext  priceContext = PriceContextHelper.CreatePriceContext(
                    pricingDataManager,
                    currencyAndRoundingHelper,
                    PricingCalculationMode.Transaction,
                    DiscountCalculationMode.None,
                    itemIds,
                    catalogIds,
                    affiliationLoyaltyTiers,
                    salesTransaction.CustomerId,
                    customerPriceGroup,
                    salesTransaction.IsTaxIncludedInPrice,
                    currencyCode,
                    activeDate);

                bool isDiagnosticsCollected = GetCollectDiagnostics(salesTransaction);

                if (isDiagnosticsCollected)
                {
                    priceContext.IsDiagnosticsCollected         = true;
                    priceContext.PricingEngineDiagnosticsObject = new PricingEngineDiagnosticsObject();
                }

                PricingEngine.CalculatePricesForSalesLines(salesTransaction.PriceCalculableSalesLines, priceContext, pricingDataManager);

                if (isDiagnosticsCollected)
                {
                    SetPricingEngineDiagnosticsObject(salesTransaction, priceContext.PricingEngineDiagnosticsObject);
                }
            }
        public void CalculateUnitPrice_QtyGT20()
        {
            // arrange
            PricingEngine engine = new PricingEngine(false);
            // act
            decimal unitPrice = engine.CalculateUnitPrice(21, 10.00m);

            // assert
            Assert.AreEqual(unitPrice, 8.00m);
        }
        public void CalculateUnitPrice_HolidayBelowMinTotal()
        {
            // arrange
            PricingEngine engine = new PricingEngine(true);
            // act
            decimal unitPrice = engine.CalculateUnitPrice(5, 100.00m);

            // assert
            Assert.AreEqual(unitPrice, 100.00m);
        }
        public MakeVanillaSwap withPricingEngine(PricingEngine engine)
        {
            MakeVanillaSwap ret = new MakeVanillaSwap(NQuantLibcPINVOKE.MakeVanillaSwap_withPricingEngine(swigCPtr, PricingEngine.getCPtr(engine)), false);

            if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
            {
                throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Esempio n. 14
0
        public void CalculateUnitPrice_BelowMinPrice()
        {
            // arrange
            PricingEngine engine = new PricingEngine(false);
            // act
            decimal unitPrice = engine.CalculateUnitPrice(10, 0.50m);

            // assert
            Assert.AreEqual(unitPrice, 0.50m);
        }
        public void CalculateUnitPrice_MinQtyUpper()
        {
            // arrange
            PricingEngine engine = new PricingEngine(false);
            // act
            decimal unitPrice = engine.CalculateUnitPrice(20, 10.00m);

            // assert
            Assert.AreEqual(unitPrice, 9.00m);
        }
        public void CalculateUnitPrice_HolidayBelowMinPrice()
        {
            // arrange
            PricingEngine engine = new PricingEngine(true);

            // act
            decimal unitPrice = engine.CalculateUnitPrice(10, 1.00m);

            // assert
            Assert.AreEqual(1.00m, unitPrice);
        }
        public void CalculateUnitPrice_MinPrice()
        {
            // arrange
            PricingEngine engine = new PricingEngine(false);

            // act
            decimal unitPrice = engine.CalculateUnitPrice(20, 1.01m);

            // assert
            Assert.AreEqual(0.909m, unitPrice);
        }
Esempio n. 18
0
        public void PricingEngine_Instantiate_From_List()
        {
            IPricingEngine pe = new PricingEngine(
                new List <IPricingRule> {
                new QuantityPricingRule("A", 50),
                new QuantityPricingRule("B", 30)
            });
            decimal price         = pe.GetItemTotalPrice("A", 2);
            decimal expectedPrice = 100;

            Assert.AreEqual(expectedPrice, price);
        }
Esempio n. 19
0
        public void CalculateUnitPrice_BelowMinPrice()
        {
            // 1. If the retail price is less than, or equal to $1.00, no discount

            // arrange
            PricingEngine engine = new PricingEngine(false);
            // act
            decimal unitPrice = engine.CalculateUnitPrice(10, 0.50m);

            // assert
            Assert.AreEqual(unitPrice, 0.50m);   // no discount < $1.00
        }
Esempio n. 20
0
        public void GivenCalculateLineTotalWhenNoPromotionThenDontApplyDiscount()
        {
            var cartItem = new CartItem(new Item()
            {
                Sku = "1", UnitPrice = 1.13m
            }, 2);
            var sut = new PricingEngine(_mockPromotionProvider.Object);

            sut.CalculateLineTotal(cartItem);

            cartItem.LineTotal.Should().Be(2.26m);
        }
Esempio n. 21
0
        public void PricingEngine_Add_Generic_PricingRules()
        {
            IPricingEngine pe = new PricingEngine();

            pe.AddPricingRule(new QuantityPricingRule("A", 50));
            pe.AddPricingRule(new QuantityPricingRule("B", 30));

            decimal price         = pe.GetItemTotalPrice("B", 3);
            decimal expectedPrice = 90;

            Assert.AreEqual(expectedPrice, price);
        }
Esempio n. 22
0
        static void asd(string[] args)
        {
            var car1 = new Vehicle(2012, "Honda", "Accord", 10000, Color.BLUE,
                                   new List <Coverage>()
            {
                new Coverage(CoverageType.BOD),
                new Coverage(CoverageType.LIA)
            });
            var car2 = new Vehicle(2014, "Honda", "Civic", 25000, Color.RED, new List <Coverage>()
            {
                new Coverage(CoverageType.COMP),
                new Coverage(CoverageType.LIA)
            });
            var car3 = new Vehicle(2011, "Toyota", "Camry", 25000, Color.RED, new List <Coverage>()
            {
                new Coverage(CoverageType.COMP),
                new Coverage(CoverageType.LIA)
            });
            var dt     = DateTime.Now;
            var policy = new Policy(dt.AddMonths(-4), dt.AddMonths(8));

            policy.Vehicles.Add(car1);//note: only added car1 and car2
            policy.Vehicles.Add(car2);
            //...add drivers as well

            policy.AddCoverage(new Coverage(CoverageType.BOD), car1);
            //policy.addCoverage(new Coverage(CoverageType.Liability), car1)
            policy.AddCoverage(new Coverage(CoverageType.LIA), car2);

            // //This must throw an exception because the same coverage is being added to the same car twice
            // policy.AddCoverage(new Coverage(CoverageType.BOD), car1); // *ok

            car1.AddCoverages(new List <Coverage>()
            {
                new Coverage(CoverageType.LIA), new Coverage(CoverageType.COMP)
            }, policy);
            ////This must throw an exception because the coverage is being added to a car that is not on the Policy
            // policy.AddCoverage(new Coverage(CoverageType.LIA), car3); // should throw exception *ok
            // //
            var covs  = policy.getCarCoverages(car1);                //should return coverages for car1 only *ok
            var count = policy.getCoveredCarCount(CoverageType.BOD); //This should return 2 - i.e 2 cars on the policy have the coverage type *ok

            covs.ForEach((cov) =>
                         Console.WriteLine(cov.InsuranceCoverageType.ToString().PadRight(20).Replace('\0', ' ') + "   " + cov.CoveredCar)
                         );


            var priceEngine = new PricingEngine().pricePolicy(policy);

            Console.WriteLine(policy);
            Console.WriteLine(priceEngine);
        }
Esempio n. 23
0
        public void CalculateUnitPrice_MinPrice()
        {
            // 1. If the retail price is less than, or equal to $1.00, no discount
            // 2. If quantity is greater than 10 but less than, or equal to 20, then 10 % discount

            // arrange
            PricingEngine engine = new PricingEngine(false);
            // act
            decimal unitPrice = engine.CalculateUnitPrice(11, 1.00m);

            // assert
            Assert.AreEqual(unitPrice, .900m);      // 10% discount between 10 and 20 ordered
        }
Esempio n. 24
0
        public void PricingEngine_Add_Specific_PricingRules()
        {
            IPricingEngine pe = new PricingEngine();

            pe.AddQuantityPricingRule(new QuantityPricingRule("A", 50));
            pe.AddQuantityPricingRule(new QuantityPricingRule("A", 2, 80));
            pe.AddQuantityDiscountPricingRule(new QuantityDiscountPricingRule("A", 3, 2));

            decimal price         = pe.GetItemTotalPrice("A", 3);
            decimal expectedPrice = 80;

            Assert.AreEqual(expectedPrice, price);
        }
        public void CalculateReceiptTest()
        {
            PricingEngine target = new PricingEngine();                          // TODO: Initialize to an appropriate value

            string[] items = new string[] { "Apples", "Soup", "Soup", "Bread" }; // TODO: Initialize to an appropriate value
            Receipt  actual;

            actual = target.CalculateReceipt(items);

            //Precision again...
            Assert.AreEqual(System.Math.Round(3.10F, 2), System.Math.Round(actual.Subtotal, 2));
            Assert.AreEqual(System.Math.Round(2.60F, 2), System.Math.Round(actual.Total, 2));
        }
Esempio n. 26
0
        public void CalculateUnitPrice_QtyGT20()
        {
            // 1. If the retail price is less than, or equal to $1.00, no discount
            // 2. If quantity is greater than 10 but less than, or equal to 20, then 10 % discount
            // 3. If quantity greater than 20, then 20 % discount
            // arrange
            PricingEngine engine = new PricingEngine(false);
            // act
            decimal unitPrice = engine.CalculateUnitPrice(21, 1.00m);

            // assert
            Assert.AreEqual(unitPrice, 0.800m);   // 20% discount if order more than 20
        }
Esempio n. 27
0
        public void CalculateUnitPrice_BelowMinQty()
        {
            // 1. If the retail price is less than, or equal to $1.00, no discount
            // 2. If quantity is greater than 10 but less than, or equal to 20, then 10 % discount

            // arrange
            PricingEngine engine = new PricingEngine(false);
            // act
            decimal unitPrice = engine.CalculateUnitPrice(9, 1.00m);

            // assert
            Assert.AreEqual(unitPrice, 1.000m);    // no discount < under 10 ordered
        }
        public void CalculateUnitPrice_HolidayMinQty()
        {
            // Test the discount for holiday and quantity = 10 and total
            // discounted amount is above the holiday threshold

            // arrange
            PricingEngine engine = new PricingEngine(true);
            // act
            decimal unitPrice = engine.CalculateUnitPrice(11, 150.00m);

            // assert
            Assert.AreEqual(unitPrice, 120.00m);
        }
Esempio n. 29
0
        public void CalculateUnitPrice_HolidayBelowMinPrice()
        {
            // 4. If it's a holiday and the total amount, after volume discount, is greater
            //    than the holiday threshold, then apply the holiday discount percent

            // arrange
            PricingEngine engine = new PricingEngine(true);
            // act
            decimal unitPrice = engine.CalculateUnitPrice(1250, .99m);

            // assert
            Assert.AreEqual(unitPrice, .990m);   // holiday but under $1.00 - no discount
        }
            /// <summary>
            /// Implements the IPricingCalculator interface to calculate item price trade agreement prices.
            /// </summary>
            /// <param name="salesLines">The item lines which need prices.</param>
            /// <param name="priceContext">The configuration of the overall pricing context for the calculation.</param>
            /// <param name="pricingDataManager">Instance of pricing data manager to access pricing data.</param>
            /// <returns>Sets of possible price lines keyed by item line Id.</returns>
            public Dictionary <string, IEnumerable <PriceLine> > CalculatePriceLines(
                IEnumerable <SalesLine> salesLines,
                PriceContext priceContext,
                IPricingDataAccessor pricingDataManager)
            {
                Tuple <DateTimeOffset, DateTimeOffset> dateRange = PricingEngine.GetMinAndMaxActiveDates(salesLines, priceContext.ActiveDate);

                // look up all trade agreements for given items and context
                HashSet <string> itemIds = new HashSet <string>(salesLines.Select(s => s.ItemId).Distinct(), StringComparer.OrdinalIgnoreCase);
                ReadOnlyCollection <TradeAgreement> tradeAgreements = pricingDataManager.ReadPriceTradeAgreements(
                    itemIds,
                    PriceContextHelper.GetAllPriceGroupsForPrice(priceContext),
                    priceContext.CustomerAccount,
                    dateRange.Item1,
                    dateRange.Item2,
                    priceContext.CurrencyCode,
                    QueryResultSettings.AllRecords) as ReadOnlyCollection <TradeAgreement>;

                if (priceContext.IsDiagnosticsCollected && tradeAgreements.Any())
                {
                    priceContext.PricingEngineDiagnosticsObject.AddTradeAgreementsConsidered(tradeAgreements.ToList());
                }

                var agreementsByItemId = IndexAgreementsByItemId(tradeAgreements);

                var discountParameters = DiscountParameters.CreateAndInitialize(priceContext.PriceParameters);

                Dictionary <string, IEnumerable <PriceLine> > itemPriceLines;
                Dictionary <string, decimal> itemQuantites = null;

                if (priceContext.PriceCalculationMode == PricingCalculationMode.Transaction)
                {
                    itemQuantites = GetItemQuantities(salesLines);
                }

                itemPriceLines = new Dictionary <string, IEnumerable <PriceLine> >(StringComparer.OrdinalIgnoreCase);

                foreach (SalesLine salesLine in salesLines)
                {
                    Tuple <decimal, string> priceCustPriceGroup = CalculateAgreementPriceLine(salesLines, salesLine, priceContext, agreementsByItemId, discountParameters, itemQuantites);
                    if (priceCustPriceGroup.Item1 != decimal.Zero)
                    {
                        itemPriceLines.Add(salesLine.LineId, new List <PriceLine>(1)
                        {
                            ConstructTradeAgreementPriceLine(priceCustPriceGroup)
                        });
                    }
                }

                return(itemPriceLines);
            }
Esempio n. 31
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PricingEngine obj) {
   return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
 }
Esempio n. 32
0
 public void setPricingEngine(PricingEngine engine) {
   NQuantLibcPINVOKE._CalibrationHelper_setPricingEngine(swigCPtr, PricingEngine.getCPtr(engine));
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
 }
Esempio n. 33
0
 public void setPricingEngine(PricingEngine arg0) {
   NQuantLibcPINVOKE.Instrument_setPricingEngine(swigCPtr, PricingEngine.getCPtr(arg0));
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
 }