コード例 #1
0
        public void SingleOrDefault_should_throw_when_aggregate_is_null(
            [Values(false, true)] bool async)
        {
            IAggregateFluent <Person> subject = null;

            Action action;

            if (async)
            {
                action = () => subject.SingleOrDefaultAsync().GetAwaiter().GetResult();
            }
            else
            {
                action = () => subject.SingleOrDefault();
            }

            action.ShouldThrow <ArgumentNullException>().And.ParamName.Should().Be("aggregate");
        }