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}")); }
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)); }