public void GetSchema_GetSchemaByName() { // Arrange mockSchemaRepository = new Mock<IRepository<Schema>>(); var list = new List<Schema>() { new Schema() { Id = "1", Data = "Data", Name = "Name" }, }; mockSchemaRepository.Setup(x => x.Get(It.IsAny<Expression<Func<Schema, bool>>>())).Returns(list); var schemaService = new SchemaService(mockSchemaRepository.Object, mapper); var schemaDomain = new SchemaDomain(); // Act var res = schemaService.GetSchema("Name"); // Assert mockSchemaRepository.Verify(x => x.Get(It.IsAny<Expression<Func<Schema, bool>>>()), Times.Once); }
public XElement Get(string name) { IEnumerable <KeyValuePair <string, string> > deltaKey = Request.GetQueryNameValuePairs(); return(SchemaService.GetSchema(name, deltaKey)); }