/// <summary> /// The CreateFutureAuction. /// </summary> /// <returns>The <see cref="Auction"/>.</returns> private Auction CreateFutureAuction() { var userProfile = FakeEntityFactory.CreateUserProfile(); var person = FakeEntityFactory.CreatePerson(); person.Id = userProfile.Id; person.UserProfile = userProfile; var product = FakeEntityFactory.CreateProduct(); var category = FakeEntityFactory.CreateCategory(); product.Sellers.Add(this.seller); product.Categories.Add(category); var auction = FakeEntityFactory.CreateAuction(); auction.Seller = this.seller; auction.Products.Add(product); auction.BeginDate = DateTime.Now.AddDays(1); auction.EndDate = DateTime.Now.AddDays(2); auction.Active = false; return(auction); }
public void Initialize() { this.userProfile = FakeEntityFactory.CreateUserProfile(); this.person = FakeEntityFactory.CreatePerson(); this.seller = FakeEntityFactory.CreateSeller(); this.auction = FakeEntityFactory.CreateAuction(); this.bidder = FakeEntityFactory.CreateBidder(); this.product = FakeEntityFactory.CreateProduct(); this.category = FakeEntityFactory.CreateCategory(); this.userProfileServices = new UserProfileService(new UserProfileRepository()); this.personServices = new PersonService(new PersonRepository()); this.bidderServices = new BidderService(new BidderRepository()); this.sellerServices = new SellerService(new SellerRepository()); this.categoryServices = new CategoryService(new CategoryRepository()); this.bidServices = new BidService(new BidRepository()); this.productServices = new ProductService(new ProductRepository()); this.auctionServices = new AuctionService(new AuctionRepository()); using (var auctionDBContext = new AuctionDBContext()) { auctionDBContext.Database.Delete(); } }