public void ShouldReturnNegativeOneOnNotFound()
        {
            fieldMetaData = new FieldMetaData(null, fieldTypes);
            var actual = fieldMetaData.IndexOf(Terms.scientificName);

            Assert.Equal(-1, actual);
        }
 private void Ascending(IFieldMetaData fieldsMetaData)
 {
     var license                  = fieldsMetaData[Terms.license];
     var modified                 = fieldsMetaData[Terms.modified];
     var taxonomicStatus          = fieldsMetaData[Terms.taxonomicStatus];
     var scientificNameAuthorship = fieldsMetaData[Terms.scientificNameAuthorship];
     var taxonRank                = fieldsMetaData[Terms.taxonRank];
     var infraspecificEpithet     = fieldsMetaData[Terms.infraspecificEpithet];
     var specificEpithet          = fieldsMetaData[Terms.specificEpithet];
     var subgenus                 = fieldsMetaData[Terms.subgenus];
     var genus  = fieldsMetaData[Terms.genus];
     var family = fieldsMetaData[Terms.family];
     var order  = fieldsMetaData[Terms.order];
     var @class = fieldsMetaData[Terms.@class];
     var higherClassification = fieldsMetaData[Terms.higherClassification];
     var nameAccordingTo      = fieldsMetaData[Terms.nameAccordingTo];
     var parentNameUsage      = fieldsMetaData[Terms.parentNameUsage];
     var acceptedNameUsage    = fieldsMetaData[Terms.acceptedNameUsage];
     var scientificName       = fieldsMetaData[Terms.scientificName];
     var nameAccordingToID    = fieldsMetaData[Terms.nameAccordingToID];
     var parentNameUsageID    = fieldsMetaData[Terms.parentNameUsageID];
     var acceptedNameUsageID  = fieldsMetaData[Terms.acceptedNameUsageID];
     var taxonID = fieldsMetaData[Terms.taxonID];
     var bibliographicCitation = fieldsMetaData[Terms.bibliographicCitation];
     var references            = fieldsMetaData[Terms.references];
 }
示例#3
0
        public IRow CreateRow(IEnumerable <string> fields, IFieldMetaData fieldMetaData)
        {
            switch (rowStrategy)
            {
            case RowStrategy.Greedy: return(new GreedyRow(fields, fieldMetaData));

            case RowStrategy.Lazy:
            default: return(new LazyRow(fields, fieldMetaData));
            }
        }
        //issue#51
        public void ShouldReturnListOfDefaultFields()
        {
            var idField = new IdFieldType()
            {
                Index          = 0,
                IndexSpecified = true
            };

            fieldMetaData = new FieldMetaData(idField, fieldTypes);
            Assert.NotEmpty(fieldMetaData.Where(n => !n.IndexSpecified));
        }
        //issue#51
        public void ShouldReturnDefaultField()
        {
            var idField = new IdFieldType()
            {
                Index          = 0,
                IndexSpecified = true
            };

            fieldMetaData = new FieldMetaData(idField, fieldTypes);
            Assert.NotNull(fieldMetaData[Terms.accessRights]);
        }
        //issue#12
        public void ShouldNotCreateDuplicateIdFields()
        {
            var idField = new IdFieldType()
            {
                Index          = 1,
                IndexSpecified = true
            };

            fieldMetaData = new FieldMetaData(idField, fieldTypes);
            Assert.Equal(3, fieldMetaData.Count());
        }
        public void ShouldReturnCount3WithId()
        {
            var idField = new IdFieldType()
            {
                Index          = 0,
                IndexSpecified = true
            };

            fieldMetaData = new FieldMetaData(idField, fieldTypes);
            Assert.Equal(4, fieldMetaData.Count());
        }
        //issue#51
        public void ShouldEnumerateAllFields()
        {
            var idField = new IdFieldType()
            {
                Index          = 0,
                IndexSpecified = true
            };

            fieldMetaData = new FieldMetaData(idField, fieldTypes);
            Assert.Equal(4, fieldMetaData.Count());
        }
示例#9
0
 public LazyRow(IEnumerable <string> fields, IFieldMetaData fieldMetaData)
 {
     this.fields        = fields;
     this.FieldMetaData = fieldMetaData;
 }
示例#10
0
 public GreedyRow(IEnumerable <string> fields, IFieldMetaData fieldMetaData)
 {
     this.fields        = fields.ToArray(fieldMetaData.Length);
     this.FieldMetaData = fieldMetaData;
 }
示例#11
0
 public void ShouldReturn2For_acceptedNameUsageID()
 {
     fieldMetaData = new FieldMetaData(null, fieldTypes);
     Assert.Equal(2, fieldMetaData.IndexOf(Terms.acceptedNameUsageID));
 }