public void SetUp() { this.libraryContextMock = EntityFrameworkMock.Create <LibraryDbContext>(); EntityFrameworkMock.PrepareMock(this.libraryContextMock); this.userReviewService = new UserReviewService(new UserReviewRepository(this.libraryContextMock)); this.auctionUserService = new AuctionUserService(new AuctionUserRepository(this.libraryContextMock), this.userReviewService); }
private UserReviewService CreateUserReviewService() { var userId = Guid.Parse(User.Identity.GetUserId()); var service = new UserReviewService(userId); return(service); }
public ActionResult Index() { var userId = Guid.Parse(User.Identity.GetUserId()); var service = new UserReviewService(userId); var model = service.GetUserReviews(); return View(model); }
public ActionResult Details(Guid id) { var svc = new StylistsService(Guid.Parse(User.Identity.GetUserId())); var model = svc.GetStylistById(id); var profilesvc = new ProfilesService(Guid.Parse(User.Identity.GetUserId())); var userreviewsvc = new UserReviewService(Guid.Parse(User.Identity.GetUserId())); model.UserReviewListItem = userreviewsvc.GetUserReviewsByStylistID(id.ToString()).ToList(); model.StylistProfile = profilesvc.GetProfileByUserID(id.ToString()); return(View(model)); }
public void SetUp() { this.libraryContextMock = EntityFrameworkMock.Create <LibraryDbContext>().PrepareMock(); this.productService = new ProductService(new ProductRepository(this.libraryContextMock)); this.priceService = new PriceService(new PriceRepository(this.libraryContextMock)); this.userReviewService = new UserReviewService(new UserReviewRepository(this.libraryContextMock)); this.auctionUserService = new AuctionUserService(new AuctionUserRepository(this.libraryContextMock), this.userReviewService); this.categoryService = new CategoryService(new CategoryRepository(this.libraryContextMock)); this.auctionService = new AuctionService(new AuctionRepository(this.libraryContextMock), this.categoryService, this.auctionUserService); this.bidService = new BidService(new BidRepository(this.libraryContextMock), this.auctionService); }
public ActionResult Create(UserReviewCreate model) { if (!ModelState.IsValid) { return(View(model)); } var userId = Guid.Parse(User.Identity.GetUserId()); var service = new UserReviewService(userId); service.CreateUserReview(model); return(RedirectToAction("Index")); }