Exemple #1
0
        public static TServer CreateFromXml <TServer, TOptions>(XNode xServer)
            where TServer : IServer//, new()
            where TOptions : IServerOptions
        {
            TServer server = Activator.CreateInstance <TServer>();

            //T server = new T();
            server.Options = BaseServerOptions.CreateFromXml <TOptions>(xServer);
            return(server);
        }
        public void CreateFromXmlTest()
        {
            XNode             xServer  = xServerForTest;                // TODO: Initialize to an appropriate value
            BaseServerOptions expected = new GoldSourceServerOptions(); // TODO: Initialize to an appropriate value
            BaseServerOptions actual;

            actual = BaseServerOptions.CreateFromXml <GoldSourceServerOptions>(xServer);
            Assert.AreEqual(expected.CommandLine(), actual.CommandLine());
            //Assert.Inconclusive("No appropriate type parameter is found to satisfies the type constraint(s) of T. " +
            //        "Please call CreateFromXmlTestHelper<T>() with appropriate type parameters.");
        }