public void CompareDefaultDllMappingWithConifgFile() { var defaultDllMapItems = NaiveDllMap.GetDefaultDllMap().ToList(); var additionalConfigPath = NaiveDllMap.ConstructAdditionalConfigFile(typeof(IPamService).Assembly.Location); var root = XElement.Load(additionalConfigPath); var configDllMapItems = DllMapItem.LoadDllMap(root.Elements("dllmap")).ToList(); Assert.Equal(defaultDllMapItems, configDllMapItems); }
public void DllMapGetsRemovedWhenTargetAttributeMissingOrEmpty() { var loadedDllMaps = DllMapItem.LoadDllMap(new[] { new XElement( "dllmap", new XAttribute("dll", "dllToSearchFor1"), new XAttribute("target", string.Empty)), new XElement( "dllmap", new XAttribute("dll", "dllToSearchFor2")), }); Assert.Empty(loadedDllMaps); }
public void DllMapGetsRemovedWhenDllAttributeMissingOrEmpty() { var loadedDllMaps = DllMapItem.LoadDllMap(new[] { new XElement( "dllmap", new XAttribute("dll", string.Empty), new XAttribute("target", "dllToReplaceWith1")), new XElement( "dllmap", new XAttribute("target", "dllToReplaceWith2")), }); Assert.Empty(loadedDllMaps); }
public void CanParseSimpleDllMap() { var loadedDllMaps = DllMapItem.LoadDllMap(new[] { new XElement( "dllmap", new XAttribute("dll", "dllToSearchFor"), new XAttribute("target", "dllToReplaceWith")), }); Assert.Collection( loadedDllMaps, dllMap => { Assert.Equal("dllToSearchFor", dllMap.Dll); Assert.Equal("dllToReplaceWith", dllMap.Target); Assert.Empty(dllMap.OperatingSystems); }); }