示例#1
0
 public void tearDown()
 {
     if (RealBridge == null)
     {
         RealBridge.tearDown();
     }
 }
示例#2
0
        public ShopId?AssureOpenShop(ShopInfo shopInfo)
        {
            if (RealBridge == null)
            {
                return(null);
            }

            ShopRefs?shopRef;
            ShopId?  shopId;

            try
            {
                shopRef = shops.GetOrAdd
                          (
                    shopInfo.Name,
                    shopName =>
                {
                    ShopId?shopId = RealBridge.OpenShop(shopInfo);
                    if (shopId == null)
                    {
                        throw new OperationFailedException();
                    }

                    return(new ShopRefs(shopId.Value, SystemContext !.LoggedInUser !));
                }
                          );

                shopId = shopRef.Id;
            }
示例#3
0
        public bool Logout()
        {
            if (RealBridge == null)
            {
                return(false);
            }

            bool success = RealBridge.Logout();

            if (success)
            {
                SystemContext !.LoggedInUser = null;
            }
            return(success);
        }
示例#4
0
        public bool Login(UserInfo loginInfo)
        {
            if (RealBridge == null)
            {
                return(false);
            }

            bool success = RealBridge.Login(loginInfo);

            if (success)
            {
                SystemContext !.LoggedInUser = loginInfo;
            }
            return(success);
        }
示例#5
0
        public bool SignUp(UserInfo signupInfo)
        {
            if (RealBridge == null)
            {
                return(false);
            }

            bool success = RealBridge.SignUp(signupInfo);

            if (success && !registeredUsers.ContainsKey(signupInfo))
            {
                registeredUsers.Add(signupInfo, signupInfo);
            }
            return(success);
        }
示例#6
0
 public ShopId?OpenShop(ShopInfo shopInfo)
 {
     return(RealBridge?.OpenShop(shopInfo));
 }
示例#7
0
 public ProductSearchResults?SearchProducts(ProductSearchCreteria creteria)
 {
     return(RealBridge?.SearchProducts(creteria));
 }
示例#8
0
 public bool Disconnect()
 {
     return(RealBridge != null && RealBridge.Disconnect());
 }
示例#9
0
 public bool Connect()
 {
     return(RealBridge != null && RealBridge.Connect());
 }