Пример #1
0
        public void Should_Retrieve_Request_From_Context()
        {
            // Arrange
            var sut = new HostHttpTenantTokenResolver(_mockHttpContextAccessor.Object);

            // Act
            var _ = sut.GetTenantToken().Result;

            // Assert
            _mockHttpContext.Verify(c => c.Request, Times.Once());
        }
Пример #2
0
        public void Should_Return_Host_Value()
        {
            // Arrange
            var host = new HostString("test.host");

            _mockHttpRequest.Setup(r => r.Host).Returns(host);
            var sut = new HostHttpTenantTokenResolver(_mockHttpContextAccessor.Object);

            // Act
            var result = sut.GetTenantToken().Result;

            // Assert
            result.Should().Be(host.Host);
        }
Пример #3
0
        public void Should_Retrieve_Host_From_Request()
        {
            // Arrange
            var host = new HostString("test.host");

            _mockHttpRequest.Setup(r => r.Host).Returns(host);
            var sut = new HostHttpTenantTokenResolver(_mockHttpContextAccessor.Object);

            // Act
            var _ = sut.GetTenantToken().Result;

            // Assert
            _mockHttpRequest.Verify(i => i.Host, Times.Once());
        }