コード例 #1
0
        public void GetAuthorizationCode_CodeProvided_ExtractsCode()
        {
            LearningLayersOidcProvider  lloidc             = new LearningLayersOidcProvider();
            Dictionary <string, string> redirectParameters = new Dictionary <string, string>();

            redirectParameters.Add("code", "myCode");
            string res = lloidc.GetAuthorizationCode(redirectParameters);

            Assert.AreEqual("myCode", res);
        }
コード例 #2
0
        public void GetAuthorizationCode_CodeNotProvided_ReturnsEmptyString()
        {
            LearningLayersOidcProvider  lloidc             = new LearningLayersOidcProvider();
            Dictionary <string, string> redirectParameters = new Dictionary <string, string>();

            LogAssert.Expect(LogType.Error, new Regex(@"\w*Redirect parameters did not contain authorization code\w*"));

            string res = lloidc.GetAuthorizationCode(redirectParameters);

            Assert.IsEmpty(res);
        }