Beispiel #1
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="pricingSource">Pricing source </param>
 /// <param name="updateInterval"> interval between price updates in milli seconds </param>
 public PricingEngine(IPricingSource pricingSource, int updateInterval)
 {
     myPricingSource           = pricingSource;
     myDispatcherToOwnerThread = Dispatcher.FromThread(Thread.CurrentThread);
     myTimer.Interval          = updateInterval;
     myTimer.Elapsed          += OnTimerElapsed;
 }
Beispiel #2
0
        public void TestSetup()
        {
            mySupportedInstruments = new List <string>()
            {
                "a", "b", "c", "d"
            };
            myTestee = new CompositePricingSource(new List <IPricingSource>()
            {
                myPricingSource1.Object, myPricingSource2.Object
            });

            myPricingSource1.SetupGet(m => m.SupportedInstruments).Returns(new List <string>()
            {
                "a", "b"
            });
            myPricingSource1.Setup(m => m.GetPrice("a")).Returns(10.25);
            myPricingSource1.Setup(m => m.GetPrice("b")).Returns(15.25);

            myPricingSource2.SetupGet(m => m.SupportedInstruments).Returns(new List <string>()
            {
                "c", "d"
            });
            myPricingSource2.Setup(m => m.GetPrice("c")).Returns(80.25);
            myPricingSource2.Setup(m => m.GetPrice("d")).Returns(45.25);
        }
Beispiel #3
0
 public void TestSetup()
 {
     mySupportedInstruments = new List <string>()
     {
         "a", "b", "c", "d"
     };
     myTestee = new SimulatedPricingSource(mySupportedInstruments);
 }
Beispiel #4
0
 public void TestTeardown()
 {
     myTestee = null;
 }