当前位置: 首页>>代码示例>>C#>>正文


C# Models.Account类代码示例

本文整理汇总了C#中Salesforce.Force.FunctionalTests.Models.Account的典型用法代码示例。如果您正苦于以下问题:C# Account类的具体用法?C# Account怎么用?C# Account使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Account类属于Salesforce.Force.FunctionalTests.Models命名空间,在下文中一共展示了Account类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Create_Account_Typed

        public async void Create_Account_Typed()
        {
            var client = await GetForceClient();
            var account = new Account() { Name = "New Account", Description = "New Account Description" };
            var id = await client.Create("Account", account);

            Assert.IsNotNullOrEmpty(id);
        }
开发者ID:nadrees,项目名称:Force.com-Toolkit-for-NET,代码行数:8,代码来源:ForceClientTests.cs

示例2: CreateLotsOfAccounts

        public async Task CreateLotsOfAccounts(ForceClient forceClient)
        {
            var account = new Account { Name = "Test Account", Description = "New Account Description" };

            for (var i = 0; i < 1000; i++)
            {
                account.Name = "Test Account (" + i + ")";
                await forceClient.CreateAsync("Account", account);
            }
        }
开发者ID:brocsky,项目名称:Force.com-Toolkit-for-NET,代码行数:10,代码来源:ForceClientTests.cs

示例3: Update_Account_NameChanged

        public async void Update_Account_NameChanged()
        {
            var client = await GetForceClient();
            
            var originalName = "New Account";
            var newName = "New Account 2";

            var account = new Account() { Name = originalName, Description = "New Account Description" };
            var id = await client.Create("Account", account);
            account.Name = newName;
            await client.Update("Account", id, account);
            
            var result = await client.QueryById<Account>("Account", id);

            Assert.True(result.Name == newName);
        }
开发者ID:nadrees,项目名称:Force.com-Toolkit-for-NET,代码行数:16,代码来源:ForceClientTests.cs

示例4: Update_Account_IsSuccess

        public async void Update_Account_IsSuccess()
        {
            var client = await GetForceClient();
            
            string originalName = "New Account";
            string newName = "New Account 2";

            var account = new Account() { Name = originalName, Description = "New Account Description" };
            var id = await client.Create("Account", account);

            account.Name = newName;

            var success = await client.Update("Account", id, account);

            Assert.IsTrue(success);
        }
开发者ID:nadrees,项目名称:Force.com-Toolkit-for-NET,代码行数:16,代码来源:ForceClientTests.cs

示例5: Upsert_Account_NameChanged

        public async void Upsert_Account_NameChanged()
        {
            const string fieldName = "ExternalId__c";
            await CreateExternalIdField("Account", fieldName);

            const string originalName = "New Account External Upsert";
            const string newName = "New Account External Upsert 2";

            var account = new Account { Name = originalName, Description = "New Account Description" };
            await _client.UpsertExternalAsync("Account", fieldName, "4", account);

            account.Name = newName;
            await _client.UpsertExternalAsync("Account", fieldName, "4", account);

            var accountResult = await _client.QueryAsync<Account>(string.Format("SELECT Name FROM Account WHERE {0} = '4'", fieldName));
            var firstOrDefault = accountResult.Records.FirstOrDefault();

            Assert.True(firstOrDefault != null && firstOrDefault.Name == newName);
        }
开发者ID:samtrost-avalara,项目名称:Force.com-Toolkit-for-NET,代码行数:19,代码来源:ForceClientTests.cs

示例6: Upsert_Account_Insert_IsSuccess

        public async void Upsert_Account_Insert_IsSuccess()
        {
            const string objectName = "Account";
            const string fieldName = "ExternalId__c";

            await CreateExternalIdField(objectName, fieldName);

            var account = new Account { Name = "Upserted Account" + DateTime.Now.Ticks, Description = "New Upserted Account Description" + DateTime.Now.Ticks };
            var success = await _client.UpsertExternalAsync(objectName, fieldName, "123" + DateTime.Now.Ticks, account);

            Assert.IsNotNull(success);
            Assert.IsNotNull(success.Id);
            Assert.IsNotNullOrEmpty(success.Id);
        }
开发者ID:samtrost-avalara,项目名称:Force.com-Toolkit-for-NET,代码行数:14,代码来源:ForceClientTests.cs

示例7: Delete_Account_ValidateIsGone

        public async void Delete_Account_ValidateIsGone()
        {
            using (var httpClient = new HttpClient())
            {
                var client = await GetForceClient(httpClient);
                var account = new Account() { Name = "New Account", Description = "New Account Description" };
                var id = await client.Create("Account", account);
                await client.Delete("Account", id);

                var result = await client.QueryById<Account>("Account", id);

                Assert.IsNull(result);
            }
        }
开发者ID:jasonlee2000,项目名称:Force.com-Toolkit-for-NET,代码行数:14,代码来源:ForceClientTests.cs

示例8: Delete_Account_ObjectDoesNotExist

        public async Task Delete_Account_ObjectDoesNotExist()
        {
            try
            {
                var account = new Account { Name = "New Account", Description = "New Account Description" };
                var successResponse = await _client.CreateAsync("Account", account);
                var success = await _client.DeleteAsync("BadAccount", successResponse.Id);

                Assert.IsTrue(success);
            }
            catch (ForceException ex)
            {
                Assert.IsNotNull(ex);
                Assert.IsNotNull(ex.Message);
                Assert.IsNotNull(ex.Error);
            }
        }
开发者ID:Rajisampathkumar,项目名称:Force.com-Toolkit-for-NET,代码行数:17,代码来源:ForceClientTests.cs

示例9: Update_Account_NameChanged

        public async Task Update_Account_NameChanged()
        {
            const string originalName = "New Account";
            const string newName = "New Account 2";

            var account = new Account { Name = originalName, Description = "New Account Description" };
            var successResponse = await _client.CreateAsync("Account", account);
            account.Name = newName;
            await _client.UpdateAsync("Account", successResponse.Id, account);

            var result = await _client.QueryByIdAsync<Account>("Account", successResponse.Id);

            Assert.True(result.Name == newName);
        }
开发者ID:Rajisampathkumar,项目名称:Force.com-Toolkit-for-NET,代码行数:14,代码来源:ForceClientTests.cs

示例10: Update_Account_NullValues

        public async Task Update_Account_NullValues()
        {
            const string originalName = "New Account";
            const string newName = "New Account 2";

            var newAccount = new Account { Name = originalName, Description = "New Account Description" };
            var success1 = await _client.CreateAsync("Account", newAccount);
            Assert.IsNotNull(success1);

            var id = success1.Id;

            const string query = "SELECT AccountNumber,AccountSource,Active__c,AnnualRevenue,BillingAddress,BillingCity,BillingCountry,BillingGeocodeAccuracy,BillingLatitude,BillingLongitude,BillingPostalCode,BillingState,BillingStreet,CleanStatus,CreatedById,CreatedDate,CustomerPriority__c,DandbCompanyId,Description,DunsNumber,ExternalId__c,External_Id__c,Fax,Id,Industry,IsDeleted,Jigsaw,JigsawCompanyId,LastActivityDate,LastModifiedById,LastModifiedDate,LastReferencedDate,LastViewedDate,MasterRecordId,MyCustomField__c,NaicsCode,NaicsDesc,Name,NumberOfEmployees,NumberofLocations__c,OwnerId,Ownership,ParentId,Phone,PhotoUrl,Rating,ShippingAddress,ShippingCity,ShippingCountry,ShippingGeocodeAccuracy,ShippingLatitude,ShippingLongitude,ShippingPostalCode,ShippingState,ShippingStreet,Sic,SicDesc,Site,SLAExpirationDate__c,SLASerialNumber__c,SLA__c,SystemModstamp,TickerSymbol,Tradestyle,Type,UpsellOpportunity__c,Website,YearStarted FROM Account WHERE Id = '{0}'";

            var account1 = await _client.QueryAsync<Account>(string.Format(query, id));
            var newAccount2 = new Account { Name = newName };

            var success2 = await _client.UpdateAsync("Account", id, newAccount2);
            Assert.IsNotNull(success2);

            var account2 = await _client.QueryAsync<Account>(string.Format(query, id));

            Assert.AreEqual(account1.Records[0].Description, account2.Records[0].Description);
        }
开发者ID:Rajisampathkumar,项目名称:Force.com-Toolkit-for-NET,代码行数:23,代码来源:ForceClientTests.cs

示例11: Delete_Account_IsSuccess

        public async void Delete_Account_IsSuccess()
        {
            var account = new Account { Name = "New Account", Description = "New Account Description" };
            var id = await _client.CreateAsync("Account", account);
            var success = await _client.DeleteAsync("Account", id);

            Assert.IsTrue(success);
        }
开发者ID:brocsky,项目名称:Force.com-Toolkit-for-NET,代码行数:8,代码来源:ForceClientTests.cs

示例12: Upsert_Account_BadObject

 public async void Upsert_Account_BadObject()
 {
     try
     {
         using (var httpClient = new HttpClient())
         {
             var client = await GetForceClient(httpClient);
             var account = new Account { Name = "New Account ExternalID", Description = "New Account Description" };
             await client.UpsertExternalAsync("BadAccount", "ExternalID__c", "2", account);
         }
     }
     catch (ForceException ex)
     {
         Assert.IsNotNull(ex);
         Assert.IsNotNull(ex.Message);
         Assert.IsNotNull(ex.Error);
     }
 }
开发者ID:jadkisson,项目名称:Force.com-Toolkit-for-NET,代码行数:18,代码来源:ForceClientTests.cs

示例13: Delete_Account_ObjectDoesNotExist

        public async void Delete_Account_ObjectDoesNotExist()
        {
            try
            {
                using (var httpClient = new HttpClient())
                {
                    var client = await GetForceClient(httpClient);
                    var account = new Account { Name = "New Account", Description = "New Account Description" };
                    var id = await client.CreateAsync("Account", account);
                    var success = await client.DeleteAsync("BadAccount", id);

                    Assert.IsTrue(success);
                }
            }
            catch (ForceException ex)
            {
                Assert.IsNotNull(ex);
                Assert.IsNotNull(ex.Message);
                Assert.IsNotNull(ex.Error);
            }
        }
开发者ID:jadkisson,项目名称:Force.com-Toolkit-for-NET,代码行数:21,代码来源:ForceClientTests.cs

示例14: Delete_Account_IsSuccess

        public async void Delete_Account_IsSuccess()
        {
            using (var httpClient = new HttpClient())
            {
                var client = await GetForceClient(httpClient);
                var account = new Account { Name = "New Account", Description = "New Account Description" };
                var id = await client.CreateAsync("Account", account);
                var success = await client.DeleteAsync("Account", id);

                Assert.IsTrue(success);
            }
        }
开发者ID:jadkisson,项目名称:Force.com-Toolkit-for-NET,代码行数:12,代码来源:ForceClientTests.cs

示例15: Update_Account_BadObject

        public async void Update_Account_BadObject()
        {
            try
            {
                using (var httpClient = new HttpClient())
                {
                    var client = await GetForceClient(httpClient);

                    var originalName = "New Account";
                    var newName = "New Account 2";

                    var account = new Account { Name = originalName, Description = "New Account Description" };
                    var id = await client.CreateAsync("Account", account);

                    account.Name = newName;

                    await client.UpdateAsync("BadAccount", id, account);
                }
            }
            catch (ForceException ex)
            {
                Assert.IsNotNull(ex);
                Assert.IsNotNull(ex.Message);
                Assert.IsNotNull(ex.Error);
            }
        }
开发者ID:jadkisson,项目名称:Force.com-Toolkit-for-NET,代码行数:26,代码来源:ForceClientTests.cs


注:本文中的Salesforce.Force.FunctionalTests.Models.Account类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。