Exemplo n.º 1
0
        public void CoreMaps(
            string sourceLibrary,
            string sourceSymbol,
            string targetLibrary,
            string targetSymbol)
        {
            var map = new DllMap {
                {
                    new DllMap.Entity("liba"),
                    new DllMap.Entity("liba-mapped")
                },
                {
                    new DllMap.Entity("liba", "specialfunc"),
                    new DllMap.Entity("libspecialfunc")
                },
                {
                    new DllMap.Entity("liba", "specialfunc2"),
                    new DllMap.Entity("libspecialfunc", "newspecialfunc2")
                },
            };

            var source         = new DllMap.Entity(sourceLibrary, sourceSymbol);
            var expectedTarget = new DllMap.Entity(targetLibrary, targetSymbol);

            Assert.True(map.TryMap(source, out var target));
            Assert.Equal(expectedTarget, target);
        }
Exemplo n.º 2
0
        public void XmlMap(
            string host,
            string sourceLibrary,
            string sourceSymbol,
            string targetLibrary,
            string targetSymbol,
            bool expectedMatch)
        {
            var map = new DllMap(new Runtime(OSPlatform.Create(host))).LoadXml(dllmapXml);

            var source         = new DllMap.Entity(sourceLibrary, sourceSymbol);
            var expectedTarget = new DllMap.Entity(targetLibrary, targetSymbol);

            Assert.Equal(expectedMatch, map.TryMap(source, out var target));
            Assert.Equal(expectedTarget, target);
        }