Esempio n. 1
0
        public void PropertiesTest()
        {
            WebHttpElement3 target = new WebHttpElement3();

            bool anyBool1 = AnyInstance.AnyBool;
            bool anyBool2 = !AnyInstance.AnyBool;
            bool anyBool3 = AnyInstance.AnyBool;
            WebMessageBodyStyle anyBodyStyle     = WebMessageBodyStyle.Bare;
            WebMessageFormat    anyMessageFormat = WebMessageFormat.Xml;

            target.AutomaticFormatSelectionEnabled = anyBool1;
            Assert.AreEqual(anyBool1, target.AutomaticFormatSelectionEnabled);

            target.DefaultBodyStyle = anyBodyStyle;
            Assert.AreEqual(anyBodyStyle, target.DefaultBodyStyle);

            target.DefaultOutgoingResponseFormat = anyMessageFormat;
            Assert.AreEqual(anyMessageFormat, target.DefaultOutgoingResponseFormat);

            target.FaultExceptionEnabled = anyBool2;
            Assert.AreEqual(anyBool2, target.FaultExceptionEnabled);

            target.HelpEnabled = anyBool3;
            Assert.AreEqual(anyBool3, target.HelpEnabled);
        }
Esempio n. 2
0
        public void DefaultsTest()
        {
            string configXml = CreateConfig(null, null, null, null, null);

            TestjQueryConfigurationSection configSection = TestjQueryConfigurationSection.GetWebHttpBehavior3Section(configXml);
            WebHttpElement3 element = configSection.WebHttpElement3;

            Assert.AreEqual(true, element.AutomaticFormatSelectionEnabled);
            Assert.AreEqual(typeof(WebHttpBehavior3), element.BehaviorType);
            Assert.AreEqual(WebMessageBodyStyle.Bare, element.DefaultBodyStyle);
            Assert.AreEqual(WebMessageFormat.Xml, element.DefaultOutgoingResponseFormat);
            Assert.AreEqual(false, element.FaultExceptionEnabled);
            Assert.AreEqual(true, element.HelpEnabled);
        }
Esempio n. 3
0
        public void ValuesTest()
        {
            bool anyBool1 = AnyInstance.AnyBool;
            bool anyBool2 = !AnyInstance.AnyBool;
            bool anyBool3 = AnyInstance.AnyBool;
            WebMessageBodyStyle anyBodyStyle     = WebMessageBodyStyle.Bare;
            WebMessageFormat    anyMessageFormat = WebMessageFormat.Xml;

            string configXml = CreateConfig(anyBool1, anyBodyStyle, anyMessageFormat, anyBool2, anyBool3);

            TestjQueryConfigurationSection configSection = TestjQueryConfigurationSection.GetWebHttpBehavior3Section(configXml);
            WebHttpElement3 element = configSection.WebHttpElement3;

            Assert.AreEqual(typeof(WebHttpBehavior3), element.BehaviorType);

            Assert.AreEqual(anyBool1, element.AutomaticFormatSelectionEnabled);
            Assert.AreEqual(anyBodyStyle, element.DefaultBodyStyle);
            Assert.AreEqual(anyMessageFormat, element.DefaultOutgoingResponseFormat);
            Assert.AreEqual(anyBool2, element.FaultExceptionEnabled);
            Assert.AreEqual(anyBool3, element.HelpEnabled);
        }