public static void Save(this TestRun testRun, string path) { path.Create(); var fullPath = Path.Combine(path, LocationsProvider.GetTestRunFileName(testRun.TestInfo.Finish)); using (var file = File.CreateText(fullPath)) { var serializer = new JsonSerializer(); serializer.Serialize(file, testRun); } }
public static ItemInfo MapTestRunInfo(this ItemInfoDto itemInfoDto) { var run = new ItemInfo { Guid = itemInfoDto.Guid, Start = itemInfoDto.Start, Finish = itemInfoDto.Finish, FileName = LocationsProvider.GetTestRunFileName(itemInfoDto.Finish) }; return(run); }
public static Run Map(this RunDto runDto) { var run = new Run { TestRunFiles = runDto.TestsInfo.Select( ti => Path.Combine(ti.Guid.ToString(), LocationsProvider.GetTestRunFileName(ti.Finish))).ToList(), Name = runDto.Name, RunInfo = runDto.RunInfo.MapRunInfo(), RunSummary = runDto.RunSummary.Map(), Sprint = runDto.Sprint }; return(run); }