Example #1
0
        public void Setup()
        {
            Random rand = new Random();

            sequence = Enumerable.Range(0, fields.Length - 1)
                       .OrderBy(n => rand.Next())
                       .ToArray();

            var metaData = FieldsMetaDataBuilder.Fields()
                           .AutomaticallyIndex()
                           .AddField(_ => _.Term("id"))
                           .AddField(_ => _.Term(Terms.taxonID))
                           .AddField(_ => _.Term(Terms.acceptedNameUsageID))
                           .AddField(_ => _.Term(Terms.parentNameUsageID))
                           .AddField(_ => _.Term(Terms.nameAccordingToID))
                           .AddField(_ => _.Term(Terms.scientificName))
                           .AddField(_ => _.Term(Terms.acceptedNameUsage))
                           .AddField(_ => _.Term(Terms.parentNameUsage))
                           .AddField(_ => _.Term(Terms.nameAccordingTo))
                           .AddField(_ => _.Term(Terms.higherClassification))
                           .AddField(_ => _.Term(Terms.@class))
                           .AddField(_ => _.Term(Terms.order))
                           .AddField(_ => _.Term(Terms.family))
                           .AddField(_ => _.Term(Terms.genus))
                           .AddField(_ => _.Term(Terms.subgenus))
                           .AddField(_ => _.Term(Terms.specificEpithet))
                           .AddField(_ => _.Term(Terms.infraspecificEpithet))
                           .AddField(_ => _.Term(Terms.taxonRank))
                           .AddField(_ => _.Term(Terms.scientificNameAuthorship))
                           .AddField(_ => _.Term(Terms.taxonomicStatus))
                           .AddField(_ => _.Term(Terms.modified))
                           .AddField(_ => _.Term(Terms.license))
                           .AddField(_ => _.Term(Terms.bibliographicCitation))
                           .AddField(_ => _.Term(Terms.references))
                           .Build();
            var coreFileType = new CoreFileType();

            foreach (var m in metaData)
            {
                coreFileType.Field.Add(m);
            }
            var defaultFactory = new DefaultFactory();

            fileMetaData = defaultFactory.CreateCoreMetaData(coreFileType);

            rowFactory = defaultFactory.CreateRowFactory();
        }