public void test_client_not_implemented()
        {
            var client           = HelloWorldClient.NEW_CLIENT;
            var connectionString = "DB Connection string";

            HelloWorldFactory.Init(connectionString);
            HelloWorldFactory.CreateInstance(client, connectionString);
        }
        public void test_write_on_implemented_client()
        {
            var client           = HelloWorldClient.MOBILE;
            var connectionString = "DB Connection string";

            HelloWorldFactory.Init(connectionString);
            var hwInstance = HelloWorldFactory.CreateInstance(client, connectionString);

            hwInstance.setGreeting("Test");
        }
        public void test_create_mobile_type()
        {
            var client           = HelloWorldClient.MOBILE;
            var connectionString = "DB Connection string";

            HelloWorldFactory.Init(connectionString);
            var hwInstance = HelloWorldFactory.CreateInstance(client, connectionString);

            Assert.AreEqual(hwInstance.getGreeting(), "Hello " + client.ToString());
        }
Exemple #4
0
        static void Main(string[] args)
        {
            var connectionString = ConfigurationManager.AppSettings["connectionString"];

            HelloWorldFactory.Init(connectionString);
            var hwInstance = HelloWorldFactory.CreateInstance(HelloWorldClient.CONSOLE, connectionString);

            hwInstance.getGreeting();
            Console.WriteLine(string.Format("Greetings from console : {0}", hwInstance.getGreeting()));
            Console.WriteLine("Press Enter to exit...");
            Console.ReadLine();
        }