Ejemplo n.º 1
0
        public IEnumerator TestProductPickerRendersErrorWhenError()
        {
            _client = new ShopifyClient(new UnityEditorLoader(ShopDomain, "badbadbad"));
            _view   = Substitute.For <IProductPickerView>();
            _picker = new ProductPicker(_client, _view);
            _picker.OnShouldRefreshProductList();

            while (!_picker.ProductsFinishedLoading())
            {
                yield return(null);
            }

            _picker.DrawInspectorGUI(null);

            _view.DidNotReceive().DrawProductPicker(null, Arg.Any <Dictionary <string, string> >());
            _view.DidNotReceive().DrawProductLoadingState(null);
            _view.DidNotReceive().DrawShopHasNoProductsState(null);
            _view.Received().DrawProductLoadingError(null);
        }
Ejemplo n.º 2
0
 public ProductPicker(ShopifyClient client, IProductPickerView view = null)
 {
     _view  = view ?? new ProductPickerView(this);
     Client = client;
     LoadProducts();
 }
Ejemplo n.º 3
0
 public void Setup()
 {
     _client = new ShopifyClient(new UnityEditorLoader(ShopDomain, AccessToken));
     _view   = Substitute.For <IProductPickerView>();
     _picker = new ProductPicker(_client, _view);
 }