Esempio n. 1
0
 public void SqlNameSafe()
 {
     Assert.IsTrue(string.IsNullOrEmpty(StringUtilsSQL.SqlNameSafe(null)));
     Assert.IsTrue(string.IsNullOrEmpty(StringUtilsSQL.SqlNameSafe(string.Empty)));
     Assert.AreEqual("[Raphael.Noeldner]", StringUtilsSQL.SqlNameSafe("Raphael.Noeldner"));
     Assert.AreEqual("[Table]", StringUtilsSQL.SqlNameSafe("Table"));
 }
Esempio n. 2
0
        public void SQLNameOK()
        {
            Assert.AreEqual("A", StringUtilsSQL.SqlName("A"));
            var ret = StringUtilsSQL.SqlName("TryInjection]");

            Assert.IsTrue(ret == "TryInjection\\]" || ret == "TryInjection]]");
        }
Esempio n. 3
0
 public void SqlNameNeedsQuotingTest()
 {
     Assert.IsFalse(StringUtilsSQL.SqlNameNeedsQuoting(null));
     Assert.IsFalse(StringUtilsSQL.SqlNameNeedsQuoting(""));
     Assert.IsTrue(StringUtilsSQL.SqlNameNeedsQuoting("Test Value"));
     Assert.IsTrue(StringUtilsSQL.SqlNameNeedsQuoting("Test.Value"));
     Assert.IsTrue(StringUtilsSQL.SqlNameNeedsQuoting("1Test"));
 }
Esempio n. 4
0
 public void SqlIsKeyword()
 {
     Assert.AreEqual(false, StringUtilsSQL.SqlIsKeyword(null));
     Assert.AreEqual(false, StringUtilsSQL.SqlIsKeyword(string.Empty));
     Assert.AreEqual(false, StringUtilsSQL.SqlIsKeyword("Raphael"));
     Assert.AreEqual(true, StringUtilsSQL.SqlIsKeyword("TABLE"));
     Assert.AreEqual(true, StringUtilsSQL.SqlIsKeyword("Table"));
 }
Esempio n. 5
0
 public void SqlNameNeedsQuoting()
 {
     Assert.AreEqual(false, StringUtilsSQL.SqlNameNeedsQuoting(null));
     Assert.AreEqual(false, StringUtilsSQL.SqlNameNeedsQuoting(string.Empty));
     Assert.AreEqual(false, StringUtilsSQL.SqlNameNeedsQuoting("Raphael"));
     Assert.AreEqual(true, StringUtilsSQL.SqlNameNeedsQuoting("Raphael.Noeldner"));
     Assert.AreEqual(true, StringUtilsSQL.SqlNameNeedsQuoting("Raphael Nöldner"));
     Assert.AreEqual(false, StringUtilsSQL.SqlNameNeedsQuoting("RaphaelNoeldner"));
     Assert.AreEqual(false, StringUtilsSQL.SqlNameNeedsQuoting("RaphaelNöldner"));
     Assert.AreEqual(true, StringUtilsSQL.SqlNameNeedsQuoting("TABLE"));
 }
Esempio n. 6
0
 public void SQLQuoteOK()
 {
     Assert.AreEqual("A", StringUtilsSQL.SqlQuote("A"));
     Assert.AreEqual("TryInjection]", StringUtilsSQL.SqlQuote("TryInjection]"));
     Assert.AreEqual("Try''Injection", StringUtilsSQL.SqlQuote("Try'Injection"));
 }
Esempio n. 7
0
 public void SQLQuoteNull()
 {
     Assert.AreEqual(string.Empty, StringUtilsSQL.SqlQuote(null));
     Assert.AreEqual(string.Empty, StringUtilsSQL.SqlQuote(string.Empty));
 }