Ejemplo n.º 1
0
        public async Task CountQuery()
        {
            ForceClient client = await forceClientFixture.GetForceClient();

            int count = await client.CountQuery("SELECT COUNT() FROM Case");

            Assert.True(count > 1);
        }
Ejemplo n.º 2
0
        public async void CountQuery()
        {
            ForceClient client = CreateMockClient(
                "https://na15.salesforce.com",
                "v41.0",
                "https://na15.salesforce.com/services/data/v41.0/query?q=SELECT%20COUNT()%20FROM%20Case",
                "count_query.json",
                HttpStatusCode.OK);

            int count = await client.CountQuery("SELECT COUNT() FROM Case");

            await Assert.ThrowsAsync <ForceApiException>(
                async() => await client.CountQuery("SELECT COUNT(Id) FROM Case")
                );

            await Assert.ThrowsAsync <ForceApiException>(
                async() => await client.CountQuery("SELECT COUNT(Id) CaseCount FROM Case")
                );

            Assert.Equal(26, count);
        }