예제 #1
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);
        }
예제 #2
0
        public static HydraIdType GetHydraIdType(string address)
        {
            string peopleUrl  = "ciscospark://us/PEOPLE/";
            string spaceUrl   = "ciscospark://us/ROOM/";
            string messageUrl = "ciscospark://us/MESSAGE/";

            HydraIdType result = HydraIdType.Error;

            try
            {
                var decodedStr = StringExtention.Base64UrlDecode(address);
                if (decodedStr.StartsWith(peopleUrl))
                {
                    result = HydraIdType.People;
                }
                else if (decodedStr.StartsWith(spaceUrl))
                {
                    result = HydraIdType.Space;
                }
                else if (decodedStr.StartsWith(messageUrl))
                {
                    result = HydraIdType.Message;
                }
                else
                {
                    result = HydraIdType.Unknow;
                }
            }
            catch
            {
                result = HydraIdType.Error;
            }


            return(result);
        }