-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ksqlDb.RestApi.Client]: added cloning of QueryStreamParameters tests #…
- Loading branch information
1 parent
0052e16
commit cf2fa3f
Showing
2 changed files
with
81 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
49 changes: 49 additions & 0 deletions
49
Tests/ksqlDB.RestApi.Client.Tests/KSql/Query/KStreamSetDependenciesTests.cs
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,49 @@ | ||
using FluentAssertions; | ||
using ksqlDB.RestApi.Client.KSql.Query; | ||
using ksqlDB.RestApi.Client.KSql.Query.Options; | ||
using ksqlDB.RestApi.Client.KSql.RestApi.Parameters; | ||
using NUnit.Framework; | ||
|
||
namespace ksqlDb.RestApi.Client.Tests.KSql.Query | ||
{ | ||
public class KStreamSetDependenciesTests | ||
{ | ||
[Test] | ||
public void QueryStreamParameters_CloneIsReturned() | ||
{ | ||
//Arrange | ||
var queryStreamParameters = new QueryStreamParameters | ||
{ | ||
[QueryStreamParameters.AutoOffsetResetPropertyName] = AutoOffsetReset.Latest.ToKSqlValue() | ||
}; | ||
var kStreamSetDependencies = new KStreamSetDependencies(null!, null!, null!, queryStreamParameters); | ||
|
||
//Act | ||
var queryStreamParameters1 = kStreamSetDependencies.QueryStreamParameters; | ||
var queryStreamParameters2 = kStreamSetDependencies.QueryStreamParameters; | ||
|
||
//Assert | ||
queryStreamParameters1.Should().BeEquivalentTo(queryStreamParameters2); | ||
} | ||
|
||
[Test] | ||
public void QueryStreamParameters_CloneIsReturned_SqlIsChanged() | ||
{ | ||
//Arrange | ||
var queryStreamParameters = new QueryStreamParameters | ||
{ | ||
[QueryStreamParameters.AutoOffsetResetPropertyName] = AutoOffsetReset.Latest.ToKSqlValue() | ||
}; | ||
var kStreamSetDependencies = new KStreamSetDependencies(null!, null!, null!, queryStreamParameters); | ||
|
||
//Act | ||
var queryStreamParameters1 = kStreamSetDependencies.QueryStreamParameters; | ||
queryStreamParameters1.Sql = "sql1"; | ||
var queryStreamParameters2 = kStreamSetDependencies.QueryStreamParameters; | ||
queryStreamParameters1.Sql = "sql2"; | ||
|
||
//Assert | ||
queryStreamParameters1.Should().NotBeEquivalentTo(queryStreamParameters2); | ||
} | ||
} | ||
} |