public void WhenIViewTheHospitalList() { var ratingsProcessingService = new RatingsProcessingService(); var ratingsRepository = new RatingsRepository(); var surveyService = new SurveyService(ratingsRepository, ratingsProcessingService); var controller = new HospitalsController(surveyService); _actionResult = controller.Index(); }
public static void Initialize(TestContext context) { var JsonList = new RatingsRepository().GetAll(); Mock <IRatingRepositoryFile> repo = new Mock <IRatingRepositoryFile>(); repo.Setup(r => r.GetAll()).Returns(() => JsonList); service = new RatingServiceFile(repo.Object); repo.Verify(m => m.GetAll(), Times.Once); }
public static void AddRateWithCK() { var rateRepo = new RatingsRepository(); try { rateRepo.Add(new Rating { Magazine = "Samuel", Points = 5, RatingDate = DateTime.Now, BookId = 17 }); rateRepo.Save(); Console.WriteLine("Added new rating successfully"); } catch { Console.WriteLine("Can't add a rating with less than 1 or higher than 5 points..."); } }
public UnitOfWork(WebStoreContext context) { this.context = context; Products = new ProductsRepository(context); Sliders = new SlidersRepository(context); FooterMenus = new FooterMenusRepository(context); HeadingMenus = new HeadingMenusRepository(context); Polls = new PollsRepository(context); Prices = new PricesRepository(context); ProductVariant = new ProductVariantsRepository(context); Colors = new ColorsRepository(context); Votes = new VotesRepository(context); Options = new OptionsRepository(context); Ratings = new RatingsRepository(context); Ordered = new OrderedRepository(context); Orders = new OrdersRepository(context); }
public RatingsController(RatingsRepository ratingsRepository) { this.ratingsRepository = ratingsRepository; }
public BooksByRatingFilter(RatingsRepository ratingsRepository) { this.ratingsRepository = ratingsRepository; }
public static IEnumerable <Rating> GetAll() { return(RatingsRepository.GetAll()); }
public static Rating Get(int id) { var ratings = RatingsRepository.GetAll(); return(ratings.FirstOrDefault(x => x.Id == id)); }
public void SetUp() { hourRepository = new HourRepository(ConnectionFactorySetup.ConnectionFactory); ratingsRepository = new RatingsRepository(ConnectionFactorySetup.ConnectionFactory); }