Exemple #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()));
        }
Exemple #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());
 }
Exemple #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();
 }
Exemple #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());
        }
Exemple #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();
        }
Exemple #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);
 }
Exemple #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);
        }
Exemple #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());
 }