Example #1
0
        public void prop_CollectionType_get()
        {
            const ConfigurationElementCollectionType expected = ConfigurationElementCollectionType.AddRemoveClearMap;
            var actual = new RedirectionConfigurationElementCollection <AbsoluteUri>().CollectionType;

            Assert.Equal(expected, actual);
        }
Example #2
0
        public void op_Remove_NameValueConfigurationElement_whenEmpty()
        {
            var element = new RedirectionConfigurationElement <AbsoluteUri>("http://example.com/", "http://example.net/");
            var obj     = new RedirectionConfigurationElementCollection <AbsoluteUri>();

            Assert.False(obj.Remove(element));
        }
Example #3
0
        public void op_Contains_NameValueConfigurationElement()
        {
            var element = new RedirectionConfigurationElement <AbsoluteUri>("http://example.com/", "http://example.net/");
            var obj     = new RedirectionConfigurationElementCollection <AbsoluteUri>
            {
                element
            };

            Assert.True(obj.Contains(element));
        }
Example #4
0
        public void op_Add_string_T()
        {
            var obj = new RedirectionConfigurationElementCollection <AbsoluteUri>
            {
                {
                    "http://example.com/", "http://example.net/"
                }
            };

            Assert.Equal((AbsoluteUri)"http://example.com/", obj.First().From);
        }
Example #5
0
        public void op_Remove_NameValueConfigurationElement()
        {
            var element = new RedirectionConfigurationElement <AbsoluteUri>("http://example.com/", "http://example.net/");
            var obj     = new RedirectionConfigurationElementCollection <AbsoluteUri>
            {
                new RedirectionConfigurationElement <AbsoluteUri>("http://example.org/", "http://example.co.uk/"),
                element
            };

            Assert.True(obj.Remove(element));
            Assert.False(obj.Contains(element));
        }
Example #6
0
        public void op_Clear()
        {
            var obj = new RedirectionConfigurationElementCollection <AbsoluteUri>
            {
                {
                    "http://example.com/", "http://example.net/"
                }
            };

            Assert.NotEmpty(obj);
            obj.Clear();
            Assert.Empty(obj);
        }
Example #7
0
        public void op_CopyTo_NameValueConfigurationElement_int()
        {
            var expected = new RedirectionConfigurationElement <AbsoluteUri>("http://example.com/", "http://example.net/");
            var obj      = new RedirectionConfigurationElementCollection <AbsoluteUri>
            {
                expected,
                new RedirectionConfigurationElement <AbsoluteUri>("http://example.org/", "http://example.co.uk/")
            };

            var array = new RedirectionConfigurationElement <AbsoluteUri> [obj.Count];

            obj.CopyTo(array, 0);

            var actual = array.First();

            Assert.Equal(expected, actual);
        }