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); }
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); }