public void BenchmarkPresenter_DescriptionLinkClicked_ShowsMessageBoxWhenLocalProcessFailsToStart() { // Arrange var model = CreateModel(); var messageBox = new MockMessageBoxPresenter(); using (var presenter = new MockFormBenchmarksPresenter(model, messageBox)) { presenter.Show(); var localProcess = new LocalProcessServiceThrows(); // Act presenter.DescriptionLinkClicked(localProcess); // Assert Assert.AreEqual(1, messageBox.Invocations.Count); Assert.AreEqual(nameof(MessageBoxPresenter.ShowError), messageBox.Invocations.First().Name); } }
public void BenchmarkPresenter_DescriptionLinkClicked_StartsLocalProcess() { // Arrange var dataContainer = new ProteinDataContainer(); dataContainer.Data.Add(new Protein { ProjectNumber = 12345, Description = "http://someurl" }); var proteinService = new ProteinService(dataContainer, null, null); var benchmarkService = CreateBenchmarkServiceWithOneSlotAndProject(); var model = CreateModel(proteinService, benchmarkService); using (var presenter = new MockFormBenchmarksPresenter(model)) { presenter.Show(); var localProcess = new MockLocalProcessService(); // Act presenter.DescriptionLinkClicked(localProcess); // Assert Assert.AreEqual(1, presenter.Model.SlotProjects.Count); Assert.IsTrue(localProcess.Invocations.First().FileName == "http://someurl"); } }