Exemplo n.º 1
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());
        }
Exemplo n.º 2
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);
        }