public void SetUpSampleData(string containerName, int numFiles, int fileLineCount, Identifiers allowedIdentifiers) { var provider = new BlobProvider(); var factory = new QuoteFileFactory(); for (var n = 0; n < numFiles; n++) { var fileName = "stock" + n.ToString() + ".txt"; var file = factory.CreateRandomFile(allowedIdentifiers, fileLineCount); provider.CreateBlob(containerName, fileName, file.ToString()); } }
public void CreateRandomFile_creates_expected_number_of_lines() { // arrange var factory = new QuoteFileFactory(); var allowedIdentifiers = new List<string> {"MSFT", "CSCO", "AMZN", "SBUX"}; var identifiers = new Identifiers(allowedIdentifiers); var expectedLines = 100; // act var file = factory.CreateRandomFile(identifiers, expectedLines); // assert var fileContents = file.ToString(); AssertHelper.AssertHasLines(fileContents, expectedLines); }