public void Launch_ShouldPassException_WhenOriginThrows() { _origin.WhenForAnyArgs(x => x.Download("", "")).Throw <SomeException>(); var downloadable = new SafeDownloadableFile(_origin); Func <Task> action = () => downloadable.Download("", ""); action.Should().Throw <SomeException>(); }
private void Launch_ShouldThrow_AppUpdateException_WhenOriginThrows(Exception ex) { TestInitialize(); _origin.WhenForAnyArgs(x => x.Download("", "")).Throw(ex); var downloadable = new SafeDownloadableFile(_origin); Func <Task> action = () => downloadable.Download("", ""); action.Should().Throw <AppUpdateException>(); }
public async Task Download_ShouldCall_Origin_Download_WithArguments() { const string uri = "Download uri"; const string filename = "File to launch"; var downloadable = new SafeDownloadableFile(_origin); await downloadable.Download(uri, filename); await _origin.Received(1).Download(uri, filename); }