public void ReturnsNoSuggestionsInCaseOfError() { var now = new DateTimeOffset(2020, 1, 5, 3, 55, 0, TimeSpan.Zero); TimeService.CurrentDateTime.Returns(now); var exception = new Exception(); InteractorFactory.GetDefaultWorkspace().Execute().Returns(Observable.Throw <IThreadSafeWorkspace>(exception)); var provider = new CalendarSuggestionProvider(TimeService, CalendarService, InteractorFactory); provider.GetSuggestions().Count().Wait().Should().Be(0); }
public void NeverThrows() { var now = new DateTimeOffset(2020, 1, 5, 3, 55, 0, TimeSpan.Zero); TimeService.CurrentDateTime.Returns(now); var exception = new Exception(); InteractorFactory.GetDefaultWorkspace().Execute().Returns(Observable.Throw <IThreadSafeWorkspace>(exception)); var provider = new CalendarSuggestionProvider(TimeService, CalendarService, InteractorFactory); Action getSuggestions = () => provider.GetSuggestions().Subscribe(); getSuggestions.Should().NotThrow(); }
public CalendarSuggestionProviderTest() { Provider = new CalendarSuggestionProvider(TimeService, CalendarService, InteractorFactory); }