Пример #1
0
        public void IsFixedLength()
        {
            var edmProperty     = this.builder.BuildString("prop", false, true);
            var mappingProperty = new MappingProperty(edmProperty);

            mappingProperty.IsTypeOfString().Should().BeTrue();
            mappingProperty.HasFacet(DbProviderManifest.FixedLengthFacetName).Should().BeTrue();
            mappingProperty.GetFacetValue <bool>(DbProviderManifest.FixedLengthFacetName).Should().BeTrue();
        }
Пример #2
0
        public void Required()
        {
            var edmProperty = this.builder.BuildString("prop", false, false);

            edmProperty.Nullable = false;

            var mappingProperty = new MappingProperty(edmProperty);

            mappingProperty.IsNullable.Should().BeFalse();
            mappingProperty.GetClrEquivalentType().Should().Be(typeof(string));
            mappingProperty.IsTypeOfString().Should().BeTrue();
            mappingProperty.IsNullable.Should().BeFalse();
        }
Пример #3
0
 public bool IsMatch(MappingProperty mappingProperty)
 {
     return
         ((mappingProperty.IsTypeOfString() || mappingProperty.IsTypeOfByteArray()) &&
          !mappingProperty.IsNullable);
 }