Example #1
0
 public void tearDown()
 {
     if (RealBridge == null)
     {
         RealBridge.tearDown();
     }
 }
Example #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;
            }
Example #3
0
        public bool Logout()
        {
            if (RealBridge == null)
            {
                return(false);
            }

            bool success = RealBridge.Logout();

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

            bool success = RealBridge.Login(loginInfo);

            if (success)
            {
                SystemContext !.LoggedInUser = loginInfo;
            }
            return(success);
        }
Example #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);
        }
Example #6
0
 public ShopId?OpenShop(ShopInfo shopInfo)
 {
     return(RealBridge?.OpenShop(shopInfo));
 }
Example #7
0
 public ProductSearchResults?SearchProducts(ProductSearchCreteria creteria)
 {
     return(RealBridge?.SearchProducts(creteria));
 }
Example #8
0
 public bool Disconnect()
 {
     return(RealBridge != null && RealBridge.Disconnect());
 }
Example #9
0
 public bool Connect()
 {
     return(RealBridge != null && RealBridge.Connect());
 }