Пример #1
0
        public void IfNoResultsAreFoundReturnsNull()
        {
            var context    = new XrmFakedContext();
            var orgService = context.GetOrganizationService();

            var retrievedAccount = (Account)SampleAccountQueryExpression.RetrieveSingleRecord(orgService);

            Assert.IsNull(retrievedAccount);
        }
Пример #2
0
        public void QueryExpressionSingleRecordExtensionMethod()
        {
            var context    = new XrmFakedContext();
            var orgService = context.GetOrganizationService();

            context.Initialize(new List <Entity>()
            {
                TestAccount1
            });

            var retrievedAccount = (Account)SampleAccountQueryExpression.RetrieveSingleRecord(orgService);

            Assert.AreEqual(TestAccount1.Id, retrievedAccount.Id);
            Assert.AreEqual(TestAccount1.Name, retrievedAccount.Name);
        }