Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<PackageReference Include="Appveyor.TestLogger" Version="2.0.0" />
<PackageReference Include="Microsoft.DotNet.InternalAbstractions" Version="1.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="Moq" Version="4.7.99" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="NUnit" Version="4.4.0" />
<PackageReference Include="NUnit3TestAdapter" Version="5.1.0" />
<PackageReference Include="NunitXml.TestLogger" Version="6.1.0" />
Expand Down
2 changes: 1 addition & 1 deletion src/Cassandra.Tests/Cassandra.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<PackageReference Include="Appveyor.TestLogger" Version="2.0.0" />
<PackageReference Include="Microsoft.DotNet.InternalAbstractions" Version="1.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="Moq" Version="4.7.99" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="NUnit" Version="4.4.0" />
<PackageReference Include="NUnit3TestAdapter" Version="5.1.0" />
<PackageReference Include="NunitXml.TestLogger" Version="6.1.0" />
Expand Down
6 changes: 3 additions & 3 deletions src/Cassandra.Tests/Mapping/BatchTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ private IMapper GetMapper(Func<Task<RowSet>> getRowSetFunc, Action<BatchStatemen
sessionMock
.Setup(s => s.ExecuteAsync(It.IsAny<BatchStatement>()))
.Returns(getRowSetFunc)
.Callback(statementCallback)
.Callback<IStatement>(stmt => statementCallback((BatchStatement)stmt))
.Verifiable();
sessionMock
.Setup(s => s.ExecuteAsync(It.IsAny<BatchStatement>(), It.IsAny<string>()))
.Returns(getRowSetFunc)
.Callback<BatchStatement, string>((bs, profile) => statementCallback(bs))
.Callback<IStatement, string>((stmt, profile) => statementCallback((BatchStatement)stmt))
.Verifiable();
sessionMock
.Setup(s => s.PrepareAsync(It.IsAny<string>()))
Expand All @@ -77,7 +77,7 @@ private MapperAndSessionTuple GetMapperAndSession(Func<Task<RowSet>> getRowSetFu
sessionMock
.Setup(s => s.ExecuteAsync(It.IsAny<BatchStatement>()))
.Returns(getRowSetFunc)
.Callback(statementCallback)
.Callback<IStatement>(stmt => statementCallback((BatchStatement)stmt))
.Verifiable();
sessionMock
.Setup(s => s.ExecuteAsync(It.IsAny<IStatement>(), It.IsAny<string>()))
Expand Down
4 changes: 2 additions & 2 deletions src/Cassandra.Tests/Mapping/DeleteTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public void Insert_SetTimestamp_Test()
sessionMock
.Setup(s => s.ExecuteAsync(It.IsAny<BoundStatement>()))
.Returns(() => TestHelper.DelayedTask(RowSet.Empty()))
.Callback<BoundStatement>(stmt => statement = stmt)
.Callback<IStatement>(stmt => statement = (BoundStatement)stmt)
.Verifiable();
sessionMock
.Setup(s => s.PrepareAsync(It.IsAny<string>()))
Expand All @@ -106,7 +106,7 @@ public void Insert_SetTimestamp_Test()
sessionMock
.Setup(s => s.ExecuteAsync(It.IsAny<BoundStatement>(), It.IsAny<string>()))
.Returns(() => TestHelper.DelayedTask(RowSet.Empty()))
.Callback<BoundStatement, string>((stmt, profile) => statement = stmt)
.Callback<IStatement, string>((stmt, profile) => statement = (BoundStatement)stmt)
.Verifiable();
sessionMock
.Setup(s => s.PrepareAsync(It.IsAny<string>()))
Expand Down
13 changes: 7 additions & 6 deletions src/Cassandra.Tests/Mapping/InsertTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,11 @@ public void Insert_Without_Nulls()
sessionMock
.Setup(s => s.ExecuteAsync(It.IsAny<BoundStatement>(), It.IsAny<string>()))
.Returns(TaskHelper.ToTask(new RowSet()))
.Callback<BoundStatement, string>((stmt, profile) =>
.Callback<IStatement, string>((stmt, profile) =>
{
query = stmt.PreparedStatement.Cql;
parameters = stmt.QueryValues;
var boundStmt = (BoundStatement)stmt;
query = boundStmt.PreparedStatement.Cql;
parameters = boundStmt.QueryValues;
})
.Verifiable();
sessionMock
Expand Down Expand Up @@ -268,7 +269,7 @@ public void InsertIfNotExists_Poco_AppliedInfo_True_Test()
sessionMock
.Setup(s => s.ExecuteAsync(It.IsAny<BoundStatement>(), It.IsAny<string>()))
.Returns(TestHelper.DelayedTask(TestDataHelper.CreateMultipleValuesRowSet(new[] { "[applied]" }, new[] { true })))
.Callback<BoundStatement, string>((b, profile) => query = b.PreparedStatement.Cql)
.Callback<IStatement, string>((stmt, profile) => query = ((BoundStatement)stmt).PreparedStatement.Cql)
.Verifiable();
sessionMock
.Setup(s => s.PrepareAsync(It.IsAny<string>()))
Expand Down Expand Up @@ -299,7 +300,7 @@ public void InsertIfNotExists_Poco_AppliedInfo_False_Test()
sessionMock
.Setup(s => s.ExecuteAsync(It.IsAny<BoundStatement>(), It.IsAny<string>()))
.Returns(TestHelper.DelayedTask(TestDataHelper.CreateMultipleValuesRowSet(new[] { "[applied]", "userid", "name" }, new object[] { false, newUser.Id, "existing-name" })))
.Callback<BoundStatement, string>((b, profile) => query = b.PreparedStatement.Cql)
.Callback<IStatement, string>((stmt, profile) => query = ((BoundStatement)stmt).PreparedStatement.Cql)
.Verifiable();
sessionMock
.Setup(s => s.PrepareAsync(It.IsAny<string>()))
Expand Down Expand Up @@ -364,7 +365,7 @@ public void Insert_SetTimestamp_Test()
sessionMock
.Setup(s => s.ExecuteAsync(It.IsAny<BoundStatement>(), It.IsAny<string>()))
.Returns(TaskHelper.ToTask(new RowSet()))
.Callback<BoundStatement, string>((stmt, profile) => statement = stmt)
.Callback<IStatement, string>((stmt, profile) => statement = (BoundStatement)stmt)
.Verifiable();
sessionMock
.Setup(s => s.PrepareAsync(It.IsAny<string>()))
Expand Down
6 changes: 3 additions & 3 deletions src/Cassandra.Tests/Mapping/MappingTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ protected MapperAndSessionTuple GetMappingClientAndSession(Func<Task<RowSet>> ge
sessionMock
.Setup(s => s.ExecuteAsync(It.IsAny<BoundStatement>()))
.Returns(getRowSetFunc)
.Callback<BoundStatement>(s => queryCallback(s.PreparedStatement.Cql, s.QueryValues))
.Callback<IStatement>(stmt => { var s = (BoundStatement)stmt; queryCallback(s.PreparedStatement.Cql, s.QueryValues); })
.Verifiable();
sessionMock
.Setup(s => s.ExecuteAsync(It.IsAny<BoundStatement>(), It.IsAny<string>()))
.Returns(getRowSetFunc)
.Callback<BoundStatement, string>((s, profile) => queryCallback(s.PreparedStatement.Cql, s.QueryValues))
.Callback<IStatement, string>((stmt, profile) => { var s = (BoundStatement)stmt; queryCallback(s.PreparedStatement.Cql, s.QueryValues); })
.Verifiable();
sessionMock
.Setup(s => s.PrepareAsync(It.IsAny<string>()))
Expand Down Expand Up @@ -117,7 +117,7 @@ protected ISession GetSession<TStatement>(RowSet rs, Action<TStatement> callback
sessionMock
.Setup(s => s.ExecuteAsync(It.IsAny<IStatement>()))
.Returns(() => TaskHelper.ToTask(rs))
.Callback(callback)
.Callback<IStatement>(stmt => callback((TStatement)stmt))
.Verifiable();
sessionMock
.Setup(s => s.ExecuteAsync(It.IsAny<IStatement>(), It.IsAny<string>()))
Expand Down
10 changes: 6 additions & 4 deletions src/Cassandra.Tests/Mapping/UpdateTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,9 @@ public void UpdateIf_AppliedInfo_True_Test()
sessionMock
.Setup(s => s.ExecuteAsync(It.IsAny<BoundStatement>()))
.Returns(TestHelper.DelayedTask(TestDataHelper.CreateMultipleValuesRowSet(new[] { "[applied]" }, new[] { true })))
.Callback<BoundStatement>(b =>
.Callback<IStatement>(stmt =>
{
var b = (BoundStatement)stmt;
parameters = b.QueryValues;
query = b.PreparedStatement.Cql;
})
Expand Down Expand Up @@ -246,8 +247,9 @@ public void UpdateIf_AppliedInfo_False_Test()
sessionMock
.Setup(s => s.ExecuteAsync(It.IsAny<BoundStatement>()))
.Returns(TestHelper.DelayedTask(TestDataHelper.CreateMultipleValuesRowSet(new[] { "[applied]", "id", "artist" }, new object[] { false, id, "Jimmy Page" })))
.Callback<BoundStatement>(b =>
.Callback<IStatement>(stmt =>
{
var b = (BoundStatement)stmt;
parameters = b.QueryValues;
query = b.PreparedStatement.Cql;
})
Expand Down Expand Up @@ -278,12 +280,12 @@ public void Update_SetTimestamp_Test()
sessionMock
.Setup(s => s.ExecuteAsync(It.IsAny<BoundStatement>(), It.IsAny<string>()))
.Returns(() => TestHelper.DelayedTask(RowSet.Empty()))
.Callback<BoundStatement, string>((stmt, profile) => statement = stmt)
.Callback<IStatement, string>((stmt, profile) => statement = (BoundStatement)stmt)
.Verifiable();
sessionMock
.Setup(s => s.ExecuteAsync(It.IsAny<BoundStatement>()))
.Returns(() => TestHelper.DelayedTask(RowSet.Empty()))
.Callback<BoundStatement>(stmt => statement = stmt)
.Callback<IStatement>(stmt => statement = (BoundStatement)stmt)
.Verifiable();
sessionMock
.Setup(s => s.PrepareAsync(It.IsAny<string>()))
Expand Down