public SearchCapability GetSearchCapability(FieldLookups lookups) { var factoryFactory = new FieldLookupInterpreter(new ExcelColumnNamer(), new SearchActionProvider(), new DisplayFieldProvider()); var searcherFactory = factoryFactory.CreateSearcherFactory(lookups); return(searcherFactory.GetSearchCapability()); }
public void CanDeserializeImportMapping() { var result = Parse <ExcelImportMapping>(@"{ 'SheetDescription':{ 'Filename':'C:\\code\\Audition\\build\\Debug\\Dev\\ExampleSage50Export.xlsx', 'UseHeaderRow':true, 'Sheet':2 }, 'Lookups':{ 'TransactionDate':2, 'Description':4, 'Username':8, 'NominalCode':16, 'NominalName':32, 'Amount':64, 'Id':128, 'Type':256} }"); var fieldLookups = new FieldLookups(transactionDate: 2, description: 4, username: 8, nominalCode: 16, nominalName: 32, amount: 64, id: 128, type: 256); Assert.AreEqual(fieldLookups, result.Lookups); var sheetDescription = result.SheetDescription; Assert.AreEqual(true, sheetDescription.UseHeaderRow); Assert.AreEqual(2, result.SheetDescription.Sheet); Assert.AreEqual(@"C:\code\Audition\build\Debug\Dev\ExampleSage50Export.xlsx", sheetDescription.Filename); }
private static TestCaseData CreateTestCase(string name, FieldLookups fieldLookups, IDictionary <string, string> errorMessages, params DisplayFieldName[] availableFields) { return(new TestCaseData(fieldLookups) .Returns(new SearchCapability(availableFields, errorMessages)) .SetName(name)); }