Exemplo n.º 1
0
        // This program programmatically generates a Meta file that uses sequences.
        // The Meta is for a CSV file which lists 3 types of pets.  For each pet the file will specify
        // its type and its name.  These 2 fields make the root sequence.
        // Pet type 1 is cats.  For each cat it will specify its running speed (Cat Sequence)
        // Pet type 2 is dogs.  For each dog it will specify its walking distance, its running speed
        // and whether it is being trained. (Dog Sequence)
        // If a dog is being trained, it will also specify the trainer and the cost of each
        // training session. (Training Sequence)
        // Pet type 3 is gold fish. For each gold fish, it will specify its color and
        // chinese classification (GoldFish sequence).
        static void Main(string[] args)
        {
            const string MetaFileName = "ExampleSequenceMeta.ftm";

            // Define Field Names
            const string TypeFieldName                  = "Type";
            const string NameFieldName                  = "Name";
            const string RunningSpeedFieldName          = "RunningSpeed";
            const string WalkDistanceFieldName          = "WalkDistance";
            const string TrainingFieldName              = "Training";
            const string TrainerFieldName               = "Trainer";
            const string SessionCostFieldName           = "SessionCost";
            const string ColorFieldName                 = "Color";
            const string ChineseClassificationFieldName = "ChineseClassification";

            // Define Field Ids
            const int TypeFieldId                  = 0;
            const int NameFieldId                  = 1;
            const int RunningSpeedFieldId          = 2;
            const int WalkDistanceFieldId          = 3;
            const int TrainingFieldId              = 4;
            const int TrainerFieldId               = 5;
            const int SessionCostFieldId           = 6;
            const int ColorFieldId                 = 7;
            const int ChineseClassificationFieldId = 8;

            // Define Sequence Names
            const string RootSequenceName     = "Root";
            const string CatSequenceName      = "Cat";
            const string DogSequenceName      = "Dog";
            const string GoldFishSequenceName = "GoldFish";
            const string TrainingSequenceName = "Training";

            FtMeta meta = new FtMeta();

            // Add fields to Meta
            FtMetaField typeField = meta.FieldList.New(FtStandardDataType.Integer);

            typeField.Name = TypeFieldName;
            typeField.Id   = TypeFieldId;
            FtMetaField nameField = meta.FieldList.New(FtStandardDataType.String);

            nameField.Name = NameFieldName;
            nameField.Id   = NameFieldId;
            FtMetaField runningSpeedField = meta.FieldList.New(FtStandardDataType.Float);

            runningSpeedField.Name = RunningSpeedFieldName;
            runningSpeedField.Id   = RunningSpeedFieldId;
            FtMetaField walkDistanceField = meta.FieldList.New(FtStandardDataType.Float);

            walkDistanceField.Name = WalkDistanceFieldName;
            walkDistanceField.Id   = WalkDistanceFieldId;
            FtMetaField trainingField = meta.FieldList.New(FtStandardDataType.Boolean);

            trainingField.Name = TrainingFieldName;
            trainingField.Id   = TrainingFieldId;
            FtMetaField trainerField = meta.FieldList.New(FtStandardDataType.String);

            trainerField.Name = TrainerFieldName;
            trainerField.Id   = TrainerFieldId;
            FtMetaField sessionCostField = meta.FieldList.New(FtStandardDataType.Decimal);

            sessionCostField.Name = SessionCostFieldName;
            sessionCostField.Id   = SessionCostFieldId;
            FtMetaField tankLocationField = meta.FieldList.New(FtStandardDataType.String);

            tankLocationField.Name = ColorFieldName;
            tankLocationField.Id   = ColorFieldId;
            FtMetaField chineseClassificationField = meta.FieldList.New(FtStandardDataType.String);

            chineseClassificationField.Name = ChineseClassificationFieldName;
            chineseClassificationField.Id   = ChineseClassificationFieldId;

            // Add Sequences to Meta
            FtMetaSequence rootSequence = meta.SequenceList.New();

            rootSequence.Name = RootSequenceName;
            rootSequence.Root = true;
            FtMetaSequence catSequence = meta.SequenceList.New();

            catSequence.Name = CatSequenceName;
            FtMetaSequence dogSequence = meta.SequenceList.New();

            dogSequence.Name = DogSequenceName;
            FtMetaSequence goldFishSequence = meta.SequenceList.New();

            goldFishSequence.Name = GoldFishSequenceName;
            FtMetaSequence trainingSequence = meta.SequenceList.New();

            trainingSequence.Name = TrainingSequenceName;

            // Add SequenceItems to Sequences.
            // Add SequenceItems with fields in correct order.  This way index does not need to be specified
            FtMetaSequenceItem item; // used for sequence items without redirects
            FtMetaSequenceItem typeSequenceItem = rootSequence.ItemList.New();

            typeSequenceItem.Field = typeField;
            item       = rootSequence.ItemList.New();
            item.Field = nameField;
            item       = catSequence.ItemList.New();
            item.Field = runningSpeedField;
            item       = dogSequence.ItemList.New();
            item.Field = walkDistanceField;
            item       = dogSequence.ItemList.New();
            item.Field = runningSpeedField;
            FtMetaSequenceItem trainingSequenceItem = dogSequence.ItemList.New();

            trainingSequenceItem.Field = trainingField;
            item       = trainingSequence.ItemList.New();
            item.Field = trainerField;
            item       = trainingSequence.ItemList.New();
            item.Field = sessionCostField;
            item       = goldFishSequence.ItemList.New();
            item.Field = tankLocationField;
            item       = goldFishSequence.ItemList.New();
            item.Field = chineseClassificationField;

            // Add redirects to Meta Sequence Items.
            FtExactIntegerMetaSequenceRedirect typeRedirect;

            typeRedirect = typeSequenceItem.RedirectList.New(FtStandardSequenceRedirectType.ExactInteger) as FtExactIntegerMetaSequenceRedirect;
            typeRedirect.InvokationDelay = FtSequenceInvokationDelay.ftikAfterSequence;
            typeRedirect.Sequence        = catSequence;
            typeRedirect.Value           = 1;
            typeRedirect = typeSequenceItem.RedirectList.New(FtStandardSequenceRedirectType.ExactInteger) as FtExactIntegerMetaSequenceRedirect;
            typeRedirect.InvokationDelay = FtSequenceInvokationDelay.ftikAfterSequence;
            typeRedirect.Sequence        = dogSequence;
            typeRedirect.Value           = 2;
            typeRedirect = typeSequenceItem.RedirectList.New(FtStandardSequenceRedirectType.ExactInteger) as FtExactIntegerMetaSequenceRedirect;
            typeRedirect.InvokationDelay = FtSequenceInvokationDelay.ftikAfterSequence;
            typeRedirect.Sequence        = goldFishSequence;
            typeRedirect.Value           = 3;

            FtBooleanMetaSequenceRedirect trainingRedirect;

            trainingRedirect = trainingSequenceItem.RedirectList.New(FtStandardSequenceRedirectType.Boolean) as FtBooleanMetaSequenceRedirect;
            trainingRedirect.InvokationDelay = FtSequenceInvokationDelay.ftikAfterField;
            trainingRedirect.Sequence        = trainingSequence;
            trainingRedirect.Value           = true;

            // Save Meta to file
            System.Xml.XmlWriterSettings writerSettings = new System.Xml.XmlWriterSettings();
            writerSettings.Indent      = true;
            writerSettings.IndentChars = "  ";
            FtMetaSerializer.Serialize(meta, MetaFileName, writerSettings);
        }
Exemplo n.º 2
0
        public void MetaVariations()
        {
            foreach (MetaVariation variation in metaVariationArray)
            {
                FtMeta meta = new FtMeta();
                variation.Properties.LoadIntoMeta(ref meta);

                foreach (MetaFieldDefinition metaFieldDefinition in metaFieldDefinitionArray)
                {
                    FtMetaField metaField = meta.FieldList.New(metaFieldDefinition.DataType);
                    // metaField.Name = "Field" + idx++.ToString();
                    metaFieldDefinition.Properties.LoadIntoMetaField(ref metaField, true);

                    switch (metaFieldDefinition.DataType)
                    {
                    case FtStandardDataType.Boolean:
                        FtBooleanMetaField booleanMetaField = metaField as FtBooleanMetaField;
                        booleanMetaField.Styles    = BooleanMetaFieldStyles;
                        booleanMetaField.FalseText = BooleanMetaFieldFalseText;
                        booleanMetaField.TrueText  = BooleanMetaFieldTrueText;
                        break;

                    case FtStandardDataType.String:
                        FtStringMetaField stringMetaField = metaField as FtStringMetaField;
                        stringMetaField.Value = StringMetaFieldValue;
                        break;

                    case FtStandardDataType.Float:
                        FtFloatMetaField floatMetaField = metaField as FtFloatMetaField;
                        floatMetaField.Format = FloatMetaFieldFormat;
                        floatMetaField.Styles = FloatMetaFieldStyles;
                        break;

                    case FtStandardDataType.DateTime:
                        FtDateTimeMetaField dateTimeMetaField = metaField as FtDateTimeMetaField;
                        dateTimeMetaField.Format = DateTimeMetaFieldFormat;
                        dateTimeMetaField.Styles = DateTimeMetaFieldStyles;
                        dateTimeMetaField.Value  = DateTimeMetaFieldValue;
                        break;
                    }
                }

                string    filePath = Path.Combine(TestFolder, variation.FileName);
                XmlWriter writer   = XmlWriter.Create(filePath, xmlWriterSettings);
                FtMetaSerializer.Serialize(meta, writer);
                writer.Close();

                string DataFilePath = Path.Combine(DataFolder, variation.FileName);
                if (!TextFilesAreEqual(filePath, DataFilePath))
                {
                    Assert.Fail(variation.FileName + " does not match Test Data");
                }
                else
                {
                    FtMeta deserialisedMeta = FtMetaSerializer.Deserialize(filePath);

                    variation.Properties.AssertMetaAreEqual(meta);

                    Assert.AreEqual <int>(metaFieldDefinitionArray.Length, deserialisedMeta.FieldList.Count);

                    for (int i = 0; i < deserialisedMeta.FieldList.Count; i++)
                    {
                        FtMetaField metaField = deserialisedMeta.FieldList[i];
                        metaFieldDefinitionArray[i].Properties.AssertMetaFieldAreEqual(metaField, true);

                        switch (metaFieldDefinitionArray[i].DataType)
                        {
                        case FtStandardDataType.Boolean:
                            FtBooleanMetaField booleanMetaField = metaField as FtBooleanMetaField;
                            Assert.AreEqual <FtBooleanStyles>(BooleanMetaFieldStyles, booleanMetaField.Styles);
                            Assert.AreEqual <string>(BooleanMetaFieldFalseText, booleanMetaField.FalseText);
                            Assert.AreEqual <string>(BooleanMetaFieldTrueText, booleanMetaField.TrueText);
                            break;

                        case FtStandardDataType.String:
                            FtStringMetaField stringMetaField = metaField as FtStringMetaField;
                            Assert.AreEqual <string>(StringMetaFieldValue, stringMetaField.Value);
                            break;

                        case FtStandardDataType.Float:
                            FtFloatMetaField floatMetaField = metaField as FtFloatMetaField;
                            Assert.AreEqual <string>(FloatMetaFieldFormat, floatMetaField.Format);
                            Assert.AreEqual <NumberStyles>(FloatMetaFieldStyles, floatMetaField.Styles);
                            break;

                        case FtStandardDataType.DateTime:
                            FtDateTimeMetaField dateTimeMetaField = metaField as FtDateTimeMetaField;
                            Assert.AreEqual <string>(DateTimeMetaFieldFormat, dateTimeMetaField.Format);
                            Assert.AreEqual <DateTimeStyles>(DateTimeMetaFieldStyles, dateTimeMetaField.Styles);
                            Assert.AreEqual <DateTime>(DateTimeMetaFieldValue, dateTimeMetaField.Value);
                            break;
                        }
                    }
                }
            }
        }
Exemplo n.º 3
0
        public void MetaSequence()
        {
            FtMeta meta = new FtMeta();

            FtMetaField rootField1 = meta.FieldList.New(FtStandardDataType.String);

            rootField1.Id = RootField1Id;
            FtMetaField rootField2 = meta.FieldList.New(FtStandardDataType.Integer);

            rootField2.Id = RootField2Id;
            FtMetaField rootField3 = meta.FieldList.New(FtStandardDataType.Boolean);

            rootField3.Id = RootField3Id;
            FtMetaField sequence1Field1 = meta.FieldList.New(FtStandardDataType.Float);

            sequence1Field1.Id = Sequence1Field1Id;
            FtMetaField sequence1Field2 = meta.FieldList.New(FtStandardDataType.Decimal);

            sequence1Field2.Id = Sequence1Field2Id;
            FtMetaField sequence2Field1 = meta.FieldList.New(FtStandardDataType.DateTime);

            sequence2Field1.Id = Sequence2Field1Id;
            FtMetaField sequence2Field2 = meta.FieldList.New(FtStandardDataType.Boolean);

            sequence2Field2.Id = Sequence2Field2Id;
            FtMetaField sequence2Field3 = meta.FieldList.New(FtStandardDataType.String);

            sequence2Field3.Id = Sequence2Field3Id;
            FtMetaField sequence2Field4 = meta.FieldList.New(FtStandardDataType.Integer);

            sequence2Field4.Id = Sequence2Field4Id;
            FtMetaField sequence3Field1 = meta.FieldList.New(FtStandardDataType.Boolean);

            sequence3Field1.Id = Sequence3Field1Id;
            FtMetaField sequence4Field1 = meta.FieldList.New(FtStandardDataType.Float);

            sequence4Field1.Id = Sequence4Field1Id;
            FtMetaField sequence4Field2 = meta.FieldList.New(FtStandardDataType.Decimal);

            sequence4Field2.Id = Sequence4Field2Id;

            FtMetaSequence rootSequence = meta.SequenceList.New();

            rootSequence.Root = true;
            FtMetaSequenceItem rootItem1 = rootSequence.ItemList.New();

            rootItem1.Field = rootField1;
            FtMetaSequenceItem rootItem2 = rootSequence.ItemList.New();

            rootItem2.Field = rootField2;
            FtMetaSequenceItem rootItem3 = rootSequence.ItemList.New();

            rootItem3.Field = rootField3;

            FtMetaSequence sequence1 = meta.SequenceList.New();

            sequence1.Name = Sequence1Name;
            FtMetaSequenceItem sequence1Item1 = sequence1.ItemList.New();

            sequence1Item1.Field = sequence1Field1;
            FtMetaSequenceItem sequence1Item2 = sequence1.ItemList.New();

            sequence1Item2.Field = sequence1Field2;
            FtMetaSequence sequence2 = meta.SequenceList.New();

            sequence2.Name = Sequence2Name;
            FtMetaSequenceItem sequence2Item1 = sequence2.ItemList.New();

            sequence2Item1.Field = sequence2Field1;
            FtMetaSequenceItem sequence2Item2 = sequence2.ItemList.New();

            sequence2Item2.Field = sequence2Field2;
            FtMetaSequenceItem sequence2Item3 = sequence2.ItemList.New();

            sequence2Item3.Field = sequence2Field3;
            FtMetaSequenceItem sequence2Item4 = sequence2.ItemList.New();

            sequence2Item4.Field = sequence2Field4;
            FtMetaSequence sequence3 = meta.SequenceList.New();

            sequence3.Name = Sequence3Name;
            FtMetaSequenceItem sequence3Item1 = sequence3.ItemList.New();

            sequence3Item1.Field = sequence3Field1;
            FtMetaSequence sequence4 = meta.SequenceList.New();

            sequence4.Name = Sequence4Name;
            FtMetaSequenceItem sequence4Item1 = sequence4.ItemList.New();

            sequence4Item1.Field = sequence4Field1;
            FtMetaSequenceItem sequence4Item2 = sequence4.ItemList.New();

            sequence4Item2.Field = sequence4Field2;

            FtExactIntegerMetaSequenceRedirect rootRedirect1 = rootItem2.RedirectList.New(FtStandardSequenceRedirectType.ExactInteger) as FtExactIntegerMetaSequenceRedirect;

            rootRedirect1.InvokationDelay = RootRedirect1InvokationDelay;
            rootRedirect1.Value           = RootRedirect1Value;
            rootRedirect1.Sequence        = sequence1;
            FtExactIntegerMetaSequenceRedirect rootRedirect2 = rootItem2.RedirectList.New(FtStandardSequenceRedirectType.ExactInteger) as FtExactIntegerMetaSequenceRedirect;

            rootRedirect2.InvokationDelay = RootRedirect2InvokationDelay;
            rootRedirect2.Value           = 2;
            rootRedirect2.Sequence        = sequence2;
            FtExactIntegerMetaSequenceRedirect rootRedirect3 = rootItem2.RedirectList.New(FtStandardSequenceRedirectType.ExactInteger) as FtExactIntegerMetaSequenceRedirect;

            rootRedirect3.InvokationDelay = RootRedirect3InvokationDelay;
            rootRedirect3.Value           = 3;
            rootRedirect3.Sequence        = sequence3;

            FtNullMetaSequenceRedirect sequence1Redirect1 = sequence1Item2.RedirectList.New(FtStandardSequenceRedirectType.Null) as FtNullMetaSequenceRedirect;

            sequence1Redirect1.InvokationDelay = Sequence1Redirect1InvokationDelay;
            sequence1Redirect1.Sequence        = sequence4;

            FtCaseInsensitiveStringMetaSequenceRedirect sequence2Redirect1 = sequence2Item3.RedirectList.New(FtStandardSequenceRedirectType.CaseInsensitiveString) as FtCaseInsensitiveStringMetaSequenceRedirect;

            sequence2Redirect1.InvokationDelay = Sequence2Redirect1InvokationDelay;
            sequence2Redirect1.Value           = Sequence2Redirect1Value;
            sequence2Redirect1.Sequence        = sequence4;

            // Serialize Meta
            XmlWriter writer = XmlWriter.Create(filePath, xmlWriterSettings);

            FtMetaSerializer.Serialize(meta, writer);
            writer.Close();

            string DataFilePath = Path.Combine(DataFolder, SequenceFileName);

            if (!TextFilesAreEqual(filePath, DataFilePath))
            {
                Assert.Fail("MetaSequence does not match Test Data");
            }
            else
            {
                FtMeta deserializedMeta = FtMetaSerializer.Deserialize(filePath);
                AssertDeserializedMeta(deserializedMeta);

                string foreignFilePath     = Path.Combine(DataFolder, ForeignFileName);
                FtMeta deserializedForeign = FtMetaSerializer.Deserialize(foreignFilePath);
                AssertDeserializedMeta(deserializedForeign);
            }
        }
Exemplo n.º 4
0
        public void AllDefaults()
        {
            // Creates Meta with one sequence with one field of each type
            // Sets Meta and fields and sequence redirects properties to default values
            // Saves to XML (Serialize)
            // Compares XML to Expected
            // Creates Meta from XML (Deserialize)
            // Checks properties are as originally set

            state = State.Initialise;

            // Create Meta and set default properties
            FtMeta meta = new FtMeta();

            defaultMetaProperties.LoadIntoMeta(ref meta);

            FtStringMetaField stringField = meta.FieldList.New(FtStandardDataType.String) as FtStringMetaField;

            stringField.Name = StringFieldName;
            FtBooleanMetaField booleanField = meta.FieldList.New(FtStandardDataType.Boolean) as FtBooleanMetaField;

            booleanField.Name = BooleanFieldName;
            FtIntegerMetaField integerField = meta.FieldList.New(FtStandardDataType.Integer) as FtIntegerMetaField;

            integerField.Name = IntegerFieldName;
            FtFloatMetaField floatField = meta.FieldList.New(FtStandardDataType.Float) as FtFloatMetaField;

            floatField.Name = FloatFieldName;
            FtDecimalMetaField decimalField = meta.FieldList.New(FtStandardDataType.Decimal) as FtDecimalMetaField;

            decimalField.Name = DecimalFieldName;
            FtDateTimeMetaField dateTimeField = meta.FieldList.New(FtStandardDataType.DateTime) as FtDateTimeMetaField;

            dateTimeField.Name = DateTimeFieldName;

            FtStringMetaField redirectStringField1 = meta.FieldList.New(FtStandardDataType.String) as FtStringMetaField;

            redirectStringField1.Name = RedirectStringField1Name;
            FtBooleanMetaField redirectBooleanField2 = meta.FieldList.New(FtStandardDataType.Boolean) as FtBooleanMetaField;

            redirectBooleanField2.Name = RedirectBooleanField2Name;
            FtIntegerMetaField redirectIntegerField3 = meta.FieldList.New(FtStandardDataType.Integer) as FtIntegerMetaField;

            redirectIntegerField3.Name = RedirectIntegerField3Name;
            FtFloatMetaField redirectFloatField4 = meta.FieldList.New(FtStandardDataType.Float) as FtFloatMetaField;

            redirectFloatField4.Name = RedirectFloatField4Name;
            FtDecimalMetaField redirectDecimalField5 = meta.FieldList.New(FtStandardDataType.Decimal) as FtDecimalMetaField;

            redirectDecimalField5.Name = RedirectDecimalField5Name;
            FtDateTimeMetaField redirectDateTimeField6 = meta.FieldList.New(FtStandardDataType.DateTime) as FtDateTimeMetaField;

            redirectDateTimeField6.Name = RedirectDateTimeField6Name;

            // Create root sequence
            FtMetaSequence rootSequence = meta.SequenceList.New();

            rootSequence.Name = "Root";
            rootSequence.Root = true;

            // Create redirect target sequence
            FtMetaSequence redirectTargetSequence = meta.SequenceList.New();

            redirectTargetSequence.Name = "RedirectTarget";
            FtMetaSequenceItem     sequenceItem;
            FtMetaSequenceRedirect sequenceRedirect;

            sequenceItem              = redirectTargetSequence.ItemList.New();
            sequenceItem.Field        = redirectStringField1;
            sequenceItem              = redirectTargetSequence.ItemList.New();
            sequenceItem.Field        = redirectBooleanField2;
            sequenceRedirect          = sequenceItem.RedirectList.New(FtStandardSequenceRedirectType.Null);
            sequenceRedirect.Sequence = rootSequence;
            sequenceItem              = redirectTargetSequence.ItemList.New();
            sequenceItem.Field        = redirectIntegerField3;
            sequenceItem              = redirectTargetSequence.ItemList.New();
            sequenceItem.Field        = redirectFloatField4;
            sequenceRedirect          = sequenceItem.RedirectList.New(FtStandardSequenceRedirectType.Null);
            sequenceRedirect.Sequence = rootSequence;
            sequenceItem              = redirectTargetSequence.ItemList.New();
            sequenceItem.Field        = redirectDecimalField5;
            sequenceItem              = redirectTargetSequence.ItemList.New();
            sequenceItem.Field        = redirectDateTimeField6;

            // Create one field of each type and set properties to defaults and put in sequence.  Add default redirect to sequence item redirect list
            AllDefaults_Field(stringField, rootSequence, redirectTargetSequence, FtStandardSequenceRedirectType.ExactString, 0);
            AllDefaults_Field(booleanField, rootSequence, redirectTargetSequence, FtStandardSequenceRedirectType.Boolean, 1);
            booleanField.FalseText = BooleanFalseText;
            booleanField.TrueText  = BooleanTrueText;
            booleanField.Styles    = BooleanStyles;
            AllDefaults_Field(integerField, rootSequence, redirectTargetSequence, FtStandardSequenceRedirectType.ExactInteger, 2);
            integerField.Format = IntegerFieldFormat;
            integerField.Styles = IntegerFieldStyles;
            AllDefaults_Field(floatField, rootSequence, redirectTargetSequence, FtStandardSequenceRedirectType.ExactFloat, 3);
            floatField.Format = FloatFieldFormat;
            floatField.Styles = FloatFieldStyles;
            AllDefaults_Field(decimalField, rootSequence, redirectTargetSequence, FtStandardSequenceRedirectType.ExactDecimal, 4);
            decimalField.Format = DecimalFieldFormat;
            decimalField.Styles = DecimalFieldStyles;
            AllDefaults_Field(dateTimeField, rootSequence, redirectTargetSequence, FtStandardSequenceRedirectType.ExactDateTime, 5);
            dateTimeField.Format = DateTimeFieldFormat;
            dateTimeField.Styles = DateTimeFieldStyles;

            // Add one substitution of default substitution type
            FtMetaSubstitution substitution = meta.SubstitutionList.New();

            substitution.Type  = SubstitutionType;
            substitution.Token = SubstitutionToken;
            substitution.Value = SubstitutionValue;

            // Serialize Meta
            XmlWriter writer = XmlWriter.Create(filePath, xmlWriterSettings);

            FtMetaSerializer.Serialize(meta, writer);
            writer.Close();

            state = State.Assert;

            string DataFilePath = Path.Combine(DataFolder, AllDefaultsFileName);

            if (!TextFilesAreEqual(filePath, DataFilePath))
            {
                Assert.Fail("AllDefaults does not match Test Data");
            }
            else
            {
                FtMeta deserialisedMeta = FtMetaSerializer.Deserialize(filePath);

                defaultMetaProperties.AssertMetaAreEqual(meta);

                rootSequence = meta.SequenceList[0];
                Assert.AreEqual <bool>(true, rootSequence.Root);
                Assert.AreEqual <int>(6, rootSequence.ItemList.Count);
                redirectTargetSequence = meta.SequenceList[1];
                Assert.AreEqual <bool>(false, redirectTargetSequence.Root);
                Assert.AreEqual <int>(6, redirectTargetSequence.ItemList.Count);

                stringField = meta.FieldList[0] as FtStringMetaField;
                Assert.AreEqual <string>(StringFieldName, stringField.Name);
                AllDefaults_Field(stringField, rootSequence, redirectTargetSequence, FtStandardSequenceRedirectType.ExactString, 0);
                booleanField = meta.FieldList[1] as FtBooleanMetaField;
                Assert.AreEqual <string>(BooleanFieldName, booleanField.Name);
                AllDefaults_Field(booleanField, rootSequence, redirectTargetSequence, FtStandardSequenceRedirectType.Boolean, 1);
                Assert.AreEqual <string>(BooleanFalseText, booleanField.FalseText);
                Assert.AreEqual <string>(BooleanTrueText, booleanField.TrueText);
                Assert.AreEqual <FtBooleanStyles>(BooleanStyles, booleanField.Styles);
                integerField = meta.FieldList[2] as FtIntegerMetaField;
                Assert.AreEqual <string>(IntegerFieldName, integerField.Name);
                AllDefaults_Field(integerField, rootSequence, redirectTargetSequence, FtStandardSequenceRedirectType.ExactInteger, 2);
                Assert.AreEqual <string>(IntegerFieldFormat, integerField.Format);
                Assert.AreEqual <NumberStyles>(IntegerFieldStyles, integerField.Styles);
                floatField = meta.FieldList[3] as FtFloatMetaField;
                Assert.AreEqual <string>(FloatFieldName, floatField.Name);
                AllDefaults_Field(floatField, rootSequence, redirectTargetSequence, FtStandardSequenceRedirectType.ExactFloat, 3);
                Assert.AreEqual <string>(FloatFieldFormat, floatField.Format);
                Assert.AreEqual <NumberStyles>(FloatFieldStyles, floatField.Styles);
                decimalField = meta.FieldList[4] as FtDecimalMetaField;
                Assert.AreEqual <string>(DecimalFieldName, decimalField.Name);
                AllDefaults_Field(decimalField, rootSequence, redirectTargetSequence, FtStandardSequenceRedirectType.ExactDecimal, 4);
                Assert.AreEqual <string>(DecimalFieldFormat, decimalField.Format);
                Assert.AreEqual <NumberStyles>(DecimalFieldStyles, decimalField.Styles);
                dateTimeField = meta.FieldList[5] as FtDateTimeMetaField;
                Assert.AreEqual <string>(DateTimeFieldName, dateTimeField.Name);
                AllDefaults_Field(dateTimeField, rootSequence, redirectTargetSequence, FtStandardSequenceRedirectType.ExactDateTime, 5);
                Assert.AreEqual <string>(DateTimeFieldFormat, dateTimeField.Format);
                Assert.AreEqual <DateTimeStyles>(DateTimeFieldStyles, dateTimeField.Styles);

                redirectStringField1 = meta.FieldList[6] as FtStringMetaField;
                Assert.AreEqual <string>(RedirectStringField1Name, redirectStringField1.Name);
                redirectBooleanField2 = meta.FieldList[7] as FtBooleanMetaField;
                Assert.AreEqual <string>(RedirectBooleanField2Name, redirectBooleanField2.Name);
                Assert.AreEqual <string>(BooleanFalseText, redirectBooleanField2.FalseText);
                Assert.AreEqual <string>(BooleanTrueText, redirectBooleanField2.TrueText);
                Assert.AreEqual <FtBooleanStyles>(BooleanStyles, redirectBooleanField2.Styles);
                redirectIntegerField3 = meta.FieldList[8] as FtIntegerMetaField;
                Assert.AreEqual <string>(RedirectIntegerField3Name, redirectIntegerField3.Name);
                Assert.AreEqual <string>(IntegerFieldFormat, redirectIntegerField3.Format);
                Assert.AreEqual <NumberStyles>(IntegerFieldStyles, redirectIntegerField3.Styles);
                redirectFloatField4 = meta.FieldList[9] as FtFloatMetaField;
                Assert.AreEqual <string>(RedirectFloatField4Name, redirectFloatField4.Name);
                Assert.AreEqual <string>(FloatFieldFormat, redirectFloatField4.Format);
                Assert.AreEqual <NumberStyles>(FloatFieldStyles, redirectFloatField4.Styles);
                redirectDecimalField5 = meta.FieldList[10] as FtDecimalMetaField;
                Assert.AreEqual <string>(RedirectDecimalField5Name, redirectDecimalField5.Name);
                Assert.AreEqual <string>(DecimalFieldFormat, redirectDecimalField5.Format);
                Assert.AreEqual <NumberStyles>(DecimalFieldStyles, redirectDecimalField5.Styles);
                redirectDateTimeField6 = meta.FieldList[11] as FtDateTimeMetaField;
                Assert.AreEqual <string>(RedirectDateTimeField6Name, redirectDateTimeField6.Name);
                Assert.AreEqual <string>(DateTimeFieldFormat, redirectDateTimeField6.Format);
                Assert.AreEqual <DateTimeStyles>(DateTimeFieldStyles, redirectDateTimeField6.Styles);

                Assert.AreEqual <FtMetaField>(redirectStringField1, redirectTargetSequence.ItemList[0].Field);
                Assert.AreEqual <int>(0, redirectTargetSequence.ItemList[0].RedirectList.Count);
                Assert.AreEqual <FtMetaField>(redirectBooleanField2, redirectTargetSequence.ItemList[1].Field);
                Assert.AreEqual <int>(1, redirectTargetSequence.ItemList[1].RedirectList.Count);
                Assert.AreEqual <int>(FtStandardSequenceRedirectType.Null, redirectTargetSequence.ItemList[1].RedirectList[0].Type);
                Assert.AreEqual <FtMetaField>(redirectIntegerField3, redirectTargetSequence.ItemList[2].Field);
                Assert.AreEqual <int>(0, redirectTargetSequence.ItemList[2].RedirectList.Count);
                Assert.AreEqual <FtMetaField>(redirectFloatField4, redirectTargetSequence.ItemList[3].Field);
                Assert.AreEqual <int>(1, redirectTargetSequence.ItemList[3].RedirectList.Count);
                Assert.AreEqual <int>(FtStandardSequenceRedirectType.Null, redirectTargetSequence.ItemList[3].RedirectList[0].Type);
                Assert.AreEqual <FtMetaField>(redirectDecimalField5, redirectTargetSequence.ItemList[4].Field);
                Assert.AreEqual <int>(0, redirectTargetSequence.ItemList[4].RedirectList.Count);
                Assert.AreEqual <FtMetaField>(redirectDateTimeField6, redirectTargetSequence.ItemList[5].Field);
                Assert.AreEqual <int>(0, redirectTargetSequence.ItemList[5].RedirectList.Count);
            }
        }