public void WhenNoPartsErrorMessageIsSetOnView()
        {
            MockRelatedPartsView mockView = new MockRelatedPartsView();

            SharePointServiceLocator.ReplaceCurrentServiceLocator(new ActivatingServiceLocator()
                                                                  .RegisterTypeMapping <IProductCatalogRepository, MockProductCatalog>()
                                                                  .RegisterTypeMapping <ILogger, MockLogger>());

            MockErrorVisualizer errorVisualizer = new MockErrorVisualizer();

            RelatedPartsPresenter target = new RelatedPartsPresenter(mockView);

            target.ErrorVisualizer = errorVisualizer;

            target.LoadParts("sku");

            Assert.AreEqual("No parts found.", mockView.ErrorMessage);
        }
        public void WhenExceptionOccursErrorIsDisplayedInVisualizer()
        {
            MockRelatedPartsView mockView = new MockRelatedPartsView();

            SharePointServiceLocator.ReplaceCurrentServiceLocator(new ActivatingServiceLocator()
                                                                  .RegisterTypeMapping <IProductCatalogRepository, MockProductCatalog>()
                                                                  .RegisterTypeMapping <ILogger, MockLogger>());

            MockErrorVisualizer errorVisualizer = new MockErrorVisualizer();

            RelatedPartsPresenter target = new RelatedPartsPresenter(mockView);

            target.ErrorVisualizer = errorVisualizer;

            target.LoadParts("Error");

            Assert.IsTrue(errorVisualizer.DefaultErrorDisplayed);
        }