Exemplo n.º 1
0
        private async Task <bool> CheckCounter(IBatchProducerGrain producer, ISampleStreaming_ConsumerGrain consumer, bool assertIsTrue)
        {
            var numProduced = await producer.GetNumberProduced();

            var numConsumed = await consumer.GetNumberConsumed();

            return(await CheckCounter(numProduced, numConsumed, assertIsTrue));
        }
Exemplo n.º 2
0
        private async Task <bool> CheckCounters(ISampleStreaming_ConsumerGrain consumer, int eventsProduced, bool assertIsTrue)
        {
            var numConsumed = await consumer.GetNumberConsumed();

            if (!assertIsTrue)
            {
                return(eventsProduced == numConsumed);
            }
            Assert.Equal(eventsProduced, numConsumed);
            return(true);
        }
Exemplo n.º 3
0
        private async Task <bool> CheckCounters(ISampleStreaming_ProducerGrain producer, ISampleStreaming_ConsumerGrain consumer, bool assertIsTrue)
        {
            var numProduced = await producer.GetNumberProduced();

            var numConsumed = await consumer.GetNumberConsumed();

            logger.Info("CheckCounters: numProduced = {0}, numConsumed = {1}", numProduced, numConsumed);
            if (assertIsTrue)
            {
                Assert.Equal(numProduced, numConsumed);
                return(true);
            }
            else
            {
                return(numProduced == numConsumed);
            }
        }
Exemplo n.º 4
0
 private async Task<bool> CheckCounters(ISampleStreaming_ProducerGrain producer, ISampleStreaming_ConsumerGrain consumer, bool assertIsTrue)
 {
     var numProduced = await producer.GetNumberProduced();
     var numConsumed = await consumer.GetNumberConsumed();
     logger.Info("CheckCounters: numProduced = {0}, numConsumed = {1}", numProduced, numConsumed);
     if (assertIsTrue)
     {
         Assert.AreEqual(numProduced, numConsumed, String.Format("numProduced = {0}, numConsumed = {1}", numProduced, numConsumed));
         return true;
     }
     else
     {
         return numProduced == numConsumed;
     }
 }