diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 4eb25a4dd..1b84dc15d 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -64,5 +64,11 @@ jobs:
exit 1
fi
+ - name: Run dotnet format (checks formatting)
+ run: |
+ dotnet format --verify-no-changes --severity warn --verbosity diagnostic src/Cassandra.IntegrationTests/Cassandra.IntegrationTests.csproj
+ dotnet format --verify-no-changes --severity warn --verbosity diagnostic src/Cassandra/Cassandra.csproj
+ dotnet format --verify-no-changes --severity warn --verbosity diagnostic src/Cassandra.Tests/Cassandra.Tests.csproj
+
- name: Run integration tests on Scylla
run: SCYLLA_EXT_OPTS="--smp 2 --memory 4G" SIMULACRON_PATH=../../../../../ci/simulacron-standalone-0.12.0.jar dotnet test src/Cassandra.IntegrationTests/Cassandra.IntegrationTests.csproj -f net8 -l "console;verbosity=detailed" --filter "(FullyQualifiedName!~ClientWarningsTests & FullyQualifiedName!~CustomPayloadTests & FullyQualifiedName!~Connect_With_Ssl_Test & FullyQualifiedName!~Should_UpdateHosts_When_HostIpChanges & FullyQualifiedName!~Should_UseNewHostInQueryPlans_When_HostIsDecommissionedAndJoinsAgain & FullyQualifiedName!~Should_RemoveNodeMetricsAndDisposeMetricsContext_When_HostIsRemoved & FullyQualifiedName!~Virtual_Keyspaces_Are_Included & FullyQualifiedName!~Virtual_Table_Metadata_Test & FullyQualifiedName!~SessionAuthenticationTests & FullyQualifiedName!~TypeSerializersTests & FullyQualifiedName!~Custom_MetadataTest & FullyQualifiedName!~LinqWhere_WithVectors & FullyQualifiedName!~SimpleStatement_With_No_Compact_Enabled_Should_Reveal_Non_Schema_Columns & FullyQualifiedName!~SimpleStatement_With_No_Compact_Disabled_Should_Not_Reveal_Non_Schema_Columns & FullyQualifiedName!~ColumnClusteringOrderReversedTest & FullyQualifiedName!~GetMaterializedView_Should_Refresh_View_Metadata_Via_Events & FullyQualifiedName!~MaterializedView_Base_Table_Column_Addition & FullyQualifiedName!~MultipleSecondaryIndexTest & FullyQualifiedName!~RaiseErrorOnInvalidMultipleSecondaryIndexTest & FullyQualifiedName!~TableMetadataAllTypesTest & FullyQualifiedName!~TableMetadataClusteringOrderTest & FullyQualifiedName!~TableMetadataCollectionsSecondaryIndexTest & FullyQualifiedName!~TableMetadataCompositePartitionKeyTest & FullyQualifiedName!~TupleMetadataTest & FullyQualifiedName!~Udt_Case_Sensitive_Metadata_Test & FullyQualifiedName!~UdtMetadataTest & FullyQualifiedName!~Should_Retrieve_Table_Metadata & FullyQualifiedName!~CreateTable_With_Frozen_Key & FullyQualifiedName!~CreateTable_With_Frozen_Udt & FullyQualifiedName!~CreateTable_With_Frozen_Value & FullyQualifiedName!~Should_AllMetricsHaveValidValues_When_AllNodesAreUp & FullyQualifiedName!~SimpleStatement_Dictionary_Parameters_CaseInsensitivity_ExcessOfParams & FullyQualifiedName!~SimpleStatement_Dictionary_Parameters_CaseInsensitivity_NoOverload & FullyQualifiedName!~TokenAware_TransientReplication_NoHopsAndOnlyFullReplicas & FullyQualifiedName!~GetFunction_Should_Return_Most_Up_To_Date_Metadata_Via_Events & FullyQualifiedName!~LargeDataTests & FullyQualifiedName!~MetadataTests & FullyQualifiedName!~MultiThreadingTests & FullyQualifiedName!~PoolTests & FullyQualifiedName!~PrepareLongTests & FullyQualifiedName!~SpeculativeExecutionLongTests & FullyQualifiedName!~StressTests & FullyQualifiedName!~TransitionalAuthenticationTests & FullyQualifiedName!~ProxyAuthenticationTests & FullyQualifiedName!~SessionDseAuthenticationTests & FullyQualifiedName!~CloudIntegrationTests & FullyQualifiedName!~CoreGraphTests & FullyQualifiedName!~GraphTests & FullyQualifiedName!~InsightsIntegrationTests & FullyQualifiedName!~DateRangeTests & FullyQualifiedName!~FoundBugTests & FullyQualifiedName!~GeometryTests & FullyQualifiedName!~LoadBalancingPolicyTests & FullyQualifiedName!~ConsistencyTests & FullyQualifiedName!~LoadBalancingPolicyTests & FullyQualifiedName!~ReconnectionPolicyTests & FullyQualifiedName!~RetryPolicyTests)"
diff --git a/src/Cassandra.IntegrationTests/Ado/AdoBasicTests.cs b/src/Cassandra.IntegrationTests/Ado/AdoBasicTests.cs
index f38cfcc47..2ea48fad2 100644
--- a/src/Cassandra.IntegrationTests/Ado/AdoBasicTests.cs
+++ b/src/Cassandra.IntegrationTests/Ado/AdoBasicTests.cs
@@ -33,7 +33,7 @@ public override void SetUp()
base.SetUp();
var cb = new CassandraConnectionStringBuilder
{
- ContactPoints = new[] { TestCluster.InitialContactPoint.Address.ToString() },
+ ContactPoints = new[] { TestCluster.InitialContactPoint.Address.ToString() },
Port = 9042
};
_connection = new CqlConnection(cb.ToString());
@@ -80,7 +80,7 @@ public void ExecuteNonQueryInsertAndSelectTest()
int RowsNo = 300;
for (int i = 0; i < RowsNo; i++)
{
- longQ.AppendFormat("INSERT INTO {0} (tweet_id, author, isok, body) VALUES ({1},'test{2}',{3},'body{2}');", tableName, guids[i], i, i%2 == 0 ? "false" : "true");
+ longQ.AppendFormat("INSERT INTO {0} (tweet_id, author, isok, body) VALUES ({1},'test{2}',{3},'body{2}');", tableName, guids[i], i, i % 2 == 0 ? "false" : "true");
}
longQ.AppendLine("APPLY BATCH;");
cmd.CommandText = longQ.ToString();
@@ -94,7 +94,7 @@ public void ExecuteNonQueryInsertAndSelectTest()
TestCluster.PrimeFluent(
b => b.WhenQuery($"SELECT * from {tableName} LIMIT 10000;")
.ThenRowsSuccess(
- new[] {"tweet_id", "author", "body", "isok"},
+ new[] { "tweet_id", "author", "body", "isok" },
r => r.WithRows(guids.Select((guid, idx) => new object[] { guid, $"test{idx}", $"body{idx}", idx % 2 != 0 }).ToArray())));
cmd.CommandText = string.Format(@"SELECT * from {0} LIMIT 10000;", tableName);
@@ -118,7 +118,7 @@ public void ExecuteScalarReturnsFirstColumn()
TestCluster.PrimeFluent(
b => b.WhenQuery("SELECT key FROM system.local")
- .ThenRowsSuccess(new [] { "key" }, r => r.WithRow("local")));
+ .ThenRowsSuccess(new[] { "key" }, r => r.WithRow("local")));
TestCluster.PrimeFluent(
b => b.WhenQuery("SELECT * FROM system.local WHERE key = 'does not exist'")
diff --git a/src/Cassandra.IntegrationTests/BaseIntegrationTest.cs b/src/Cassandra.IntegrationTests/BaseIntegrationTest.cs
index d67f16b02..866c83f6b 100644
--- a/src/Cassandra.IntegrationTests/BaseIntegrationTest.cs
+++ b/src/Cassandra.IntegrationTests/BaseIntegrationTest.cs
@@ -42,7 +42,7 @@ protected BaseIntegrationTest()
"schema.propertyKey('title').Text().ifNotExists().create();\n" +
"schema.propertyKey('tags').Text().multiple().ifNotExists().create();\n" +
"schema.vertexLabel('movie').properties('title', 'tags').ifNotExists().create();\n";
-
+
protected const string CoreSchemaGremlinQuery =
"schema.vertexLabel('person')" +
".partitionBy('name', Text)" +
@@ -66,7 +66,7 @@ protected BaseIntegrationTest()
".create();\n" +
"schema.type('address')" +
".property('address1', Text)" +
- ".property('address2', Text)" +
+ ".property('address2', Text)" +
".property('city_code', Text)" +
".property('state_code', Text)" +
".property('zip_code', Text)" +
@@ -86,12 +86,12 @@ protected BaseIntegrationTest()
".property('emails', setOf(Text))" +
".property('nullable_long', Bigint)" +
".create();\n" +
- "schema.vertexLabel('users')" +
- ".partitionBy('id', Int)" +
+ "schema.vertexLabel('users')" +
+ ".partitionBy('id', Int)" +
".property('main_phone', frozen(typeOf('phone')))" +
".create();\n" +
- "schema.vertexLabel('users_contacts')" +
- ".partitionBy('id', Int)" +
+ "schema.vertexLabel('users_contacts')" +
+ ".partitionBy('id', Int)" +
".property('contacts', listOf(frozen(typeOf('contact'))))" +
".create();\n" +
"schema.type('user_feedback')" +
@@ -102,19 +102,19 @@ protected BaseIntegrationTest()
".from('users').to('software')" +
".property('feedback', typeOf('user_feedback'))" +
".create();\n" +
- "schema.vertexLabel('tuple_test')" +
- ".partitionBy('id', Int)" +
+ "schema.vertexLabel('tuple_test')" +
+ ".partitionBy('id', Int)" +
".property('tuple_property', tupleOf(typeOf('phone'), Instant, UUID, listOf(Text), setOf(Int),mapOf(Text, Int)))" +
".create();\n";
///
/// Reference graph: http://www.tinkerpop.com/docs/3.0.0.M1/
///
- protected const string CoreLoadGremlinQuery =
+ protected const string CoreLoadGremlinQuery =
"g.addV('person')" +
".property('name', 'marko')" +
".property('age', 29)" +
- ".as('marko')" +
+ ".as('marko')" +
".addV('person')" +
".property('name', 'vadas')" +
".property('age', 27)" +
@@ -122,7 +122,7 @@ protected BaseIntegrationTest()
".addV('software')" +
".property('name', 'lop')" +
".property('lang', 'java')" +
- ".as('lop')" +
+ ".as('lop')" +
".addV('person')" +
".property('name', 'josh')" +
".property('age', 32)" +
@@ -155,7 +155,7 @@ protected BaseIntegrationTest()
".from('peter').to('lop')" +
".addV('users_contacts')" +
".property('id', 1923)" +
- ".property('contacts', " +
+ ".property('contacts', " +
"[ " +
"typeOf('contact').create(" +
"'Jimmy', " +
@@ -182,7 +182,7 @@ protected BaseIntegrationTest()
///
/// Reference graph: http://www.tinkerpop.com/docs/3.0.0.M1/
///
- protected const string ClassicLoadGremlinQuery =
+ protected const string ClassicLoadGremlinQuery =
"Vertex marko = graph.addVertex(label, 'person', 'name', 'marko', 'age', 29);\n" +
"Vertex vadas = graph.addVertex(label, 'person', 'name', 'vadas', 'age', 27);\n" +
"Vertex lop = graph.addVertex(label, 'software', 'name', 'lop', 'lang', 'java');\n" +
@@ -198,7 +198,7 @@ protected BaseIntegrationTest()
protected const string MakeStrict = "schema.config().option(\"graph.schema_mode\").set(\"production\");";
protected const string AllowScans = "schema.config().option(\"graph.allow_scan\").set(\"true\");";
-
+
///
/// Creates a graph using the current session
///
@@ -231,7 +231,7 @@ public void CreateClassicGraph(string contactPoint, string name)
CreateClassicGraph(cluster.Connect(), name);
}
}
-
+
///
/// Creates a core graph using the current session
///
@@ -279,7 +279,7 @@ private void WaitUntilKeyspaceMetadataRefresh(ISession session, string graphName
Task.Delay(500).GetAwaiter().GetResult();
}
-
+
Assert.Fail("Keyspace metadata does not have the correct graph engine.");
}
}
diff --git a/src/Cassandra.IntegrationTests/Core/BasicTypeTests.cs b/src/Cassandra.IntegrationTests/Core/BasicTypeTests.cs
index ef813c5a7..1f9d47df4 100644
--- a/src/Cassandra.IntegrationTests/Core/BasicTypeTests.cs
+++ b/src/Cassandra.IntegrationTests/Core/BasicTypeTests.cs
@@ -174,11 +174,11 @@ public void DecimalWithNegativeScaleTest()
TestCluster.PrimeFluent(
b => b.WhenQuery("SELECT * FROM decimal_neg_scale")
- .ThenRowsSuccess(new[] {"id", "value"}, r => r.WithRow(firstRowValues.First(), (decimal) 50)));
+ .ThenRowsSuccess(new[] { "id", "value" }, r => r.WithRow(firstRowValues.First(), (decimal)50)));
var row = Session.Execute("SELECT * FROM decimal_neg_scale").First();
var decValue = row.GetValue("value");
-
+
Assert.AreEqual(50, decValue);
}
@@ -245,7 +245,7 @@ public void ExceedingCassandraType(Type toExceed, Type toExceedWith, bool sameOu
TestCluster.PrimeFluent(
b => b.WhenQuery($"SELECT * FROM {tableName};", when => when.WithConsistency(ConsistencyLevel.One))
.ThenRowsSuccess(
- new[] {"tweet_id", "label", "number"},
+ new[] { "tweet_id", "label", "number" },
r => r.WithRow(toInsertAndCheck[0][0], toInsertAndCheck[0][1], toInsertAndCheck[0][2])
.WithRow(toInsertAndCheck[1][0], toInsertAndCheck[1][1], toInsertAndCheck[1][2])));
@@ -282,7 +282,7 @@ public void TestCounters()
TestCluster.PrimeFluent(
b => b.WhenQuery($"SELECT * FROM {tableName};", when => when.WithConsistency(ConsistencyLevel.LocalOne))
- .ThenRowsSuccess(new[] {"tweet_id", "incdec"}, r => r.WithRow(tweet_id, (Int64) 50)));
+ .ThenRowsSuccess(new[] { "tweet_id", "incdec" }, r => r.WithRow(tweet_id, (Int64)50)));
QueryTools.ExecuteSyncQuery(Session, $"SELECT * FROM {tableName};",
Session.Cluster.Configuration.QueryOptions.GetConsistencyLevel(),
@@ -310,7 +310,7 @@ public void InsertingSingleValue(Type tp)
var query =
$"INSERT INTO {tableName}(tweet_id,value) VALUES (" +
$"{toInsert[0][0]}, " +
- $"{(row1[1].GetType() == typeof(byte[]) ? "0x" + CqlQueryTools.ToHex((byte[]) toInsert[0][1]) : "'" + toInsert[0][1] + "'")}" +
+ $"{(row1[1].GetType() == typeof(byte[]) ? "0x" + CqlQueryTools.ToHex((byte[])toInsert[0][1]) : "'" + toInsert[0][1] + "'")}" +
");";
QueryTools.ExecuteSyncNonQuery(Session, query, null);
VerifyStatement(QueryType.Query, query, 1);
@@ -333,7 +333,7 @@ public void InsertingSingleValue(Type tp)
TestCluster.PrimeFluent(
b => b.WhenQuery($"SELECT * FROM {tableName};", when => when.WithConsistency(ConsistencyLevel.LocalOne))
- .ThenRowsSuccess(new[] {"tweet_id", "value"}, r => r.WithRow(toInsert[0][0], toInsert[0][1])));
+ .ThenRowsSuccess(new[] { "tweet_id", "value" }, r => r.WithRow(toInsert[0][0], toInsert[0][1])));
QueryTools.ExecuteSyncQuery(
Session, $"SELECT * FROM {tableName};", Session.Cluster.Configuration.QueryOptions.GetConsistencyLevel(), toInsert);
diff --git a/src/Cassandra.IntegrationTests/Core/ClientTimeoutTests.cs b/src/Cassandra.IntegrationTests/Core/ClientTimeoutTests.cs
index 8e2bf93e7..500f89ad6 100644
--- a/src/Cassandra.IntegrationTests/Core/ClientTimeoutTests.cs
+++ b/src/Cassandra.IntegrationTests/Core/ClientTimeoutTests.cs
@@ -58,7 +58,7 @@ public void Should_Move_To_Next_Host_For_Simple_Queries()
var node = nodes[0];
node.PrimeFluent(b => b
.WhenQuery("SELECT key FROM system.local")
- .ThenRowsSuccess(new [] { ("key", DataType.Ascii) }, rows => rows.WithRow("123"))
+ .ThenRowsSuccess(new[] { ("key", DataType.Ascii) }, rows => rows.WithRow("123"))
.WithDelayInMs(2000));
TestHelper.Invoke(() =>
{
@@ -85,7 +85,7 @@ public void Should_Move_To_Next_Host_For_Bound_Statements()
var node = nodes[0];
node.PrimeFluent(
b => b.WhenQuery("SELECT key FROM system.local")
- .ThenRowsSuccess(new [] { ("key", DataType.Ascii) }, rows => rows.WithRow("123"))
+ .ThenRowsSuccess(new[] { ("key", DataType.Ascii) }, rows => rows.WithRow("123"))
.WithDelayInMs(2000));
TestHelper.Invoke(() =>
{
@@ -135,7 +135,7 @@ public void Should_Throw_OperationTimedOutException_When_Retry_Is_False()
var node = nodes[1];
node.PrimeFluent(
b => b.WhenQuery("SELECT key FROM system.local")
- .ThenRowsSuccess(new [] { ("key", DataType.Ascii) }, rows => rows.WithRow("123"))
+ .ThenRowsSuccess(new[] { ("key", DataType.Ascii) }, rows => rows.WithRow("123"))
.WithDelayInMs(2000));
var coordinators = new HashSet();
var exceptions = new List();
@@ -166,7 +166,7 @@ public void Should_Wait_When_ReadTimeout_Is_Zero()
const string cql = "SELECT key FROM system.local";
simulacronCluster.PrimeFluent(
b => b.WhenQuery(cql)
- .ThenRowsSuccess(new [] { ("key", DataType.Ascii) }, rows => rows.WithRow("123"))
+ .ThenRowsSuccess(new[] { ("key", DataType.Ascii) }, rows => rows.WithRow("123"))
.WithDelayInMs(30000));
using (var cluster = ClusterBuilder().AddContactPoint(simulacronCluster.InitialContactPoint).WithSocketOptions(socketOptions).Build())
@@ -213,7 +213,7 @@ public void Should_Use_Statement_ReadTimeout()
var node = nodes[0];
node.PrimeFluent(
b => b.WhenQuery("SELECT key FROM system.local")
- .ThenRowsSuccess(new [] { ("key", DataType.Ascii) }, rows => rows.WithRow("123"))
+ .ThenRowsSuccess(new[] { ("key", DataType.Ascii) }, rows => rows.WithRow("123"))
.WithDelayInMs(30000));
var stopWatch = new Stopwatch();
stopWatch.Start();
@@ -259,7 +259,7 @@ public void Should_Throw_NoHostAvailableException_When_All_Hosts_Down()
TestHelper.Invoke(() => session.Execute("SELECT key FROM system.local"), 10);
_testCluster.PrimeFluent(
b => b.WhenQuery("SELECT key FROM system.local")
- .ThenRowsSuccess(new [] { ("key", DataType.Ascii) }, rows => rows.WithRow("123"))
+ .ThenRowsSuccess(new[] { ("key", DataType.Ascii) }, rows => rows.WithRow("123"))
.WithDelayInMs(10000));
var ex = Assert.Throws(() => session.Execute("SELECT key FROM system.local"));
Assert.AreEqual(2, ex.Errors.Count);
@@ -296,7 +296,7 @@ public void Should_Not_Leak_Connections_Test()
var listeners = new List();
foreach (var l in Trace.Listeners)
{
- listeners.Add((TraceListener) l);
+ listeners.Add((TraceListener)l);
}
Trace.Listeners.Clear();
@@ -395,7 +395,7 @@ public void Should_Not_Leak_Connections_Test()
}
}
}
-
+
///
/// CSHARP-958
///
@@ -405,7 +405,7 @@ public async Task Should_Not_Leak_Connections_With_InvalidKeyspace_Test()
var listeners = new List();
foreach (var l in Trace.Listeners)
{
- listeners.Add((TraceListener) l);
+ listeners.Add((TraceListener)l);
}
Trace.Listeners.Clear();
@@ -478,7 +478,7 @@ public async Task Should_Not_Leak_Connections_With_InvalidKeyspace_Test()
Exception ex = null;
try
{
- using (await c.ConnectAsync($"keyspace_{i+numberOfDefaultKsClusters}").ConfigureAwait(false))
+ using (await c.ConnectAsync($"keyspace_{i + numberOfDefaultKsClusters}").ConfigureAwait(false))
{
}
}
@@ -514,12 +514,12 @@ public async Task Should_Not_Leak_Connections_With_InvalidKeyspace_Test()
await Task.Delay(1000).ConfigureAwait(false);
decimal initialMemory = GC.GetTotalMemory(true);
-
+
await connectClustersFunc(100).ConfigureAwait(false);
GC.Collect();
await Task.Delay(1000).ConfigureAwait(false);
-
+
var connectedPorts = await _testCluster.GetConnectedPortsAsync().ConfigureAwait(false);
Assert.AreEqual(20, connectedPorts.Count); // control connections
diff --git a/src/Cassandra.IntegrationTests/Core/ClientWarningsTests.cs b/src/Cassandra.IntegrationTests/Core/ClientWarningsTests.cs
index 45337e4ca..95b34b618 100644
--- a/src/Cassandra.IntegrationTests/Core/ClientWarningsTests.cs
+++ b/src/Cassandra.IntegrationTests/Core/ClientWarningsTests.cs
@@ -88,7 +88,7 @@ public void Should_QueryTrace_When_Enabled()
Assert.Greater(rs.Info.QueryTrace.Events.Count, 0);
if (Session.BinaryProtocolVersion >= 4)
{
- Assert.NotNull(rs.Info.QueryTrace.ClientAddress);
+ Assert.NotNull(rs.Info.QueryTrace.ClientAddress);
}
else
{
@@ -114,7 +114,7 @@ public void Should_NotGenerateWarning_When_RegularBehavior()
[Test, TestCassandraVersion(2, 2)]
public void Should_Warning_When_BatchExceedsLength()
{
- var rs = Session.Execute(GetBatchAsSimpleStatement(5*1025));
+ var rs = Session.Execute(GetBatchAsSimpleStatement(5 * 1025));
Assert.NotNull(rs.Info.Warnings);
Assert.AreEqual(1, rs.Info.Warnings.Length);
StringAssert.Contains("batch", rs.Info.Warnings[0].ToLowerInvariant());
@@ -147,7 +147,7 @@ public void Should_ThrowInvalidException_When_BatchIsTooBig()
[Test, TestCassandraVersion(2, 2)]
public void Should_WarningAndGetPayload_When_UsingMirrorPayload()
{
- var statement = GetBatchAsSimpleStatement(5*1025);
+ var statement = GetBatchAsSimpleStatement(5 * 1025);
var outgoing = GetPayload();
var rs = Session.Execute(statement.SetOutgoingPayload(GetPayload()));
Assert.NotNull(rs.Info.Warnings);
@@ -161,7 +161,7 @@ public void Should_WarningAndGetPayload_When_UsingMirrorPayload()
[Test, TestCassandraVersion(2, 2)]
public void Should_WarningAndTracingAndGetPayload_When_UsingMirrorPayloadAndEnableTracing()
{
- var statement = GetBatchAsSimpleStatement(5*1025);
+ var statement = GetBatchAsSimpleStatement(5 * 1025);
var outgoing = new Dictionary
{
{"k1", Encoding.UTF8.GetBytes("value1")},
diff --git a/src/Cassandra.IntegrationTests/Core/ClusterPeersV2SimulacronTests.cs b/src/Cassandra.IntegrationTests/Core/ClusterPeersV2SimulacronTests.cs
index 803dc5f47..519e9cd37 100644
--- a/src/Cassandra.IntegrationTests/Core/ClusterPeersV2SimulacronTests.cs
+++ b/src/Cassandra.IntegrationTests/Core/ClusterPeersV2SimulacronTests.cs
@@ -46,7 +46,7 @@ public void Should_SendRequestsToAllHosts_When_PeersOnSameAddress()
// doesn't exist but doesn't matter
Session.Execute(query);
}
-
+
Assert.AreEqual(3, Session.Cluster.AllHosts().Count);
Assert.IsTrue(Session.Cluster.AllHosts().All(h => h.IsUp));
diff --git a/src/Cassandra.IntegrationTests/Core/ClusterTests.cs b/src/Cassandra.IntegrationTests/Core/ClusterTests.cs
index 656a7a952..ea92e6401 100644
--- a/src/Cassandra.IntegrationTests/Core/ClusterTests.cs
+++ b/src/Cassandra.IntegrationTests/Core/ClusterTests.cs
@@ -168,8 +168,8 @@ await TestGlobals.ConnectAndDispose(cluster, false, session =>
TestHelper.RetryAssert(() =>
{
Assert.True(TestUtils.IsNodeReachable(newNodeIpAddress));
- //New node should be part of the metadata
- Assert.AreEqual(2, cluster.AllHosts().Count);
+ //New node should be part of the metadata
+ Assert.AreEqual(2, cluster.AllHosts().Count);
var host = cluster.AllHosts().FirstOrDefault(h => h.Address.Address.Equals(newNodeIpAddress));
Assert.IsNotNull(host);
},
@@ -212,8 +212,8 @@ await TestGlobals.ConnectAndDispose(cluster, false, session =>
{
decommisionedNode = _realCluster.ClusterIpPrefix + 3;
Assert.False(TestUtils.IsNodeReachable(IPAddress.Parse(decommisionedNode)));
- //New node should be part of the metadata
- Assert.AreEqual(2, cluster.AllHosts().Count);
+ //New node should be part of the metadata
+ Assert.AreEqual(2, cluster.AllHosts().Count);
}, 100, 100);
var queried = false;
for (var i = 0; i < 10; i++)
diff --git a/src/Cassandra.IntegrationTests/Core/CollectionsNestedTests.cs b/src/Cassandra.IntegrationTests/Core/CollectionsNestedTests.cs
index eb243fd5f..b8f2e7209 100644
--- a/src/Cassandra.IntegrationTests/Core/CollectionsNestedTests.cs
+++ b/src/Cassandra.IntegrationTests/Core/CollectionsNestedTests.cs
@@ -258,8 +258,8 @@ public void NestedCollections_BatchStatements()
/// Nested Collection Helpers
///////////////////////////////////////
- private static void ValidateSelectedNestedFrozenRow(Row row,
- Dictionary> expectedMap1 = null,
+ private static void ValidateSelectedNestedFrozenRow(Row row,
+ Dictionary> expectedMap1 = null,
Dictionary> expectedMap2 = null,
List> expectedList1 = null)
{
diff --git a/src/Cassandra.IntegrationTests/Core/CollectionsTests.cs b/src/Cassandra.IntegrationTests/Core/CollectionsTests.cs
index df48be173..e91ffd762 100644
--- a/src/Cassandra.IntegrationTests/Core/CollectionsTests.cs
+++ b/src/Cassandra.IntegrationTests/Core/CollectionsTests.cs
@@ -42,11 +42,11 @@ public override void OneTimeSetUp()
public void DecodeCollectionTest()
{
var id = "c9850ed4-c139-4b75-affe-098649f9de93";
- var insertQuery = string.Format("INSERT INTO {0} (id, map_sample, list_sample, set_sample) VALUES ({1}, {2}, {3}, {4})",
- AllTypesTableName,
- id,
- "{'fruit': 'apple', 'band': 'Beatles'}",
- "['one', 'two']",
+ var insertQuery = string.Format("INSERT INTO {0} (id, map_sample, list_sample, set_sample) VALUES ({1}, {2}, {3}, {4})",
+ AllTypesTableName,
+ id,
+ "{'fruit': 'apple', 'band': 'Beatles'}",
+ "['one', 'two']",
"{'set_1one', 'set_2two'}");
Session.Execute(insertQuery);
@@ -139,23 +139,23 @@ public void Decode_List_With_NullValue_Should_Return_Correct_Results()
AllTypesTableName));
var list = new List { "apple", "queen" };
var set = new List { "fruit", "band" };
- var map = new Dictionary { { "fruit", "apple" }, { "band", "queen" } };
+ var map = new Dictionary { { "fruit", "apple" }, { "band", "queen" } };
var stmt = insertQuery.Bind(id, map, set, list, ttlInsert);
localSession.Execute(stmt);
insertQuery = localSession.Prepare(string.Format("INSERT INTO {0} (id, map_sample, set_sample, list_sample) VALUES (?, ?, ?, ?)",
AllTypesTableName));
stmt = insertQuery.Bind(id2, map, set, list);
localSession.Execute(stmt);
-
+
var rowSet = localSession.Execute(
- new SimpleStatement($"select ttl(list_sample), ttl(map_sample), ttl(set_sample) from {AllTypesTableName} where id=?",id2)).ToList();
-
- CollectionAssert.AreEqual(new int? [] { null, null }, rowSet.Single().GetValue(0));
- CollectionAssert.AreEqual(new int? [] { null, null }, rowSet.Single().GetValue>(1));
- CollectionAssert.AreEqual(new int? [] { null, null }, rowSet.Single().GetValue>(2));
+ new SimpleStatement($"select ttl(list_sample), ttl(map_sample), ttl(set_sample) from {AllTypesTableName} where id=?", id2)).ToList();
+
+ CollectionAssert.AreEqual(new int?[] { null, null }, rowSet.Single().GetValue(0));
+ CollectionAssert.AreEqual(new int?[] { null, null }, rowSet.Single().GetValue>(1));
+ CollectionAssert.AreEqual(new int?[] { null, null }, rowSet.Single().GetValue>(2));
rowSet = localSession.Execute(
- new SimpleStatement($"select writetime(list_sample), writetime(map_sample), ttl(list_sample), ttl(map_sample), ttl(set_sample) from {AllTypesTableName} where id=?",id)).ToList();
+ new SimpleStatement($"select writetime(list_sample), writetime(map_sample), ttl(list_sample), ttl(map_sample), ttl(set_sample) from {AllTypesTableName} where id=?", id)).ToList();
Assert.IsTrue(rowSet.Single().GetValue(0).All(i => i > 0) && rowSet.Single().GetValue(0).Length == 2);
Assert.IsTrue(rowSet.Single().GetValue(1).All(i => i > 0) && rowSet.Single().GetValue(1).Length == 2);
Assert.IsTrue(rowSet.Single().GetValue(2).All(i => i > 0) && rowSet.Single().GetValue(2).Length == 2);
@@ -163,7 +163,7 @@ public void Decode_List_With_NullValue_Should_Return_Correct_Results()
Assert.IsTrue(rowSet.Single().GetValue>(4).All(ttl => ttl <= ttlInsert && ttl >= (ttlInsert - 100)) && rowSet.Single().GetValue>(4).Count() == 2);
}
- public void CheckingOrderOfCollection(string CassandraCollectionType, Type TypeOfDataToBeInputed, Type TypeOfKeyForMap = null,string pendingMode = "")
+ public void CheckingOrderOfCollection(string CassandraCollectionType, Type TypeOfDataToBeInputed, Type TypeOfKeyForMap = null, string pendingMode = "")
{
string cassandraDataTypeName = QueryTools.convertTypeNameToCassandraEquivalent(TypeOfDataToBeInputed);
string openBracket = CassandraCollectionType == "list" ? "[" : "{";
@@ -177,12 +177,12 @@ public void CheckingOrderOfCollection(string CassandraCollectionType, Type TypeO
string cassandraKeyDataTypeName = QueryTools.convertTypeNameToCassandraEquivalent(TypeOfKeyForMap);
mapSyntax = cassandraKeyDataTypeName + ",";
- if (TypeOfKeyForMap == typeof (DateTimeOffset))
+ if (TypeOfKeyForMap == typeof(DateTimeOffset))
randomKeyValue =
- Randomm.RandomVal(typeof (DateTimeOffset))
+ Randomm.RandomVal(typeof(DateTimeOffset))
.GetType()
- .GetMethod("ToString", new[] {typeof (string)})
- .Invoke(Randomm.RandomVal(typeof (DateTimeOffset)), new object[1] {"yyyy-MM-dd H:mm:sszz00"}) + "' : '";
+ .GetMethod("ToString", new[] { typeof(string) })
+ .Invoke(Randomm.RandomVal(typeof(DateTimeOffset)), new object[1] { "yyyy-MM-dd H:mm:sszz00" }) + "' : '";
else
randomKeyValue = Randomm.RandomVal(TypeOfDataToBeInputed) + "' : '";
}
@@ -213,7 +213,7 @@ public void CheckingOrderOfCollection(string CassandraCollectionType, Type TypeO
for (int i = 0; i < collectionElementsNo; i++)
{
- int data = i*(i%2);
+ int data = i * (i % 2);
longQ.AppendFormat(@"UPDATE {0} SET some_collection = " + inputSide + " WHERE tweet_id = {2};"
, tableName, openBracket + randomKeyValue + data + closeBracket, tweet_id);
orderedAsInputed.Add(data);
@@ -237,7 +237,7 @@ public void CheckingOrderOfCollection(string CassandraCollectionType, Type TypeO
foreach (Row row in rs.GetRows())
foreach (object value in row[1] as IEnumerable)
{
- Assert.True(orderedAsInputed[ind] == (int) value);
+ Assert.True(orderedAsInputed[ind] == (int)value);
ind++;
}
}
@@ -256,11 +256,11 @@ public void InsertingSingleCollection(string cassandraCollectionType, Type typeO
string mapSyntax = "";
object randomValue = Randomm.RandomVal(typeOfDataToBeInputed);
- if (typeOfDataToBeInputed == typeof (string))
+ if (typeOfDataToBeInputed == typeof(string))
randomValue = "'" + randomValue.ToString().Replace("'", "''") + "'";
else if (typeOfDataToBeInputed == typeof(double))
{
- randomValue = ((double) randomValue).ToString(CultureInfo.InvariantCulture);
+ randomValue = ((double)randomValue).ToString(CultureInfo.InvariantCulture);
}
string randomKeyValue = string.Empty;
@@ -270,15 +270,15 @@ public void InsertingSingleCollection(string cassandraCollectionType, Type typeO
cassandraKeyDataTypeName = QueryTools.convertTypeNameToCassandraEquivalent(typeOfKeyForMap);
mapSyntax = cassandraKeyDataTypeName + ",";
- if (typeOfKeyForMap == typeof (DateTimeOffset))
+ if (typeOfKeyForMap == typeof(DateTimeOffset))
randomKeyValue = "'" +
- (Randomm.RandomVal(typeof (DateTimeOffset))
+ (Randomm.RandomVal(typeof(DateTimeOffset))
.GetType()
- .GetMethod("ToString", new[] {typeof (string)})
- .Invoke(Randomm.RandomVal(typeof (DateTimeOffset)), new object[1] {"yyyy-MM-dd H:mm:sszz00"}) + "'");
- else if (typeOfKeyForMap == typeof (string))
+ .GetMethod("ToString", new[] { typeof(string) })
+ .Invoke(Randomm.RandomVal(typeof(DateTimeOffset)), new object[1] { "yyyy-MM-dd H:mm:sszz00" }) + "'");
+ else if (typeOfKeyForMap == typeof(string))
randomKeyValue = "'" + Randomm.RandomVal(typeOfDataToBeInputed).ToString().Replace("'", "''") + "'";
- else if (typeOfKeyForMap == typeof (double))
+ else if (typeOfKeyForMap == typeof(double))
randomKeyValue = ((double)Randomm.RandomVal(typeOfDataToBeInputed)).ToString(CultureInfo.InvariantCulture);
else
randomKeyValue = Randomm.RandomVal(typeOfDataToBeInputed).ToString();
@@ -312,11 +312,11 @@ public void InsertingSingleCollection(string cassandraCollectionType, Type typeO
for (int i = 0; i < CollectionElementsNo; i++)
{
object val = rval;
- if (typeOfDataToBeInputed == typeof (string))
+ if (typeOfDataToBeInputed == typeof(string))
val = "'" + val.ToString().Replace("'", "''") + "'";
else if (typeOfDataToBeInputed == typeof(double))
{
- val = ((double) val).ToString(CultureInfo.InvariantCulture);
+ val = ((double)val).ToString(CultureInfo.InvariantCulture);
}
longQ.AppendFormat(@"UPDATE {0} SET some_collection = some_collection + {1} WHERE tweet_id = {2};"
@@ -342,14 +342,14 @@ public void insertingSingleCollectionPrepared(string CassandraCollectionType, Ty
if (CassandraCollectionType == "list" || CassandraCollectionType == "set")
{
- Type openType = CassandraCollectionType == "list" ? typeof (List<>) : typeof (HashSet<>);
+ Type openType = CassandraCollectionType == "list" ? typeof(List<>) : typeof(HashSet<>);
Type listType = openType.MakeGenericType(TypeOfDataToBeInputed);
valueCollection = Activator.CreateInstance(listType);
MethodInfo addM = listType.GetMethod("Add");
for (int i = 0; i < Cnt; i++)
{
object randomValue = Randomm.RandomVal(TypeOfDataToBeInputed);
- addM.Invoke(valueCollection, new[] {randomValue});
+ addM.Invoke(valueCollection, new[] { randomValue });
}
}
else if (CassandraCollectionType == "map")
@@ -357,18 +357,18 @@ public void insertingSingleCollectionPrepared(string CassandraCollectionType, Ty
cassandraKeyDataTypeName = QueryTools.convertTypeNameToCassandraEquivalent(TypeOfKeyForMap);
mapSyntax = cassandraKeyDataTypeName + ",";
- Type openType = typeof (SortedDictionary<,>);
+ Type openType = typeof(SortedDictionary<,>);
Type dicType = openType.MakeGenericType(TypeOfKeyForMap, TypeOfDataToBeInputed);
valueCollection = Activator.CreateInstance(dicType);
MethodInfo addM = dicType.GetMethod("Add");
for (int i = 0; i < Cnt; i++)
{
- RETRY:
+ RETRY:
try
{
object randomKey = Randomm.RandomVal(TypeOfKeyForMap);
object randomValue = Randomm.RandomVal(TypeOfDataToBeInputed);
- addM.Invoke(valueCollection, new[] {randomKey, randomValue});
+ addM.Invoke(valueCollection, new[] { randomKey, randomValue });
}
catch
{
@@ -400,163 +400,163 @@ public void insertingSingleCollectionPrepared(string CassandraCollectionType, Ty
[Test]
public void ListOrderPrepending()
{
- CheckingOrderOfCollection("list", typeof (Int32), null, "prepending");
+ CheckingOrderOfCollection("list", typeof(Int32), null, "prepending");
}
[Test]
public void ListOrderAppending()
{
- CheckingOrderOfCollection("list", typeof (Int32), null, "appending");
+ CheckingOrderOfCollection("list", typeof(Int32), null, "appending");
}
[Test]
public void SetOrder()
{
- CheckingOrderOfCollection("set", typeof (Int32));
+ CheckingOrderOfCollection("set", typeof(Int32));
}
[Test]
public void Map()
{
- InsertingSingleCollection("map", typeof (string), typeof (DateTimeOffset));
+ InsertingSingleCollection("map", typeof(string), typeof(DateTimeOffset));
}
[Test]
public void MapDouble()
{
- InsertingSingleCollection("map", typeof (Double), typeof (DateTimeOffset));
+ InsertingSingleCollection("map", typeof(Double), typeof(DateTimeOffset));
}
[Test]
public void MapInt32()
{
- InsertingSingleCollection("map", typeof (Int32), typeof (DateTimeOffset));
+ InsertingSingleCollection("map", typeof(Int32), typeof(DateTimeOffset));
}
[Test]
public void MapInt64()
{
- InsertingSingleCollection("map", typeof (Int64), typeof (DateTimeOffset));
+ InsertingSingleCollection("map", typeof(Int64), typeof(DateTimeOffset));
}
[Test]
public void ListDouble()
{
- InsertingSingleCollection("list", typeof (Double));
+ InsertingSingleCollection("list", typeof(Double));
}
[Test]
public void ListInt64()
{
- InsertingSingleCollection("list", typeof (Int64));
+ InsertingSingleCollection("list", typeof(Int64));
}
[Test]
public void ListInt32()
{
- InsertingSingleCollection("list", typeof (Int32));
+ InsertingSingleCollection("list", typeof(Int32));
}
[Test]
public void ListString()
{
- InsertingSingleCollection("list", typeof (string));
+ InsertingSingleCollection("list", typeof(string));
}
[Test]
public void SetString()
{
- InsertingSingleCollection("set", typeof (string));
+ InsertingSingleCollection("set", typeof(string));
}
[Test]
public void SetDouble()
{
- InsertingSingleCollection("set", typeof (Double));
+ InsertingSingleCollection("set", typeof(Double));
}
[Test]
public void SetInt32()
{
- InsertingSingleCollection("set", typeof (Int32));
+ InsertingSingleCollection("set", typeof(Int32));
}
[Test]
public void SetInt64()
{
- InsertingSingleCollection("set", typeof (Int64));
+ InsertingSingleCollection("set", typeof(Int64));
}
[Test]
public void MapPrepared()
{
- insertingSingleCollectionPrepared("map", typeof (string), typeof (DateTimeOffset));
+ insertingSingleCollectionPrepared("map", typeof(string), typeof(DateTimeOffset));
}
[Test]
public void MapDoublePrepared()
{
- insertingSingleCollectionPrepared("map", typeof (Double), typeof (DateTimeOffset));
+ insertingSingleCollectionPrepared("map", typeof(Double), typeof(DateTimeOffset));
}
[Test]
public void MapInt32Prepared()
{
- insertingSingleCollectionPrepared("map", typeof (Int32), typeof (DateTimeOffset));
+ insertingSingleCollectionPrepared("map", typeof(Int32), typeof(DateTimeOffset));
}
[Test]
public void MapInt64Prepared()
{
- insertingSingleCollectionPrepared("map", typeof (Int64), typeof (DateTimeOffset));
+ insertingSingleCollectionPrepared("map", typeof(Int64), typeof(DateTimeOffset));
}
[Test]
public void ListDoublePrepared()
{
- insertingSingleCollectionPrepared("list", typeof (Double));
+ insertingSingleCollectionPrepared("list", typeof(Double));
}
[Test]
public void ListInt64Prepared()
{
- insertingSingleCollectionPrepared("list", typeof (Int64));
+ insertingSingleCollectionPrepared("list", typeof(Int64));
}
[Test]
public void ListInt32Prepared()
{
- insertingSingleCollectionPrepared("list", typeof (Int32));
+ insertingSingleCollectionPrepared("list", typeof(Int32));
}
[Test]
public void ListStringPrepared()
{
- insertingSingleCollectionPrepared("list", typeof (string));
+ insertingSingleCollectionPrepared("list", typeof(string));
}
[Test]
public void SetStringPrepared()
{
- insertingSingleCollectionPrepared("set", typeof (string));
+ insertingSingleCollectionPrepared("set", typeof(string));
}
[Test]
public void SetDoublePrepared()
{
- insertingSingleCollectionPrepared("set", typeof (Double));
+ insertingSingleCollectionPrepared("set", typeof(Double));
}
[Test]
public void SetInt32Prepared()
{
- insertingSingleCollectionPrepared("set", typeof (Int32));
+ insertingSingleCollectionPrepared("set", typeof(Int32));
}
[Test]
public void SetInt64Prepared()
{
- insertingSingleCollectionPrepared("set", typeof (Int64));
+ insertingSingleCollectionPrepared("set", typeof(Int64));
}
}
}
diff --git a/src/Cassandra.IntegrationTests/Core/CompressionTests.cs b/src/Cassandra.IntegrationTests/Core/CompressionTests.cs
index e178457ba..6489b7f96 100644
--- a/src/Cassandra.IntegrationTests/Core/CompressionTests.cs
+++ b/src/Cassandra.IntegrationTests/Core/CompressionTests.cs
@@ -39,7 +39,7 @@ public void Lz4_Compression_Under_Heavy_Concurrency_Test()
session.Execute(string.Format("CREATE TABLE {0} (id uuid PRIMARY KEY, value text)", table));
var psInsert = session.Prepare(string.Format("INSERT INTO {0} (id, value) VALUES (?, ?)", table));
var psSelect = session.Prepare(string.Format("SELECT * FROM {0}", table));
- var values = new []
+ var values = new[]
{
//different values
string.Join("", Enumerable.Repeat("abc", 10)), // 3 * 10 + 16 + header + metadata = ~ 80 b on select
diff --git a/src/Cassandra.IntegrationTests/Core/ConnectionSimulacronTests.cs b/src/Cassandra.IntegrationTests/Core/ConnectionSimulacronTests.cs
index 89fcf5d2f..0b569dbe1 100644
--- a/src/Cassandra.IntegrationTests/Core/ConnectionSimulacronTests.cs
+++ b/src/Cassandra.IntegrationTests/Core/ConnectionSimulacronTests.cs
@@ -245,11 +245,11 @@ public async Task Should_KeepOperationsInWriteQueue_When_ServerAppliesTcpBackPre
var maxRequestsPerConnection = Session.Cluster.Configuration
.GetOrCreatePoolingOptions(Session.Cluster.Metadata.ControlConnection.ProtocolVersion)
.GetMaxRequestsPerConnection();
-
+
var tenKbBuffer = new byte[10240];
await TestCluster.PauseReadsAsync().ConfigureAwait(false);
-
+
var pools = InternalSession.GetPools().ToList();
var connections = pools.SelectMany(kvp => kvp.Value.ConnectionsSnapshot).ToList();
var requests = new List();
@@ -295,9 +295,9 @@ public async Task Should_KeepOperationsInWriteQueue_When_ServerAppliesTcpBackPre
var moreFailedRequests = moreRequests.Where(t => t.IsFaulted).ToList();
Assert.Greater(moreFailedRequests.Count, 1);
Assert.AreEqual(moreRequests.Count, moreFailedRequests.Count);
-
+
Assert.GreaterOrEqual(connections.Sum(c => c.InFlight), maxRequestsPerConnection * Session.Cluster.AllHosts().Count);
-
+
// ReSharper disable once PossibleNullReferenceException
Assert.IsTrue(moreFailedRequests.All(t => t.IsFaulted && ((NoHostAvailableException)t.Exception.InnerException).Errors.All(e => e.Value is BusyPoolException)));
var newWriteQueueSizes =
@@ -310,7 +310,7 @@ public async Task Should_KeepOperationsInWriteQueue_When_ServerAppliesTcpBackPre
Assert.GreaterOrEqual(newWriteQueueSizes[kvp.Key], kvp.Value);
Assert.Greater(newWriteQueueSizes[kvp.Key], 1);
}
-
+
foreach (var kvp in pendingOps)
{
Assert.AreEqual(newPendingsOps[kvp.Key], kvp.Value);
@@ -329,9 +329,9 @@ public async Task Should_KeepOperationsInWriteQueue_When_ServerAppliesTcpBackPre
}
Assert.AreEqual(
- requests.Count,
- requests.Count(t => t.IsCompleted && !t.IsFaulted && !t.IsCanceled)
- + requests.Count(t => t.IsFaulted &&
+ requests.Count,
+ requests.Count(t => t.IsCompleted && !t.IsFaulted && !t.IsCanceled)
+ + requests.Count(t => t.IsFaulted &&
((NoHostAvailableException)t.Exception.InnerException)
.Errors.All(e => e.Value is BusyPoolException)));
}
diff --git a/src/Cassandra.IntegrationTests/Core/ConnectionTests.cs b/src/Cassandra.IntegrationTests/Core/ConnectionTests.cs
index 0f10f213c..1b025bd7c 100644
--- a/src/Cassandra.IntegrationTests/Core/ConnectionTests.cs
+++ b/src/Cassandra.IntegrationTests/Core/ConnectionTests.cs
@@ -54,7 +54,7 @@ public void SetupFixture()
// we just need to make sure that there is a query-able cluster
_testCluster = TestClusterManager.GetTestCluster(1, DefaultMaxClusterCreateRetries, true, false);
}
-
+
[Test]
public void Basic_Startup_Test()
{
@@ -127,8 +127,8 @@ public void Execute_Prepared_Test()
//Execute the prepared query
var executeRequest = new ExecuteRequest(
- GetSerializer(),
- prepareOutput.QueryId,
+ GetSerializer(),
+ prepareOutput.QueryId,
new ResultMetadata(prepareOutput.ResultMetadataId, prepareOutput.ResultRowsMetadata),
QueryProtocolOptions.Default,
false,
@@ -157,8 +157,8 @@ public void Execute_Prepared_With_Param_Test()
var options = new QueryProtocolOptions(ConsistencyLevel.One, new object[] { "local" }, false, 100, null, ConsistencyLevel.Any, null, null, prepareOutput.VariablesRowsMetadata);
var executeRequest = new ExecuteRequest(
- GetSerializer(),
- prepareOutput.QueryId,
+ GetSerializer(),
+ prepareOutput.QueryId,
new ResultMetadata(prepareOutput.ResultMetadataId, prepareOutput.ResultRowsMetadata),
options,
false,
@@ -787,7 +787,7 @@ public async Task Heartbeat_Should_Be_Enabled_By_Default()
{
await connection.Open().ConfigureAwait(false);
Assert.AreEqual(defaultHeartbeatInterval, connection.Configuration.PoolingOptions.GetHeartBeatInterval());
-
+
//execute a dummy query
await Query(connection, "SELECT * FROM system.local", QueryProtocolOptions.Default).ConfigureAwait(false);
@@ -835,10 +835,10 @@ public async Task Should_Have_InFlight_Set_To_Zero_After_Successful_And_Failed_R
}
private Connection CreateConnection(
- ProtocolOptions protocolOptions = null,
- SocketOptions socketOptions = null,
- PoolingOptions poolingOptions = null,
- ProtocolVersion? version = null,
+ ProtocolOptions protocolOptions = null,
+ SocketOptions socketOptions = null,
+ PoolingOptions poolingOptions = null,
+ ProtocolVersion? version = null,
string contactPoint = null)
{
if (socketOptions == null)
diff --git a/src/Cassandra.IntegrationTests/Core/ConsistencyTests.cs b/src/Cassandra.IntegrationTests/Core/ConsistencyTests.cs
index a8d9811bf..c89d89194 100644
--- a/src/Cassandra.IntegrationTests/Core/ConsistencyTests.cs
+++ b/src/Cassandra.IntegrationTests/Core/ConsistencyTests.cs
@@ -41,7 +41,7 @@ public class ConsistencyTests : TestGlobals
[Test]
public void Should_UseCLLocalOne_When_NotSpecifiedXDefaultX()
{
- using (var simulacronCluster = SimulacronCluster.CreateNew(new SimulacronOptions { Nodes = "3" } ))
+ using (var simulacronCluster = SimulacronCluster.CreateNew(new SimulacronOptions { Nodes = "3" }))
using (var cluster = ClusterBuilder()
.AddContactPoint(simulacronCluster.InitialContactPoint).Build())
{
@@ -63,7 +63,7 @@ public void Should_UseCLLocalOne_When_NotSpecifiedXDefaultX()
[TestCase(ConsistencyLevel.LocalQuorum)]
public void Should_UseQueryOptionsCL_When_NotSetAtSimpleStatement(ConsistencyLevel consistencyLevel)
{
- using (var simulacronCluster = SimulacronCluster.CreateNew(new SimulacronOptions { Nodes = "3,3" } ))
+ using (var simulacronCluster = SimulacronCluster.CreateNew(new SimulacronOptions { Nodes = "3,3" }))
using (var cluster = ClusterBuilder()
.WithQueryOptions(new QueryOptions().SetConsistencyLevel(consistencyLevel))
.AddContactPoint(simulacronCluster.InitialContactPoint).Build())
@@ -81,7 +81,7 @@ public void Should_UseQueryOptionsCL_When_NotSetAtSimpleStatement(ConsistencyLev
[TestCase(ConsistencyLevel.LocalSerial)]
public void Should_UseQueryOptionsSerialCL_When_NotSetAtSimpleStatement(ConsistencyLevel serialConsistency)
{
- using (var simulacronCluster = SimulacronCluster.CreateNew(new SimulacronOptions { Nodes = "3,3" } ))
+ using (var simulacronCluster = SimulacronCluster.CreateNew(new SimulacronOptions { Nodes = "3,3" }))
using (var cluster = ClusterBuilder()
.WithQueryOptions(new QueryOptions().SetSerialConsistencyLevel(serialConsistency))
.AddContactPoint(simulacronCluster.InitialContactPoint).Build())
@@ -106,7 +106,7 @@ public void Should_UseQueryOptionsSerialCL_When_NotSetAtSimpleStatement(Consiste
[TestCase(ConsistencyLevel.LocalQuorum)]
public void Should_UseSimpleStatementCL_When_Set(ConsistencyLevel consistencyLevel)
{
- using (var simulacronCluster = SimulacronCluster.CreateNew(new SimulacronOptions { Nodes = "3,3" } ))
+ using (var simulacronCluster = SimulacronCluster.CreateNew(new SimulacronOptions { Nodes = "3,3" }))
using (var cluster = ClusterBuilder()
.WithQueryOptions(new QueryOptions().SetConsistencyLevel(ConsistencyLevel.Any))
.AddContactPoint(simulacronCluster.InitialContactPoint).Build())
@@ -125,7 +125,7 @@ public void Should_UseSimpleStatementCL_When_Set(ConsistencyLevel consistencyLev
public void Should_UseSerialConsistencyLevelSpecified_When_ConditionalQuery(
ConsistencyLevel consistencyLevel, ConsistencyLevel serialConsistency)
{
- using (var simulacronCluster = SimulacronCluster.CreateNew(new SimulacronOptions { Nodes = "3,3" } ))
+ using (var simulacronCluster = SimulacronCluster.CreateNew(new SimulacronOptions { Nodes = "3,3" }))
using (var cluster = ClusterBuilder()
.AddContactPoint(simulacronCluster.InitialContactPoint).Build())
{
@@ -146,7 +146,7 @@ public void Should_UseSerialConsistencyLevelSpecified_When_ConditionalQuery(
public void Should_UseSerialConsistencyLevel_From_QueryOptions(
ConsistencyLevel consistencyLevel, ConsistencyLevel serialConsistency)
{
- using (var simulacronCluster = SimulacronCluster.CreateNew(new SimulacronOptions { Nodes = "3,3" } ))
+ using (var simulacronCluster = SimulacronCluster.CreateNew(new SimulacronOptions { Nodes = "3,3" }))
using (var cluster = ClusterBuilder()
.AddContactPoint(simulacronCluster.InitialContactPoint)
.WithQueryOptions(new QueryOptions()
@@ -175,7 +175,7 @@ public void Should_UseSerialConsistencyLevel_From_QueryOptions(
[TestCase(ConsistencyLevel.LocalQuorum)]
public void Should_UseQueryOptionsCL_When_NotSetAtPreparedStatement(ConsistencyLevel consistencyLevel)
{
- using (var simulacronCluster = SimulacronCluster.CreateNew(new SimulacronOptions { Nodes = "3,3" } ))
+ using (var simulacronCluster = SimulacronCluster.CreateNew(new SimulacronOptions { Nodes = "3,3" }))
using (var cluster = ClusterBuilder()
.WithQueryOptions(new QueryOptions().SetConsistencyLevel(consistencyLevel))
.AddContactPoint(simulacronCluster.InitialContactPoint).Build())
@@ -195,7 +195,7 @@ public void Should_UseQueryOptionsCL_When_NotSetAtPreparedStatement(ConsistencyL
[TestCase(ConsistencyLevel.LocalSerial)]
public void Should_UseQueryOptionsSerialCL_When_NotSetAtPreparedStatement(ConsistencyLevel consistencyLevel)
{
- using (var simulacronCluster = SimulacronCluster.CreateNew(new SimulacronOptions { Nodes = "3,3" } ))
+ using (var simulacronCluster = SimulacronCluster.CreateNew(new SimulacronOptions { Nodes = "3,3" }))
using (var cluster = ClusterBuilder()
.WithQueryOptions(new QueryOptions().SetSerialConsistencyLevel(consistencyLevel))
.AddContactPoint(simulacronCluster.InitialContactPoint).Build())
@@ -221,7 +221,7 @@ public void Should_UseQueryOptionsSerialCL_When_NotSetAtPreparedStatement(Consis
[TestCase(ConsistencyLevel.LocalQuorum)]
public void Should_UsePreparedStatementCL_When_Set(ConsistencyLevel consistencyLevel)
{
- using (var simulacronCluster = SimulacronCluster.CreateNew(new SimulacronOptions { Nodes = "3,3" } ))
+ using (var simulacronCluster = SimulacronCluster.CreateNew(new SimulacronOptions { Nodes = "3,3" }))
using (var cluster = ClusterBuilder()
.AddContactPoint(simulacronCluster.InitialContactPoint).Build())
{
@@ -235,7 +235,7 @@ public void Should_UsePreparedStatementCL_When_Set(ConsistencyLevel consistencyL
}
}
- private static void VerifyConsistency(SimulacronCluster simulacronCluster, string query, ConsistencyLevel consistency,
+ private static void VerifyConsistency(SimulacronCluster simulacronCluster, string query, ConsistencyLevel consistency,
ConsistencyLevel? serialConsistency = null, QueryType queryType = QueryType.Query)
{
var executedQueries = simulacronCluster.GetQueries(query, queryType);
diff --git a/src/Cassandra.IntegrationTests/Core/ControlConnectionSimulatorTests.cs b/src/Cassandra.IntegrationTests/Core/ControlConnectionSimulatorTests.cs
index e3d4d43d9..7900058d3 100644
--- a/src/Cassandra.IntegrationTests/Core/ControlConnectionSimulatorTests.cs
+++ b/src/Cassandra.IntegrationTests/Core/ControlConnectionSimulatorTests.cs
@@ -68,7 +68,7 @@ public void Should_Downgrade_To_Protocol_VX_With_Versions(ProtocolVersion versio
}
}
}
-
+
[TestCase(ProtocolVersion.V5, "4.0.0")]
[TestCase(ProtocolVersion.V4, "3.11.6", "3.0.11", "2.2.9")]
[TestCase(ProtocolVersion.V4, "3.0.13", "3.0.11", "2.2.9")]
diff --git a/src/Cassandra.IntegrationTests/Core/ControlConnectionTests.cs b/src/Cassandra.IntegrationTests/Core/ControlConnectionTests.cs
index 4d1c530ce..fd9801ffc 100644
--- a/src/Cassandra.IntegrationTests/Core/ControlConnectionTests.cs
+++ b/src/Cassandra.IntegrationTests/Core/ControlConnectionTests.cs
@@ -104,9 +104,9 @@ private ControlConnection NewInstance(
metadata.AddHost(new IPEndPoint(IPAddress.Parse(_testCluster.InitialContactPoint), ProtocolOptions.DefaultPort));
}
var cc = new ControlConnection(
- Mock.Of(),
- GetEventDebouncer(config),
- version,
+ Mock.Of(),
+ GetEventDebouncer(config),
+ version,
config,
metadata,
new List
@@ -120,8 +120,8 @@ private ControlConnection NewInstance(
private IProtocolEventDebouncer GetEventDebouncer(Configuration config)
{
return new ProtocolEventDebouncer(
- new TaskBasedTimerFactory(),
- TimeSpan.FromMilliseconds(config.MetadataSyncOptions.RefreshSchemaDelayIncrement),
+ new TaskBasedTimerFactory(),
+ TimeSpan.FromMilliseconds(config.MetadataSyncOptions.RefreshSchemaDelayIncrement),
TimeSpan.FromMilliseconds(config.MetadataSyncOptions.MaxTotalRefreshSchemaDelay));
}
}
diff --git a/src/Cassandra.IntegrationTests/Core/CustomPayloadTests.cs b/src/Cassandra.IntegrationTests/Core/CustomPayloadTests.cs
index 6553a97f4..3128a7e01 100644
--- a/src/Cassandra.IntegrationTests/Core/CustomPayloadTests.cs
+++ b/src/Cassandra.IntegrationTests/Core/CustomPayloadTests.cs
@@ -43,7 +43,7 @@ public void SetupFixture()
}
//Using a mirroring handler, the server will reply providing the same payload that was sent
- var jvmArgs = new [] { "-Dcassandra.custom_query_handler_class=org.apache.cassandra.cql3.CustomPayloadMirroringQueryHandler" };
+ var jvmArgs = new[] { "-Dcassandra.custom_query_handler_class=org.apache.cassandra.cql3.CustomPayloadMirroringQueryHandler" };
var testCluster = TestClusterManager.GetTestCluster(1, 0, false, DefaultMaxClusterCreateRetries, true, true, 0, jvmArgs);
Session = testCluster.Session;
Session.Execute(string.Format(TestUtils.CreateKeyspaceSimpleFormat, Keyspace, 1));
@@ -96,7 +96,7 @@ public void Prepare_Payload_Test()
{
var outgoing = new Dictionary
{
- { "k1-prep", Encoding.UTF8.GetBytes("value1-prep") },
+ { "k1-prep", Encoding.UTF8.GetBytes("value1-prep") },
{ "k2-prep", Encoding.UTF8.GetBytes("value2-prep") }
};
var prepared = Session.Prepare("SELECT key as k FROM system.local WHERE key = ?", outgoing);
diff --git a/src/Cassandra.IntegrationTests/Core/EmptyColumnTests.cs b/src/Cassandra.IntegrationTests/Core/EmptyColumnTests.cs
index 79141f47e..2d59c14df 100644
--- a/src/Cassandra.IntegrationTests/Core/EmptyColumnTests.cs
+++ b/src/Cassandra.IntegrationTests/Core/EmptyColumnTests.cs
@@ -40,9 +40,9 @@ public void Should_ReturnCorrectValue_When_EmptyColumnNameAndSchemaParserV2()
simulacronCluster.PrimeSystemSchemaTablesV2(
"testks",
"testtable",
- new[]
- {
- new StubTableColumn("", StubColumnKind.PartitionKey, DataType.GetDataType(typeof(string))),
+ new[]
+ {
+ new StubTableColumn("", StubColumnKind.PartitionKey, DataType.GetDataType(typeof(string))),
new StubTableColumn(" ", StubColumnKind.ClusteringKey, DataType.GetDataType(typeof(string)))
});
@@ -104,9 +104,9 @@ public void Should_ReturnCorrectValue_When_EmptyColumnNameAndSchemaParserV1()
simulacronCluster.PrimeSystemSchemaTablesV1(
"testks",
"testtable",
- new[]
- {
- new StubTableColumn("", StubColumnKind.PartitionKey, DataType.GetDataType(typeof(string))),
+ new[]
+ {
+ new StubTableColumn("", StubColumnKind.PartitionKey, DataType.GetDataType(typeof(string))),
new StubTableColumn(" ", StubColumnKind.ClusteringKey, DataType.GetDataType(typeof(string)))
});
diff --git a/src/Cassandra.IntegrationTests/Core/ExceptionsTests.cs b/src/Cassandra.IntegrationTests/Core/ExceptionsTests.cs
index 644a9da36..98225b404 100644
--- a/src/Cassandra.IntegrationTests/Core/ExceptionsTests.cs
+++ b/src/Cassandra.IntegrationTests/Core/ExceptionsTests.cs
@@ -63,16 +63,16 @@ public void TearDown()
public void AlreadyExistsException()
{
var cql = string.Format(TestUtils.CreateKeyspaceSimpleFormat, _keyspace, 1);
-
+
_simulacronCluster.PrimeFluent(b => b.WhenQuery(cql).ThenAlreadyExists(_keyspace, ""));
var ex = Assert.Throws(() => _session.Execute(cql));
Assert.AreEqual(ex.Keyspace, _keyspace);
Assert.AreEqual(ex.Table, null);
Assert.AreEqual(ex.WasTableCreation, false);
-
+
var cqlTable = string.Format(TestUtils.CreateTableSimpleFormat, _table);
-
+
_simulacronCluster.PrimeFluent(b => b.WhenQuery(cqlTable).ThenAlreadyExists(_keyspace, _table));
var e = Assert.Throws(() => _session.Execute(cqlTable));
Assert.AreEqual(e.Keyspace, _keyspace);
@@ -88,7 +88,7 @@ public void AlreadyExistsException()
public void NoHostAvailableException()
{
const string ipAddress = "255.255.255.255";
- var errorsHashMap = new Dictionary {{IPAddress.Parse(ipAddress), null}};
+ var errorsHashMap = new Dictionary { { IPAddress.Parse(ipAddress), null } };
try
{
@@ -322,7 +322,7 @@ public void ReadFailureExceptionTest(ConsistencyLevel consistencyLevel, int rece
_simulacronCluster
.PrimeFluent(b => b.WhenQuery(cql).ThenReadFailure(
- (int) consistencyLevel,
+ (int)consistencyLevel,
received,
required,
"read_failure",
diff --git a/src/Cassandra.IntegrationTests/Core/HeartbeatTests.cs b/src/Cassandra.IntegrationTests/Core/HeartbeatTests.cs
index 1c18b38fc..273ffb57a 100644
--- a/src/Cassandra.IntegrationTests/Core/HeartbeatTests.cs
+++ b/src/Cassandra.IntegrationTests/Core/HeartbeatTests.cs
@@ -34,7 +34,7 @@ public class HeartbeatTests : TestGlobals
[OneTimeSetUp]
public void OneTimeSetup()
{
- _testCluster = SimulacronCluster.CreateNew(new SimulacronOptions { Nodes = "1"});
+ _testCluster = SimulacronCluster.CreateNew(new SimulacronOptions { Nodes = "1" });
_testCluster.PrimeFluent(b => b.WhenQuery(HeartbeatTests.Query).ThenVoidSuccess());
}
@@ -71,7 +71,7 @@ await TestHelper.RetryAssertAsync(
logs = await _testCluster.GetNodes().First()
.GetQueriesAsync(null, OptionsQueryType).ConfigureAwait(false);
Assert.That(logs.Count, Is.GreaterThan(initialCount));
- },
+ },
500,
20).ConfigureAwait(false);
}
diff --git a/src/Cassandra.IntegrationTests/Core/LargeDataTests.cs b/src/Cassandra.IntegrationTests/Core/LargeDataTests.cs
index 77c0f46d4..7be40d713 100644
--- a/src/Cassandra.IntegrationTests/Core/LargeDataTests.cs
+++ b/src/Cassandra.IntegrationTests/Core/LargeDataTests.cs
@@ -32,7 +32,7 @@ public class LargeDataTests : TestGlobals
{
private const int Key = 0;
private const string KeyspaceNameDefault = "largedatatests";
- ISession _session = null;
+ ISession _session = null;
[SetUp]
public void SetupFixture()
diff --git a/src/Cassandra.IntegrationTests/Core/MetadataTests.cs b/src/Cassandra.IntegrationTests/Core/MetadataTests.cs
index 31d5d87ae..19d82ae97 100644
--- a/src/Cassandra.IntegrationTests/Core/MetadataTests.cs
+++ b/src/Cassandra.IntegrationTests/Core/MetadataTests.cs
@@ -47,7 +47,7 @@ public void KeyspacesMetadataUpToDateViaCassandraEvents()
Assert.Greater(initialLength, 0);
//GetReplicas should yield the primary replica when the Keyspace is not found
- Assert.AreEqual(1, cluster.GetReplicas("ks2", new byte[] {0, 0, 0, 1}).Count);
+ Assert.AreEqual(1, cluster.GetReplicas("ks2", new byte[] { 0, 0, 0, 1 }).Count);
const string createKeyspaceQuery = "CREATE KEYSPACE {0} WITH replication = {{ 'class' : '{1}', {2} }}";
session.Execute(string.Format(createKeyspaceQuery, "ks1", "SimpleStrategy", "'replication_factor' : 1"));
@@ -64,7 +64,7 @@ public void KeyspacesMetadataUpToDateViaCassandraEvents()
Assert.NotNull(ks2);
Assert.AreEqual(ks2.Replication["replication_factor"], 3);
//GetReplicas should yield the 2 replicas (rf=3 but cluster=2) when the Keyspace is found
- Assert.AreEqual(2, cluster.GetReplicas("ks2", new byte[] {0, 0, 0, 1}).Count);
+ Assert.AreEqual(2, cluster.GetReplicas("ks2", new byte[] { 0, 0, 0, 1 }).Count);
var ks3 = cluster.Metadata.GetKeyspace("ks3");
Assert.NotNull(ks3);
Assert.AreEqual(ks3.Replication["dc1"], 1);
@@ -291,7 +291,7 @@ public void CheckNetworkTopologyStrategyKeyspace()
string strategyClass = ReplicationStrategies.NetworkTopologyStrategy;
int dataCentersCount = Randomm.Instance.Next(1, 11);
- datacentersReplicationFactors = new Dictionary((int) dataCentersCount);
+ datacentersReplicationFactors = new Dictionary((int)dataCentersCount);
for (int i = 0; i < dataCentersCount; i++)
datacentersReplicationFactors.Add("dc" + i, Randomm.Instance.Next(1, 21));
session.CreateKeyspace(keyspaceName,
@@ -481,7 +481,7 @@ public void TableMetadata_With_Compact_Storage()
CollectionAssert.AreEqual(new[] { "id1" }, table.PartitionKeys.Select(c => c.Name));
CollectionAssert.AreEqual(new[] { "id2" }, table.ClusteringKeys.Select(c => c.Item1.Name));
CollectionAssert.AreEqual(new[] { SortOrder.Ascending }, table.ClusteringKeys.Select(c => c.Item2));
-
+
table = cluster.Metadata
.GetKeyspace("ks_meta_compac")
.GetTableMetadata("tbl6");
@@ -570,7 +570,7 @@ public void GetMaterializedView_Should_Retrieve_View_Metadata()
{
session.Execute(q);
}
-
+
var ks = cluster.Metadata.GetKeyspace("ks_view_meta");
Assert.NotNull(ks);
var view = ks.GetMaterializedViewMetadata("dailyhigh");
@@ -586,13 +586,13 @@ public void GetMaterializedView_Should_Retrieve_View_Metadata()
view.WhereClause);
Assert.AreEqual(6, view.TableColumns.Length);
- Assert.AreEqual(new[] { "ks_view_meta", "ks_view_meta", "ks_view_meta", "ks_view_meta", "ks_view_meta", "ks_view_meta" },
+ Assert.AreEqual(new[] { "ks_view_meta", "ks_view_meta", "ks_view_meta", "ks_view_meta", "ks_view_meta", "ks_view_meta" },
view.TableColumns.Select(c => c.Keyspace));
Assert.AreEqual(new[] { "dailyhigh", "dailyhigh", "dailyhigh", "dailyhigh", "dailyhigh", "dailyhigh" },
view.TableColumns.Select(c => c.Table));
Assert.AreEqual(new[] { "day", "game", "month", "score", "user", "year" }, view.TableColumns.Select(c => c.Name));
- Assert.AreEqual(new[] { ColumnTypeCode.Int, ColumnTypeCode.Varchar, ColumnTypeCode.Int, ColumnTypeCode.Int, ColumnTypeCode.Varchar,
+ Assert.AreEqual(new[] { ColumnTypeCode.Int, ColumnTypeCode.Varchar, ColumnTypeCode.Int, ColumnTypeCode.Int, ColumnTypeCode.Varchar,
ColumnTypeCode.Int }, view.TableColumns.Select(c => c.TypeCode));
Assert.AreEqual(new[] { "game", "year", "month", "day" }, view.PartitionKeys.Select(c => c.Name));
Assert.AreEqual(new[] { "score", "user" }, view.ClusteringKeys.Select(c => c.Item1.Name));
diff --git a/src/Cassandra.IntegrationTests/Core/MultiThreadingTests.cs b/src/Cassandra.IntegrationTests/Core/MultiThreadingTests.cs
index e2afeaee7..75421467c 100644
--- a/src/Cassandra.IntegrationTests/Core/MultiThreadingTests.cs
+++ b/src/Cassandra.IntegrationTests/Core/MultiThreadingTests.cs
@@ -105,8 +105,8 @@ public void ParallelInsertTest()
ar[i] = localSession.BeginExecute(string.Format(@"
INSERT INTO {0} (tweet_id, author, isok, body)
- VALUES ({1},'test{2}',{3},'body{2}');",
- tableName, Guid.NewGuid(), i, i%2 == 0 ? "false" : "true"), ConsistencyLevel.One, null, null);
+ VALUES ({1},'test{2}',{3},'body{2}');",
+ tableName, Guid.NewGuid(), i, i % 2 == 0 ? "false" : "true"), ConsistencyLevel.One, null, null);
Interlocked.MemoryBarrier();
}
catch
@@ -196,7 +196,7 @@ public void InsertFireAndForget()
var taskList = new List>();
for (var i = 0; i < rowLength; i++)
{
- taskList.Add(localSession.ExecuteAsync(insertStatement.Bind(Guid.NewGuid(), new byte[1024*rnd.Next(10)])));
+ taskList.Add(localSession.ExecuteAsync(insertStatement.Bind(Guid.NewGuid(), new byte[1024 * rnd.Next(10)])));
}
var taskArray = taskList.ToArray();
@@ -234,7 +234,7 @@ public void MassiveAsyncTest()
localSession.ChangeKeyspace(keyspaceName);
string tableName = "table" + Randomm.RandomAlphaNum(8);
-
+
localSession.Execute(string.Format(@"CREATE TABLE {0}(
tweet_id uuid,
author text,
@@ -254,7 +254,7 @@ public void MassiveAsyncTest()
author,
isok,
body)
- VALUES ({1},'test{2}',{3},'body{2}');", tableName, Guid.NewGuid(), i, i%2 == 0 ? "false" : "true")
+ VALUES ({1},'test{2}',{3},'body{2}');", tableName, Guid.NewGuid(), i, i % 2 == 0 ? "false" : "true")
, ConsistencyLevel.One, _ =>
{
ar[tmpi] = true;
@@ -321,8 +321,8 @@ public void ShutdownAsyncTest()
int tmpi = i;
try
{
- var query = string.Format(@"INSERT INTO {0} (tweet_id, author, isok, body) VALUES ({1},'test{2}',{3},'body{2}');",
- tableName, Guid.NewGuid(), i, i%2 == 0 ? "false" : "true");
+ var query = string.Format(@"INSERT INTO {0} (tweet_id, author, isok, body) VALUES ({1},'test{2}',{3},'body{2}');",
+ tableName, Guid.NewGuid(), i, i % 2 == 0 ? "false" : "true");
localSession.BeginExecute(query, ConsistencyLevel.Quorum, arx =>
{
try
diff --git a/src/Cassandra.IntegrationTests/Core/PagingTests.cs b/src/Cassandra.IntegrationTests/Core/PagingTests.cs
index 2bdf05a8e..ef02680e3 100644
--- a/src/Cassandra.IntegrationTests/Core/PagingTests.cs
+++ b/src/Cassandra.IntegrationTests/Core/PagingTests.cs
@@ -162,16 +162,16 @@ public void Should_PagingOnBoundStatement_When_NewResultMetadataIsSet()
Assert.AreNotSame(previousResultMetadata, ps.ResultMetadata);
Assert.AreNotEqual(previousResultMetadata.ResultMetadataId, ps.ResultMetadata.ResultMetadataId);
Assert.AreEqual(3, ps.ResultMetadata.RowSetMetadata.Columns.Length);
-
+
rs = Session.Execute(boundStatementManualPaging.SetPagingState(rs.PagingState));
var thirdPage = rs.ToList();
-
+
var allRowsAfterAlter = Session.Execute(ps.Bind()).ToList();
Assert.AreEqual(totalRowLength, allRowsAfterAlter.Count);
Assert.AreEqual(pageSize, firstPage.Count);
Assert.AreEqual(pageSize, secondPage.Count);
- Assert.AreEqual(totalRowLength-(pageSize*2), thirdPage.Count);
+ Assert.AreEqual(totalRowLength - (pageSize * 2), thirdPage.Count);
Assert.IsTrue(firstPage.All(r => !r.ContainsColumn("new_column")));
Assert.IsTrue(secondPage.All(r => r.ContainsColumn("new_column") && r.GetValue("new_column") == null));
diff --git a/src/Cassandra.IntegrationTests/Core/ParameterizedStatementsTests.cs b/src/Cassandra.IntegrationTests/Core/ParameterizedStatementsTests.cs
index bf767ddd4..630f3b3f1 100644
--- a/src/Cassandra.IntegrationTests/Core/ParameterizedStatementsTests.cs
+++ b/src/Cassandra.IntegrationTests/Core/ParameterizedStatementsTests.cs
@@ -295,7 +295,7 @@ public void SimpleStatementNamedValuesCaseInsensitivity()
Session.Execute(
new SimpleStatement(
insertQuery,
- new { my_INt = 1, my_TEXT = "WAT1", my_id = id}));
+ new { my_INt = 1, my_TEXT = "WAT1", my_id = id }));
var row = Session.Execute(string.Format("SELECT * FROM {0} WHERE id = {1:D}", AllTypesTableName, id)).First();
Assert.AreEqual(1, row.GetValue("int_sample"));
@@ -310,7 +310,7 @@ public void SimpleStatementNamedValuesNotSpecified()
Assert.Throws(() => Session.Execute(
new SimpleStatement(insertQuery,
- new {id = Guid.NewGuid(), my_bigint = 1L })));
+ new { id = Guid.NewGuid(), my_bigint = 1L })));
}
[Test]
@@ -341,7 +341,7 @@ public void SimpleStatementTinyIntTests()
foreach (var v in values)
{
var insert = new SimpleStatement("INSERT INTO tbl_tinyint_param (id, v, m) VALUES (?, ?, ?)",
- Convert.ToInt32(v), v, new SortedDictionary { { v, v.ToString()} });
+ Convert.ToInt32(v), v, new SortedDictionary { { v, v.ToString() } });
var select = new SimpleStatement("SELECT * FROM tbl_tinyint_param WHERE id = ?", Convert.ToInt32(v));
Session.Execute(insert);
var rs = Session.Execute(select).ToList();
@@ -535,7 +535,7 @@ public void SimpleStatement_With_Keyspace_Defined_On_Protocol_Greater_Than_4()
}
[Test]
- [TestBothServersVersion(4, 0, 5,1, Comparison.LessThan)]
+ [TestBothServersVersion(4, 0, 5, 1, Comparison.LessThan)]
public void SimpleStatement_With_Keyspace_Defined_On_Lower_Protocol_Versions()
{
// It should fail as the keyspace from the session will be used
diff --git a/src/Cassandra.IntegrationTests/Core/PoolShortTests.cs b/src/Cassandra.IntegrationTests/Core/PoolShortTests.cs
index 4b3d5d2d8..bf423c916 100644
--- a/src/Cassandra.IntegrationTests/Core/PoolShortTests.cs
+++ b/src/Cassandra.IntegrationTests/Core/PoolShortTests.cs
@@ -308,7 +308,7 @@ public async Task Should_Create_Core_Connections_To_Hosts_In_Local_Dc_When_Warmu
}
}
}
-
+
[Test]
public async Task ControlConnection_Should_Reconnect_To_Up_Host()
{
@@ -654,9 +654,9 @@ await TestHelper.RetryAssertAsync(async () =>
connections = await simulacronNode.GetConnectionsAsync().ConfigureAwait(false);
Assert.AreEqual(1, connections.Count);
}, 100, 200).ConfigureAwait(false);
-
+
await testCluster.DropConnection(connections[0]).ConfigureAwait(false);
-
+
await TestHelper.RetryAssertAsync(async () =>
{
connections = await simulacronNode.GetConnectionsAsync().ConfigureAwait(false);
diff --git a/src/Cassandra.IntegrationTests/Core/PoolTests.cs b/src/Cassandra.IntegrationTests/Core/PoolTests.cs
index fd50c0ffd..83972765e 100644
--- a/src/Cassandra.IntegrationTests/Core/PoolTests.cs
+++ b/src/Cassandra.IntegrationTests/Core/PoolTests.cs
@@ -281,7 +281,7 @@ public void AddressTranslatorIsCalledPerEachPeer()
Thread.Sleep(30000);
//Should be down
Assert.False(cluster.AllHosts().First(h => TestHelper.GetLastAddressByte(h) == 3).IsUp);
-
+
//Should have been translated
Assert.AreEqual(3, invokedEndPoints.Count);
//The recently translated should be the host #3
diff --git a/src/Cassandra.IntegrationTests/Core/PrepareSimulatorTests.cs b/src/Cassandra.IntegrationTests/Core/PrepareSimulatorTests.cs
index cdd74864b..8de7eb24b 100644
--- a/src/Cassandra.IntegrationTests/Core/PrepareSimulatorTests.cs
+++ b/src/Cassandra.IntegrationTests/Core/PrepareSimulatorTests.cs
@@ -34,7 +34,7 @@ public class PrepareSimulatorTests : TestGlobals
{
private const string Keyspace = "ks1";
private static readonly string Query = $"SELECT * FROM {PrepareSimulatorTests.Keyspace}.prepare_table1";
-
+
private static readonly string QueryWithoutKeyspace = $"SELECT * FROM prepare_table1";
private static IPrimeRequest QueryPrime(int delay = 0)
@@ -46,7 +46,7 @@ private static IPrimeRequest QueryPrime(int delay = 0)
.WithDelayInMs(delay)
.BuildRequest();
}
-
+
private static IPrimeRequest QueryWithoutKeyspacePrime(int delay = 0)
{
return SimulacronBase
@@ -221,7 +221,7 @@ public async Task Should_Reprepare_On_Up_Node()
Assert.AreEqual(2, node.GetQueries(Query, QueryType.Prepare).Count);
}
}
-
+
[Test]
public async Task Should_ReprepareOnUpNodeAfterSetKeyspace_With_SessionKeyspace()
{
@@ -250,7 +250,7 @@ public async Task Should_ReprepareOnUpNodeAfterSetKeyspace_With_SessionKeyspace(
await node.Stop().ConfigureAwait(false);
await TestHelper.WaitUntilAsync(() => cluster.AllHosts().Any(h => !h.IsUp)).ConfigureAwait(false);
Assert.AreEqual(1, cluster.AllHosts().Count(h => !h.IsUp));
-
+
// still only 1 USE and Prepare requests
Assert.AreEqual(1, node.GetQueries($"USE \"{PrepareSimulatorTests.Keyspace}\"").Count);
Assert.AreEqual(1, node.GetQueries(PrepareSimulatorTests.QueryWithoutKeyspace, QueryType.Prepare).Count);
@@ -264,10 +264,10 @@ public async Task Should_ReprepareOnUpNodeAfterSetKeyspace_With_SessionKeyspace(
Assert.AreEqual(0, cluster.AllHosts().Count(h => !h.IsUp));
// wait until driver reprepares the statement
- TestHelper.WaitUntil(() =>
+ TestHelper.WaitUntil(() =>
node.GetQueries(PrepareSimulatorTests.QueryWithoutKeyspace, QueryType.Prepare).Count == 2
&& node.GetQueries(PrepareSimulatorTests.Query, QueryType.Prepare).Count == 2);
-
+
// It should be prepared 2 times
Assert.AreEqual(2, node.GetQueries(PrepareSimulatorTests.QueryWithoutKeyspace, QueryType.Prepare).Count);
Assert.AreEqual(2, node.GetQueries(PrepareSimulatorTests.Query, QueryType.Prepare).Count);
@@ -284,11 +284,11 @@ public async Task Should_ReprepareOnUpNodeAfterSetKeyspace_With_SessionKeyspace(
Assert.AreEqual(PrepareSimulatorTests.Query, relevantQueries[2].Query);
Assert.AreEqual($"USE \"{PrepareSimulatorTests.Keyspace}\"", relevantQueries[3].Query);
CollectionAssert.AreEquivalent(
- new []
+ new[]
{
PrepareSimulatorTests.QueryWithoutKeyspace,
PrepareSimulatorTests.Query
- },
+ },
relevantQueries.Skip(4).Select(q => q.Query));
}
}
diff --git a/src/Cassandra.IntegrationTests/Core/PreparedStatementsTests.cs b/src/Cassandra.IntegrationTests/Core/PreparedStatementsTests.cs
index 5d03c2e5d..f871b679d 100644
--- a/src/Cassandra.IntegrationTests/Core/PreparedStatementsTests.cs
+++ b/src/Cassandra.IntegrationTests/Core/PreparedStatementsTests.cs
@@ -75,7 +75,7 @@ public override void OneTimeSetUp()
Session.Execute(string.Format(TestUtils.CreateTableAllTypes, AllTypesTableName));
CreateTable(_tableName);
}
-
+
[Test]
public void Bound_AllSingleTypesDifferentValues()
{
@@ -86,21 +86,21 @@ INSERT INTO {0}
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", AllTypesTableName);
var preparedStatement = Session.Prepare(insertQuery);
- CollectionAssert.AreEqual(new[] {0}, preparedStatement.RoutingIndexes);
-
- var firstRowValues = new object[]
- {
- Guid.NewGuid(), "first", 10, Int64.MaxValue - 1, 1.999F, 32.002D, 1.101010M,
+ CollectionAssert.AreEqual(new[] { 0 }, preparedStatement.RoutingIndexes);
+
+ var firstRowValues = new object[]
+ {
+ Guid.NewGuid(), "first", 10, Int64.MaxValue - 1, 1.999F, 32.002D, 1.101010M,
new byte[] {255, 255}, true, new DateTimeOffset(new DateTime(2005, 8, 5)), new IPAddress(new byte[] {192, 168, 0, 100})
};
- var secondRowValues = new object[]
- {
- Guid.NewGuid(), "second", 0, 0L, 0F, 0D, 0M,
+ var secondRowValues = new object[]
+ {
+ Guid.NewGuid(), "second", 0, 0L, 0F, 0D, 0M,
new byte[] {0, 0}, true, new DateTimeOffset(new DateTime(1970, 9, 18)), new IPAddress(new byte[] {0, 0, 0, 0})
};
- var thirdRowValues = new object[]
- {
- Guid.NewGuid(), "third", -100, Int64.MinValue + 1, -150.111F, -5.12342D, -8.101010M,
+ var thirdRowValues = new object[]
+ {
+ Guid.NewGuid(), "third", -100, Int64.MinValue + 1, -150.111F, -5.12342D, -8.101010M,
new byte[] {1, 1}, true, new DateTimeOffset(new DateTime(1543, 5, 24)), new IPAddress(new byte[] {255, 128, 12, 1, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255})
};
@@ -116,7 +116,7 @@ INSERT INTO {0}
var rowList = Session.Execute(selectQuery).ToList();
//Check that they were inserted and retrieved
Assert.AreEqual(3, rowList.Count);
-
+
//Create a dictionary with the inserted values to compare with the retrieved values
var insertedValues = new Dictionary()
{
@@ -128,7 +128,7 @@ INSERT INTO {0}
foreach (var retrievedRow in rowList)
{
var inserted = insertedValues[retrievedRow.GetValue("id")];
- for (var i = 0; i < inserted.Length; i++ )
+ for (var i = 0; i < inserted.Length; i++)
{
var insertedValue = inserted[i];
var retrievedValue = retrievedRow[i];
@@ -149,8 +149,8 @@ INSERT INTO {0}
var preparedStatement = Session.Prepare(insertQuery);
Assert.AreEqual(columns, String.Join(", ", preparedStatement.Variables.Columns.Select(c => c.Name)));
- var nullRowValues = new object[]
- {
+ var nullRowValues = new object[]
+ {
Guid.NewGuid(), null, null, null, null, null, null, null, null, null, null
};
@@ -174,8 +174,8 @@ INSERT INTO {0}
var preparedStatement = Session.Prepare(insertQuery);
Assert.AreEqual(columns, String.Join(", ", preparedStatement.Variables.Columns.Select(c => c.Name)));
- var nullRowValues = new object[]
- {
+ var nullRowValues = new object[]
+ {
Guid.NewGuid(), ""
};
@@ -335,22 +335,22 @@ public void Bound_Unset_Values_Tests()
// initial condition
Session.Execute(insert.Bind(0, 0, 0));
- Check_Expected(select, new object[] {0, 0, 0});
+ Check_Expected(select, new object[] { 0, 0, 0 });
// explicit unset
Session.Execute(insert.Bind(0, 1, Unset.Value));
- Check_Expected(select, new object[] {0, 1, 0});
+ Check_Expected(select, new object[] { 0, 1, 0 });
Session.Execute(insert.Bind(0, Unset.Value, 2));
- Check_Expected(select, new object[] {0, 1, 2});
-
- Session.Execute(insert.Bind(new {k = 0, v0 = 3, v1 = Unset.Value}));
- Check_Expected(select, new object[] {0, 3, 2});
- Session.Execute(insert.Bind(new {k = 0, v0 = Unset.Value, v1 = 4}));
- Check_Expected(select, new object[] {0, 3, 4});
+ Check_Expected(select, new object[] { 0, 1, 2 });
+
+ Session.Execute(insert.Bind(new { k = 0, v0 = 3, v1 = Unset.Value }));
+ Check_Expected(select, new object[] { 0, 3, 2 });
+ Session.Execute(insert.Bind(new { k = 0, v0 = Unset.Value, v1 = 4 }));
+ Check_Expected(select, new object[] { 0, 3, 4 });
// nulls still work
Session.Execute(insert.Bind(0, null, null));
- Check_Expected(select, new object[] {0, null, null});
+ Check_Expected(select, new object[] { 0, null, null });
// PKs cannot be UNSET
Assert.Throws(Is.InstanceOf(), () => Session.Execute(insert.Bind(Unset.Value, 0, 0)));
@@ -369,23 +369,23 @@ INSERT INTO {0}
var preparedStatement = Session.Prepare(insertQuery);
CollectionAssert.AreEqual(new[] { 0 }, preparedStatement.RoutingIndexes);
- var firstRowValues = new object[]
- {
- Guid.NewGuid(),
+ var firstRowValues = new object[]
+ {
+ Guid.NewGuid(),
new Dictionary {{"key1", "value1"}, {"key2", "value2"}},
new List (new [] {"one", "two", "three", "four", "five"}),
new List (new [] {"set_1one", "set_2two", "set_3three", "set_4four", "set_5five"})
};
- var secondRowValues = new object[]
- {
- Guid.NewGuid(),
+ var secondRowValues = new object[]
+ {
+ Guid.NewGuid(),
new Dictionary(),
new List(),
new List()
};
- var thirdRowValues = new object[]
- {
- Guid.NewGuid(),
+ var thirdRowValues = new object[]
+ {
+ Guid.NewGuid(),
null,
null,
null
@@ -426,7 +426,7 @@ INSERT INTO {0}
}
if (insertedValue != null)
{
- Assert.AreEqual(((ICollection) insertedValue).Count, ((ICollection) retrievedValue).Count);
+ Assert.AreEqual(((ICollection)insertedValue).Count, ((ICollection)retrievedValue).Count);
}
Assert.AreEqual(insertedValue, retrievedValue);
}
@@ -465,7 +465,7 @@ public void Bound_NamedParamsOrder()
if (TestClusterManager.CheckCassandraVersion(false, new Version(2, 2), Comparison.LessThan))
{
//For older versions, there is no way to determine that my_id is actually id column
- Assert.Null(preparedStatement.RoutingIndexes);
+ Assert.Null(preparedStatement.RoutingIndexes);
}
Assert.AreEqual(preparedStatement.Variables.Columns.Length, 4);
Assert.AreEqual("my_text, my_int, my_bigint, my_id", String.Join(", ", preparedStatement.Variables.Columns.Select(c => c.Name)));
@@ -477,7 +477,7 @@ public void Bound_NamedParameters()
{
var insertQuery = string.Format("INSERT INTO {0} (text_sample, int_sample, bigint_sample, id) VALUES (:my_text, :my_int, :my_bigint, :id)", AllTypesTableName);
var preparedStatement = Session.Prepare(insertQuery);
- CollectionAssert.AreEqual(new [] {3}, preparedStatement.RoutingIndexes);
+ CollectionAssert.AreEqual(new[] { 3 }, preparedStatement.RoutingIndexes);
Assert.AreEqual(preparedStatement.Variables.Columns.Length, 4);
Assert.AreEqual("my_text, my_int, my_bigint, id", String.Join(", ", preparedStatement.Variables.Columns.Select(c => c.Name)));
@@ -503,7 +503,7 @@ public void Bound_NamedParameters_Nulls()
var id = Guid.NewGuid();
Session.Execute(
preparedStatement.Bind(
- new {my_bigint = (long?)null, my_int = 100, my_id = id}));
+ new { my_bigint = (long?)null, my_int = 100, my_id = id }));
var row = Session.Execute(string.Format("SELECT int_sample, bigint_sample, text_sample FROM {0} WHERE id = {1:D}", AllTypesTableName, id)).First();
@@ -755,10 +755,10 @@ public void Bound_With_Named_Parameters_Routing_Key()
var ps = Session.Prepare("SELECT * FROM tbl_ps_multiple_pk_named WHERE a = :a AND b = :b AND c = :ce");
//Parameters at position 1 and 0 are part of the routing key
CollectionAssert.AreEqual(new[] { 0, 1 }, ps.RoutingIndexes);
- var anon = new {ce = "hello ce2", a = "aValue1", b = "bValue1"};
+ var anon = new { ce = "hello ce2", a = "aValue1", b = "bValue1" };
var statement = ps.Bind(anon);
Assert.NotNull(statement.RoutingKey);
- CollectionAssert.AreEqual(calculateKey(anon.a, anon.b), statement.RoutingKey.RawRoutingKey);
+ CollectionAssert.AreEqual(calculateKey(anon.a, anon.b), statement.RoutingKey.RawRoutingKey);
//Now with another parameters
anon = new { ce = "hello ce2", a = "aValue2", b = "bValue2" };
statement = ps.Bind(anon);
@@ -854,7 +854,7 @@ public void Bound_TinyInt_Tests()
[TestCase(true)]
[TestCase(false)]
- [TestBothServersVersion(4,0,5,1)]
+ [TestBothServersVersion(4, 0, 5, 1)]
public void Session_Prepare_With_Keyspace_Defined_On_Protocol_Greater_Than_4(bool usePayload)
{
if (Session.Cluster.Metadata.ControlConnection.Serializer.CurrentProtocolVersion < ProtocolVersion.V5)
@@ -872,7 +872,7 @@ public void Session_Prepare_With_Keyspace_Defined_On_Protocol_Greater_Than_4(boo
else
{
ps = Session.Prepare("SELECT key FROM local", "system",
- new Dictionary {{"a", new byte[] {0, 0, 0, 1}}});
+ new Dictionary { { "a", new byte[] { 0, 0, 0, 1 } } });
}
Assert.AreEqual("system", ps.Keyspace);
@@ -887,7 +887,7 @@ public void Session_Prepare_With_Keyspace_Defined_On_Protocol_Greater_Than_4(boo
[TestCase(true)]
[TestCase(false)]
- [TestBothServersVersion(4,0,5,1)]
+ [TestBothServersVersion(4, 0, 5, 1)]
public async Task Session_PrepareAsync_With_Keyspace_Defined_On_Protocol_Greater_Than_4(bool usePayload)
{
if (Session.Cluster.Metadata.ControlConnection.Serializer.CurrentProtocolVersion < ProtocolVersion.V5)
@@ -905,7 +905,7 @@ public async Task Session_PrepareAsync_With_Keyspace_Defined_On_Protocol_Greater
else
{
ps = await Session.PrepareAsync("SELECT key FROM local", "system",
- new Dictionary {{"a", new byte[] {0, 0, 0, 1}}}).ConfigureAwait(false);
+ new Dictionary { { "a", new byte[] { 0, 0, 0, 1 } } }).ConfigureAwait(false);
}
Assert.AreEqual("system", ps.Keyspace);
@@ -920,14 +920,14 @@ await TestHelper.TimesLimit(async () =>
}
[Test]
- [TestBothServersVersion(4,0,5,1)]
+ [TestBothServersVersion(4, 0, 5, 1)]
public void Session_Prepare_With_Keyspace_Defined_On_Protocol_V4()
{
TestKeyspaceInPrepareNotSupported(true);
}
[Test]
- [TestBothServersVersion(4, 0, 5,1, Comparison.LessThan)]
+ [TestBothServersVersion(4, 0, 5, 1, Comparison.LessThan)]
public void Session_Prepare_With_Keyspace_Defined_On_Previuos_Cassandra_Versions()
{
TestKeyspaceInPrepareNotSupported(false);
@@ -935,12 +935,13 @@ public void Session_Prepare_With_Keyspace_Defined_On_Previuos_Cassandra_Versions
private void TestKeyspaceInPrepareNotSupported(bool specifyProtocol)
{
- using (var cluster = GetNewTemporaryCluster(builder => {
- if (specifyProtocol)
- {
- builder.WithMaxProtocolVersion(ProtocolVersion.V4);
- }
- }))
+ using (var cluster = GetNewTemporaryCluster(builder =>
+ {
+ if (specifyProtocol)
+ {
+ builder.WithMaxProtocolVersion(ProtocolVersion.V4);
+ }
+ }))
{
var session = cluster.Connect(KeyspaceName);
@@ -1082,7 +1083,7 @@ public void Batch_PreparedStatement_With_Unprepared_Flow()
Assert.AreEqual(Enumerable.Range(1, 4).Select(i => new object[] { i, $"label{i}_u" }), result);
}
}
-
+
[Test]
[TestCassandraVersion(2, 0, Comparison.Equal)]
public void Batch_PreparedStatements_FlagsNotSupportedInC2_0()
@@ -1113,7 +1114,7 @@ public void Batch_PreparedStatements_NotSupportedInC1_2()
}
[Test]
- [TestBothServersVersion(4,0,5,1)]
+ [TestBothServersVersion(4, 0, 5, 1)]
public void BatchStatement_With_Keyspace_Defined_On_Protocol_Greater_Than_4()
{
using (var cluster = ClusterBuilder().AddContactPoint(TestClusterManager.InitialContactPoint).Build())
@@ -1139,7 +1140,7 @@ public void BatchStatement_With_Keyspace_Defined_On_Protocol_Greater_Than_4()
}
[Test]
- [TestBothServersVersion(4, 0, 5,1, Comparison.LessThan)]
+ [TestBothServersVersion(4, 0, 5, 1, Comparison.LessThan)]
public void BatchStatement_With_Keyspace_Defined_On_Lower_Protocol_Versions()
{
using (var cluster = GetNewTemporaryCluster())
@@ -1162,10 +1163,11 @@ public void BatchStatement_With_Keyspace_Defined_On_Lower_Protocol_Versions()
[Test]
public void Should_FailFast_When_PreparedStatementIdChangesOnReprepare()
{
- if (TestClusterManager.CheckCassandraVersion(false, new Version(3, 0, 0), Comparison.GreaterThanOrEqualsTo) &&
+ if (TestClusterManager.CheckCassandraVersion(false, new Version(3, 0, 0), Comparison.GreaterThanOrEqualsTo) &&
TestClusterManager.CheckCassandraVersion(false, new Version(3, 11, 0), Comparison.LessThan))
{
- if (TestClusterManager.CheckCassandraVersion(false, new Version(3, 0, 26), Comparison.GreaterThanOrEqualsTo)) {
+ if (TestClusterManager.CheckCassandraVersion(false, new Version(3, 0, 26), Comparison.GreaterThanOrEqualsTo))
+ {
Assert.Ignore("This test relies on a bug that is fixed in this server version.");
return;
}
@@ -1209,10 +1211,10 @@ public void InsertingSingleValuePrepared(Type tp, object value = null)
var toInsert = new List