public async Task DelContactCsv() { Console.WriteLine(DelContact.FromCsv(await Client.Contacts(new ContactsParams { Action = ContactsAction.del, Id = 13513516 }))); }
public async Task DelNonExistingContactCsv() { Console.WriteLine(DelContact.FromCsv(await Client.Contacts(new ContactsParams { Action = ContactsAction.del, Id = 51341255, }))); }
public async Task DelNonExistingContactCsv() { AssertDelNonExistingContact(DelContact.FromCsv(await BaseTest.Client.Contacts(new ContactsParams { Action = ContactsAction.del, Id = NonExistingContactId, }))); }
public async Task <dynamic> Contacts(ContactsParams @params) { HttpMethod httpMethod = ContactsAction.read == @params.Action ? HttpMethod.Get : HttpMethod.Post; string method = Library.Util.ToTitleCase(httpMethod.Method); object[] paras = { "contacts", @params }; var response = await CallDynamicMethod(method, paras); if ([email protected]) { return(response); } return(@params.Action switch { ContactsAction.write => WriteContact.FromCsv(response), ContactsAction.del => DelContact.FromCsv(response), _ => JsonConvert.DeserializeObject <Contact[]>(response) });
private void AssertDelNonExistingContact(DelContact contact) { Assert.That(contact.Return, Is.EqualTo(ErrorCode)); }
private void AssertDelContact(DelContact contact) { Assert.That(contact.Return, Is.EqualTo(SuccessCode)); }
public static bool OpDelContact(string userName) { DelContact.Builder builder = DelContact.CreateBuilder(); builder.UserName = Util.toSKString(userName); return(add(new OpLog(4, builder.Build().ToByteArray()))); }