Created
February 24, 2016 07:14
-
-
Save kdhollow/e0f40ffae85e64ffdb50 to your computer and use it in GitHub Desktop.
Azure Search Test Initialization Code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private AzureSearchEngine azureSearchEngine; | |
private string indexName; | |
private string suggesterName; | |
private System.IO.Stream csvFile; | |
[TestInitialize] | |
public void Initialize() | |
{ | |
indexName = ConfigurationManager.AppSettings["SearchServiceIndexName"]; | |
suggesterName = ConfigurationManager.AppSettings["SearchServiceSuggesterName"]; | |
var engines = new SearchEngines("SearchServiceName", "SearchServiceApiKey"); | |
azureSearchEngine = engines.AzureSearchEngine; | |
csvFile = GetTestCsvFile(); | |
} | |
private Stream GetTestCsvFile() | |
{ | |
var assembly = Assembly.GetExecutingAssembly(); | |
const string resourceName = "AFDSearch.Test.airports.csv"; | |
return assembly.GetManifestResourceStream(resourceName); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment