Ejemplo n.º 1
0
        public void GetUnitName_Checks()
        {
            var dictionary = new Dictionary <string, string>()
            {
                { "/home/user/.config/sharpinit/units/[email protected]", "[email protected]" },
                { "/etc/sharpinit/units/[email protected]", "[email protected]" },
                { "C:\\Users\\User\\.config\\sharpinit\\units\\notepad.service", "notepad.service" },
                { "relative/path/to/[email protected]", "[email protected]" },
                { "backslash\\relative\\path\\test.target", "test.target" }
            };

            foreach (var pair in dictionary)
            {
                Assert.AreEqual(UnitRegistry.GetUnitName(pair.Key), pair.Value);
            }
        }