Ejemplo n.º 1
0
        public void BuildValues(object[] values)
        {
            BuildersSupport b = new BuildersSupport();

            b.RealNumbersConverter(values);
            InsertQuery.Values = values;
        }
Ejemplo n.º 2
0
        private string BuildValues()
        {
            BuildersSupport b   = new BuildersSupport();
            var             res = $"({b.ArrayToStringWithComma(Values)})";

            return(res);
        }
        public void ArrayToStringWithComma_Str_SomeElements()
        {
            //Arrange
            string[] array    = { "a3", "o.o", "temp", "", "!" };
            string   expected = "\'a3\', \'o.o\', \'temp\', \'\', \'!\'";

            //Act
            string result = new BuildersSupport().ArrayToStringWithComma(array);

            //Assert
            Assert.AreEqual(expected, result);
        }
        public void ArrayToStringWithComma_Str_NoElements()
        {
            //Arrange
            string[] array    = new string[0];
            string   expected = "";

            //Act
            string result = new BuildersSupport().ArrayToStringWithComma(array);

            //Assert
            Assert.AreEqual(expected, result);
        }
        public void ArrayToStringWithComma_Str_OneElement()
        {
            //Arrange
            string[] array    = { "str1" };
            string   expected = "\'str1\'";

            //Act
            string result = new BuildersSupport().ArrayToStringWithComma(array);

            //Assert
            Assert.AreEqual(expected, result);
        }
        public void ArrayToStringWithComma_Obj_OneElement()
        {
            //Arrange
            object[] array    = { 45 };
            string   expected = "\'45\'";

            //Act
            string result = new BuildersSupport().ArrayToStringWithComma(array);

            //Assert
            Assert.AreEqual(expected, result);
        }
        public void ArrayToStringWithComma_Obj_SomeElements()
        {
            //Arrange
            object[] array    = { 5, 't', "str", -6 };
            string   expected = "\'5\', \'t\', \'str\', \'-6\'";

            //Act
            string result = new BuildersSupport().ArrayToStringWithComma(array);

            //Assert
            Assert.AreEqual(expected, result);
        }
        public void RealNumbersConverter_OneItem_String()
        {
            //Arrange
            object array    = "!qwe";
            object expected = "!qwe";

            //Act
            object res = new BuildersSupport().RealNumbersConverter(array);

            //Assert
            Assert.AreEqual(expected, res);
        }
        public void RealNumbersConverter()
        {
            //Arrange
            object[] array    = { 4.5f, "abc", 5, -2.8f };
            object[] expected = { "4.5", "abc", 5, "-2.8" };

            //Act
            object[] res = new BuildersSupport().RealNumbersConverter(array);

            //Assert
            CollectionAssert.AreEqual(expected, res);
        }
Ejemplo n.º 10
0
        public void BuildComparison_Others(Dictionaries.ComparisonOperators co)
        {
            //Arrange
            object[] array    = { "qwerty" };
            string   expected = "\'qwerty\'";

            //Act
            string result = new BuildersSupport().BuildComparison(co, array);

            //Assert
            Assert.AreEqual(expected, result);
        }
Ejemplo n.º 11
0
        public void BuildComparison_In_All(Dictionaries.ComparisonOperators co)
        {
            //Arrange
            object[] array    = { "qwerty", 45, '?' };
            string   expected = "(\'qwerty\', \'45\', \'?\')";

            //Act
            string result = new BuildersSupport().BuildComparison(co, array);

            //Assert
            Assert.AreEqual(expected, result);
        }
Ejemplo n.º 12
0
        public void ArrayToStringWithComma_Str_TableName()
        {
            //Arrange
            string[] array    = { "c1", "c2" };
            string   tn       = "table";
            string   expected = "[table].[c1], [table].[c2]";

            //Act
            string result = new BuildersSupport().ArrayToStringWithComma(tn, array);

            //Assert
            Assert.AreEqual(expected, result);
        }