コード例 #1
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);
        }
コード例 #2
0
 public void Setup()
 {
     _validator = new RemoveQuestionCommandValidator();
 }