示例#1
0
        public async Task Releases_ShouldCall_Origin_Releases()
        {
            var storage = new SafeReleaseStorage(_origin);

            await storage.Releases();

            await _origin.Received(1).Releases();
        }
示例#2
0
        public void Releases_ShouldPassException_WhenOriginThrows()
        {
            _origin.When(x => x.Releases()).Throw <Exception>();
            var storage = new SafeReleaseStorage(_origin);

            Func <Task> action = () => storage.Releases();

            action.Should().Throw <Exception>();
        }
示例#3
0
        private void Releases_ShouldThrow_AppUpdateException_WhenOriginThrowsAsync(Exception ex)
        {
            TestInitialize();
            _origin.Releases().Returns(Task.FromException <IEnumerable <Release> >(ex));
            var storage = new SafeReleaseStorage(_origin);

            Func <Task> action = () => storage.Releases();

            action.Should().Throw <AppUpdateException>();
        }
示例#4
0
        private void Releases_ShouldThrow_AppUpdateException_WhenOriginThrows(Exception ex)
        {
            TestInitialize();
            _origin.When(x => x.Releases()).Throw(ex);
            var storage = new SafeReleaseStorage(_origin);

            Func <Task> action = () => storage.Releases();

            action.Should().Throw <AppUpdateException>();
        }