Example #1
0
        private static Task FireAndForget(ILogger logger, DeadLetterObject deadLetter)
        {
            Console.WriteLine("Sending async message to deadletter");
            var firstRealObject = new RealObject(logger);

            return(firstRealObject.Send(deadLetter, new PingMessage()));
        }
Example #2
0
 public async Task PingObjectAndRecievePong_missspell1()
 {
     var logger = new FakeTraceLogger();
     logger.FirstCall(str => str.ToString().Contains("call Ping"));
     var firstRealObject = new RealObject(logger);
     var secondRealObject = new RealObject(logger);
     await firstRealObject.Send(secondRealObject, new PingMessage());
 }
Example #3
0
 private static async Task CallOneObjectFromAnother(ILogger logger)
 {
     var firstRealObject = new RealObject(logger);
     var secondRealObject = new RealObject(logger);
     Console.WriteLine($"Method calls between {firstRealObject.GetObjectRef()} and {secondRealObject.GetObjectRef()}");
     await firstRealObject.Send(secondRealObject, new PingMessage());
     Console.WriteLine();
 }
Example #4
0
        public async Task PingObjectAndRecievePong_missspell1()
        {
            var logger = new FakeTraceLogger();

            logger.FirstCall(str => str.ToString().Contains("call Ping"));
            var firstRealObject  = new RealObject(logger);
            var secondRealObject = new RealObject(logger);
            await firstRealObject.Send(secondRealObject, new PingMessage());
        }
Example #5
0
        private static async Task CallOneObjectFromAnother(ILogger logger)
        {
            var firstRealObject  = new RealObject(logger);
            var secondRealObject = new RealObject(logger);

            Console.WriteLine($"Method calls between {firstRealObject.GetObjectRef()} and {secondRealObject.GetObjectRef()}");
            await firstRealObject.Send(secondRealObject, new PingMessage());

            Console.WriteLine();
        }
Example #6
0
 public async Task PingObjectAndRecievePong()
 {
     var logger = new FakeTraceLogger();
     logger
         .FirstCall(str => str.ToString().Contains("calls Ping"))
         .AndThenCall(str => str.ToString().Contains("Received Ping"))
         .AndThenCall(str => str.ToString().Contains("calls Pong"))
         .AndThenCall(str => str.ToString().Contains("Received Pong"));
     var firstRealObject = new RealObject(logger);
     var secondRealObject = new RealObject(logger);
     await firstRealObject.Send(secondRealObject, new PingMessage());
     Assert.AreEqual(4, logger.NumberOfCalls);
 }
Example #7
0
        public async Task PingObjectAndRecievePong()
        {
            var logger = new FakeTraceLogger();

            logger
            .FirstCall(str => str.ToString().Contains("calls Ping"))
            .AndThenCall(str => str.ToString().Contains("Received Ping"))
            .AndThenCall(str => str.ToString().Contains("calls Pong"))
            .AndThenCall(str => str.ToString().Contains("Received Pong"));
            var firstRealObject  = new RealObject(logger);
            var secondRealObject = new RealObject(logger);
            await firstRealObject.Send(secondRealObject, new PingMessage());

            Assert.AreEqual(4, logger.NumberOfCalls);
        }
Example #8
0
 private static Task FireAndForget(ILogger logger, DeadLetterObject deadLetter)
 {
     Console.WriteLine("Sending async message to deadletter");
     var firstRealObject = new RealObject(logger);
     return firstRealObject.Send(deadLetter, new PingMessage());
 }