コード例 #1
0
 public void ViewProductDetails(Product product, ProductVariant[] variants)
 {
     if (_activeView == _productDetailsView)
     {
         return;
     }
     ViewSwitcher.PushView(_productDetailsView.RectTransform);
     _activeView = _productDetailsView;
     OnViewChanged();
     _productDetailsView.FillWithProductAndVariants(product, variants);
 }
コード例 #2
0
        public IEnumerator TestPushViewThrowsErrorIfViewIsNotRegistered()
        {
            yield return(null);

            var exception = Assert.Catch(() => {
                Subject.PushView(Subject.Container);
            });

            Assert.AreEqual("View was not registered with ViewSwitcher before being pushed", exception.Message);
        }