public Test(string filePath) { string solutionFileName = PathToSolutionPath(filePath); var knapsackReader = new KnapsackReader(filePath, solutionFileName); Knapsack knapsack; do { knapsack = knapsackReader.ReadKnapsack(); if (knapsack != null) { _knapsacks.Add(knapsack); } } while (knapsack != null); }
public Test(StreamReader streamReader, GeneratorSetup generatorSetup) { KnapsackReader knapsackReader = new KnapsackReader(streamReader); _generatorSetup = generatorSetup; Knapsack knapsack; do { knapsack = knapsackReader.ReadKnapsack(); if (knapsack != null) { _knapsacks.Add(knapsack); } } while (knapsack != null); }