public void TestInitialize() { if (this.vm != null || this.controller != null || this.idleTimeProvider != null) { this.TestCleanup(); if (this.vm != null || this.controller != null || this.idleTimeProvider != null) { throw new ArgumentException("Test cleanup does not appear to be cleaning up correctly - one or more variables were expected to be null."); } } this.controller = new Mock<IController>(MockBehavior.Strict); this.idleTimeProvider = new Mock<IIdleTimeProvider>(MockBehavior.Strict); this.summaryDataManager = new Mock<ISummaryDataManager>(MockBehavior.Strict); this.summaryDataManager.Setup(s => s.LoadDataAsync(It.IsAny<DateTime>(), It.IsAny<TimeSpan>(), It.IsAny<double>(), It.IsNotNull<Action<IEnumerable<SummaryData>>>())); this.summaryDataManager.SetupAllProperties(); this.windowController = new Mock<IWindowController>(MockBehavior.Strict); this.windowController.Setup(s => s.SetWindowVisibilityByProcessName(It.IsAny<string>(), It.IsAny<bool>())); this.versionService = new Mock<IVersionService>(MockBehavior.Strict); this.versionService.Setup(s => s.IsUpdateAvailableAsync(It.IsNotNull<Action<bool>>())); this.versionService.SetupAllProperties(); this.controller.SetupAllProperties(); this.controller.Setup(s => s.ImportantProcessDetected).Returns(false); this.vm = new MiningViewModel(this.controller.Object, this.idleTimeProvider.Object, this.summaryDataManager.Object, this.windowController.Object, this.versionService.Object); }
public void TestCleanup() { this.vm = null; this.controller = null; this.idleTimeProvider = null; }