예제 #1
0
        public void TestEmptyDictionaryOfHeaders()
        {
            Dictionary <String, String> headers = new Dictionary <string, string>();

            DictionaryHeaderProvider provider = new DictionaryHeaderProvider(headers);

            Assert.AreEqual(0, provider.GetHeaders().Length);
        }
예제 #2
0
        public void TestHeaderValuesCorrespondToDictionaryValuesSingle()
        {
            Dictionary <String, String> headers = new Dictionary <string, string>();

            headers.Add("a", "b");
            DictionaryHeaderProvider provider = new DictionaryHeaderProvider(headers);

            Assert.AreEqual("b", provider.GetHeaders()[0].Value);
        }
예제 #3
0
        public void TestHeaderValuesCorrespondToDictionaryKeysDouble()
        {
            Dictionary <String, String> headers = new Dictionary <string, string>();

            headers.Add("a", "b");
            headers.Add("c", "d");
            DictionaryHeaderProvider provider = new DictionaryHeaderProvider(headers);

            Assert.AreEqual("c", provider.GetHeaders()[1].Name);
        }
예제 #4
0
        public void TestHeaderValuesCorrespondToObjectValuesDouble()
        {
            DictionaryHeaderProvider provider = new DictionaryHeaderProvider(new { a = "b", c = "d" });

            Assert.AreEqual("d", provider.GetHeaders()[1].Value);
        }
예제 #5
0
        public void TestHeaderValuesCorrespondToObjectKeysSingle()
        {
            DictionaryHeaderProvider provider = new DictionaryHeaderProvider(new { a = "b" });

            Assert.AreEqual("a", provider.GetHeaders()[0].Name);
        }
예제 #6
0
 public void TestCatchesNullObject2()
 {
     DictionaryHeaderProvider provider = new DictionaryHeaderProvider((object)null);
 }
예제 #7
0
 public void TestCatchesNullObject()
 {
     DictionaryHeaderProvider provider = new DictionaryHeaderProvider((IDictionary <string, string>)null);
 }
예제 #8
0
 public TestReceiveContext(Uri sourceAddress)
     : base(sourceAddress, false, new ReceiveObservable(), null, null)
 {
     HeaderProvider = new DictionaryHeaderProvider(new Dictionary <string, object>());
 }
예제 #9
0
 public TestReceiveContext(ReceiveEndpointContext receiveEndpointContext)
     : base(false, receiveEndpointContext)
 {
     HeaderProvider = new DictionaryHeaderProvider(new Dictionary <string, object>());
 }