public void CheckForMatchingShuttle_Returns_Null_When_Match_Found() { Mock <IRepository <Shuttle> > mockShuttleRepo = new Mock <IRepository <Shuttle> >(); mockShuttleRepo.SetupGet(repo => repo.Data).Returns(() => TestShuttles); var sut = new YoyoDataService(null, mockShuttleRepo.Object, null); var timeParam = new TimeSpan(0, 0, 10); var result = sut.CheckForMatchingShuttle(timeParam); Assert.NotNull(result); Assert.Equal(result.StartTime, timeParam); }
private async void UpdateShuttle() { var newShuttle = YoyoDataService.CheckForMatchingShuttle(TotalTime); if (newShuttle == null) { return; } _logger.LogDebug("Shuttle Changed!"); PreviousShuttle = CurrentShuttle; CurrentShuttle = newShuttle; CurrentShuttleTimeLeft = CurrentShuttle.CommulativeTime - CurrentShuttle.StartTime; await InvokeAsync(StateHasChanged); }