예제 #1
0
        public void GetAuthTokenByPage(KeyValuePair <LGMServiceType, string> item)
        {
            //string updatedUrl = FormatUrl(item.Key);
            string result     = string.Empty;
            string updatedUrl = string.Empty;

            using (IApiPage page = APIFactory.ApiFactory <IApiPage>(item.Key, Settings))
            {
                updatedUrl = FormatUrl(page.ServiceName, Settings);

                // IApiPage i = new LGMFiltersService();

                if (!string.IsNullOrEmpty(updatedUrl))
                {
                    //Dictionary<string, string> parms = new Dictionary<string, string>()
                    //{
                    //    { "url", updatedUrl },
                    //    { "username", Settings.UserName },
                    //    { "password", Settings.Password },
                    //};
                    result = page.GetAuthInfo(updatedUrl);

                    //result = LGApitAction.GetAuthInfo(updatedUrl, Settings.UserName, Settings.Password);
                    //result = LGApitAction.GetAuthInfo(updatedUrl, Settings.UserName, Settings.Password);
                    //AuthTokens.Add(item.Key.ToString(), result.Trim('"'));
                }
            }
            //NUnit.Framework.Internal.TestExecutionContext t = PropertyHelper.GetPrivateFieldValue<NUnit.Framework.Internal.TestExecutionContext>(TestContext.CurrentContext, "_testExecuteContext");

            Assert.IsFalse(string.IsNullOrWhiteSpace(result));

            Console.WriteLine($"Url: {updatedUrl}");
            Console.WriteLine($"Result: {result}");
            Console.WriteLine("\r\n");
        }
예제 #2
0
        public static string GetPlayListByName(string playlistName, string userName, string passWord, EnvironmentType env)
        {
            APRIConfigSettings config = new APRIConfigSettings
            {
                UserName    = userName,
                Password    = passWord,
                Environment = env
            };

            string result     = string.Empty;
            string updatedUrl = string.Empty;

            using (LGMPlaylistsService page = APIFactory.ApiFactory <LGMPlaylistsService>(LGMServiceType.PlaylistsService, config))
            {
                updatedUrl = FormatUrl(page.ServiceName, config);

                // IApiPage i = new LGMFiltersService();

                if (!string.IsNullOrEmpty(updatedUrl))
                {
                    //Dictionary<string, string> parms = new Dictionary<string, string>()
                    //{
                    //    { "url", updatedUrl },
                    //    { "username", Settings.UserName },
                    //    { "password", Settings.Password },
                    //};
                    result = ((LGMPlaylistsService)page).LGMPlaylistServiceByName(playlistName);

                    //result = LGApitAction.GetAuthInfo(updatedUrl, Settings.UserName, Settings.Password);
                    //result = LGApitAction.GetAuthInfo(updatedUrl, Settings.UserName, Settings.Password);
                    //AuthTokens.Add(item.Key.ToString(), result.Trim('"'));
                }
            }
            //NUnit.Framework.Internal.TestExecutionContext t = PropertyHelper.GetPrivateFieldValue<NUnit.Framework.Internal.TestExecutionContext>(TestContext.CurrentContext, "_testExecuteContext");

            Assert.IsFalse(string.IsNullOrWhiteSpace(result));

            Console.WriteLine($"Url: {updatedUrl}");
            Console.WriteLine($"Result: {result}");
            Console.WriteLine("\r\n");

            return("Playlist");
        }