public void SetUp()
		{
			stubProjectMonitor = new StubProjectMonitor("project");

			mockLampController = new DynamicMock(typeof(ILampController));
			mockLampController.Strict = true;
			ILampController lampController = mockLampController.MockInstance as ILampController;
			
			configuration = new X10Configuration();
			configuration.Enabled = true;
			configuration.StartTime = DateTime.Parse("08:00");
			configuration.EndTime = DateTime.Parse("18:00");
            configuration.ActiveDays[(int)DayOfWeek.Sunday] = false;
            configuration.ActiveDays[(int)DayOfWeek.Monday] = true;
            configuration.ActiveDays[(int)DayOfWeek.Tuesday] = true;
            configuration.ActiveDays[(int)DayOfWeek.Wednesday] = true;
            configuration.ActiveDays[(int)DayOfWeek.Thursday] = true;
            configuration.ActiveDays[(int)DayOfWeek.Friday] = true;
            configuration.ActiveDays[(int)DayOfWeek.Saturday] = false;
			
			stubCurrentTimeProvider = new StubCurrentTimeProvider();
			stubCurrentTimeProvider.SetNow(new DateTime(2005, 11, 03, 12, 00, 00));
			Assert.AreEqual(DayOfWeek.Thursday, stubCurrentTimeProvider.Now.DayOfWeek);

			new X10Controller(
				stubProjectMonitor, 
				stubCurrentTimeProvider, 
				configuration,
				lampController);
		}
 public void SetUp()
 {
     buildOccurredCount     = pollCount = 0;
     mockServerMonitor      = new Mock <ISingleServerMonitor>(MockBehavior.Strict);
     mockProjectManager     = new Mock <ICruiseProjectManager>(MockBehavior.Strict);
     dateTimeProvider       = new StubCurrentTimeProvider();
     monitor                = new ProjectMonitor(null, (ICruiseProjectManager)mockProjectManager.Object, (ISingleServerMonitor)mockServerMonitor.Object, dateTimeProvider);
     monitor.Polled        += new MonitorPolledEventHandler(Monitor_Polled);
     monitor.BuildOccurred += new MonitorBuildOccurredEventHandler(Monitor_BuildOccurred);
 }
Exemple #3
0
 public void SetUp()
 {
     buildOccurredCount        = pollCount = 0;
     mockServerMonitor         = new DynamicMock(typeof(ISingleServerMonitor));
     mockServerMonitor.Strict  = true;
     mockProjectManager        = new DynamicMock(typeof(ICruiseProjectManager));
     mockProjectManager.Strict = true;
     dateTimeProvider          = new StubCurrentTimeProvider();
     monitor                = new ProjectMonitor(null, (ICruiseProjectManager)mockProjectManager.MockInstance, (ISingleServerMonitor)mockServerMonitor.MockInstance, dateTimeProvider);
     monitor.Polled        += new MonitorPolledEventHandler(Monitor_Polled);
     monitor.BuildOccurred += new MonitorBuildOccurredEventHandler(Monitor_BuildOccurred);
 }
		public void SetUp()
		{
			buildOccurredCount = pollCount = 0;
            mockServerMonitor = new DynamicMock(typeof(ISingleServerMonitor));
            mockServerMonitor.Strict = true;
            mockProjectManager = new DynamicMock(typeof(ICruiseProjectManager));
			mockProjectManager.Strict = true;
			dateTimeProvider = new StubCurrentTimeProvider();
            monitor = new ProjectMonitor(null, (ICruiseProjectManager)mockProjectManager.MockInstance, (ISingleServerMonitor)mockServerMonitor.MockInstance, dateTimeProvider);
			monitor.Polled += new MonitorPolledEventHandler(Monitor_Polled);
			monitor.BuildOccurred += new MonitorBuildOccurredEventHandler(Monitor_BuildOccurred);
		}
		public void SetUp()
		{
			currentTimeProvider = new StubCurrentTimeProvider();
			tracker = new BuildDurationTracker(currentTimeProvider);
		}
 public void SetUp()
 {
     currentTimeProvider = new StubCurrentTimeProvider();
     tracker             = new BuildDurationTracker(currentTimeProvider);
 }