예제 #1
0
        public async void SteamServiceGetGameModels()
        {
            var mock = new Mock <ISteamRepository>();

            mock.Setup(repo => repo.GetUserWishlistData(_steamID).Result).Returns(GetUserWishlistData());
            var steamService = new SteamService(mock.Object, _mapper);

            var actualGameModels = await steamService.GetGameModelsAsync(_steamID);

            var expectedGameModels = new List <WishlistGameModel>
            {
                new WishlistGameModel
                {
                    Name              = "STAR WARS™ Jedi Knight - Jedi Academy™",
                    Type              = "Game",
                    Price             = 6.29m,
                    ReleaseDate       = "16 Sep, 2009",
                    ReviewDescription = "Overwhelmingly Positive",
                    ReviewScore       = 9,
                    Free              = false,
                    Banner            = "https://cdn.akamai.steamstatic.com/steam/apps/6020/header_292x136.jpg?t=1586462966",
                    Tags              = new string[]
                    {
                        "Action",
                        "Sci-fi",
                        "Third Person",
                        "Multiplayer",
                        "Classic"
                    }
                },

                new WishlistGameModel
                {
                    Name              = "Dreamfall: The Longest Journey",
                    Type              = "Game",
                    Price             = 12.59m,
                    ReleaseDate       = "12 Jan, 2007",
                    ReviewDescription = "Very Positive",
                    ReviewScore       = 8,
                    Free              = false,
                    Banner            = "https://cdn.akamai.steamstatic.com/steam/apps/6300/header_292x136.jpg?t=1592476034",
                    Tags              = new string[]
                    {
                        "Adventure",
                        "Female Protagonist",
                        "Story Rich",
                        "Fantasy",
                        "Singleplayer"
                    }
                },

                new WishlistGameModel
                {
                    Name              = "The Longest Journey",
                    Type              = "Game",
                    Price             = 6.99m,
                    ReleaseDate       = "1 May, 2007",
                    ReviewDescription = "Very Positive",
                    ReviewScore       = 8,
                    Free              = false,
                    Banner            = "https://cdn.akamai.steamstatic.com/steam/apps/6310/header_292x136.jpg?t=1592476451",
                    Tags              = new string[]
                    {
                        "Adventure",
                        "Point & Click",
                        "Story Rich",
                        "Female Protagonist",
                        "Classic"
                    }
                }
            };

            Assert.Equal(expectedGameModels, actualGameModels);
        }