public void Launch_ShouldPassException_WhenOriginThrows() { _origin.WhenForAnyArgs(x => x.Launch("", "")).Throw <SomeException>(); var launchable = new SafeLaunchableFile(_origin); Action action = () => launchable.Launch("", ""); action.Should().Throw <SomeException>(); }
private void Launch_ShouldThrow_AppUpdateException_WhenOriginThrows(Exception ex) { TestInitialize(); _origin.WhenForAnyArgs(x => x.Launch("", "")).Throw(ex); var launchable = new SafeLaunchableFile(_origin); Action action = () => launchable.Launch("", ""); action.Should().Throw <AppUpdateException>(); }
public void Launch_ShouldCall_Origin_Launch_WithArguments() { const string filename = "File to launch"; const string args = "Launch arguments"; var launchable = new SafeLaunchableFile(_origin); launchable.Launch(filename, args); _origin.Received(1).Launch(filename, args); }