private async Task ApplyRunResultToCell(FeatureCell cell, Task<FeatureTestResult> resultTask) { var result = await resultTask; if (result.Kind == FeatureTestResultKind.Success) { cell.DisplayValue = "pass"; cell.State = FeatureState.Success; cell.Details = result.Message; } else if (result.Kind == FeatureTestResultKind.Failure) { var exceptionString = this.RemoveLocalPaths(result.Exception.ToString()); cell.DisplayValue = "fail"; cell.State = FeatureState.Failure; cell.Details = exceptionString; cell.RawError = exceptionString; } else if (result.Kind == FeatureTestResultKind.SkippedDueToDependency) { cell.DisplayValue = "n/a"; cell.State = FeatureState.Skipped; cell.Details = result.Message; } else { cell.DisplayValue = "note"; cell.State = FeatureState.Concern; cell.Details = result.Message; } }
private async Task ApplyRunResultToCell(FeatureCell cell, Task<FeatureTestResult> resultTask, Assembly testAssembly) { var result = await resultTask; if (result.Kind == FeatureTestResultKind.Success) { cell.DisplayValue = "pass"; cell.State = FeatureState.Success; cell.Details = result.Message; } else if (result.Kind == FeatureTestResultKind.Failure) { var exceptionString = this.exceptionNormalizer.Normalize(result.Exception, testAssembly); cell.DisplayValue = "fail"; cell.State = FeatureState.Failure; cell.Details = ConvertExceptionToMarkdown(exceptionString); cell.RawError = exceptionString; } else if (result.Kind == FeatureTestResultKind.SkippedDueToDependency) { cell.DisplayValue = "n/a"; cell.State = FeatureState.Skipped; cell.Details = result.Message; } else { cell.DisplayValue = "note"; cell.State = FeatureState.Concern; cell.Details = result.Message; } }
private KeyValuePair<string, object> GetSingleFeatureData(Feature feature, FeatureCell cell) { var key = this.GetFeatureName(feature); var value = new { result = cell.State.ToString().ToLowerInvariant(), comment = cell.Details, error = cell.RawError }; return new KeyValuePair<string, object>(key, value); }
public string GetCssClassesForCell(FeatureCell cell) { var classes = cell.State.ToString().ToLowerInvariant(); if (cell.DisplayValue is int) classes += " number"; if (cell.DisplayValue is DateTimeOffset) classes += " date"; return classes; }