Exemplo n.º 1
0
        public void ConverToCommaSeperatedStringTest()
        {
            CommaSeperatedUtils target = new CommaSeperatedUtils();
            IEnumerable         list   = new List <string>();
            bool   autoQuote           = false;
            string fieldName           = string.Empty;
            string expected            = string.Empty;
            string actual;

            actual = target.ConverToCommaSeperatedString(list, autoQuote);
            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 2
0
        public void ConverToCommaSeperatedStringTest6()
        {
            CommaSeperatedUtils target = new CommaSeperatedUtils();
            List <int>          list   = new List <int>();

            list.Add(1000);
            list.Add(2000);
            bool   autoQuote = true;
            string expected  = "1000,2000";
            string actual;

            actual = target.ConverToCommaSeperatedString(list, autoQuote);
            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 3
0
        public void ConverToCommaSeperatedStringTest2()
        {
            CommaSeperatedUtils target = new CommaSeperatedUtils();
            List <string>       list   = new List <string>();

            list.Add("Item1");
            list.Add("Item2");
            bool   autoQuote = false;
            string fieldName = string.Empty;
            string expected  = "Item1,Item2";
            string actual;

            actual = target.ConverToCommaSeperatedString(list, autoQuote);
            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 4
0
        public void ConverToCommaSeperatedStringTest4()
        {
            CommaSeperatedUtils     target = new CommaSeperatedUtils();
            List <ComplexStructure> list   = new List <ComplexStructure>();

            list.Add(new ComplexStructure()
            {
                Field1 = "Item1"
            });
            list.Add(new ComplexStructure()
            {
                Field1 = "Item2"
            });
            bool   autoQuote = true;
            string fieldName = "Field1";
            string expected  = "'Item1','Item2'";
            string actual;

            actual = target.ConverToCommaSeperatedString(list, autoQuote, fieldName);
            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 5
0
        public void ConverToCommaSeperatedStringTest5()
        {
            CommaSeperatedUtils     target = new CommaSeperatedUtils();
            List <ComplexStructure> list   = new List <ComplexStructure>();
            Guid g1 = Guid.NewGuid();
            Guid g2 = Guid.NewGuid();

            list.Add(new ComplexStructure()
            {
                Field1 = "Item1", Field2 = g1
            });
            list.Add(new ComplexStructure()
            {
                Field1 = "Item2", Field2 = g2
            });
            bool   autoQuote = true;
            string fieldName = "Field2";
            string expected  = "'" + g1.ToString() + "','" + g2.ToString() + "'";
            string actual;

            actual = target.ConverToCommaSeperatedString(list, autoQuote, fieldName);
            Assert.AreEqual(expected, actual);
        }