Exemplo n.º 1
0
        public void CreateFeedbackTest()
        {
            _databaseContext.Feedback.RemoveRange(_databaseContext.Feedback.ToList());
            var goodFeedback = new StudyBuddyBackend.Database.Entities.Feedback
            {
                AuthorUsername   = "******",
                RevieweeUsername = "******",
                Comment          = "test",
                Rating           = 5
            };

            _feedbackController.AddFeedback(goodFeedback);

            Assert.StrictEqual(goodFeedback, _databaseContext.Feedback.Find("titas", "emilis"));
        }
Exemplo n.º 2
0
        public void DeleteFeedbackTest()
        {
            _databaseContext.Feedback.RemoveRange(_databaseContext.Feedback.ToList());
            var goodFeedback = new StudyBuddyBackend.Database.Entities.Feedback
            {
                AuthorUsername   = "******",
                RevieweeUsername = "******",
                Comment          = "test",
                Rating           = 5
            };

            _feedbackController.AddFeedback(goodFeedback);

            var feedback_res = _feedbackController.DeleteFeedback(new FeedbackPair(goodFeedback.AuthorUsername, goodFeedback.RevieweeUsername));

            //_testOutputHelper.WriteLine(feedback_res.Value.ToString());
            Assert.Equal(JsonConvert.SerializeObject(new StudyBuddyBackend.Database.Models.Response.Feedback(goodFeedback)),
                         JsonConvert.SerializeObject(feedback_res.Value));
        }