public void AutoIncrementExceptions() { DataColumn col = new DataColumn(); col.Expression = "SomeExpression"; //if computed column exception is thrown try { col.AutoIncrement = true; Assert.False(true); } catch (ArgumentException) { } }