public void TestUpdateKeyspaceWithMultiDcConfiguration()
        {
            var clusterConnection = cluster.RetrieveClusterConnection();

            var keyspaceName    = TestSchemaUtils.GetRandomKeyspaceName();
            var createdKeyspace = new Keyspace
            {
                Name = keyspaceName,
                ReplicationStrategy = NetworkTopologyReplicationStrategy.Create(new[]
                {
                    new DataCenterReplicationFactor("dc1", 3),
                    new DataCenterReplicationFactor("dc2", 5)
                })
            };

            clusterConnection.AddKeyspace(createdKeyspace);

            createdKeyspace.ReplicationStrategy = NetworkTopologyReplicationStrategy.Create(new[]
            {
                new DataCenterReplicationFactor("dc3", 7)
            });
            clusterConnection.UpdateKeyspace(createdKeyspace);

            var keyspaces      = clusterConnection.RetrieveKeyspaces();
            var actualKeyspace = keyspaces.First(x => x.Name == keyspaceName);

            AssertKeyspacePropertiesEquals(createdKeyspace, actualKeyspace);
        }
        public void TestUpdateKeyspace(bool durableWrites)
        {
            var keyspaceName = Guid.NewGuid().ToString("N");

            cassandraCluster.ActualizeKeyspaces(new[]
            {
                new KeyspaceScheme
                {
                    Name          = keyspaceName,
                    Configuration = new KeyspaceConfiguration
                    {
                        DurableWrites       = durableWrites,
                        ReplicationStrategy = SimpleReplicationStrategy.Create(1),
                        ColumnFamilies      = new[]
                        {
                            new ColumnFamily
                            {
                                Name = "1"
                            },
                            new ColumnFamily
                            {
                                Name = "2"
                            },
                            new ColumnFamily
                            {
                                Name = "3"
                            }
                        }
                    }
                }
            });

            var keyspaces = cassandraCluster.RetrieveClusterConnection().RetrieveKeyspaces().ToArray();

            AssertKeyspacesEquals(new Keyspace
            {
                Name                = keyspaceName,
                DurableWrites       = durableWrites,
                ReplicationStrategy = SimpleReplicationStrategy.Create(1),
                ColumnFamilies      = new Dictionary <string, ColumnFamily>
                {
                    { "1", new ColumnFamily {
                          Name = "1"
                      } },
                    { "2", new ColumnFamily {
                          Name = "2"
                      } },
                    { "3", new ColumnFamily {
                          Name = "3"
                      } }
                }
            }, keyspaces.Single(keyspace1 => keyspace1.Name == keyspaceName));

            cassandraCluster.RetrieveClusterConnection().UpdateKeyspace(new Keyspace
            {
                Name                = keyspaceName,
                DurableWrites       = durableWrites,
                ReplicationStrategy = NetworkTopologyReplicationStrategy.Create(new[] { new DataCenterReplicationFactor("dc1", 3) })
            });

            var keyspace = cassandraCluster.RetrieveClusterConnection().RetrieveKeyspaces().ToArray().Single(keyspace1 => keyspace1.Name == keyspaceName);

            AssertKeyspacesEquals(new Keyspace
            {
                Name                = keyspaceName,
                DurableWrites       = durableWrites,
                ReplicationStrategy = NetworkTopologyReplicationStrategy.Create(new[] { new DataCenterReplicationFactor("dc1", 3) }),
                ColumnFamilies      = new Dictionary <string, ColumnFamily>
                {
                    { "1", new ColumnFamily {
                          Name = "1"
                      } },
                    { "2", new ColumnFamily {
                          Name = "2"
                      } },
                    { "3", new ColumnFamily {
                          Name = "3"
                      } }
                }
            }, keyspace);
        }