I have
public class ABSInfo
{
public decimal CodeCoveragePercentage { get; set; }
public TestInfo TestInformation { get; set; }
}
And I have an Object array say "SourceType"
public object[] SourceType { get; set; }
I want to convert the Object Array (SoiurceType) to ABSInfo[].
I am trying as
ABSInfo[] absInfo = Array.ConvertAll(SourceType, x => (ABSInfo)x);
but error
Unable to cast object of type 'WindowsFormsApplication1.TestInfo' to type 'WindowsFormsApplication1.ABSInfo'.
how to do the conversion?
Edited:
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; }
}
TestInfoamong yourABSInfoarray?object[]