public void GetAllChildrenAndChildrenOfChildrenAccounts_When_No_Account_Exists() { var orgService = CreateTestingContext(); IAccountQueries queryEngine = new AccountQueries(orgService); Assert.False(queryEngine.GetAllChildrenAndChildrenOfChildrenAccounts(new EntityReference(CrmObject.Account.EntityLogicalName, Guid.NewGuid())).Any()); }
public void GetAllChildrenAndChildrenOfChildrenAccounts_Throws_Error_On_Null_EntityReference() { var orgService = CreateTestingContext(); IAccountQueries queryEngine = new AccountQueries(orgService); Assert.Throws <ArgumentNullException>(() => queryEngine.GetAllChildrenAndChildrenOfChildrenAccounts(null)); }
public void GetAllChildrenAndChildrenOfChildrenAccounts_With_No_Children() { var orgService = CreateTestingContext(); IAccountQueries queryEngine = new AccountQueries(orgService); var results = queryEngine.GetAllChildrenAndChildrenOfChildrenAccounts(new EntityReference(CrmObject.Account.EntityLogicalName, Guid.Parse("{66F541B7-2A0C-4668-B2D6-4E6C6F556946}"))); Assert.True(results.Count == 0); }
public void GetAllChildrenAndChildrenOfChildrenAccounts_With_Children_And_A_Parent() { var orgService = CreateTestingContext(); IAccountQueries queryEngine = new AccountQueries(orgService); var results = queryEngine.GetAllChildrenAndChildrenOfChildrenAccounts(new EntityReference(CrmObject.Account.EntityLogicalName, Guid.Parse("{E063D3AF-13E3-4A89-9E26-3FE9E88D491B}"))); Assert.True(results.Count == 2); Assert.True(results.Any(x => x.Id == Guid.Parse("{66F541B7-2A0C-4668-B2D6-4E6C6F556946}"))); Assert.True(results.Any(x => x.Id == Guid.Parse("{7C4DB64C-0D80-4092-8F31-D6EB7558ED39}"))); }
public void GetAllChildrenAndChildrenOfChildrenAccounts_With_Multiple_Levels() { var orgService = CreateTestingContext(); IAccountQueries queryEngine = new AccountQueries(orgService); var results = queryEngine.GetAllChildrenAndChildrenOfChildrenAccounts(new EntityReference(CrmObject.Account.EntityLogicalName, Guid.Parse("{FCFD0F00-B18A-45E8-9CF5-2A4C6BB6923D}"))); Assert.True(results.Count == 4); Assert.True(results.Any(x => x.Id == Guid.Parse("{70446EE5-8591-4141-9429-632F231B02F6}"))); Assert.True(results.Any(x => x.Id == Guid.Parse("{E063D3AF-13E3-4A89-9E26-3FE9E88D491B}"))); Assert.True(results.Any(x => x.Id == Guid.Parse("{66F541B7-2A0C-4668-B2D6-4E6C6F556946}"))); Assert.True(results.Any(x => x.Id == Guid.Parse("{E063D3AF-13E3-4A89-9E26-3FE9E88D491B}"))); }