public void GivenAnAdapterWithABrokenConnection(bool brokenCconnection) { dashboard = new DashboardResource { Environments = new List <DashboardEnvironmentResource> { new DashboardEnvironmentResource { Id = "1234", Name = "1234" }, }, Projects = new List <DashboardProjectResource> { new DashboardProjectResource { Id = "1234", Name = "1234", } }, Id = "1234", Items = new List <DashboardItemResource>(), PreviousItems = new List <DashboardItemResource>(), }; Mock <IOctopusRepository> repoMock = new Mock <IOctopusRepository>(); repoMock.SetupGet(r => r.Dashboards).Returns(dashboardMock.Object); adapter = new OctopusAdapter(repoMock.Object, 15000); if (brokenCconnection) { dashboardMock.Setup(d => d.GetDashboard()).Throws(new Exception("Test")); adapter.Poll(); } adapter.ConnectionError += Adapter_ConnectionError; adapter.ConnectionRestored += Adapter_ConnectionRestored; }
public void WhenTheRepositoryIsPolled() { adapter.Poll(); // System.Threading.Thread.Sleep(1000); }
public void WhenTheRepositoryIsPolled() { adapter.Poll(); }