public void BulkLinkedRead1Test() { var client = new SugarRestClient(TestAccount.Url, TestAccount.Username, TestAccount.Password); // -------------------Read Account Link Contact------------------- int count = 10; SugarRestResponse response = LinkedModules.BulkReadAccountLinkContact(client, count); Assert.NotNull(response); Assert.Equal(response.StatusCode, HttpStatusCode.OK); // Deserialize json data to custom object List <CustomAcccount1> customAccounts = JsonConvert.DeserializeObject <List <CustomAcccount1> >(response.JData); Assert.NotNull(customAccounts); Assert.True(customAccounts.Count <= count); // -------------------End Account Link Contact------------------- }
public SchemeModule(SchemeProject project, string code) : base(project, code) { var elem = XDocument.Load(Dir + "ModuleProperties.xml").Element("ModuleProperties"); Name = elem.GetAttr("ModuleName"); Description = elem.GetAttr("Description"); var linked = elem.Element("LinkedModules").Elements(); foreach (var el in linked) { LinkedModules.Add(el.Name.LocalName); } linked = elem.Element("LinkedConnects").Elements(); foreach (var el in linked) { LinkedConnects.Add(el.Name.LocalName); } }
public void LinkedRead2Test() { var client = new SugarRestClient(TestAccount.Url, TestAccount.Username, TestAccount.Password); // -------------------Bulk Read Account------------------- int count = 10; SugarRestResponse response = AccountsModule.BulkReadAccount(client, count); Assert.NotNull(response); Assert.Equal(response.StatusCode, HttpStatusCode.OK); List <Account> readAccounts = (List <Account>)(response.Data); Assert.NotNull(readAccounts); Assert.True(readAccounts.Count <= count); // -------------------End Bulk Read Account------------------- // -------------------Read Account Link Concat------------------- string accountId = readAccounts[count - 1].Id; response = LinkedModules.ReadAccountLinkItems(client, accountId); Assert.NotNull(response); Assert.Equal(response.StatusCode, HttpStatusCode.OK); Assert.True(response.Data == null); Assert.NotEmpty(response.JData); Assert.NotEmpty(response.JData); // Deserialize json data to custom object CustomAcccount2 customAccount = JsonConvert.DeserializeObject <CustomAcccount2>(response.JData); Assert.NotNull(customAccount); Assert.Equal(accountId, customAccount.Id); // -------------------End Read Account Link Concat------------------- }