コード例 #1
0
 public async Task DelContactCsv()
 {
     Console.WriteLine(DelContact.FromCsv(await Client.Contacts(new ContactsParams {
         Action = ContactsAction.del,
         Id     = 13513516
     })));
 }
コード例 #2
0
 public async Task DelNonExistingContactCsv()
 {
     Console.WriteLine(DelContact.FromCsv(await Client.Contacts(new ContactsParams {
         Action = ContactsAction.del,
         Id     = 51341255,
     })));
 }
コード例 #3
0
 public async Task DelNonExistingContactCsv()
 {
     AssertDelNonExistingContact(DelContact.FromCsv(await BaseTest.Client.Contacts(new ContactsParams {
         Action = ContactsAction.del,
         Id     = NonExistingContactId,
     })));
 }
コード例 #4
0
        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)
            });
コード例 #5
0
 private void AssertDelNonExistingContact(DelContact contact)
 {
     Assert.That(contact.Return, Is.EqualTo(ErrorCode));
 }
コード例 #6
0
 private void AssertDelContact(DelContact contact)
 {
     Assert.That(contact.Return, Is.EqualTo(SuccessCode));
 }
コード例 #7
0
 public static bool OpDelContact(string userName)
 {
     DelContact.Builder builder = DelContact.CreateBuilder();
     builder.UserName = Util.toSKString(userName);
     return(add(new OpLog(4, builder.Build().ToByteArray())));
 }