Skip to content

Instantly share code, notes, and snippets.

@Alexei000
Last active September 5, 2017 15:20
Show Gist options
  • Save Alexei000/d70b50f06d3d839ea3e3dc594c731607 to your computer and use it in GitHub Desktop.
Save Alexei000/d70b50f06d3d839ea3e3dc594c731607 to your computer and use it in GitHub Desktop.
List fetch - Importing system test result view model
public class ImportingSystemTestResultViewModel
{
// used internally to provide indexing if model is within a list of models
public int ModelIndex { get; set; }
public int ImportingSystemTestResultId { get; set; }
public DateTime EnteredTimestamp { get; set; }
public string EnteredTimestampStr => EnteredTimestamp.GetDateTimeDefaultString();
public DateTime RunTimestamp { get; set; }
public string RunTimestampStr => RunTimestamp.GetDateTimeDefaultString();
[StandardListItemMappingInfo]
public StandardListItem<ImportingSystemTest> ImportingSystemTestId { get; set; }
public string TestNameTruncated => ImportingSystemTestId?.Value?.Truncate(20);
[StandardListItemMappingInfo]
public StandardListItem<ImportingSystem> ImportingSystemId { get; set; }
[StandardListItemMappingInfo]
public StandardListItem<Models.Environment> EnvironmentId { get; set; }
[StandardListItemMappingInfo]
public StandardListItem<AppUser> RequesterId { get; set; }
[StandardListItemMappingInfo]
public StandardListItem<ImportingSystemTestExecutionStatus> ImportingSystemTestExecutionStatusId { get; set; }
public bool Passed => ImportingSystemTestExecutionStatusId?.Key == (int)TestExecutionStatusEnum.Passed;
public string PassedStr => ImportingSystemTestExecutionStatusId?.Value;
public string ResultFilename { get; set; }
public string ResultFilenameTruncated => ResultFilename?.Truncate(20);
public string ErrorMessage { get; set; }
public string ErrorMessageSanitized => string.IsNullOrWhiteSpace(ErrorMessage) ? "" : ErrorMessage;
public Guid RequestId { get; set; }
public int RunSessionNo { get; set; }
public int? DurationMs { get; set; }
public string DurationStr => DurationMs?.ToString() ?? "-";
}
// automapper mapping configuration
cfg.CreateMap<ImportingSystemTestResultOutputServiceModel, ImportingSystemTestResultViewModel>()
.IgnoreAllDestinationStandardListItemMappingInfo();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment