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)); }
[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); }