public void Setup() { var repo = Substitute.For <IAnswerRepository>(); repo.VerifyExistence(_existingAnswer, null).Returns(true); _validator = new AddAnswerCommandValidator(repo); }
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); }