public void tearDown() { if (RealBridge == null) { RealBridge.tearDown(); } }
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; }
public bool Logout() { if (RealBridge == null) { return(false); } bool success = RealBridge.Logout(); if (success) { SystemContext !.LoggedInUser = null; } return(success); }
public bool Login(UserInfo loginInfo) { if (RealBridge == null) { return(false); } bool success = RealBridge.Login(loginInfo); if (success) { SystemContext !.LoggedInUser = loginInfo; } return(success); }
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); }
public ShopId?OpenShop(ShopInfo shopInfo) { return(RealBridge?.OpenShop(shopInfo)); }
public ProductSearchResults?SearchProducts(ProductSearchCreteria creteria) { return(RealBridge?.SearchProducts(creteria)); }
public bool Disconnect() { return(RealBridge != null && RealBridge.Disconnect()); }
public bool Connect() { return(RealBridge != null && RealBridge.Connect()); }