Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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...");
            }
        }
Exemplo n.º 4
0
 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);
 }
Exemplo n.º 5
0
 public RatingsController(RatingsRepository ratingsRepository)
 {
     this.ratingsRepository = ratingsRepository;
 }
Exemplo n.º 6
0
 public BooksByRatingFilter(RatingsRepository ratingsRepository)
 {
     this.ratingsRepository = ratingsRepository;
 }
Exemplo n.º 7
0
 public static IEnumerable <Rating> GetAll()
 {
     return(RatingsRepository.GetAll());
 }
Exemplo n.º 8
0
        public static Rating Get(int id)
        {
            var ratings = RatingsRepository.GetAll();

            return(ratings.FirstOrDefault(x => x.Id == id));
        }
Exemplo n.º 9
0
 public void SetUp()
 {
     hourRepository    = new HourRepository(ConnectionFactorySetup.ConnectionFactory);
     ratingsRepository = new RatingsRepository(ConnectionFactorySetup.ConnectionFactory);
 }