Пример #1
0
        public void No_value_provided()
        {
            var kvp = ToDictionaryExtension.Split_assignment("a");

            Assert.AreEqual("a", kvp.Key);
            Assert.AreEqual("", kvp.Value);
        }
Пример #2
0
        public void Equal_sign_in_value()
        {
            var kvp = ToDictionaryExtension.Split_assignment("a==");

            Assert.AreEqual("=", kvp.Value);
        }
Пример #3
0
        public void Whitespace_in_value()
        {
            var kvp = ToDictionaryExtension.Split_assignment("a= 1 ");

            Assert.AreEqual(" 1 ", kvp.Value);
        }
Пример #4
0
        public void Whitespace_in_name()
        {
            var kvp = ToDictionaryExtension.Split_assignment(" a =1");

            Assert.AreEqual("a", kvp.Key);
        }
Пример #5
0
        public void Multi_char_value()
        {
            var kvp = ToDictionaryExtension.Split_assignment("a=1234");

            Assert.AreEqual("1234", kvp.Value);
        }
Пример #6
0
        public void Multi_char_name()
        {
            var kvp = ToDictionaryExtension.Split_assignment("abc=1");

            Assert.AreEqual("abc", kvp.Key);
        }
Пример #7
0
 public void No_name_given()
 {
     Assert.Throws <ArgumentException>(() => ToDictionaryExtension.Split_assignment("=1"));
 }