public void UnLinkFacebookLinkTwitter() { // テストデータ作成 NCMBUser user = new NCMBUser(); user.AuthData = facebookParams.param; // authData登録 user.LogInWithAuthDataAsync((NCMBException e) => { Assert.Null(e); }); NCMBTestSettings.AwaitAsync(); // authData追加 user.LinkWithAuthDataAsync(twitterParams.param, (NCMBException e1) => { Assert.Null(e1); }); NCMBTestSettings.AwaitAsync(); Assert.True(user.IsLinkWith("twitter")); // authData削除 user.UnLinkWithAuthDataAsync("facebook", (NCMBException e2) => { Assert.Null(e2); NCMBTestSettings.CallbackFlag = true; }); NCMBTestSettings.AwaitAsync(); // 削除成功の確認 Assert.IsNotEmpty(NCMBUser._getCurrentSessionToken()); Assert.True(user.IsLinkWith("twitter")); Assert.False(user.IsLinkWith("facebook")); Assert.True(NCMBTestSettings.CallbackFlag); NCMBUser.LogOutAsync(); }
public void LinkWithAuthDataAsyncInvalidTwitter() { // テストデータ作成 NCMBUser user = new NCMBUser(); user.AuthData = facebookParams.param; // authData登録 user.LogInWithAuthDataAsync((NCMBException e) => { Assert.Null(e); }); NCMBTestSettings.AwaitAsync(); // authData追加 user.LinkWithAuthDataAsync(invalidTwitterParams.param, (NCMBException e) => { Assert.AreEqual(NCMBException.OAUTH_ERROR, e.ErrorCode); NCMBTestSettings.CallbackFlag = true; }); NCMBTestSettings.AwaitAsync(); // 追加失敗の確認 Assert.IsNotEmpty(NCMBUser._getCurrentSessionToken()); Assert.True(user.IsLinkWith("facebook")); Assert.False(user.IsLinkWith("twitter")); Assert.True(NCMBTestSettings.CallbackFlag); NCMBUser.LogOutAsync(); }
public void UnLinkWithAuthDataAsyncTwitter() { // テストデータ作成 NCMBUser user = new NCMBUser(); user.AuthData = twitterParams.param; // authData登録 user.LogInWithAuthDataAsync((NCMBException e) => { Assert.Null(e); }); NCMBTestSettings.AwaitAsync(); Assert.True(user.IsLinkWith("twitter")); // authData削除 user.UnLinkWithAuthDataAsync("twitter", (NCMBException e1) => { Assert.Null(e1); NCMBTestSettings.CallbackFlag = true; }); NCMBTestSettings.AwaitAsync(); // 削除成功の確認 Assert.False(user.IsLinkWith("twitter")); Assert.True(NCMBTestSettings.CallbackFlag); NCMBUser.LogOutAsync(); }
public async Task LinkWithAuthDataTaskAsyncInvalidTwitterTask() { // テストデータ作成 NCMBUser user = new NCMBUser(); user.AuthData = facebookParams.param; // authData登録 await user.LogInWithAuthDataTaskAsync(); try { // authData追加 await user.LinkWithAuthDataTaskAsync(invalidTwitterParams.param); Assert.Fail("Exception not thrown"); } catch (NCMBException e) { Assert.AreEqual(NCMBException.OAUTH_ERROR, e.ErrorCode); } // 追加失敗の確認 Assert.IsNotEmpty(NCMBUser._getCurrentSessionToken()); Assert.True(user.IsLinkWith("facebook")); Assert.False(user.IsLinkWith("twitter")); Assert.True(NCMBTestSettings.CallbackFlag); }
public IEnumerator UnLinkWithAuthDataAsyncFacebook() { // テストデータ作成 NCMBUser user = new NCMBUser(); user.AuthData = facebookParams.param; // authData登録 user.LogInWithAuthDataAsync((NCMBException e) => { Assert.Null(e); NCMBTestSettings.CallbackFlag = true; }); yield return(NCMBTestSettings.AwaitAsync()); NCMBTestSettings.CallbackFlag = false; Assert.True(user.IsLinkWith("facebook")); // authData削除 user.UnLinkWithAuthDataAsync("facebook", (NCMBException e1) => { Assert.Null(e1); NCMBTestSettings.CallbackFlag = true; }); yield return(NCMBTestSettings.AwaitAsync()); // 削除成功の確認 Assert.False(user.IsLinkWith("facebook")); Assert.True(NCMBTestSettings.CallbackFlag); }
public IEnumerator LinkWithAuthDataAsyncTwitter() { // テストデータ作成 NCMBUser user = new NCMBUser(); user.AuthData = facebookParams.param; // authData登録 user.LogInWithAuthDataAsync((NCMBException e) => { Assert.Null(e); NCMBTestSettings.CallbackFlag = true; }); yield return(NCMBTestSettings.AwaitAsync()); NCMBTestSettings.CallbackFlag = false; // authData追加 user.LinkWithAuthDataAsync(twitterParams.param, (NCMBException e1) => { Assert.Null(e1); NCMBTestSettings.CallbackFlag = true; }); yield return(NCMBTestSettings.AwaitAsync()); // 追加成功の確認 Assert.IsNotEmpty(NCMBUser._getCurrentSessionToken()); Assert.True(user.IsLinkWith("facebook")); Assert.True(user.IsLinkWith("twitter")); Assert.True(NCMBTestSettings.CallbackFlag); }
public void LogInWithAuthDataAsyncTwitter() { // テストデータ作成 NCMBUser user = new NCMBUser(); user.AuthData = twitterParams.param; // authData登録 user.LogInWithAuthDataAsync((NCMBException e) => { Assert.Null(e); NCMBTestSettings.CallbackFlag = true; }); NCMBTestSettings.AwaitAsync(); Assert.AreEqual("dummyObjectId", user.ObjectId); // twitterパラメータ確認 Dictionary <string, object> authData = user.GetAuthDataForProvider("twitter"); Assert.AreEqual("twitterDummyId", authData["id"]); Assert.AreEqual("twitterDummyScreenName", authData["screen_name"]); Assert.AreEqual("twitterDummyConsumerKey", authData["oauth_consumer_key"]); Assert.AreEqual("twitterDummyConsumerSecret", authData["consumer_secret"]); Assert.AreEqual("twitterDummyAuthToken", authData["oauth_token"]); Assert.AreEqual("twitterDummyAuthSecret", authData["oauth_token_secret"]); // 登録成功の確認 Assert.NotNull(NCMBUser._getCurrentSessionToken()); Assert.True(user.IsLinkWith("twitter")); Assert.True(NCMBTestSettings.CallbackFlag); NCMBUser.LogOutAsync(); }
public void LogInWithAuthDataAsyncFacebook() { // テストデータ作成 NCMBUser user = new NCMBUser(); user.AuthData = facebookParams.param; // authData登録 user.LogInWithAuthDataAsync((NCMBException e) => { Assert.Null(e); NCMBTestSettings.CallbackFlag = true; }); NCMBTestSettings.AwaitAsync(); Assert.AreEqual("dummyObjectId", user.ObjectId); // facebookパラメータ確認 Dictionary <string, object> authData = user.GetAuthDataForProvider("facebook"); Assert.AreEqual("facebookDummyId", authData["id"]); Assert.AreEqual("facebookDummyAccessToken", authData["access_token"]); Assert.AreEqual("2017-02-07T01:02:03.004Z", authData["expiration_date"]); // 登録成功の確認 Assert.IsNotEmpty(NCMBUser._getCurrentSessionToken()); Assert.True(user.IsLinkWith("facebook")); Assert.True(NCMBTestSettings.CallbackFlag); NCMBUser.LogOutAsync(); }
public IEnumerator LogInWithAuthDataAsyncFacebookStatus200() { // テストデータ作成 NCMBUser user = new NCMBUser(); user.AuthData = facebookParams200.param; // authData登録 user.LogInWithAuthDataAsync((NCMBException e1) => { Assert.Null(e1); NCMBUser currentUser = NCMBUser.CurrentUser; Assert.NotNull(currentUser); Assert.AreEqual("dummyObjectId", currentUser.ObjectId); // facebookパラメータ確認 Dictionary <string, object> authData = currentUser.GetAuthDataForProvider("facebook"); Assert.AreEqual("facebookDummyId200", authData ["id"]); Assert.AreEqual("facebookDummyAccessToken200", authData ["access_token"]); Assert.AreEqual("2017-02-07T01:02:03.004Z", authData ["expiration_date"]); // 登録成功の確認 Assert.IsNotEmpty(NCMBUser._getCurrentSessionToken()); Assert.True(currentUser.IsLinkWith("facebook")); NCMBTestSettings.CallbackFlag = true; }); yield return(NCMBTestSettings.AwaitAsync()); Assert.True(NCMBTestSettings.CallbackFlag); }
public async Task UnLinkWithAuthDataTaskAsyncTwitterTask() { // テストデータ作成 NCMBUser user = new NCMBUser(); user.AuthData = twitterParams.param; // authData登録 await user.LogInWithAuthDataTaskAsync(); Assert.True(user.IsLinkWith("twitter")); // authData削除 await user.UnLinkWithAuthDataTaskAsync("twitter"); // 削除成功の確認 Assert.False(user.IsLinkWith("twitter")); Assert.True(NCMBTestSettings.CallbackFlag); }
public async Task LinkWithAuthDataTaskAsyncTwitterTask() { // テストデータ作成 NCMBUser user = new NCMBUser(); user.AuthData = facebookParams.param; // authData登録 await user.LogInWithAuthDataTaskAsync(); // authData追加 await user.LinkWithAuthDataTaskAsync(twitterParams.param); // 追加成功の確認 Assert.IsNotEmpty(NCMBUser._getCurrentSessionToken()); Assert.True(user.IsLinkWith("facebook")); Assert.True(user.IsLinkWith("twitter")); Assert.True(NCMBTestSettings.CallbackFlag); }
public IEnumerator LogInWithAuthDataAsyncInvalidTwitter() { // テストデータ作成 NCMBUser user = new NCMBUser(); user.AuthData = invalidTwitterParams.param; // authData登録 user.LogInWithAuthDataAsync((NCMBException e) => { Assert.AreEqual(NCMBException.OAUTH_ERROR, e.ErrorCode); NCMBTestSettings.CallbackFlag = true; }); yield return(NCMBTestSettings.AwaitAsync()); // 登録失敗の確認 Assert.IsEmpty(NCMBUser._getCurrentSessionToken()); Assert.False(user.IsLinkWith("twitter")); Assert.True(NCMBTestSettings.CallbackFlag); }