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; }
}
什么是'TestInfo'? – 2013-04-09 12:36:51
你的'ABSInfo'数组中似乎有'TestInfo'? – 2013-04-09 12:37:03
这是另一个班级..看到更新 – 2013-04-09 12:37:25