Esempio n. 1
0
        public void TestLoadDefaults(string contentType, string ext)
        {
            ContentTypes ct;
            var          assembly = Assembly.GetExecutingAssembly();

            using (var xmlFile = assembly.GetManifestResourceStream("MOPE.Tests.Collateral.[Content_Types].xml"))
            {
                ct = ContentTypes.Load(xmlFile);
            }

            Assert.Equal(contentType, ct.Defaults[ext]);
            Assert.Equal(contentType, ct.GetContentType($"foo.{ext}"));
        }
Esempio n. 2
0
        public void TestLoadOverrides(string contentType, string partUri)
        {
            ContentTypes ct;
            var          assembly = Assembly.GetExecutingAssembly();

            using (var xmlFile = assembly.GetManifestResourceStream("MOPE.Tests.Collateral.[Content_Types].xml"))
            {
                ct = ContentTypes.Load(xmlFile);
            }

            Assert.Equal(contentType, ct.Overrides[partUri]);
            Assert.Equal(contentType, ct.GetContentType(partUri));
        }