public void Test_0003_Save() { this.LogIn(); ClearClientRequest(); client.AddResponse(200, null); KiiTopic topic = KiiUser.CurrentUser.Topic("my_topic"); topic.Save(); Assert.AreEqual(KiiHttpMethod.PUT, client.RequestMethod [0]); Assert.AreEqual("https://api.kii.com/api/apps/appId/users/user1234/topics/my_topic", client.RequestUrl [0]); }
public void Test_Save_By_Anonymous() { this.LogIn(); ClearClientRequest(); client.AddResponse(new CloudException(401, null)); KiiTopic topic = KiiUser.CurrentUser.Topic("my_topic"); Kii.LogOut(); try { topic.Save(); Assert.Fail("CloudException has not thrown"); } catch (CloudException e) { // pass } Assert.AreEqual(KiiHttpMethod.PUT, client.RequestMethod [0]); Assert.AreEqual("https://api.kii.com/api/apps/appId/users/user1234/topics/my_topic", client.RequestUrl [0]); }