private int CreateGroup(string name) { ICreateGroupApi api = new CreateGroupApi(context); var jsonContainer = new GroupApiJsonDataContainer(); jsonContainer.Group = new Neuzilla.Wex.Core.Group.UserGroup() { Name = name }; api.JsonData = jsonContainer; var response = api.Execute(); return(response.Group.Id); }
public void TestCreateGroupApi() { ICreateGroupApi api = new CreateGroupApi(context); var jsonContainer = new GroupApiJsonDataContainer(); jsonContainer.Group = new Neuzilla.Wex.Core.Group.UserGroup() { Name = "test" }; api.JsonData = jsonContainer; var response = api.Execute(); Assert.IsNotNull(response); Assert.IsTrue(response.Group.Id > 0); Assert.AreEqual("test", response.Group.Name); Assert.AreEqual(0, response.Group.Count); }
public void TestRenameGroupApi() { int id = CreateGroup("test2"); IRenameGroupApi api2 = new RenameGroupApi(context); var jsonContainer2 = new GroupApiJsonDataContainer(); string renameTo = "test2_modify"; jsonContainer2.Group = new Neuzilla.Wex.Core.Group.UserGroup() { Id = id, Name = renameTo }; api2.JsonData = jsonContainer2; var response2 = api2.Execute(); Assert.IsTrue(GroupExists(renameTo)); DeleteGroup(id); }