public void SequentialConsolidatorsFiresAllEvents() { var first = new IdentityDataConsolidator<BaseData>(); var second = new IdentityDataConsolidator<BaseData>(); var sequential = new SequentialConsolidator(first, second); bool firstFired = false; bool secondFired = false; bool sequentialFired = false; first.DataConsolidated += (sender, consolidated) => { firstFired = true; }; second.DataConsolidated += (sender, consolidated) => { secondFired = true; }; sequential.DataConsolidated += (sender, consolidated) => { sequentialFired = true; }; sequential.Update(new TradeBar()); Assert.IsTrue(firstFired); Assert.IsTrue(secondFired); Assert.IsTrue(sequentialFired); }
public void SequentialConsolidatorAcceptsSubTypesForSecondInputType() { var first = new IdentityDataConsolidator<TradeBar>(); var second = new IdentityDataConsolidator<BaseData>(); var sequential = new SequentialConsolidator(first, second); bool firstFired = false; bool secondFired = false; bool sequentialFired = false; first.DataConsolidated += (sender, consolidated) => { firstFired = true; }; second.DataConsolidated += (sender, consolidated) => { secondFired = true; }; sequential.DataConsolidated += (sender, consolidated) => { sequentialFired = true; }; sequential.Update(new TradeBar()); Assert.IsTrue(firstFired); Assert.IsTrue(secondFired); Assert.IsTrue(sequentialFired); }