コード例 #1
0
        private static void CheckParameterizedProperty(PropertySymbol property, bool expectGetter, bool expectSetter, string propertyDisplayString, bool expectIndexer, bool suppressAssociatedPropertyCheck)
        {
            Assert.Equal(SymbolKind.Property, property.Kind);
            Assert.Equal(expectIndexer, property.IsIndexer);
            Assert.NotEqual(expectIndexer, property.MustCallMethodsDirectly);
            Assert.Equal(propertyDisplayString, property.ToTestDisplayString());

            if (expectGetter)
            {
                CheckAccessorShape(property.GetMethod, true, property, expectIndexer, suppressAssociatedPropertyCheck);
            }
            else
            {
                Assert.Null(property.GetMethod);
            }

            if (expectSetter)
            {
                CheckAccessorShape(property.SetMethod, false, property, expectIndexer, suppressAssociatedPropertyCheck);
            }
            else
            {
                Assert.Null(property.SetMethod);
            }
        }