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); }
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); }