public void QueryByAttributeEntityCollectionExtensionMethod() { var context = new XrmFakedContext(); var orgService = context.GetOrganizationService(); context.Initialize(new List <Entity>() { TestAccount1, TestAccount1Duplicate }); var retrievedAccounts = SampleAccountQueryByAttribute.RetrieveMultiple(orgService); Assert.AreEqual(2, retrievedAccounts.Entities.Count); }
public void QueryByAttributeSingleRecordExtensionMethod() { var context = new XrmFakedContext(); var orgService = context.GetOrganizationService(); context.Initialize(new List <Entity>() { TestAccount1 }); var retrievedAccount = (Account)SampleAccountQueryByAttribute.RetrieveSingleRecord(orgService); Assert.AreEqual(TestAccount1.Id, retrievedAccount.Id); Assert.AreEqual(TestAccount1.Name, retrievedAccount.Name); }