Example #1
0
        public void Setup()
        {
            var repo = Substitute.For <IQuestionRepository>();

            repo.VerifyExistence(_existingQuestion, null).Returns(true);
            _validator = new AddQuestionCommandValidator(repo);
        }
Example #2
0
        public void Setup()
        {
            var repo = Substitute.For <IQuestionRepository>();

            repo.Get(_question.Id).Returns(_question);
            repo.GetAll().Returns(new List <Question>
            {
                _question,
                new Question(Guid.NewGuid(), "TESTE 2", new List <QuestionAnswer>())
            });
            repo.VerifyExistence(Arg.Any <string>(), null).ReturnsForAnyArgs(false);

            var addValidator    = new AddQuestionCommandValidator(repo);
            var updateValidator = new UpdateQuestionCommandValidator(repo);
            var removeValidator = new RemoveQuestionCommandValidator();

            _service = new QuestionService(repo, addValidator, updateValidator, removeValidator);
        }
Example #3
0
 public AddQuestionCommandValidatorTests()
 {
     validator = new AddQuestionCommandValidator();
 }