public void CanCreateSimpleImplicitUpdateStatement() { var saveExpression = new SaveExpression(new Patient() { Id = "#12:1", Name = "Foo", Age = 3 }); var queryText = Translate(saveExpression); // properties will appear in alphabetical order! Assert.IsTrue(queryText.Equals("UPDATE #12:1 SET Age=3, Name='Foo' RETURN AFTER", StringComparison.InvariantCultureIgnoreCase), queryText); }
public void CanCreateSimpleImplicitCreateStatement() { var saveExpression = new SaveExpression(new Patient() { Name = "Foo", Age = 3 }); var queryText = Translate(saveExpression); // properties will appear in alphabetical order! Assert.IsTrue(queryText.Equals("INSERT INTO Patient (Age, Name) VALUES(3, 'Foo') RETURN @this", StringComparison.InvariantCultureIgnoreCase), queryText); }
public void CanCreateSimpleExplicitCreateStatement() { var saveExpression = new SaveExpression(new Patient() { Name = "Foo", Age = 3 }); _mappingRegistrar.Add(new Mapping()); // species all upper case NAME var queryText = Translate(saveExpression); // properties will appear in alphabetical order! Assert.IsTrue(string.Compare(queryText, "INSERT INTO Patient (Age, NAME) VALUES(3, 'Foo') RETURN @this") == 0, queryText); }
public void CanCreateSimpleExplicitUpdateStatement() { var saveExpression = new SaveExpression(new Patient() { Id = "#12:1", Name = "Foo", Age = 3 }); _mappingRegistrar.Add(_mapping); // species all upper case NAME var queryText = Translate(saveExpression); // properties will appear in alphabetical order! Assert.IsTrue(string.Compare(queryText,"UPDATE #12:1 SET Age=3, NAME='Foo' RETURN AFTER") == 0, queryText); }