Esempio n. 1
0
        public void TestGetInfoForNonRegisteredService()
        {
            OpenService os = new OpenService();

            os.ServiceName = "doesn't exists";
            OpenService.ServiceInfo info = os.GetInfo();
            Assert.IsNotNull(info);
            Assert.IsFalse(info.Installed);
            Assert.AreEqual(0, (int)info.WinState);
            Assert.AreEqual(os.ServiceName, info.Name);
            Assert.IsNull(info.DisplayName);
        }
Esempio n. 2
0
        public void TestGetInfoForStandartService()
        {
            OpenService os = new OpenService();

            os.ServiceName = "Workstation";
            OpenService.ServiceInfo info = os.GetInfo();
            Assert.IsNotNull(info);
            Assert.IsTrue(info.Installed);
            Assert.AreEqual("Workstation", info.Name);
            Assert.AreEqual(ServiceControllerStatus.Running, info.WinState);
            Assert.IsNotNull(info.DisplayName);
            Console.WriteLine(info.DisplayName);
        }