예제 #1
0
        static void Setup()
        {
            string username  = "******";
            string password  = "******";
            string storename = "store";


            LoginProxy service = new LoginProxy();

            try
            {
                service.Register(username, password, DateTime.Now, "shit");
                Console.WriteLine("Registering: " + username + ":" + password);

                Member member  = service.loginEx(username, password);
                int    storeId = service.AddStore(storename);
                Console.WriteLine("Opening store: " + storename + ":" + storeId);

                int product1Id = service.AddProductToStore(storeId, "product1", "testProduct", 10.0, "test");
                service.AddProductToStock(storeId, product1Id, 10);
                Console.WriteLine("Adding product: " + "product1" + ":" + product1Id);

                int product2Id = service.AddProductToStore(storeId, "product2", "testProduct", 5.0, "test");
                service.AddProductToStock(storeId, product1Id, 5);
                Console.WriteLine("Adding product: " + "product2" + ":" + product2Id);

                service.logout();
                Console.WriteLine("Setup Done");
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }