Пример #1
0
        public WebexTestFixture()
        {
            adminClientId     = ConfigurationManager.AppSettings["AdminClientID"] ?? "";
            adminClientSecret = ConfigurationManager.AppSettings["AdminSecret"] ?? "";

            // get access token
            adminAccessToken = CreateAdminAccessToken(adminClientId, adminClientSecret);
            if (adminAccessToken == null)
            {
                Console.WriteLine("Error: create access token failed!");
                return;
            }

            //create the first user
            selfUser = CreateUser(adminAccessToken, adminClientId, adminClientSecret);
            if (selfUser == null)
            {
                Console.WriteLine("Error: create test user failed!");
                return;
            }


            webex = CreateWebex();

            Console.WriteLine("WebexTestFixture build success!");
        }
Пример #2
0
        public Webex CreateWebexbyJwt()
        {
            if (jwtWebex == null)
            {
                jwtAuth  = new JWTAuthenticator();
                jwtWebex = new WebexSDK.Webex(jwtAuth);

                //login
                for (int count = 1; count <= 5; count++)
                {
                    if (JWtLogin() == true)
                    {
                        Console.WriteLine("JWtLogin success.");
                        break;
                    }
                    Console.WriteLine($"Error: jwt login fail[{count}].");

                    if (count == 5)
                    {
                        jwtWebex = null;
                        return(null);
                    }
                }
            }

            return(jwtWebex);
        }
        public static void ClassSetup(TestContext context)
        {
            fixture = WebexTestFixture.Instance;
            Assert.IsNotNull(fixture);

            webex = fixture.CreateWebex();
            Assert.IsNotNull(webex);
        }
Пример #4
0
 public SpaceManageViewModel()
 {
     webex               = ApplicationController.Instance.CurWebexManager.CurWebex;
     CreateSpaceCMD      = new RelayCommand(CreateSpace);
     DeleteSpaceCMD      = new RelayCommand(DeleteSpace);
     CreateMembershipCMD = new RelayCommand(CreateMembership);
     DeleteMembershipCMD = new RelayCommand(DeleteMembership);
     FetchSpaces();
 }
Пример #5
0
        public Webex CreateWebex()
        {
            if (webex == null)
            {
                webex = new WebexSDK.Webex(new WebexTestFixtureAuth(selfUser.AccessToken));
            }

            return(webex);
        }
Пример #6
0
        public void SetUp()
        {
            fixture = WebexTestFixture.Instance;
            Assert.IsNotNull(fixture);

            //webex = fixture.webex;
            webex = fixture.CreateWebex();
            Assert.IsNotNull(webex);

            space = webex.Spaces;
            Assert.IsNotNull(space);
        }
Пример #7
0
        public string YahooStockRequest(string Symbols, bool UseYahoo = true)
        {
            {
                string StockQuoteUrl = string.Empty;

                try
                {
                    // Use Yahoo finance service to download stock data from Yahoo
                    if (UseYahoo)
                    {
                        string YahooSymbolString = Symbols.Replace(",", "+");
                        StockQuoteUrl = @"http://finance.yahoo.com/q?s=" + YahooSymbolString + "&ql=1";
                    }
                    else
                    {
                        //Going to Put Google Finance here when I Figure it out.
                    }

                    // Initialize a new WebRequest.
                    HttpWebRequest webreq = (HttpWebRequest)WebRequest.Create(StockQuoteUrl);
                    // Get the response from the Internet resource.
                    HttpWebResponse webresp = (HttpWebResponse)webreq.GetResponse();
                    // Read the body of the response from the server.

                    HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument();
                    string pageSource;
                    using (StreamReader sr = new StreamReader(webresp.GetResponseStream()))
                    {
                        pageSource = sr.ReadToEnd();
                    }
                    doc.LoadHtml(pageSource.ToString());
                    if (UseYahoo)
                    {
                        string Results = string.Empty;
                        //loop through each Symbol that you provided with a "," delimiter
                        foreach (string SplitSymbol in Symbols.Split(new char[] { ',' }))
                        {
                            Results += SplitSymbol + " : " + doc.GetElementbyId("yfs_l10_" + SplitSymbol).InnerText + Environment.NewLine;
                        }
                        return(Results);
                    }
                    else
                    {
                        return(doc.GetElementbyId("ref_14135_l").InnerText);
                    }
                }
                catch (WebException Webex)
                {
                    return("SYSTEM ERROR DOWNLOADING SYMBOL: " + Webex.ToString());
                }
            }
        }
Пример #8
0
        public static void ClassTearDown()
        {
            Console.WriteLine("ClassTearDown");
            if (mySpace != null)
            {
                DeleteSpace(mySpace.Id);
                mySpace = null;
            }

            fixture  = null;
            webex    = null;
            messages = null;
            mySpace  = null;
        }
Пример #9
0
        public void SetUp()
        {
            fixture = WebexTestFixture.Instance;
            Assert.IsNotNull(fixture);

            //webex = fixture.webex;
            webex = fixture.CreateWebex();
            Assert.IsNotNull(webex);

            person = webex.People;
            Assert.IsNotNull(person);

            other = fixture.CreatUser();
            Assert.IsNotNull(other);
        }
Пример #10
0
        public void SetUp()
        {
            fixture = WebexTestFixture.Instance;
            Assert.IsNotNull(fixture);

            //webex = fixture.webex;
            webex = fixture.CreateWebex();
            Assert.IsNotNull(webex);

            teamMemberships = webex.TeamMemberships;
            Assert.IsNotNull(teamMemberships);

            myTeamInfo = fixture.CreateTeam("test team");
            Assert.IsNotNull(myTeamInfo);
        }
Пример #11
0
        public void SetUp()
        {
            fixture = WebexTestFixture.Instance;
            Assert.IsNotNull(fixture);

            //webex = fixture.webex;
            webex = fixture.CreateWebex();
            Assert.IsNotNull(webex);

            teams = webex.Teams;
            Assert.IsNotNull(teams);

            myTeamInfo = CreateTeam(teamName);
            Validate(myTeamInfo);
        }
Пример #12
0
        public void SetUp()
        {
            fixture = WebexTestFixture.Instance;
            Assert.IsNotNull(fixture);

            //webex = fixture.webex;
            webex = fixture.CreateWebex();
            Assert.IsNotNull(webex);

            webhooks = webex.Webhooks;
            Assert.IsNotNull(webhooks);

            mySpace   = fixture.CreateSpace("test space");
            myWebHook = CreateWebHook();
            Assert.IsNotNull(myWebHook);
            Assert.IsNotNull(myWebHook.Id);
        }
Пример #13
0
        public void SetUp()
        {
            fixture = WebexTestFixture.Instance;
            Assert.IsNotNull(fixture);

            //webex = fixture.webex;
            webex = fixture.CreateWebex();
            Assert.IsNotNull(webex);

            memberships = webex.Memberships;
            Assert.IsNotNull(memberships);

            if (other == null)
            {
                other = fixture.CreatUser();
            }
            var space = fixture.CreateSpace("test space");

            Assert.IsNotNull(space);
            spaceId = space.Id;
        }
Пример #14
0
        public static void ClassSetup(TestContext context)
        {
            Console.WriteLine("ClassSetup");
            fixture = WebexTestFixture.Instance;
            Assert.IsNotNull(fixture);

            webex = fixture.CreateWebexbyJwt();
            Assert.IsNotNull(webex);

            messages = webex.Messages;
            Assert.IsNotNull(messages);

            self = GetMe();

            other = fixture.CreatUser();

            mySpace = CreateSpace("my test space");
            Assert.IsNotNull(mySpace);

            if (StringExtention.GetHydraIdType(calleeAddress) == StringExtention.HydraIdType.People)
            {
                calleePersonId    = calleeAddress;
                calleePersonEmail = GetSpecificPerson(calleePersonId)?.Emails[0];
            }
            else if (calleeAddress.Contains("@"))
            {
                calleePersonEmail = calleeAddress;
                calleePersonId    = GetPerson(calleeAddress).Id;
            }

            Assert.IsNotNull(CreateMembership(mySpace.Id, null, calleePersonId, false));

            fileUrl = Directory.GetCurrentDirectory() + "\\Resources\\" + "WebexTeams.jpg";

            Thread.Sleep(60000);
        }
Пример #15
0
 public static void ClassTearDown()
 {
     fixture = null;
     webex   = null;
 }