コード例 #1
0
ファイル: RealObjectTests.cs プロジェクト: lemmit/RealOOP
        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());
        }
コード例 #2
0
ファイル: RealObjectTests.cs プロジェクト: lemmit/RealOOP
        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);
        }