public void Test_Using_TakeUnless_With_A_Null_Predicate() { DummyStruct instance = new DummyStruct(); Action action = () => instance.TakeUnless(null); action.Should() .ThrowExactly <ArgumentNullException>() .WithMessage($"*predicate*"); }
public void Test_Using_TakeUnless_With_A_False_Predicate() { DummyStruct instance = new DummyStruct() { Value = nameof(instance) }; DummyStruct?result = instance.TakeUnless(inst => inst.Value.Length != 0); result.HasValue.Should().BeFalse(); }