示例#1
0
        static void DemoMaintenance()
        {
            ApplicationServices app = new ApplicationServices();

            string userName = "******";

            app.RegisterUser(userName);
            app.Deposit(150);
            Purchase(app, "book");

            using (File.Create("maintenance.lock")) { }
            Purchase(app, "book");

            File.Delete("maintenance.lock");
            Purchase(app, "book");
        }
示例#2
0
        static void DemoPurchase()
        {
            ApplicationServices app = new ApplicationServices();

            string userName = "******";

            app.RegisterUser(userName);
            app.Deposit(150);

            Purchase(app, "book");
            Purchase(app, "book");
            Purchase(app, "parachute");
            Purchase(app, "book");
            Purchase(app, "book");

            AnonymousPurchase(app, "book");
            AnonymousPurchase(app, "parachute");
        }
示例#3
0
        static void DemoReferral()
        {
            ApplicationServices app = new ApplicationServices();

            string userName = "******";

            app.RegisterUser(userName);
            app.Deposit(200);
            Purchase(app, "book");

            app.RegisterUser("Joe", userName);

            app.Login(userName);
            Purchase(app, "book");

            app.RegisterUser("Jill", userName);

            app.Login(userName);
            Purchase(app, "book");
        }