Write Unit test for sorting
- by user175084
I need to write a unit test for a method where I arrange data according to another default list.
This is the method.
internal AData[] GetDataArrayInInitialSortOrder(ABData aBData)
{
Dictionary<string,AData > aMap = aBData.ADataArray.ToDictionary(v => v.GroupName, v => v);
List<AData> newDataList = new List<AData>();
foreach (AData aData in _viewModel.ADList)
newDataList.Add(aMap[aData.GroupName]);
return newDataList.ToArray();
}
Please help I am new in unit testing and this is not easy for me.
Any sample or links are appreciated
Thanks