public void GetHeader_returns_null_if_unknown_type(IBasicProperties properties, string headerName, Encoding encoding, object value) { var values = new Dictionary <string, object> { [headerName] = value }; Mock.Get(properties).SetupGet(p => p.Headers).Returns(values); var result = BasicPropertiesExtensions.GetHeader(properties, headerName, encoding); Assert.That(result, Is.Null); }
public void GetHeader_supports_strings(IBasicProperties properties, string headerName, Encoding encoding, string value) { var values = new Dictionary <string, object> { [headerName] = value }; Mock.Get(properties).SetupGet(p => p.Headers).Returns(values); var result = BasicPropertiesExtensions.GetHeader(properties, headerName, encoding); Assert.That(result, Is.EqualTo(value)); }