Beispiel #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);
        }
Beispiel #2
0
        public void TestAddServerInfo()
        {
            MockConfigFileController mockConfigFileLoader = new MockConfigFileController();

            mockConfigFileLoader.CreateMockXmlConfigDocument();
            Config config = new Config(mockConfigFileLoader);

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

            config.AddServerInfo(TEST_SERVER_TYPE, TSET_SERVER_EXE_PATH, TSET_SERVER_PROCESS_NAME);

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