-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SNOW-723810: Add coverage for SnowflakeDb classes (#786)
### Description Regarding issue 113 The PR adds tests for SnowflakeDb classes to increase code coverage ### Checklist - [x] Code compiles correctly - [x] Code is formatted according to [Coding Conventions](../CodingConventions.md) - [x] Created tests which fail without the change (if possible) - [x] All tests passing (`dotnet test`) - [x] Extended the README / documentation, if necessary - [x] Provide JIRA issue id (if possible) or GitHub issue id in PR name
- Loading branch information
1 parent
459b170
commit febed63
Showing
3 changed files
with
195 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved. | ||
*/ | ||
|
||
namespace Snowflake.Data.Tests.UnitTests | ||
{ | ||
using NUnit.Framework; | ||
using Snowflake.Data.Client; | ||
using System; | ||
|
||
[TestFixture] | ||
class SFDbCommandTest | ||
{ | ||
SnowflakeDbCommand command; | ||
|
||
[SetUp] | ||
public void BeforeTest() | ||
{ | ||
command = new SnowflakeDbCommand(); | ||
} | ||
|
||
[Test] | ||
public void TestCommandWithConnectionAndCommandText() | ||
{ | ||
// Arrange | ||
SnowflakeDbConnection conn = new SnowflakeDbConnection(); | ||
string commandText = "select 1"; | ||
|
||
// Act | ||
command = new SnowflakeDbCommand(conn, commandText); | ||
|
||
// Assert | ||
Assert.AreEqual(conn, command.Connection); | ||
Assert.AreEqual(commandText, command.CommandText); | ||
} | ||
|
||
[Test] | ||
public void TestCommandPrepareThrowsNotImplemented() | ||
{ | ||
Assert.Throws<NotImplementedException>(() => command.Prepare()); | ||
} | ||
} | ||
} |