Skip to content

Commit 95f41f3

Browse files
author
Michael-Jorge Gómez Campos
committed
Added tests for sql-update and sql-delete (join)
1 parent 4d2286d commit 95f41f3

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/FluentNHibernate.Testing/DomainModel/Mapping/JoinPartTester.cs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,26 @@ public void JoinIsAlwaysLastInTheClassElement()
105105
public void JoinContainsAnSqlInsertElement()
106106
{
107107
new MappingTester<JoinTarget>()
108-
.ForMapping(m => m.Join("myTable", t => t.SqlInsert("INSERT INTO myTable VALUES(?)")))
108+
.ForMapping(m => m.Join("myTable", t => t.SqlInsert("INSERT INTO myTable VALUES(?)"))) // Now it's not important whether statement is correct or not.
109109
.Element("class/join/sql-insert").Exists();
110110
}
111111

112+
[Test]
113+
public void JoinContainsAnSqlUpdateElement()
114+
{
115+
new MappingTester<JoinTarget>()
116+
.ForMapping(m => m.Join("myTable", t => t.SqlUpdate("UPDATE myTable SET Name = ? WHERE Id = ?"))) // Now it's not important whether statement is correct or not.
117+
.Element("class/join/sql-update").Exists();
118+
}
119+
120+
[Test]
121+
public void JoinContainsAnSqlDeleteElement()
122+
{
123+
new MappingTester<JoinTarget>()
124+
.ForMapping(m => m.Join("myTable", t => t.SqlDelete("DELETE FROM myTable WHERE Id = ?"))) // Now it's not important whether statement is correct or not.
125+
.Element("class/join/sql-delete").Exists();
126+
}
127+
112128
private class JoinTarget
113129
{
114130
public string Name { get; set; }

0 commit comments

Comments
 (0)