public void GroupParticleValidateTest()
        {
            SdbSchemaData sdbSchemaDatas = SdbSchemaData.GetSchemaData(FileFormatVersions.Office2007);

            TestSimpleGroup(sdbSchemaDatas);
            TestSimpleGroup2(sdbSchemaDatas);
        }
Exemplo n.º 2
0
        public void RoundtripRestrictions(FileFormatVersions fileFormat)
        {
            byte[] Roundtrip()
            {
                var restrictions = SdbSchemaData.GetSchemaData(fileFormat).Restrictions;

                using (var ms = new MemoryStream())
                {
                    restrictions.Serialize(ms);
                    return(ms.ToArray());
                }
            }

            byte[] GetStream()
            {
                using (var stream = SdbSchemaData.GetStream(fileFormat, SdbSchemaData.SimpleTypes))
                    using (var ms = new MemoryStream())
                    {
                        stream.CopyTo(ms);
                        return(ms.ToArray());
                    }
            }

            var expected = GetNormalizedString(GetStream());
            var actual   = GetNormalizedString(Roundtrip());

            Assert.Equal(expected, actual);
        }
Exemplo n.º 3
0
        public void FileFormatVersionIsSet(FileFormatVersions fileFormat)
        {
            var schemaData = SdbSchemaData.GetSchemaData(fileFormat);

            foreach (var type in schemaData.Restrictions.SimpleTypes)
            {
                Assert.Equal(fileFormat, type.FileFormat);
            }
        }
        public void ChoiceParticleValidateTest()
        {
            SdbSchemaData sdbSchemaDatas = SdbSchemaData.GetSchemaData(FileFormatVersions.Office2007);

            TestSimpleChoice(sdbSchemaDatas);
            TestSimpleChoice2(sdbSchemaDatas);
            TestSimpleChoice3(sdbSchemaDatas);
            TestSimpleChoice4(sdbSchemaDatas);
        }
Exemplo n.º 5
0
        public void CompositeParticleValidateTest()
        {
            SdbSchemaData sdbSchemaDatas = SdbSchemaData.GetSchemaData(FileFormatVersions.Office2007);

            // TODO: unit test for some types
            ValidatePpr(sdbSchemaDatas);
            ValidateBody(sdbSchemaDatas);
            ValidateBlip(sdbSchemaDatas);
        }
Exemplo n.º 6
0
        public void LoadData()
        {
            var data = SdbSchemaData.GetSchemaData(Version);

            foreach (var type in _types)
            {
                var typeData = data.GetSchemaTypeData(type);

                Assert.NotNull(typeData);
            }
        }
Exemplo n.º 7
0
        public void LoadSdbSchemaDatasTest()
        {
            var actual = SdbSchemaData.GetSchemaData(FileFormatVersions.Office2007);

            AttributeConstraintTest(actual);

            SimpleLoadTest(actual);

            DocumentConstraintTest(actual);

            BodyConstraintTest(actual);

            ParagraphConstraintTest(actual);

            TextboxConstraintTest(actual);

            SimpleTypeConstraintTest(actual);
        }