public async Task <Project> ImportAsync(string fileName) { var buffer = await ReadWorkDataSourceFileAsync(fileName); var isTry = ProjectTextParser.TryParseProject(buffer, out var project); return(isTry ? project : null); }
public void TryParseProjectTests(string buffer, bool expectedIsTry, Project expectedProject) { var actualIsTry = ProjectTextParser.TryParseProject(buffer, out var actualProject); Assert.AreEqual(expectedIsTry, actualIsTry); if (expectedIsTry) { Assert.AreEqual(expectedProject.WorkCount, actualProject.WorkCount); CollectionAssert.AreEqual(expectedProject.TechnologicalConditions, actualProject.TechnologicalConditions); //CollectionAssert.AreEqual(expectedProject.TimeCharacteristics, actualProject.TimeCharacteristics); } }