public void EmptyStringForCloseQuote() { // Arrange var quoter = new OracleQuoter(); // Act // Assert quoter.CloseQuote.ShouldBe(string.Empty); }
public void CanQuoteBinaryValue() { // Arrange var quoter = new OracleQuoter(); // Act var value = quoter.QuoteValue(System.Text.Encoding.ASCII.GetBytes("Foo")); // Assert value.ShouldBe("hextoraw('466F6F')"); }
public void CanQuoteNull() { // Arrange var quoter = new OracleQuoter(); // Act var value = quoter.QuoteValue(null); // Assert value.ShouldBe("NULL"); }
public void CanQuoteGuid() { // Arrange var quoter = new OracleQuoter(); // Act var value = quoter.QuoteValue(new Guid("30e16f6e-d8e2-45b9-97aa-9ef500fa1e9b")); // Assert value.ShouldBe("hextoraw('30E16F6ED8E245B997AA9EF500FA1E9B')"); }
public void ShouldEscapeOracleObjectNames() { //Do Nothing at the moment due to case sensitivity issues with oracle OracleQuoter quoter = new OracleQuoter(); quoter.Quote("Table\"Name").ShouldBe("Table\"Name"); }
public OracleGenerator(OracleColumn column, OracleQuoter quoter ) : base(column, quoter) { }
private void QuoteInsertColumnNames(InsertDataExpression expression) { if ( ! expression.CaseSensitiveColumnNames) return; var quoter = new OracleQuoter {CaseSensitiveNames = expression.CaseSensitiveColumnNames}; foreach ( var row in expression.Rows ) { var toRemove = (from nameValue in row let quotedName = quoter.QuoteColumnName(nameValue.Key) where quotedName != nameValue.Key && (expression.CaseSensitiveColumns.Count == 0 || expression.CaseSensitiveColumns.Contains(nameValue.Key)) select nameValue).ToList(); foreach (var keyValuePair in toRemove) { row.Remove(keyValuePair); row.Add(new KeyValuePair<string, object>(quoter.QuoteColumnName(keyValuePair.Key), keyValuePair.Value)); } } }