public void Insert_MislabledClusteringKey() { string tableName = typeof(PocoWithAdditionalField).Name.ToLower(); string createTableCql = "Create table " + tableName + "(somestring text PRIMARY KEY)"; _session.Execute(createTableCql); var cqlClient = new Mapper(_session, new MappingConfiguration()); PocoWithAdditionalField pocoWithCustomAttributes = new PocoWithAdditionalField(); // Validate expected exception var ex = Assert.Throws <InvalidQueryException>(() => cqlClient.Insert(pocoWithCustomAttributes)); StringAssert.Contains("Unknown identifier someotherstring", ex.Message); }
public void Insert_MislabledClusteringKey() { string tableName = typeof(PocoWithAdditionalField).Name.ToLower(); string createTableCql = "Create table " + tableName + "(somestring text PRIMARY KEY)"; _session.Execute(createTableCql); var cqlClient = new Mapper(_session, new MappingConfiguration()); PocoWithAdditionalField pocoWithCustomAttributes = new PocoWithAdditionalField(); // Validate expected exception var ex = Assert.Throws <InvalidQueryException>(() => cqlClient.Insert(pocoWithCustomAttributes)); var expectedMessage = "Unknown identifier someotherstring"; if (TestClusterManager.CheckCassandraVersion(false, Version.Parse("3.10"), Comparison.GreaterThanOrEqualsTo)) { expectedMessage = "Undefined column name someotherstring"; } StringAssert.Contains(expectedMessage, ex.Message); }
public void Insert_MislabledClusteringKey() { string tableName = typeof(PocoWithAdditionalField).Name.ToLower(); string createTableCql = "Create table " + tableName + "(somestring text PRIMARY KEY)"; _session.Execute(createTableCql); var cqlClient = new Mapper(_session, new MappingConfiguration()); PocoWithAdditionalField pocoWithCustomAttributes = new PocoWithAdditionalField(); // Validate expected exception var ex = Assert.Throws<InvalidQueryException>(() => cqlClient.Insert(pocoWithCustomAttributes)); StringAssert.Contains("Unknown identifier someotherstring", ex.Message); }