예제 #1
0
        public void SqlColumn_WhenColumnIsIgnored_DoesntSetResolver()
        {
            var fieldConfig = new FieldConfig("name");

            fieldConfig.SqlColumn(ignore: true);

            fieldConfig.Resolver.Should().BeNull();
        }
예제 #2
0
        public void SqlColumn_WithColumnName_SetsColumnName()
        {
            var fieldConfig = new FieldConfig("name");

            var builder = fieldConfig.SqlColumn("productName");

            builder.SqlColumnConfig.Column.Should().Be("productName");
        }
예제 #3
0
        public void SqlColumn_WhenFieldResolverIsNull_SetsResolver()
        {
            var fieldConfig = new FieldConfig("name");

            fieldConfig.SqlColumn("productName");

            fieldConfig.Resolver.Should().Be(DictionaryFieldResolver.Instance);
        }
예제 #4
0
        public void SqlColumn_WhenColumnIsNull_UsesFieldNameAsColumnName()
        {
            var fieldConfig = new FieldConfig("name");

            var builder = fieldConfig.SqlColumn();

            builder.SqlColumnConfig.Column.Should().Be("name");
        }
예제 #5
0
        public void SqlColumn_WhenFieldResolverIsNotNull_DoesntSetResolver()
        {
            var resolver    = new FuncFieldResolver <string>(_ => "");
            var fieldConfig = new FieldConfig("name")
            {
                Resolver = resolver
            };

            fieldConfig.SqlColumn("productName");

            fieldConfig.Resolver.Should().Be(resolver);
        }