public void TestResourceTypeGetRelationshipInfo(string name, bool relationshipExists, IResourceType resourceType, string rel, IRelationshipInfo expected) { this.Output.WriteLine("Test Name: {0}", name); this.Output.WriteLine(String.Empty); // Arrange // Act if (!relationshipExists) { Assert.Throws <ServiceModelException>(() => resourceType.GetRelationshipInfo(rel)); return; } var actual = resourceType.GetRelationshipInfo(rel); // Assert RelationshipInfoAssert.Equal(expected, actual); }
public void TestResourceTypeTryGetRelationshipInfo(string name, bool attributeExists, IResourceType resourceType, string clrPropertyName, IRelationshipInfo expected) { this.Output.WriteLine("Test Name: {0}", name); this.Output.WriteLine(String.Empty); // Arrange // Act IRelationshipInfo actual; var actualExists = resourceType.TryGetRelationshipInfo(clrPropertyName, out actual); // Assert if (!attributeExists) { Assert.False(actualExists); Assert.Null(actual); return; } Assert.True(actualExists); Assert.NotNull(actual); RelationshipInfoAssert.Equal(expected, actual); }