예제 #1
0
 public void Can_Guard_With_Specific_Exception()
 {
     Assert.Throws <OutOfMemoryException>(() => Guard.Against <OutOfMemoryException>(true, "Out Of memory"));
 }
예제 #2
0
 public void Will_Not_Throw_If_Condition_Is_Not_Met()
 {
     Assert.DoesNotThrow(() => Guard.Against(false, string.Empty));
     Assert.DoesNotThrow(() => Guard.Against <Exception>(false, string.Empty));
 }
예제 #3
0
 public void Can_Guard_Against_Wrong_Conditions()
 {
     Assert.Throws <InvalidOperationException>(() => Guard.Against(true, "Value Wrong"));
 }