Beispiel #1
0
        public void TestResourceTypeGetLinkInfo(string name, bool linkExists, IResourceType resourceType, string rel, ILinkInfo expected)
        {
            this.Output.WriteLine("Test Name: {0}", name);
            this.Output.WriteLine(String.Empty);

            // Arrange

            // Act
            if (!linkExists)
            {
                Assert.Throws <ServiceModelException>(() => resourceType.GetLinkInfo(rel));
                return;
            }
            var actual = resourceType.GetLinkInfo(rel);

            // Assert
            LinkInfoAssert.Equal(expected, actual);
        }
Beispiel #2
0
        public void TestResourceTypeTryGetLinkInfo(string name, bool attributeExists, IResourceType resourceType, string clrPropertyName, ILinkInfo expected)
        {
            this.Output.WriteLine("Test Name: {0}", name);
            this.Output.WriteLine(String.Empty);

            // Arrange

            // Act
            ILinkInfo actual;
            var       actualExists = resourceType.TryGetLinkInfo(clrPropertyName, out actual);

            // Assert
            if (!attributeExists)
            {
                Assert.False(actualExists);
                Assert.Null(actual);
                return;
            }

            Assert.True(actualExists);
            Assert.NotNull(actual);
            LinkInfoAssert.Equal(expected, actual);
        }