Exemple #1
0
        public void SqlWhere_WhenWhereDelegateIsNull_ThrowsException()
        {
            var    fieldConfig = new FieldConfig("name");
            Action action      = () => fieldConfig.SqlWhere(null);

            action.Should()
            .Throw <ArgumentNullException>()
            .Which.ParamName.Should()
            .Be("where");
        }
Exemple #2
0
        public void SqlWhere_WithWhereDelegate_AddsWhereDelegateToMetadata()
        {
            void Where(WhereBuilder where, IReadOnlyDictionary <string, object> arguments,
                       IResolveFieldContext context, SqlTable sqlAStNode) => where.Column("id", 3);

            var fieldConfig = new FieldConfig("name");

            fieldConfig.SqlWhere(Where);

            fieldConfig.GetMetadata <WhereDelegate>(nameof(WhereDelegate))
            .Should()
            .Be((WhereDelegate)Where);
        }