コード例 #1
0
        public void ReportstLostIfAuctionClosesWhenBidding()
        {
            sniper.CurrentPrice(123, 45, PriceSource.FromOtherBidder);

            //In the original example it uses jMock states for keeping the method call
            bool called = false;

            sniperListener.When(sl => sl.SniperStateChanged(Arg.Is <SniperSnapshot>(ss => ss.State == SniperState.BIDDING))).Do(x => called = true);

            // If SniperBidding is called then SniperLost should be called.
            if (called)
            {
                sniperListener.Received().SniperLost();
            }
        }