Esempio n. 1
0
        public void GameListXmlCloneTest()
        {
            var gameList1 = new GameList();

            gameList1.Add(new Game(
                              1,
                              "Name1",
                              "Description1"));

            gameList1.Add(new Game(
                              2,
                              "Name2",
                              "Description2"));

            gameList1.Add(new Game(
                              3,
                              "Name3",
                              "Description3"));

            var gameList2 = CloneUtility.XmlClone(gameList1, null);

            Assert.AreNotSame(gameList1, gameList2);
            Assert.AreEqual(gameList1.List.Count, gameList2.List.Count);

            for (var index = 0; index < gameList1.List.Count; index++)
            {
                Assert.AreEqual(gameList1.List[index].Id, gameList2.List[index].Id);
                Assert.AreEqual(gameList1.List[index].Name, gameList2.List[index].Name);
                Assert.AreEqual(gameList1.List[index].Description, gameList2.List[index].Description);
            }
        }
Esempio n. 2
0
        public void GameImageListXmlCloneTest()
        {
            var gameImageList1 = new GameImageList();

            gameImageList1.Add(new GameImage(1, 2, _imageData));

            gameImageList1.Add(new GameImage(3, 4, null));

            gameImageList1.Add(new GameImage(5, 6, _imageData));

            var gameImageList2 = CloneUtility.XmlClone(gameImageList1, null);

            Assert.AreNotSame(gameImageList1, gameImageList2);
            Assert.AreEqual(gameImageList1.List.Count, gameImageList2.List.Count);

            for (var index = 0; index < gameImageList1.List.Count; index++)
            {
                Assert.AreEqual(gameImageList1.List[index].Id, gameImageList2.List[index].Id);
                Assert.AreEqual(gameImageList1.List[index].GameId, gameImageList2.List[index].GameId);

                if (gameImageList1.List[index].Image != null)
                {
                    Assert.IsTrue(gameImageList1.List[index].Image.SequenceEqual(gameImageList2.List[index].Image));
                }

                else
                {
                    Assert.IsNull(gameImageList1.List[index].Image);
                    Assert.IsNull(gameImageList2.List[index].Image);
                }
            }
        }
Esempio n. 3
0
        public void GameRatingListXmlCloneTest()
        {
            var gameRatingList1 = new GameRatingList();

            gameRatingList1.Add(new GameRating(
                                    1,
                                    2,
                                    3, "Notes1"));

            gameRatingList1.Add(new GameRating(
                                    2,
                                    3,
                                    4, "Notes2"));

            gameRatingList1.Add(new GameRating(
                                    3,
                                    4,
                                    5, "Notes3"));

            var gameRatingList2 = CloneUtility.XmlClone(gameRatingList1, null);

            Assert.AreNotSame(gameRatingList1, gameRatingList2);
            Assert.AreEqual(gameRatingList1.List.Count, gameRatingList2.List.Count);

            for (var index = 0; index < gameRatingList1.List.Count; index++)
            {
                Assert.AreEqual(gameRatingList1.List[index].Id, gameRatingList2.List[index].Id);
                Assert.AreEqual(gameRatingList1.List[index].GameId, gameRatingList2.List[index].GameId);
                Assert.AreEqual(gameRatingList1.List[index].RatingId, gameRatingList2.List[index].RatingId);
            }
        }
Esempio n. 4
0
        public void GameGenreListXmlCloneTest()
        {
            var gameGenreList1 = new GameGenreList();

            gameGenreList1.Add(new GameGenre(
                                   1,
                                   2,
                                   3));

            gameGenreList1.Add(new GameGenre(
                                   2,
                                   3,
                                   4));

            gameGenreList1.Add(new GameGenre(
                                   3,
                                   4,
                                   5));

            var gameGenreList2 = CloneUtility.XmlClone(gameGenreList1, null);

            Assert.AreNotSame(gameGenreList1, gameGenreList2);
            Assert.AreEqual(gameGenreList1.List.Count, gameGenreList2.List.Count);

            for (var index = 0; index < gameGenreList1.List.Count; index++)
            {
                Assert.AreEqual(gameGenreList1.List[index].Id, gameGenreList2.List[index].Id);
                Assert.AreEqual(gameGenreList1.List[index].GameId, gameGenreList2.List[index].GameId);
                Assert.AreEqual(gameGenreList1.List[index].GenreId, gameGenreList2.List[index].GenreId);
            }
        }
Esempio n. 5
0
        public void GameImageXmlCloneTest()
        {
            var gameImage1 = new GameImage(
                1,
                2,
                _imageData);

            var gameImage2 = CloneUtility.XmlClone(gameImage1, null);

            Assert.AreNotSame(gameImage1, gameImage2);

            Assert.AreEqual(gameImage1.Id, gameImage2.Id);
            Assert.AreEqual(gameImage1.GameId, gameImage2.GameId);

            if (gameImage1.Image != null)
            {
                Assert.IsTrue(gameImage1.Image.SequenceEqual(gameImage2.Image));
            }

            else
            {
                Assert.IsNull(gameImage1.Image);
                Assert.IsNull(gameImage2.Image);
            }
        }
Esempio n. 6
0
        public void PlatformXmlCloneTest()
        {
            var platform1 = new Platform(1, "Name", "Maker");

            var platform2 = CloneUtility.XmlClone(platform1, null);

            Assert.AreNotSame(platform1, platform2);

            Assert.AreEqual(platform1.Id, platform2.Id);
            Assert.AreEqual(platform1.Name, platform2.Name);
            Assert.AreEqual(platform1.Maker, platform2.Maker);
        }
Esempio n. 7
0
        public void GenreXmlCloneTest()
        {
            var genre1 = new Genre(1, "Name", "Description");

            var genre2 = CloneUtility.XmlClone(genre1, null);

            Assert.AreNotSame(genre1, genre2);

            Assert.AreEqual(genre1.Id, genre2.Id);
            Assert.AreEqual(genre1.Name, genre2.Name);
            Assert.AreEqual(genre1.Description, genre2.Description);
        }
Esempio n. 8
0
        public void RatingXmlCloneTest()
        {
            var rating1 = new Rating(1, "Name", "Description", "Symbol");

            var rating2 = CloneUtility.XmlClone(rating1, null);

            Assert.AreNotSame(rating1, rating2);

            Assert.AreEqual(rating1.Id, rating2.Id);
            Assert.AreEqual(rating1.Name, rating2.Name);
            Assert.AreEqual(rating1.Description, rating2.Description);
            Assert.AreEqual(rating1.Symbol, rating2.Symbol);
        }
Esempio n. 9
0
        public void ReviewXmlCloneTest()
        {
            var rating1 = new Review(1, "Name", "Description", 2);

            var rating2 = CloneUtility.XmlClone(rating1, null);

            Assert.AreNotSame(rating1, rating2);

            Assert.AreEqual(rating1.Id, rating2.Id);
            Assert.AreEqual(rating1.Name, rating2.Name);
            Assert.AreEqual(rating1.Description, rating2.Description);
            Assert.AreEqual(rating1.Reviewrating, rating2.Reviewrating);
        }
Esempio n. 10
0
        public void GameRatingXmlCloneTest()
        {
            var gameRating1 = new GameRating(
                1,
                2,
                3, "Notes");

            var gameRating2 = CloneUtility.XmlClone(gameRating1, null);

            Assert.AreNotSame(gameRating1, gameRating2);

            Assert.AreEqual(gameRating1.Id, gameRating2.Id);
            Assert.AreEqual(gameRating1.GameId, gameRating2.GameId);
            Assert.AreEqual(gameRating1.RatingId, gameRating2.RatingId);
        }
Esempio n. 11
0
        public void GameGenreXmlCloneTest()
        {
            var gameGenre1 = new GameGenre(
                1,
                2,
                3);

            var gameGenre2 = CloneUtility.XmlClone(gameGenre1, null);

            Assert.AreNotSame(gameGenre1, gameGenre2);

            Assert.AreEqual(gameGenre1.Id, gameGenre2.Id);
            Assert.AreEqual(gameGenre1.GameId, gameGenre2.GameId);
            Assert.AreEqual(gameGenre1.GenreId, gameGenre2.GenreId);
        }
Esempio n. 12
0
        public void GamePlatformXmlCloneTest()
        {
            var gamePlatform1 = new GamePlatform(
                1,
                2,
                3);

            var gamePlatform2 = CloneUtility.XmlClone(gamePlatform1, null);

            Assert.AreNotSame(gamePlatform1, gamePlatform2);

            Assert.AreEqual(gamePlatform1.Id, gamePlatform2.Id);
            Assert.AreEqual(gamePlatform1.GameId, gamePlatform2.GameId);
            Assert.AreEqual(gamePlatform1.PlatformId, gamePlatform2.PlatformId);
        }
Esempio n. 13
0
        public void GameReviewXmlCloneTest()
        {
            var gameReview1 = new GameReview(
                1,
                2,
                3);

            var gameReview2 = CloneUtility.XmlClone(gameReview1, null);

            Assert.AreNotSame(gameReview1, gameReview2);

            Assert.AreEqual(gameReview1.Id, gameReview2.Id);
            Assert.AreEqual(gameReview1.GameId, gameReview2.GameId);
            Assert.AreEqual(gameReview1.ReviewId, gameReview2.ReviewId);
        }
Esempio n. 14
0
        public void PlatformListXmlCloneTest()
        {
            var platformList1 = new PlatformList();

            platformList1.Add(new Platform(1, "Name1", "Maker1"));
            platformList1.Add(new Platform(2, "Name2", "Maker2"));
            platformList1.Add(new Platform(3, "Name3", "Maker3"));

            var platformList2 = CloneUtility.XmlClone(platformList1, null);

            Assert.AreNotSame(platformList1, platformList2);
            Assert.AreEqual(platformList1.List.Count, platformList2.List.Count);

            for (var index = 0; index < platformList1.List.Count; index++)
            {
                Assert.AreEqual(platformList1.List[index].Id, platformList2.List[index].Id);
                Assert.AreEqual(platformList1.List[index].Name, platformList2.List[index].Name);
                Assert.AreEqual(platformList1.List[index].Maker, platformList2.List[index].Maker);
            }
        }
Esempio n. 15
0
        public void RatingListXmlCloneTest()
        {
            var ratingList1 = new RatingList();

            ratingList1.Add(new Rating(1, "Name1", "Description1", "Symbol1"));
            ratingList1.Add(new Rating(2, "Name2", "Description2", "Symbol2"));
            ratingList1.Add(new Rating(3, "Name3", "Description3", "Symbol3"));

            var ratingList2 = CloneUtility.XmlClone(ratingList1, null);

            Assert.AreNotSame(ratingList1, ratingList2);
            Assert.AreEqual(ratingList1.List.Count, ratingList2.List.Count);

            for (var index = 0; index < ratingList1.List.Count; index++)
            {
                Assert.AreEqual(ratingList1.List[index].Id, ratingList2.List[index].Id);
                Assert.AreEqual(ratingList1.List[index].Name, ratingList2.List[index].Name);
                Assert.AreEqual(ratingList1.List[index].Description, ratingList2.List[index].Description);
                Assert.AreEqual(ratingList1.List[index].Symbol, ratingList2.List[index].Symbol);
            }
        }
Esempio n. 16
0
        public void ReviewListXmlCloneTest()
        {
            var ratingList1 = new ReviewList();

            ratingList1.Add(new Review(1, "Name1", "Description1", 2));
            ratingList1.Add(new Review(2, "Name2", "Description2", 3));
            ratingList1.Add(new Review(3, "Name3", "Description3", 4));

            var ratingList2 = CloneUtility.XmlClone(ratingList1, null);

            Assert.AreNotSame(ratingList1, ratingList2);
            Assert.AreEqual(ratingList1.List.Count, ratingList2.List.Count);

            for (var index = 0; index < ratingList1.List.Count; index++)
            {
                Assert.AreEqual(ratingList1.List[index].Id, ratingList2.List[index].Id);
                Assert.AreEqual(ratingList1.List[index].Name, ratingList2.List[index].Name);
                Assert.AreEqual(ratingList1.List[index].Description, ratingList2.List[index].Description);
                Assert.AreEqual(ratingList1.List[index].Reviewrating, ratingList2.List[index].Reviewrating);
            }
        }