示例#1
0
        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);
        }
示例#2
0
        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));
        }