Exemplo n.º 1
0
        public void DownloadGameMetadataTest()
        {
            var gogLib = new GogMetadataProvider();

            // Existing store page - contains all data
            var existingStore = gogLib.DownloadGameMetadata("1207658645");

            Assert.IsNotNull(existingStore.GameDetails);
            Assert.IsNotNull(existingStore.StoreDetails);
            Assert.IsNotNull(existingStore.Icon.OriginalUrl);
            Assert.IsNotNull(existingStore.CoverImage.OriginalUrl);
            Assert.IsNotNull(existingStore.BackgroundImage.OriginalUrl);

            // Game with missing store link in api data
            var customStore = gogLib.DownloadGameMetadata("1207662223");

            Assert.IsNotNull(customStore.GameDetails);
            Assert.IsNull(customStore.StoreDetails);
            Assert.IsNotNull(existingStore.Icon.OriginalUrl);
            Assert.IsNotNull(existingStore.CoverImage.OriginalUrl);
            Assert.IsNotNull(existingStore.BackgroundImage.OriginalUrl);

            // Existing game not present on store
            var nonStore = gogLib.DownloadGameMetadata("2");

            Assert.IsNotNull(nonStore.GameDetails);
            Assert.IsNull(nonStore.StoreDetails);
            Assert.IsNotNull(existingStore.Icon.OriginalUrl);
            Assert.IsNotNull(existingStore.CoverImage.OriginalUrl);
            Assert.IsNotNull(existingStore.BackgroundImage.OriginalUrl);
        }
        public void DownloadGameMetadataTest()
        {
            var gogLib = new GogMetadataProvider();

            // Existing store page - contains all data
            var existingStore = gogLib.DownloadGameMetadata("1207658645");

            Assert.IsNotNull(existingStore.GameDetails);
            Assert.IsNotNull(existingStore.StoreDetails);
            Assert.IsNotNull(existingStore.Icon.Content);
            Assert.IsNotNull(existingStore.Image.Content);
            Assert.IsNotNull(existingStore.BackgroundImage);

            // Game with missing store link in api data
            var customStore = gogLib.DownloadGameMetadata("1207662223", "https://www.gog.com/game/commandos_2_3");

            Assert.IsNotNull(customStore.GameDetails);
            Assert.IsNotNull(customStore.StoreDetails);
            Assert.IsNotNull(customStore.Icon.Content);
            Assert.IsNotNull(customStore.Image.Content);
            Assert.IsNotNull(customStore.BackgroundImage);

            // Existing game not present on store
            var nonStore = gogLib.DownloadGameMetadata("2");

            Assert.IsNotNull(nonStore.GameDetails);
            Assert.IsNull(nonStore.StoreDetails);
            Assert.IsNotNull(nonStore.Icon.Content);
            Assert.IsNotNull(nonStore.Image.Content);
            Assert.IsNotNull(nonStore.BackgroundImage);
        }
        public void StandardDownloadTest()
        {
            var provider = new GogMetadataProvider();
            var data     = provider.GetMetadata("1207659012");

            Assert.IsNotNull(data.GameData);
            Assert.IsNotNull(data.Icon);
            Assert.IsNotNull(data.Image);
            Assert.IsNotNull(data.GameData.ReleaseDate);
            Assert.IsFalse(string.IsNullOrEmpty(data.BackgroundImage));
            Assert.IsFalse(string.IsNullOrEmpty(data.GameData.Description));
            CollectionAssert.IsNotEmpty(data.GameData.Publishers);
            CollectionAssert.IsNotEmpty(data.GameData.Developers);
            CollectionAssert.IsNotEmpty(data.GameData.Tags);
            CollectionAssert.IsNotEmpty(data.GameData.Genres);
            CollectionAssert.IsNotEmpty(data.GameData.Links);
            CollectionAssert.IsNotEmpty(data.GameData.Publishers);
        }
Exemplo n.º 4
0
        public void StandardDownloadTest()
        {
            var provider = new GogMetadataProvider(GogLibraryTests.CreateLibrary());
            var data     = provider.GetMetadata(new Game()
            {
                GameId = "1207659012"
            });

            Assert.IsNotNull(data.GameInfo);
            Assert.IsNotNull(data.Icon);
            Assert.IsNotNull(data.CoverImage);
            Assert.IsNotNull(data.GameInfo.ReleaseDate);
            Assert.IsNotNull(data.BackgroundImage);
            Assert.IsFalse(string.IsNullOrEmpty(data.GameInfo.Description));
            CollectionAssert.IsNotEmpty(data.GameInfo.Publishers);
            CollectionAssert.IsNotEmpty(data.GameInfo.Developers);
            CollectionAssert.IsNotEmpty(data.GameInfo.Tags);
            CollectionAssert.IsNotEmpty(data.GameInfo.Genres);
            CollectionAssert.IsNotEmpty(data.GameInfo.Links);
            CollectionAssert.IsNotEmpty(data.GameInfo.Publishers);
        }