/// <summary> /// Checks if the List Item in the index provided matches the provided expectedItem /// /// Assert Fail is thrown if index is bigger than the size of the list provided /// </summary> /// <typeparam name="T"></typeparam> /// <param name="target"></param> /// <param name="index"></param> /// <param name="expectedItem"></param> /// <returns></returns> public static List <T> assert_Item_Is_Equal <T>(this List <T> target, int index, T expectedItem) { if (target.size() <= index) { nUnitTests.assert_Fail("in assert_Item_Is_Equal, the provided index value ({0}) is smaller than the size of target list ({1})".format(index, target.size())); } var itemAtIndex = target.value(index); if (itemAtIndex.notNull()) { nUnitTests.assert_Are_Equal(itemAtIndex, expectedItem); } return(target); }
public static T assert_Are_Equal <T, T1> (this T source, Func <T1> callback, T1 target) { nUnitTests.assert_Are_Equal(callback(), target); return(source); }
//T public static T assert_Is_Equal_To <T>(this T source, T target) { return(nUnitTests.assert_Are_Equal(source, target)); }