public void ViewProductDetails(Product product, ProductVariant[] variants) { if (_activeView == _productDetailsView) { return; } ViewSwitcher.PushView(_productDetailsView.RectTransform); _activeView = _productDetailsView; OnViewChanged(); _productDetailsView.FillWithProductAndVariants(product, variants); }
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); }