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

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

            var addValidator    = new AddAnswerCommandValidator(repo);
            var updateValidator = new UpdateAnswerCommandValidator(repo);
            var removeValidator = new RemoveAnswerCommandValidator();

            _service = new AnswerService(repo, addValidator, updateValidator, removeValidator);
        }
Example #2
0
 public void Setup()
 {
     _validator = new RemoveAnswerCommandValidator();
 }