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

            repo.VerifyExistence(_existingAnswer, null).Returns(true);
            _validator = new AddAnswerCommandValidator(repo);
        }
Esempio n. 2
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);
        }