Exemple #1
0
        public void RemoveValueForUnknownValueDoesNotThrow()
        {
            var dictionary = new Xunit.Sdk.MultiValueDictionary <string, string>();

            dictionary.AddValue("Key", "Value1");

            Assert.DoesNotThrow(() => dictionary.RemoveValue("Key", "Value2"));
        }
Exemple #2
0
        public void RemovingLastValueFromKeyRemovesKey()
        {
            var dictionary = new Xunit.Sdk.MultiValueDictionary <string, string>();

            dictionary.AddValue("Key", "Value1");

            dictionary.RemoveValue("Key", "Value1");

            Assert.DoesNotContain("Key", dictionary.Keys);
        }
Exemple #3
0
        public void RemoveValue()
        {
            var dictionary = new Xunit.Sdk.MultiValueDictionary <string, string>();

            dictionary.AddValue("Key", "Value1");
            dictionary.AddValue("Key", "Value2");

            dictionary.RemoveValue("Key", "Value1");

            Assert.Contains("Key", dictionary.Keys);
            IEnumerable <string> values = dictionary["Key"];

            Assert.DoesNotContain("Value1", values);
            Assert.Contains("Value2", values);
        }
        public void RemoveValueForUnknownKeyDoesNotThrow()
        {
            var dictionary = new Xunit.Sdk.MultiValueDictionary<string, string>();

            Assert.DoesNotThrow(() => dictionary.RemoveValue("Key", "Value1"));
        }
        public void RemoveValue()
        {
            var dictionary = new Xunit.Sdk.MultiValueDictionary<string, string>();
            dictionary.AddValue("Key", "Value1");
            dictionary.AddValue("Key", "Value2");

            dictionary.RemoveValue("Key", "Value1");

            Assert.Contains("Key", dictionary.Keys);
            IEnumerable<string> values = dictionary["Key"];
            Assert.DoesNotContain("Value1", values);
            Assert.Contains("Value2", values);
        }
        public void RemovingLastValueFromKeyRemovesKey()
        {
            var dictionary = new Xunit.Sdk.MultiValueDictionary<string, string>();
            dictionary.AddValue("Key", "Value1");

            dictionary.RemoveValue("Key", "Value1");

            Assert.DoesNotContain("Key", dictionary.Keys);
        }