public void SuperDispatcherIsNotRetrieved() { var messageMapperMock = new Mock <IFeedMessageMapper>(); var dispatcher = new SpecificEntityDispatcher <ITestBallMatch>(messageMapperMock.Object, TestData.Cultures); _store.Add(dispatcher); dispatcher.Open(); var matchDispatcher = _store.Get(URN.Parse("sr:match:100"), URN.Parse("sr:sport:100")); Assert.IsNull(matchDispatcher, $"{nameof(matchDispatcher)} must be null"); }
public void SpecificDispatcherIsRetrieved() { var messageMapperMock = new Mock <IFeedMessageMapper>(); var dispatcher = new SpecificEntityDispatcher <ITestSoccerMatch>(messageMapperMock.Object, TestData.Cultures); _store.Add(dispatcher); dispatcher.Open(); var retrievedDispatcher = _store.Get(URN.Parse("sr:match:112"), URN.Parse("sr:sport:1")); Assert.AreEqual(dispatcher, retrievedDispatcher, $"{nameof(retrievedDispatcher)} must be equal to {nameof(dispatcher)}"); }
public void RemovedDispatcherIsNotRetrieved() { var dispatcher = new SpecificEntityDispatcher <IMatch>(new Mock <IFeedMessageMapper>().Object, TestData.Cultures); _store.Add(dispatcher); dispatcher.Open(); dispatcher.Close(); var retrievedDispatcher = _store.Get(URN.Parse("sr:match:100"), URN.Parse("sr:sport:100")); Assert.IsNull(retrievedDispatcher, $"{nameof(retrievedDispatcher)} must be null"); }
public void AllSubDispatchersAreRetrieved() { var messageMapperMock = new Mock <IFeedMessageMapper>(); var dispatcher = new SpecificEntityDispatcher <IMatch>(messageMapperMock.Object, TestData.Cultures); _store.Add(dispatcher); dispatcher.Open(); var soccerDispatcher = _store.Get(URN.Parse("sr:match:112"), URN.Parse("sr:sport:1")); Assert.AreEqual(dispatcher, soccerDispatcher, $"{nameof(soccerDispatcher)} must be equal to {nameof(dispatcher)}"); var basketDispatcher = _store.Get(URN.Parse("sr:match:112"), URN.Parse("sr:sport:2")); Assert.AreEqual(dispatcher, basketDispatcher, $"{nameof(basketDispatcher)} must be equal to {nameof(dispatcher)}"); var matchDispatcher = _store.Get(URN.Parse("sr:match:112"), URN.Parse("sr:sport:100")); Assert.AreEqual(dispatcher, matchDispatcher, $"{nameof(matchDispatcher)} must be equal to {nameof(dispatcher)}"); }
public void MoreSpecificDispatcherIsUsed() { var matchDispatcher = new SpecificEntityDispatcher <IMatch>(new Mock <IFeedMessageMapper>().Object, TestData.Cultures); _store.Add(matchDispatcher); matchDispatcher.Open(); var ballMatchDispatcher = new SpecificEntityDispatcher <ITestBallMatch>(new Mock <IFeedMessageMapper>().Object, TestData.Cultures); _store.Add(ballMatchDispatcher); ballMatchDispatcher.Open(); var retrievedMatchDispatcher = _store.Get(URN.Parse("sr:match:100"), URN.Parse("sr:sport:100")); Assert.AreEqual(matchDispatcher, retrievedMatchDispatcher, $"{nameof(retrievedMatchDispatcher)} must be equal to {nameof(matchDispatcher)}"); var retrievedSoccerDispatcher = _store.Get(URN.Parse("sr:match:100"), URN.Parse("sr:sport:1")); Assert.AreEqual(ballMatchDispatcher, retrievedSoccerDispatcher, $"{nameof(retrievedSoccerDispatcher)} must be equal to {nameof(ballMatchDispatcher)}"); }