Ejemplo n.º 1
0
        public async Task StoreStartupFailuresShouldPropagateBack()
        {
            // Arrange
            var fixture = new OneLevelCacheFixture();
            var sut     = fixture
                          .WithContentStoreStartupResult(new BoolResult("error 1"))
                          .WithMemoizationStoreStartupResult(new BoolResult("error 2"))
                          .CreateSut();

            // Act
            var startupResult = await sut.StartupAsync(fixture.Context);

            // Assert
            startupResult.ShouldBeError();
            // Both errors must be presented in the output.
            startupResult.ToString().Should().Contain("error 1");
            startupResult.ToString().Should().Contain("error 2");
        }
Ejemplo n.º 2
0
        public async Task StoreShutdownFailuresShouldPropagateBackWhenStartupFailed()
        {
            // Arrange
            var fixture = new OneLevelCacheFixture();
            var sut     = fixture
                          // When startup fails for the store, the shutdown operation is not called.
                          // Setting up the scenario when the store 1 fails to startup but the store 2 fails to shutdown
                          .WithContentStoreStartupResult(new BoolResult("content store startup error 1"))
                          .WithMemoizationStoreShutdownResult(new BoolResult("memoization store shutdown error 2"))
                          .CreateSut();

            // Act
            var startupResult = await sut.StartupAsync(fixture.Context);

            startupResult.ShouldBeError();

            // Assert
            // Both errors must be presented in the output.
            startupResult.ToString().Should().Contain("content store startup error 1");
            startupResult.ToString().Should().Contain("memoization store shutdown error 2");
        }