Пример #1
0
        public void TestLoadConfig()
        {
            MockConfigFileController mockConfigFileLoader = new MockConfigFileController();

            mockConfigFileLoader.CreateMockXmlConfigDocument();
            mockConfigFileLoader.AddServerInfoToMockXmlConfigDocument((int)TEST_SERVER_TYPE, TSET_SERVER_EXE_PATH, TSET_SERVER_PROCESS_NAME);
            Config config = new Config(mockConfigFileLoader);

            Assert.AreEqual(true, config.LoadConfig());
            Assert.AreEqual(1, config.refListServerInfo.Count);
        }
Пример #2
0
        public void TestDeleteServerInfo()
        {
            MockConfigFileController mockConfigFileLoader = new MockConfigFileController();

            mockConfigFileLoader.CreateMockXmlConfigDocument();
            mockConfigFileLoader.AddServerInfoToMockXmlConfigDocument((int)TEST_SERVER_TYPE, TSET_SERVER_EXE_PATH, TSET_SERVER_PROCESS_NAME);
            Config config = new Config(mockConfigFileLoader);

            Assert.AreEqual(false, mockConfigFileLoader.IsCallSaveConfig);
            Assert.AreEqual(1, mockConfigFileLoader.GetServerInfoCountInMockXmlConfigDocument());

            config.DeleteServerInfo(TSET_SERVER_EXE_PATH);

            Assert.AreEqual(true, mockConfigFileLoader.IsCallSaveConfig);
            Assert.AreEqual(0, mockConfigFileLoader.GetServerInfoCountInMockXmlConfigDocument());
        }