Beispiel #1
0
        public void ChangePublisherName()
        {
            var book = new Book()
            {
                Id     = 2,
                Title  = "School's Going to Kill Me",
                Author = new Author()
                {
                    Id   = 138,
                    Name = "Matt Herold"
                },
                PublishDate = DateTime.Now,
                Publisher   = "Herold's Yitty Books"
            };

            var newPublisherName = "Herold's Really Yitty Books";

            book.ChangePublisherName(newPublisherName);

            Assert.Equal(newPublisherName, book.Publisher);
        }
        public void ChangePublisherName()
        {
            var book = new Book()
            {
                Id     = 1,
                Title  = "Domain Driven Design",
                Author = new Author()
                {
                    Id   = 65,
                    Name = "Eric Evans"
                },
                PublishDate = DateTime.Now.AddMonths(-6),
                Publisher   = "McGraw-Hill"
            };

            var newPublisherName = "Test Name";

            book.ChangePublisherName(newPublisherName);

            var expectedPublisherName = newPublisherName;
            var actualPublisherName   = "Test Name";

            Assert.Equal(expectedPublisherName, actualPublisherName);
        }