示例#1
0
        public void Show_feedback()
        {
            using (var context = new MyDbContext(_options))
            {
                SetupDatabase(context);
                HospitalApp.Services.FeedbackService service = new HospitalApp.Services.FeedbackService(context);

                FeedbackDto feedback = service.ShowFeedback(1);

                feedback.IsVisible.ShouldBe(true);
            }
        }
示例#2
0
        public void Get_by_id()
        {
            using (var context = new MyDbContext(_options))
            {
                SetupDatabase(context);
                HospitalApp.Services.FeedbackService service = new HospitalApp.Services.FeedbackService(context);

                FeedbackDto feedback = service.GetById(1);

                feedback.Id.ShouldBe(1);
            }
        }
示例#3
0
        public void Get_visible_feedbacks()
        {
            using (var context = new MyDbContext(_options))
            {
                SetupDatabase(context);
                HospitalApp.Services.FeedbackService service = new HospitalApp.Services.FeedbackService(context);

                List <FeedbackDto> visibleFeedbacks = service.GetVisibleFeedbacks();

                visibleFeedbacks.Count.ShouldBe(1);
            }
        }
示例#4
0
        public void Get_all_feedbacks()
        {
            using (var context = new MyDbContext(_options))
            {
                SetupDatabase(context);
                HospitalApp.Services.FeedbackService service = new HospitalApp.Services.FeedbackService(context);

                List <FeedbackDto> feedbacks = service.GetAll();

                feedbacks.Count.ShouldBeGreaterThanOrEqualTo(2);
            }
        }