私は持っている
public class ABSInfo
{
public decimal CodeCoveragePercentage { get; set; }
public TestInfo TestInformation { get; set; }
}
そして、「SourceType」と言うオブジェクト配列があります
public object[] SourceType { get; set; }
オブジェクト配列(SoiurceType)をABSInfo[]に変換したい。
私はとしてしようとしています
ABSInfo[] absInfo = Array.ConvertAll(SourceType, x => (ABSInfo)x);
しかし、エラー
タイプ 'WindowsFormsApplication1.TestInfo' のオブジェクトをタイプ 'WindowsFormsApplication1.ABSInfo' にキャストできません。
変換を行うには?
編集:
public class TestInfo
{
public int RunID { get; set; }
public TestRunStatus Status { get; set; }
public string Description { get; set; }
public int TotalTestCases { get; set; }
public int TotalTestCasesPassed { get; set; }
public int TotalTestCasesFailed { get; set; }
public int TotalTestCasesInconclusive { get; set; }
public string ReportTo { get; set; }
public string Modules { get; set; }
public string CodeStream { get; set; }
public int RetryCount { get; set; }
public bool IsCodeCoverageRequired { get; set; }
public FrameWorkVersion FrameworkVersion { get; set; }
public string TimeTaken { get; set; }
public int ProcessID { get; set; }
public int GroupID { get; set; }
public string GroupName { get; set; }
}