public async Task Releases_ShouldCall_Origin_Releases() { var storage = new SafeReleaseStorage(_origin); await storage.Releases(); await _origin.Received(1).Releases(); }
public void Releases_ShouldPassException_WhenOriginThrows() { _origin.When(x => x.Releases()).Throw <Exception>(); var storage = new SafeReleaseStorage(_origin); Func <Task> action = () => storage.Releases(); action.Should().Throw <Exception>(); }
private void Releases_ShouldThrow_AppUpdateException_WhenOriginThrowsAsync(Exception ex) { TestInitialize(); _origin.Releases().Returns(Task.FromException <IEnumerable <Release> >(ex)); var storage = new SafeReleaseStorage(_origin); Func <Task> action = () => storage.Releases(); action.Should().Throw <AppUpdateException>(); }
private void Releases_ShouldThrow_AppUpdateException_WhenOriginThrows(Exception ex) { TestInitialize(); _origin.When(x => x.Releases()).Throw(ex); var storage = new SafeReleaseStorage(_origin); Func <Task> action = () => storage.Releases(); action.Should().Throw <AppUpdateException>(); }