예제 #1
0
        public void Cleanup_ShouldCall_Origin()
        {
            var directory = new SafeUpdatesDirectory(_origin);

            directory.Cleanup();

            _origin.Received(1).Cleanup();
        }
예제 #2
0
        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>();
        }
예제 #3
0
        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>();
        }