public void SetUp() { _now = DateTimeOffset.Now; _dateUtils = new TestDateUtils(); _dateUtils.Now = TimeInMs(0); _sut = new DoubleCommandEventDetector(_dateUtils); }
public void TestBaseSetUp() { TestIDESession = new TestIDESession(); TestRSEnv = new TestRSEnv(TestIDESession); TestDateUtils = new TestDateUtils(); Registry.RegisterComponent <IDateUtils>(TestDateUtils); MockLogger = new Mock <ILogger>(); Registry.RegisterComponent(MockLogger.Object); _publishedEvents = new List <IDEEvent>(); _eventReceptionLock = new AutoResetEvent(false); MockTestMessageBus = new Mock <IMessageBus>(); MockTestMessageBus.Setup(bus => bus.Publish(It.IsAny <IDEEvent>())).Callback( (IDEEvent ideEvent) => ProcessEvent(ideEvent)); }
public void SetUp() { _mockIoUtils = new Mock <IIoUtils>(); Registry.RegisterComponent(_mockIoUtils.Object); _mockPublisherUtils = new Mock <IPublisherUtils>(); Registry.RegisterComponent(_mockPublisherUtils.Object); _mockLogger = new Mock <ILogger>(); _mockExporter = new Mock <IExporter>(); _mockLogs = new List <Mock <ILog> > { new Mock <ILog>(), new Mock <ILog>(), new Mock <ILog>() }; _mockLogFileManager = new Mock <ILogManager>(); _mockLogFileManager.Setup(mgr => mgr.Logs).Returns(_mockLogs.Select(m => m.Object)); _mockSettingStore = new Mock <ISettingsStore>(); _mockSettingStore.Setup(store => store.GetSettings <UploadSettings>()).Returns(new UploadSettings()); _exportSettings = new ExportSettings { UploadUrl = TestUploadUrl }; _userSettings = new UserProfileSettings(); _anonymizationSettings = new AnonymizationSettings(); _mockSettingStore.Setup(store => store.GetSettings <ExportSettings>()).Returns(_exportSettings); _mockSettingStore.Setup(store => store.GetSettings <UserProfileSettings>()).Returns(_userSettings); _mockSettingStore.Setup(store => store.GetSettings <AnonymizationSettings>()) .Returns(_anonymizationSettings); _mockSettingStore.Setup(store => store.UpdateSettings(It.IsAny <Action <ExportSettings> >())) .Callback <Action <ExportSettings> >(update => update(_exportSettings)); _testDateUtils = new TestDateUtils(); _uut = new UploadWizardContext( _mockExporter.Object, _mockLogFileManager.Object, _mockSettingStore.Object, _testDateUtils, _mockLogger.Object); _errorNotificationHelper = _uut.ErrorNotificationRequest.NewTestHelper(); _successNotificationHelper = _uut.SuccessNotificationRequest.NewTestHelper(); }
public void SetUp() { _mockLogManager = new Mock <ILogManager>(); _mockTrayIcon = new Mock <NotifyTrayIcon>(_mockLogManager.Object); _dateUtils = new TestDateUtils(); }