예제 #1
0
        public void GivenConnectionIdNotInHeaders_WhenAskingForConnectionId_ThenItShouldReturnEmptyString()
        {
            // arrange
            const string      connectionId     = "connection-id";
            IHeaderDictionary headerDictionary = new HeaderDictionary(new Dictionary <string, StringValues>
            {
                { "X-DammitBobby", new StringValues(connectionId) }
            });

            // act
            string actual = new ConnectionId(headerDictionary);

            // assert
            actual.Should().Be(string.Empty);
        }
예제 #2
0
        public void GivenConnectionIdWithFunkyCasingInHeaders_WhenAskingForConnectionId_ThenItShouldReturnCorrectValue()
        {
            // arrange
            const string      connectionId     = "connection-id";
            IHeaderDictionary headerDictionary = new HeaderDictionary(new Dictionary <string, StringValues>
            {
                { "X-cOnnECtIONId", new StringValues(connectionId) }
            });

            // act
            string actual = new ConnectionId(headerDictionary);

            // assert
            actual.Should().Be(connectionId);
        }