public void SqlColumn_WhenColumnIsIgnored_DoesntSetResolver() { var fieldConfig = new FieldConfig("name"); fieldConfig.SqlColumn(ignore: true); fieldConfig.Resolver.Should().BeNull(); }
public void SqlColumn_WithColumnName_SetsColumnName() { var fieldConfig = new FieldConfig("name"); var builder = fieldConfig.SqlColumn("productName"); builder.SqlColumnConfig.Column.Should().Be("productName"); }
public void SqlColumn_WhenFieldResolverIsNull_SetsResolver() { var fieldConfig = new FieldConfig("name"); fieldConfig.SqlColumn("productName"); fieldConfig.Resolver.Should().Be(DictionaryFieldResolver.Instance); }
public void SqlColumn_WhenColumnIsNull_UsesFieldNameAsColumnName() { var fieldConfig = new FieldConfig("name"); var builder = fieldConfig.SqlColumn(); builder.SqlColumnConfig.Column.Should().Be("name"); }
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); }