public void TestTokenAuthenticator() { var loginPath = "_facebook"; var parameters = new Dictionary<string, string>(); parameters["access_token"] = "facebookaccesstoken"; TokenAuthenticator tokenAuth = new TokenAuthenticator(loginPath, parameters); var tokenAuthParams = tokenAuth.LoginParametersForSite(null); Assert.IsNotNull(tokenAuthParams); Assert.AreEqual(tokenAuthParams.Count, parameters.Count); Assert.AreEqual(tokenAuthParams["access_token"], parameters["access_token"]); Assert.AreEqual(tokenAuth.LoginPathForSite(null), "/_facebook"); Assert.IsTrue(tokenAuth.UsesCookieBasedLogin); Assert.IsNull(tokenAuth.UserInfo); }
public virtual void TestTokenAuthenticator() { string loginPath = "_facebook"; IDictionary<string, string> @params = new Dictionary<string, string>(); @params.Put("access_token", "facebookaccesstoken"); TokenAuthenticator tokenAuth = new TokenAuthenticator(loginPath, @params); IDictionary<string, string> tokenAuthParams = tokenAuth.LoginParametersForSite(null ); NUnit.Framework.Assert.IsNotNull(tokenAuthParams); NUnit.Framework.Assert.AreEqual(tokenAuthParams.Count, @params.Count); NUnit.Framework.Assert.AreEqual(tokenAuthParams.Get("access_token"), @params.Get( "access_token")); NUnit.Framework.Assert.AreEqual(tokenAuth.LoginPathForSite(null), "/_facebook"); NUnit.Framework.Assert.IsTrue(tokenAuth.UsesCookieBasedLogin()); NUnit.Framework.Assert.IsNull(tokenAuth.AuthUserInfo()); }