/// <summary> /// Add a new user to a database cluster /// </summary> public Task <DatabaseUser> AddUser(string databaseId, Models.Requests.DatabaseUser user) { var parameters = new List <Parameter> { new Parameter("id", databaseId, ParameterType.UrlSegment) }; return(_connection.ExecuteRequest <DatabaseUser>("databases/{id}/users", parameters, user, "user", Method.POST)); }
public void CorrectRequestForAddUser() { var factory = Substitute.For <IConnection>(); var client = new DatabasesClient(factory); var user = new Models.Requests.DatabaseUser(); client.AddUser("1", user); var parameters = Arg.Is <List <Parameter> >(list => (string)list[0].Value == "1"); factory.Received().ExecuteRequest <DatabaseUser>("databases/{id}/users", parameters, user, "user", Method.POST); }