public void Init() { database = new Mock <IDocumentSession>(); //mock existing vocab test database.Setup(x => x.Load <Vocabulary>()).Returns <Vocabulary>(null); validator = new Mock <IVocabularyValidator>(); validator.Setup(x => x.Validate(It.IsAny <Vocabulary>())).Returns(new ValidationResult <Vocabulary>()); service = new VocabularyService(database.Object, validator.Object); }
public void Init() { database = new Mock<IDocumentSession>(); //mock existing vocab test database.Setup(x => x.Load<Vocabulary>()).Returns<Vocabulary>(null); validator = new Mock<IVocabularyValidator>(); validator.Setup(x => x.Validate(It.IsAny<Vocabulary>())).Returns(new ValidationResult<Vocabulary>()); service = new VocabularyService(database.Object, validator.Object); }