public void CypherQueryBuilderServiceCheckGraphModelIntegrityReturnsSuccess() { foreach (var graphNodeType in AttributeUtilities.GetTypesWithAttribute(Assembly.GetAssembly(typeof(WebJobsExtensionStartup)), typeof(GraphNodeAttribute))) { //arrange int intialKeyCount = 0; int keyCount = 0; int preferredLabelCount = 0; //act foreach (var propertyInfo in graphNodeType !.GetProperties()) { var graphPropertyAttribute = propertyInfo.GetCustomAttributes(typeof(GraphPropertyAttribute), false).FirstOrDefault() as GraphPropertyAttribute; if (graphPropertyAttribute != null && graphPropertyAttribute.IsInitialKey && !graphPropertyAttribute.Ignore) { intialKeyCount++; } if (graphPropertyAttribute != null && graphPropertyAttribute.IsKey && !graphPropertyAttribute.Ignore) { keyCount++; } if (graphPropertyAttribute != null && graphPropertyAttribute.IsPreferredLabel && !graphPropertyAttribute.Ignore) { preferredLabelCount++; } } //assert Assert.Equal(1, intialKeyCount); Assert.NotEqual(0, keyCount); Assert.Equal(1, preferredLabelCount); } }