Skip to content

Commit

Permalink
#1011 - Added the Integration Tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikependon committed Dec 14, 2021
1 parent 9b81f0e commit 6024525
Showing 1 changed file with 45 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,51 @@ public void TestSqlConnectionDeleteForInheritedViaPrimary()

#endregion

#region DeleteAll

[TestMethod]
public void TestSqlConnectionDeleteAllForInheritedViaDataEntity()
{
// Setup
var entities = Helper.CreateInheritedIdentityTables(10);

using (var connection = new SqlConnection(Database.ConnectionStringForRepoDb))
{
// Act
connection.InsertAll<InheritedIdentityTable>(entities);

// Act
var deleteResult = connection.DeleteAll<InheritedIdentityTable>(entities);

// Assert
Assert.AreEqual(entities.Count(), deleteResult);
Assert.AreEqual(0, connection.CountAll<InheritedIdentityTable>());
}
}

[TestMethod]
public void TestSqlConnectionDeleteAllForInheritedViaPrimary()
{
// Setup
var entities = Helper.CreateInheritedIdentityTables(10);

using (var connection = new SqlConnection(Database.ConnectionStringForRepoDb))
{
// Act
connection.InsertAll<InheritedIdentityTable>(entities);

// Act
var deleteResult = connection.DeleteAll<InheritedIdentityTable>(
ClassExpression.GetEntitiesPropertyValues<InheritedIdentityTable, object>(entities, "Id"));

// Assert
Assert.AreEqual(entities.Count(), deleteResult);
Assert.AreEqual(0, connection.CountAll<InheritedIdentityTable>());
}
}

#endregion

#region Insert

[TestMethod]
Expand Down

0 comments on commit 6024525

Please sign in to comment.