public void TestAddingRemovingAccessors() { var ctx = new StandardEvaluationContext(); // reflective property accessor is the only one by default var propertyAccessors = ctx.PropertyAccessors; Assert.Single(propertyAccessors); var spa = new StringyPropertyAccessor(); ctx.AddPropertyAccessor(spa); Assert.Equal(2, ctx.PropertyAccessors.Count); var copy = new List <IPropertyAccessor>(ctx.PropertyAccessors); Assert.True(ctx.RemovePropertyAccessor(spa)); Assert.False(ctx.RemovePropertyAccessor(spa)); Assert.Single(ctx.PropertyAccessors); ctx.PropertyAccessors = copy; Assert.Equal(2, ctx.PropertyAccessors.Count); }