public void Counter_LinqAttributes_AttemptInsert() { var table = new Table <PocoWithCounterAttribute>(_session, new MappingConfiguration()); table.Create(); PocoWithCounterAttribute pocoAndLinqAttributesPocos = new PocoWithCounterAttribute() { KeyPart1 = Guid.NewGuid(), KeyPart2 = (decimal)123, }; // Validate Error Message var e = Assert.Throws <InvalidQueryException>(() => table.Insert(pocoAndLinqAttributesPocos).Execute()); string expectedErrMsg = "INSERT statement(s)? are not allowed on counter tables, use UPDATE instead"; StringAssert.IsMatch(expectedErrMsg, e.Message); }
public void Counter_LinqAttributes_AttemptInsert() { var table = new Table<PocoWithCounterAttribute>(_session, new MappingConfiguration()); table.Create(); PocoWithCounterAttribute pocoAndLinqAttributesPocos = new PocoWithCounterAttribute() { KeyPart1 = Guid.NewGuid(), KeyPart2 = (decimal)123, }; // Validate Error Message var e = Assert.Throws<InvalidQueryException>(() => table.Insert(pocoAndLinqAttributesPocos).Execute()); string expectedErrMsg = "INSERT statement(s)? are not allowed on counter tables, use UPDATE instead"; StringAssert.IsMatch(expectedErrMsg, e.Message); }