Skip to content

Commit 7d16e51

Browse files
committed
Test - Execute Command Async
1 parent e59a1be commit 7d16e51

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

QueryDB.Core.Tests/QueryDBTests.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using Microsoft.VisualStudio.TestTools.UnitTesting;
22
using System.Collections.Generic;
3+
using System.Threading.Tasks;
34

45
namespace QueryDB.Core.Tests
56
{
@@ -21,6 +22,18 @@ public void ExecuteCommand_UnknownDB_ReturnsNegativeOne()
2122
Assert.AreEqual(-1, result);
2223
}
2324

25+
[TestMethod]
26+
[TestCategory(DB_TESTS), TestCategory(UNKNOW_DB_TESTS)]
27+
public async Task ExecuteCommandAsync_UnknownDB_ReturnsNegativeOne()
28+
{
29+
string sqlStatement = "DELETE FROM users";
30+
31+
var dbContext = new DBContext((DB)999, "some_invalid_connection_string");
32+
var result = await dbContext.ExecuteCommandAsync(sqlStatement);
33+
34+
Assert.AreEqual(-1, result);
35+
}
36+
2437
[TestMethod]
2538
[TestCategory(DB_TESTS), TestCategory(UNKNOW_DB_TESTS)]
2639
public void ExecuteTransaction_UnknownDB_ReturnsFalse()

0 commit comments

Comments
 (0)