예제 #1
0
 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"));
예제 #2
0
 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"));
예제 #3
0
 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"));
예제 #4
0
 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"));
예제 #5
0
 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"));
예제 #6
0
 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"));
예제 #7
0
 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"));