public void CancelBid_when_1_bid_exists_changes_currentPrice_to_0_and_returns_credits_to_user() { var user1 = AuctionTestUtils.CreateUser(); auction.Raise(user1, 10); var firstBid = auction.Bids.Last(); auction.MarkPendingEventsAsHandled(); auction.CancelBid(user1, firstBid); auction.PendingEvents.Count.Should() .Be(1); auction.PendingEvents.First() .Should() .BeOfType <BidCanceled>(); auction.ActualPrice.Should().Be(0); user1.PendingEvents.Should().HaveCount(2); user1.PendingEvents.First().Should().BeOfType <CreditsWithdrawn>(); user1.PendingEvents.Last().Should().BeOfType <CreditsReturned>(); user1.Credits.Should().Be(1000); }