예제 #1
0
        public void Test_Using_TakeValueUnless_With_A_Null_Predicate()
        {
            DummyStruct instance = new DummyStruct();
            Action      action   = () => instance.TakeValueUnless(null);

            action.Should()
            .ThrowExactly <ArgumentNullException>()
            .WithMessage($"*predicate*");
        }
예제 #2
0
        public void Test_Using_TakeValueUnless_With_A_False_Predicate()
        {
            DummyStruct instance = new DummyStruct()
            {
                Value = nameof(instance)
            };

            DummyStruct?result = instance.TakeValueUnless(inst => inst.Value.Length != 0);

            result.HasValue.Should().BeFalse();
        }