Ejemplo n.º 1
0
        public static void AssertStart(MockTimer timer, Action startAction, TimeSpan interval, string message)
        {
            timer.SetExpectedInterval(interval);
            timer.ExpectedStartCount = 1;

            startAction();

            TimerHelper.AssertAndResetCounts(timer, message);
        }
Ejemplo n.º 2
0
        public static void AssertInitialization(MockTimer timer, Action initializationAction, TimeSpan interval, string message)
        {
            timer.SetExpectedInterval(interval);
            timer.ExpectedTickAddCount = 1;

            initializationAction();

            TimerHelper.AssertAndResetCounts(timer, message);
        }
Ejemplo n.º 3
0
        public static void AssertLoadingDataOnTick(MockTimer timer, DomainDataSource dds, string message)
        {
            // Add LoadingData handler
            int loadingDataCount = 0;
            EventHandler <LoadingDataEventArgs> handler = (sender, e) => loadingDataCount++;

            dds.LoadingData += handler;

            timer.RaiseTick();

            // Remove LoadingData handler
            dds.LoadingData -= handler;

            Assert.AreEqual(1, loadingDataCount,
                            "A LoadingData event should have been raised " + message);
            TimerHelper.AssertAndResetCounts(timer, message);
        }