예제 #1
0
        public void RestConnector_Connect_TestThrowException()
        {
            // This code query string is expired and will return a 400 Bad Request from GoToWebinar

            //Arrange
            string returnUrl = @"http://scribesoft.com/?code={0}";
            RestConnector connector = new RestConnector();
            Dictionary<string, string> properties = new Dictionary<string, string>();
            properties.Add(oauth, returnUrl);

            //Act:
            connector.Connect(properties);
        }
예제 #2
0
        public void RestConnector_ReConnect_Test()
        {
            //Connect twice to retrieve the access token from storage instead of getting it from the authorize call again
            //Will have to manually log into GoToWebinar with a valid account and pull the 'code' off of the URL, paste it below:

            //arrange
            string code = string.Empty;

            RestConnector connector = new RestConnector();
            Dictionary<string, string> properties = new Dictionary<string, string>();
            properties.Add(oauth, string.Format(returnUrl, code));

            //act:
            connector.Connect(properties);

            //grab the access token and serialize it. This simulates what Scribe Online does after the inital call to the Connector:
            properties[oauth] = Scribe.Core.ConnectorApi.Serialization.XmlTextSerializer.Serialize<Dictionary<string, string>>(properties, null, null);
            connector.Connect(properties);

            //Assert:
            Assert.IsTrue(connector.IsConnected);
        }