public void Can_Guard_With_Specific_Exception() { Assert.Throws <OutOfMemoryException>(() => Guard.Against <OutOfMemoryException>(true, "Out Of memory")); }
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)); }
public void Can_Guard_Against_Wrong_Conditions() { Assert.Throws <InvalidOperationException>(() => Guard.Against(true, "Value Wrong")); }