Esempio n. 1
0
        public void FileExistsTest()
        {
            Guid fid = Guid.NewGuid();

            HostManagerClient.GetInstance().CreateHostContent(fid.ToString());
            HostManagerClient.GetInstance().FileExists(fid.ToString());
        }
Esempio n. 2
0
        public void WriteHostContent()
        {
            bool ret = HostManagerClient.GetInstance().WriteHostContent("key", "abcdef");

            Assert.IsTrue(ret);

            string c = HostManagerClient.GetInstance().ReadHostContent("key");

            Assert.AreEqual("abcdef", c);
        }
Esempio n. 3
0
        public void BackUpAndGetDefaultHost()
        {
            string ruleContent = Server.GetInstance().GetHostFileContent();

            bool ret = HostManagerClient.GetInstance().BackDefaultHost(ruleContent);

            Assert.IsTrue(ret);

            string dHost = HostManagerClient.GetInstance().ReadHostContent(HostManager.DefaultHostFileName);

            Assert.AreEqual(ruleContent, dHost);
        }
Esempio n. 4
0
        public void ReadHostContent()
        {
            if (!HostManagerClient.GetInstance().FileExists("key"))
            {
                HostManagerClient.GetInstance().CreateHostContent("key");
            }
            HostManagerClient.GetInstance().WriteHostContent("key", "testHost");
            string hContent = HostManagerClient.GetInstance().ReadHostContent("key");

            Assert.IsNotNull(hContent);

            Assert.AreEqual(String.Empty,
                            HostManagerClient.GetInstance().ReadHostContent(Guid.NewGuid().ToString()));
        }
Esempio n. 5
0
        public void GetHostList()
        {
            List <HostSwitchLib.HostItem> list = HostManagerClient.GetInstance().GetHostList();

            Assert.IsTrue(list.Count > 0);
        }