示例#1
0
        void EndAuction_ShouldThrowException()
        {
            BiddingBroker broker = new BiddingBroker(InitMockedDb());

            Person  goodPerson  = GetGoodPerson(broker);
            Auction goodAuction = GetGoodAuction(broker);

            Auction registeredAuction = broker.RegisterAuction(goodPerson, goodAuction);

            Assert.NotNull(registeredAuction);
            Assert.NotEqual(0, registeredAuction.IdAuction);

            Person good2 = GetGoodPerson2(broker);

            Assert.ThrowsAny <Exception>(() => broker.EndAuction(good2, goodAuction));
        }
示例#2
0
        [Fact] void EndAuction_ShouldEndAuction()
        {
            BiddingBroker broker = new BiddingBroker(InitMockedDb());

            Person  goodPerson  = GetGoodPerson(broker);
            Auction goodAuction = GetGoodAuction(broker);

            Auction registeredAuction = broker.RegisterAuction(goodPerson, goodAuction);

            Assert.NotNull(registeredAuction);
            Assert.NotEqual(0, registeredAuction.IdAuction);

            bool didThrow = false;

            try
            {
                broker.EndAuction(goodPerson, goodAuction);
            } catch (Exception)
            {
                didThrow = true;
            }

            Assert.False(didThrow);
        }