Esempio n. 1
0
            public void RatingQuestion_Should_ThrowNotFound()
            {
                _svc = CreateService();

                _svc.Awaiting(x => x.GetRatingQuestion(INVALID_QUESTION_ID)).Should()
                .Throw <Exception>()
                .WithMessage("Question was not found with id");
            }
Esempio n. 2
0
            public void AddRatingQuestion_Should_ThrowAnswerRequired()
            {
                _svc = CreateService();

                _svc.Awaiting(x => x.AddRatingQuestionAnswer(new RatingQuestionAnswerData())).Should()
                .Throw <ValidationException>()
                .WithMessage("Answer must have a question");
            }
Esempio n. 3
0
            public void GetLatestRatingQuestionAnswer_Should_ThrowNotFound()
            {
                _svc = CreateService();

                _svc.Awaiting(x => x.GetLatestRatingQuestionAnswer(Guid.Empty)).Should()
                .Throw <ValidationException>()
                .WithMessage("Question was not found with id");
            }
Esempio n. 4
0
            public void AddRatingQuestion_Should_ThrowLoadRequired()
            {
                _svc = CreateService();

                var add = new RatingQuestionAnswerData()
                {
                    RatingQuestionId = VALID_QUESTION_ID
                };

                _svc.Awaiting(x => x.AddRatingQuestionAnswer(add)).Should()
                .Throw <ValidationException>()
                .WithMessage("Answer must have a load attached");
            }
Esempio n. 5
0
            public void AddRatingQuestion_Should_ThrowLoadClaimRequired()
            {
                _svc = CreateService();

                var add = new RatingQuestionAnswerData()
                {
                    RatingQuestionId = VALID_QUESTION_ID,
                    LoadId           = Guid.NewGuid()
                };

                _svc.Awaiting(x => x.AddRatingQuestionAnswer(add)).Should()
                .Throw <ValidationException>()
                .WithMessage("Answer must be tied to a load claim");
            }