public void Test_ForEach_With_Index_In_A_Null_Array() => Null .As <char[]>() .Invoking(a => a.ForEach((_, i) => Fail("This should never be executed"))) .Should() .Throw <ArgumentNullException>() .Where(e => e.Message.Contains("array"));
public void Test_Get_In_A_Null_Array() => Null .As <char[]>() .Invoking(n => n.Get(0)) .Should() .Throw <ArgumentNullException>() .Where(e => e.Message.Contains("array"));
public void Test_ForEach_With_Index_In_An_Array_With_A_Null_Action() => SampleArray() .Invoking(a => a.ForEach(Null.As <Action <char, int> >())) .Should() .Throw <ArgumentNullException>() .Where(e => e.Message.Contains("action"));
public void Test_GetOrElse_With_A_Function_In_A_Null_Array() => Null .As <char[]>() .Invoking(a => a.GetOrElse(0, () => 'z')) .Should() .Throw <ArgumentNullException>() .Where(e => e.Message.Contains("array"));
public void Test_ForEach_In_A_Null_IReadOnlyDictionary() => Null .As <IReadOnlyDictionary <string, int> >() .Invoking(d => d.ForEach((k, v) => Fail("This should never be executed"))) .Should() .Throw <ArgumentNullException>() .Where(e => e.Message.Contains("dictionary"));
public void Test_GetOrElse_In_A_Null_IList() => Null .As <IList <char> >() .Invoking(l => l.GetOrElse(0, 'z')) .Should() .Throw <ArgumentNullException>() .Where(e => e.Message.Contains("list"));
public void Test_Get_In_A_Null_IList() => Null .As <IList <char> >() .Invoking(n => n.Get(0)) .Should() .Throw <ArgumentNullException>() .Where(e => e.Message.Contains("list"));