Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        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);
            });
        }