public void GetFinalOutputFreeTextWithLineBreak() { var replacer = new Replacer(DefaultDictionary, "SELECT {freeTextWithLineBreak}"); Assert.AreEqual( $"SELECT '{FreeTextWithLineBreakPreparedForInsert}'", replacer.GetFinalOutput()); }
public void GetFinalOutputDbNull() { var replacer = new Replacer(DefaultDictionary, "SELECT {DBNull}, {DBNull:DATETIME}, {DBNull:RELATIVEDATETIME}, {DBNull:RELATIVEDATETIMEUTC}"); Assert.AreEqual( $"SELECT NULL, NULL, NULL, NULL", replacer.GetFinalOutput()); }
public void GetFinalOutputDateMatchesRelativeDateTimeUtcWithFractialMilliseconds() { var replacer = new Replacer(DefaultDictionary, "SELECT {dateWithFractionalMilliseconds:RELATIVEDATETIMEUTC}"); Assert.AreEqual( $"SELECT DATEADD(MILLISECOND, 51182089, DATEADD(DAY, DATEDIFF(DAY, {this.DiffToTestTimeInDays}, GETUTCDATE()), 0))", replacer.GetFinalOutput()); }
public void GetFinalOutputDateMatches() { var replacer = new Replacer(DefaultDictionary, "haha: {date}"); Assert.AreEqual("haha: '01.11.2017 14:13:02'", replacer.GetFinalOutput()); }
public void GetFinalOutputMultipleMatches() { var replacer = new Replacer(DefaultDictionary, "INSERT INTO Wikifolio () VALUES ({gaxi}, {gaxi})"); Assert.AreEqual("INSERT INTO Wikifolio () VALUES (NULL, NULL)", replacer.GetFinalOutput()); }
public void GetFinalOutputOneMatch() { var replacer = new Replacer(DefaultDictionary, "FreeText: {freeText}"); Assert.AreEqual($"FreeText: '{FreeTextPreparedForInsert}'", replacer.GetFinalOutput()); }
public void GetFinalOutputDateMatchesDateTime() { var replacer = new Replacer(DefaultDictionary, "SELECT {date:DATETIME}"); Assert.AreEqual("SELECT '20171101 14:13:02.089'", replacer.GetFinalOutput()); }