Exemplo n.º 1
0
        internal void TestIDomLinksAbstraction(string name, Links expectedLinks, IDomLinks domLinks)
        {
            // Arrange

            // Act
            this.Output.WriteLine("Test Name: {0}", name);
            this.Output.WriteLine(String.Empty);

            foreach (var expectedRelAndLink in expectedLinks)
            {
                var expectedRel  = expectedRelAndLink.Key;
                var expectedLink = expectedRelAndLink.Value;

                this.Output.WriteLine("Expected Rel:  {0}", expectedRel);
                this.Output.WriteLine("Expected Link: {0}", expectedLink);
            }

            this.Output.WriteLine(String.Empty);

            var actualLinks = domLinks.Links;

            foreach (var actualRelAndLink in actualLinks)
            {
                var actualRel  = actualRelAndLink.Key;
                var actualLink = actualRelAndLink.Value;

                this.Output.WriteLine("Actual Rel:    {0}", actualRel);
                this.Output.WriteLine("Actual Link:   {0}", actualLink);
            }

            // Assert
            LinksAssert.Equal(expectedLinks, actualLinks);
        }
Exemplo n.º 2
0
        public void TestLinksParse(string name, Links expected)
        {
            // Arrange
            var json = expected.ToJson();

            // Act
            this.Output.WriteLine(json);
            var actual = JsonObject.Parse <Links>(json);

            // Assert
            LinksAssert.Equal(expected, actual);
        }
Exemplo n.º 3
0
        public void TestLinksToJson(string name, Links expected)
        {
            // Arrange

            // Act
            var actual = expected.ToJson();

            this.Output.WriteLine(actual);

            // Assert
            LinksAssert.Equal(expected, actual);
        }
Exemplo n.º 4
0
        // PUBLIC METHODS ///////////////////////////////////////////////////
        #region Assert Methods
        public static void Equal(Article expected, Article actual)
        {
            // Handle when 'expected' is null.
            if (expected == null)
            {
                Assert.Null(actual);
                return;
            }

            Assert.Equal(expected.Id, actual.Id);
            Assert.Equal(expected.Title, actual.Title);
            RelationshipsAssert.Equal(expected.Relationships, actual.Relationships);
            LinksAssert.Equal(expected.Links, actual.Links);
            ClrObjectAssert.Equal(expected.Meta, actual.Meta);
        }
        // PUBLIC METHODS ///////////////////////////////////////////////////
        #region Assert Methods
        public static void Equal(Links expected, DomReadOnlyLinks actual)
        {
            if (expected == null)
            {
                Assert.Null(actual);
                return;
            }
            Assert.NotNull(actual);

            Assert.Equal(DomNodeType.Links, actual.NodeType);

            var actualLinks = actual.Links;

            LinksAssert.Equal(expected, actualLinks);
        }
Exemplo n.º 6
0
        // PUBLIC METHODS ///////////////////////////////////////////////////
        #region Assert Methods
        public static void Equal(Comment expected, Comment actual)
        {
            // Handle when 'expected' is null.
            if (expected == null)
            {
                Assert.Null(actual);
                return;
            }
            Assert.NotNull(actual);

            Assert.Equal(expected.Id, actual.Id);
            Assert.Equal(expected.Body, actual.Body);
            RelationshipsAssert.Equal(expected.Relationships, actual.Relationships);
            LinksAssert.Equal(expected.Links, actual.Links);
            ClrObjectAssert.Equal(expected.Meta, actual.Meta);
        }
Exemplo n.º 7
0
        // PUBLIC METHODS ///////////////////////////////////////////////////
        #region Assert Methods
        public static void Equal(Blog expected, Blog actual)
        {
            // Handle when 'expected' is null.
            if (expected == null)
            {
                Assert.Null(actual);
                return;
            }
            Assert.NotNull(actual);

            Assert.Equal(expected.Id, actual.Id);
            Assert.Equal(expected.Name, actual.Name);
            RelationshipsAssert.Equal(expected.Relationships, actual.Relationships);
            LinksAssert.Equal(expected.Links, actual.Links);
            ClrObjectAssert.Equal(expected.Meta, actual.Meta);
        }
Exemplo n.º 8
0
        // PUBLIC METHODS ///////////////////////////////////////////////////
        #region Assert Methods
        public static void Equal(Person expected, Person actual)
        {
            // Handle when 'expected' is null.
            if (expected == null)
            {
                Assert.Null(actual);
                return;
            }
            Assert.NotNull(actual);

            Assert.Equal(expected.Id, actual.Id);
            Assert.Equal(expected.FirstName, actual.FirstName);
            Assert.Equal(expected.LastName, actual.LastName);
            Assert.Equal(expected.Twitter, actual.Twitter);
            RelationshipsAssert.Equal(expected.Relationships, actual.Relationships);
            LinksAssert.Equal(expected.Links, actual.Links);
            ClrObjectAssert.Equal(expected.Meta, actual.Meta);
        }