Ejemplo n.º 1
0
        public void GetChildAccountsForAnAccount_When_No_Account_Exists()
        {
            var orgService = CreateTestingContext();

            IAccountQueries queryEngine = new AccountQueries(orgService);

            Assert.False(queryEngine.GetChildAccountsForAnAccount(new EntityReference(CrmObject.Account.EntityLogicalName, Guid.NewGuid())).Any());
        }
Ejemplo n.º 2
0
        public void GetChildAccountsForAnAccount_Throws_Error_On_Null_EntityReference()
        {
            var orgService = CreateTestingContext();

            IAccountQueries queryEngine = new AccountQueries(orgService);

            Assert.Throws <ArgumentNullException>(() => queryEngine.GetChildAccountsForAnAccount(null));
        }
Ejemplo n.º 3
0
        public void GetChildAccountsForAnAccount_When_Account_Exists()
        {
            var orgService = CreateTestingContext();

            IAccountQueries queryEngine = new AccountQueries(orgService);

            var results =
                queryEngine.GetChildAccountsForAnAccount(new EntityReference(CrmObject.Account.EntityLogicalName,
                                                                             Guid.Parse("{FCFD0F00-B18A-45E8-9CF5-2A4C6BB6923D}")));

            Assert.True(results.Count == 2);
            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}")));
        }