async public Task GetDuratioinTest_1()
        {
            var api      = new EtaSDK.v3.EtaApi();
            var response = await api.GetCatalogListAsync(null);

            if (response.HasErrors)
            {
                TestCompleteWithErrorsUISafe("Catalog error: " + response.Error.Message);
            }
            else
            {
                var catalogs = response.Result;
                if (catalogs == null || !catalogs.Any())
                {
                    TestCompleteWithErrorsUISafe("Catalog null or Empty");
                }
                else
                {
                    var catalog       = catalogs.First();
                    var durationLabel = DurationHelper.GetDurationLabel(catalog.RunFrom, catalog.RunTill);
                    if (string.IsNullOrWhiteSpace(durationLabel))
                    {
                        TestCompleteWithErrorsUISafe("durationLabel null or Empty");
                    }
                    TestCompleteUISafe();
                }
            }
        }
        async public Task GetCatalogList_test()
        {
            var api = new EtaSDK.v3.EtaApi();

            var response = await api.GetCatalogListAsync(null);

            if (response.HasErrors)
            {
                TestCompleteWithErrorsUISafe("Catalogs error: " + response.Error.Message);
            }
            var catalogs = response.Result;

            if (catalogs == null || !catalogs.Any())
            {
                TestCompleteWithErrorsUISafe("Catalogs == null or empty");
            }
            foreach (var catalog in catalogs)
            {
                if (catalog == null || catalog.Id == null)
                {
                    TestCompleteWithErrorsUISafe("Catalog == null");
                }

                if (catalog.Store == null || catalog.Store.Id == null)
                {
                    TestCompleteWithErrorsUISafe("Catalog.Store == null");
                }

                if (catalog.Store.Country == null || catalog.Store.Country.Alpha2 == null)
                {
                    TestCompleteWithErrorsUISafe("Catalog.Store.Country == null");
                }

                if (catalog.Store.Dealer == null || catalog.Store.Dealer.Id == null)
                {
                    TestCompleteWithErrorsUISafe("Catalog.Store.Dealer == null");
                }

                if (catalog.Store.Dealer.Branding == null || catalog.Store.Dealer.Branding.Color == null)
                {
                    TestCompleteWithErrorsUISafe("Catalog.Store.Dealer.Branding == null");
                }
            }
            TestCompleteUISafe();
        }
        async public Task GetStoreList_test()
        {
            var api      = new EtaSDK.v3.EtaApi();
            var response = await api.GetStoreListAsync(null);

            if (response.HasErrors)
            {
                TestCompleteWithErrorsUISafe("Store info error: " + response.Error.Message);
            }
            else
            {
                var stores = response.Result;

                if (stores == null || !stores.Any())
                {
                    TestCompleteWithErrorsUISafe("Stores is null or Empty");
                }
                TestCompleteUISafe();
            }
        }
Пример #4
0
        async public Task GetOfferListSuggested_test()
        {
            var options = new EtaApiQueryStringParameterOptions();

            options.AddParm(EtaApiConstants.EtaApi_Latitude, "55.77012");
            options.AddParm(EtaApiConstants.EtaApi_Longitude, "12.46320");
            options.AddParm(EtaApiConstants.EtaApi_LocationDetermined, UNIXTime.GetTimestamp(DateTime.Now));
            options.AddParm(EtaApiConstants.EtaApi_Geocoded, "0");
            options.AddParm(EtaApiConstants.EtaApi_Accuracy, "50");
            options.AddParm(EtaApiConstants.EtaApi_Ditance, "10000");

            //options.AddParm(EtaApiConstants.EtaApi_OfferId, "");
            options.AddParm("type", "suggested");
            //options.AddParm("api_limit", "100");
            options.AddParm("from", UNIXTime.GetTimestamp(DateTime.Now));
            options.AddParm("to", UNIXTime.GetTimestamp(DateTime.Now.AddDays(14)));

            var api = new EtaSDK.v3.EtaApi();

            var response = await api.GetOfferListAsync(options);

            if (response.HasErrors)
            {
                TestCompleteWithErrorsUISafe("suggeted offers search error: " + response.Error.Message);
            }
            else
            {
                var offers = response.Result;

                if (offers.Any())
                {
                    TestCompleteUISafe();
                }
                else
                {
                    TestCompleteWithErrorsUISafe("Suggested Offers Search result is null or Empty");
                }
            }
        }
Пример #5
0
        async public Task GetOfferSearch_test()
        {
            var api      = new EtaSDK.v3.EtaApi();
            var response = await api.GetOfferSearchAsync(null, "kaffe");

            if (response.HasErrors)
            {
                TestCompleteWithErrorsUISafe("offer search error: " + response.Error.Message);
            }
            else
            {
                var offers = response.Result;

                if (offers.Any())
                {
                    TestCompleteUISafe();
                }
                else
                {
                    TestCompleteWithErrorsUISafe("Offer Search result is null or Empty");
                }
            }
        }
Пример #6
0
        async public Task GetOfferList_test()
        {
            var api      = new EtaSDK.v3.EtaApi();
            var response = await api.GetOfferListAsync(null);

            if (response.HasErrors)
            {
                TestCompleteWithErrorsUISafe("offer list error: " + response.Error.Message);
            }
            else
            {
                var catalogs = response.Result;

                if (catalogs.Any())
                {
                    TestCompleteUISafe();
                }
                else
                {
                    TestCompleteWithErrorsUISafe("Offers is null or Empty");
                }
            }
        }
        async public Task GetStoreInfo_test()
        {
            var api      = new EtaSDK.v3.EtaApi();
            var response = await api.GetStoreInfoAsync(null);

            if (response.HasErrors)
            {
                TestCompleteWithErrorsUISafe("Store info error: " + response.Error.Message);
            }
            else
            {
                var store = response.Result;

                if (store == null || string.IsNullOrWhiteSpace(store.Id))
                {
                    TestCompleteWithErrorsUISafe("Store is null or Empty");
                }
                else
                {
                    TestCompleteUISafe();
                }
            }
        }
        async public Task GetCatalogInfo_test()
        {
            string id        = "1a94vO"; // Irma catalog id ?!
            string publicKey = "1a94vO"; // Irma publickey ?!
            var    api       = new EtaSDK.v3.EtaApi();

            var response = await api.GetCatalogInfoAsync(id, publicKey);

            if (response.HasErrors)
            {
                TestCompleteWithErrorsUISafe("Catalog info error: " + response.Error.Message);
            }
            var catalog = response.Result;

            if (catalog == null || string.IsNullOrWhiteSpace(catalog.Id))
            {
                TestCompleteWithErrorsUISafe("catalog is null or empty");
            }
            else
            {
                TestCompleteUISafe();
            }
        }