public void Cleanup_ShouldCall_Origin() { var directory = new SafeUpdatesDirectory(_origin); directory.Cleanup(); _origin.Received(1).Cleanup(); }
public void Cleanup_ShouldPassException_WhenOriginThrows() { _origin.When(x => x.Cleanup()).Do(_ => throw new SomeException()); var directory = new SafeUpdatesDirectory(_origin); Action action = () => directory.Cleanup(); action.Should().Throw <SomeException>(); }
private void Cleanup_ShouldThrow_AppUpdateException_WhenOriginThrows(Exception ex) { TestInitialize(); _origin.When(x => x.Cleanup()).Do(_ => throw ex); var directory = new SafeUpdatesDirectory(_origin); Action action = () => directory.Cleanup(); action.Should().Throw <AppUpdateException>(); }