public BondSpreadCalculator(BondSpreadServiceModel bondSpreadServiceModel, CurveBuilder curveBuilder,
                             FutureBuilder futureBuilder, FutureEnrichment futureEnricher, ForwardBuilder forwardBuilder,
                             InterestCurves curves)
 {
     this.bondSpreadServiceModel = bondSpreadServiceModel;
     this.curveBuilder = curveBuilder;            
     this.futureBuilder = futureBuilder;
     this.futureEnricher = futureEnricher;
     this.forwardBuilder = forwardBuilder;
     this.curves = curves;
     
     carbonFieldMap = CarbonModel.GetEnumToFieldMapping(new[] { "bid", "ask", "primAct1", "secAct1" });
     dataObserver = new DataObserver(bondPriceCache, carbonFieldMap, FutureCache);
     dataObserver.Subscribe(dataObserveSubject);
 }
        public void ShouldGiveCorrectBondLivePricesWithoutRicSubscription()
        {
            AutoResetEvent reset = new AutoResetEvent(false);


            DIContainer.RegisterSingletonType<FutureBuilder>();
            Mock<IRepoAssumptions> mockRepo = new Mock<IRepoAssumptions>();
            mockRepo.Setup(t => t.LoadDefaultRepo());


            //DIContainer.GetInstance().RegisterType<ForwardBuilder>(new InjectionConstructor(mockRepo.Object));

            DIContainer.RegisterSingletonType<BondSpreadServiceModel>();
            DIContainer.RegisterSingletonType<BondSpreadCalculator>();
            DIContainer.RegisterSingletonType<CurveBuilder>();
            DIContainer.RegisterSingletonType<FutureBuilder>();
            DIContainer.RegisterSingletonType<FutureEnrichment>();

            var bondSpreadServiceModel = DIContainer.Resolve<BondSpreadServiceModel>();
            var curveBuilder = DIContainer.Resolve<CurveBuilder>();
            var futureBuilder = DIContainer.Resolve<FutureBuilder>();
            var futureEnrichment = DIContainer.Resolve<FutureEnrichment>();
            var forwardBuilder = new ForwardBuilder(futureBuilder, mockRepo.Object);
            var curves = new InterestCurves(curveBuilder);

            var bondspreadcalc = new BondSpreadCalculator(bondSpreadServiceModel, curveBuilder, futureBuilder, futureEnrichment, forwardBuilder, curves);
            bondspreadcalc.GetMarketDataStreamFromCarbon("US912828P956", new[] { "Bid", "Ask" });

            bondspreadcalc.BondPriceObservable()
                .Subscribe(ProcessMethod);

            reset.WaitOne(TimeSpan.FromMinutes(1));

        }