Example #1
0
        public void GetCurrentPrice_WhenNoBidsExist_MinimumPriceIsReturned()
        {
            uint minimumPrice = 1;
            var auction = new Auction(_dummyItem, _dummyGuid, minimumPrice);

            uint currentPrice = auction.GetCurrentPrice();

            Assert.AreEqual(minimumPrice, currentPrice);
        }
Example #2
0
        public void GetCurrentPrice_WhenTwoBidsExist_HighestAmountIsReturned()
        {
            var auction = new Auction(_dummyItem, _dummyGuid, 1);

            var bid1 = new Bid(Guid.NewGuid(), 2);
            auction.PlaceBid(bid1);

            var bid2 = new Bid(Guid.NewGuid(), 3);
            auction.PlaceBid(bid2);

            uint currentPrice = auction.GetCurrentPrice();

            Assert.AreEqual(bid2.Amount, currentPrice);
        }