C# - Assert that Type have no settable properties

Post date: Dec 4, 2013 12:30:16 PM

[Test] [MSTest.TestMethod] public void ShouldAssertThatNoSettableFieldsAreAdded() { var allProperties = typeof(ColumnDataTypeDefinition).GetProperties( System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance); Assert.That(allProperties.All(x => x.GetSetMethod() == null)); Assert.That(allProperties.Count(), Is.EqualTo(8)); }