Ejemplo n.º 1
0
        public void WithUpdatedReturnsCorrectResult(
            AtomFeed sut,
            DateTimeOffset newUpdated)
        {
            AtomFeed actual = sut.WithUpdated(newUpdated);

            var expected = sut.AsSource().OfLikeness <AtomFeed>()
                           .With(x => x.Updated).EqualsWhen(
                (s, d) => object.Equals(newUpdated, d.Updated));

            expected.ShouldEqual(actual);
        }
Ejemplo n.º 2
0
        public void WithTitleReturnsCorrectResult(
            AtomFeed sut,
            string newTitle)
        {
            AtomFeed actual = sut.WithTitle(newTitle);

            var expected = sut.AsSource().OfLikeness <AtomFeed>()
                           .With(x => x.Title).EqualsWhen(
                (s, d) => object.Equals(newTitle, d.Title));

            expected.ShouldEqual(actual);
        }
Ejemplo n.º 3
0
        public void WithLinksReturnsCorrectResult(
            AtomFeed sut,
            IEnumerable <AtomLink> newLinks)
        {
            AtomFeed actual = sut.WithLinks(newLinks);

            var expected = sut.AsSource().OfLikeness <AtomFeed>()
                           .With(x => x.Links).EqualsWhen(
                (s, d) => newLinks.SequenceEqual(d.Links));

            expected.ShouldEqual(actual);
        }
Ejemplo n.º 4
0
        public void AddLinkReturnsCorrectResult(
            AtomFeed sut,
            AtomLink newLink)
        {
            AtomFeed actual = sut.AddLink(newLink);

            var expected = sut.AsSource().OfLikeness <AtomFeed>()
                           .With(x => x.Links).EqualsWhen(
                (s, d) => sut.Links.Concat(new[] { newLink }).SequenceEqual(d.Links));

            expected.ShouldEqual(actual);
        }
Ejemplo n.º 5
0
        public void WithAuthorReturnsCorrectResult(
            AtomFeed sut,
            AtomAuthor newAuthor)
        {
            AtomFeed actual = sut.WithAuthor(newAuthor);

            var expected = sut.AsSource().OfLikeness <AtomFeed>()
                           .With(x => x.Author).EqualsWhen(
                (s, d) => object.Equals(newAuthor, d.Author));

            expected.ShouldEqual(actual);
        }