예제 #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);
        }