public void Path_ShouldGet_OriginPath()
        {
            var directory = new SafeUpdatesDirectory(_origin);

            var result = directory.Path;

            var dummy = _origin.Received(1).Path;
        }
        public void Cleanup_ShouldCall_Origin()
        {
            var directory = new SafeUpdatesDirectory(_origin);

            directory.Cleanup();

            _origin.Received(1).Cleanup();
        }
        public void Path_ShouldPassException_WhenOriginThrows()
        {
            _origin.Path.Throws <SomeException>();
            var directory = new SafeUpdatesDirectory(_origin);

            Action action = () => { var result = directory.Path; };

            action.Should().Throw <SomeException>();
        }
        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 Path_ShouldThrow_AppUpdateException_WhenOriginThrows(Exception ex)
        {
            TestInitialize();
            _origin.Path.Throws(ex);
            var directory = new SafeUpdatesDirectory(_origin);

            Action action = () => { var result = directory.Path; };

            action.Should().Throw <AppUpdateException>();
        }
        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>();
        }
        public void Path_ShouldBe_FromOrigin()
        {
            const string expected = "Expected path";

            _origin.Path.Returns(expected);
            var directory = new SafeUpdatesDirectory(_origin);

            var result = directory.Path;

            result.Should().Be(expected);
        }