public void Insert_Null() { this.mockRepository.Setup(x => x.Insert(It.IsAny <Bidder>())).Throws <ArgumentNullException>(); var bidderServices = new BidderService(this.mockRepository.Object); Action act = () => bidderServices.Insert(null); act.Should().Throw <ArgumentNullException>(); }
public void InsertBidderShouldNotFail() { person.Id = userProfile.Id; person.UserProfile = userProfile; person.Bidder = bidder; bidder.Id = person.Id; bidder.Person = person; var failed = bidderServices.Insert(bidder); var dbBidder = bidderServices.GetByID(bidder.Id); Assert.AreEqual(bidder, dbBidder); }
public void Insert_ValidBidder() { this.mockRepository.Setup(x => x.Update(It.IsAny <Bidder>())); var services = new BidderService(this.mockRepository.Object); var bidder = FakeEntityFactory.CreateBidder(); bidder.Person = FakeEntityFactory.CreatePerson(); var results = services.Insert(bidder); Assert.AreEqual(0, results.Count); }