コード例 #1
0
        public void TestResourceTypeGetAttributeInfo(string name, bool attributeExists, IResourceType resourceType, string apiPropertyName, string clrPropertyName, JsonApiFramework.ServiceModel.IAttributeInfo expected)
        {
            this.Output.WriteLine("Test Name: {0}", name);
            this.Output.WriteLine(String.Empty);

            // Arrange

            // Act
            if (!attributeExists)
            {
                Assert.Throws <ServiceModelException>(() => resourceType.GetApiAttributeInfo(apiPropertyName));
                Assert.Throws <ServiceModelException>(() => resourceType.GetClrAttributeInfo(clrPropertyName));
                return;
            }

            var actualApiAttributeInfo = resourceType.GetApiAttributeInfo(apiPropertyName);
            var actualClrAttributeInfo = resourceType.GetClrAttributeInfo(clrPropertyName);

            // Assert
            AttributeInfoAssert.Equal(expected, actualApiAttributeInfo);
            AttributeInfoAssert.Equal(expected, actualClrAttributeInfo);
        }