public IFixtureOverview GetFixtureOverview(string fixtureId) { FixtureOverview fixtureOverview = null; return(_fixtures.TryGetValue(fixtureId, out fixtureOverview) ? fixtureOverview : _fixtures[fixtureId] = new FixtureOverview(fixtureId)); }
private FixtureOverview GetFixtureOverview(string fixtureId) { FixtureOverview fixtureOverview; return(_fixturesOverview.TryGetValue(fixtureId, out fixtureOverview) ? fixtureOverview : _fixturesOverview[fixtureId] = new FixtureOverview(fixtureId)); }
private void PublishDelta(FixtureOverview fixtureOverview) { var delta = fixtureOverview.GetDelta(); if (delta != null) { _fixtureTracker.OnNext(delta); } }
private static void UpdateLastErrorResolved(StreamListenerEventArgs streamListenerEventArgs, FixtureOverview fixtureOverview) { if (fixtureOverview.LastError != null && fixtureOverview.LastError.IsErrored && !streamListenerEventArgs.Listener.IsErrored) { fixtureOverview.LastError.ResolvedAt = DateTime.UtcNow; fixtureOverview.LastError.IsErrored = false; } }
private void CleanUpFixtureData(string fixtureId) { var fixtureState = EventState.GetFixtureState(fixtureId); FixtureOverview tempObj = null; _fixtures.TryRemove(fixtureId, out tempObj); if (fixtureState != null && fixtureState.MatchStatus == MatchStatus.MatchOver) { SaveState(); } }
public void GetDeltaHasNotChangedTest() { var fixtureOverview = new FixtureOverview("TestId"); fixtureOverview.ListenerOverview.IsStreaming = true; //initial set up will also create a delta this call clears it fixtureOverview.GetDelta(); fixtureOverview.ListenerOverview.IsStreaming = true; var delta = fixtureOverview.GetDelta(); delta.Should().BeNull(); }
public void GetDeltaTest() { var fixtureOverview = new FixtureOverview("TestId"); fixtureOverview.ListenerOverview.IsStreaming = false; fixtureOverview.ListenerOverview.IsStreaming = true; var delta = fixtureOverview.GetDelta(); delta.Should().NotBeNull(); delta.ListenerOverview.Should().NotBeNull(); delta.ListenerOverview.IsStreaming.HasValue.Should().BeTrue(); delta.Id.Should().Be(fixtureOverview.Id); //hasn't changed delta.ListenerOverview.IsDeleted.HasValue.Should().BeFalse(); }
public void GetErrorTest() { var fixtureOverview = new FixtureOverview("TestId"); fixtureOverview.LastError = new ErrorOverview { ErroredAt = DateTime.UtcNow, Exception = new NullReferenceException(), IsErrored = true, }; var delta = fixtureOverview.GetDelta(); delta.LastError.Should().NotBeNull(); delta.LastError.Should().Be(fixtureOverview.LastError); fixtureOverview.ListenerOverview.IsErrored = false; delta = fixtureOverview.GetDelta(); delta.LastError.Should().NotBeNull(); delta.LastError.ResolvedAt.HasValue.Should().BeTrue(); }
public IFixtureOverview GetFixtureOverview(string fixtureId) { return _fixtures.ContainsKey(fixtureId) ? _fixtures[fixtureId] : _fixtures[fixtureId] = new FixtureOverview(fixtureId); }
private void PublishDelta(FixtureOverview fixtureOverview) { var delta = fixtureOverview.GetDelta(); if (delta != null) _fixtureTracker.OnNext(delta); }
public IFixtureOverview GetFixtureOverview(string fixtureId) { return(_fixtures.ContainsKey(fixtureId) ? _fixtures[fixtureId] : _fixtures[fixtureId] = new FixtureOverview(fixtureId)); }