Example #1
0
 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);
 }
Example #2
0
        private UserReviewService CreateUserReviewService()
        {
            var userId  = Guid.Parse(User.Identity.GetUserId());
            var service = new UserReviewService(userId);

            return(service);
        }
Example #3
0
 public ActionResult Index()
 {
     var userId = Guid.Parse(User.Identity.GetUserId());
     var service = new UserReviewService(userId);
     var model = service.GetUserReviews();
     return View(model);
 }
Example #4
0
        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));
        }
Example #5
0
 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);
 }
Example #6
0
        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"));
        }