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