Esempio n. 1
0
        public void BeginWaiting_WillShowWindow_Always()
        {
            var waitIndicator = new Fake_WaitIndicator();

            waitIndicator.BeginWaiting(0, 0, 0, 0);

            Assert.IsTrue(waitIndicator.CreatedWindow.CalledShow);
        }
Esempio n. 2
0
        public void BeginWaiting_WillShowWindow_Always()
        {
            var waitIndicator = new Fake_WaitIndicator();

            waitIndicator.BeginWaiting(0, 0, 0, 0);

            Assert.IsTrue(waitIndicator.CreatedWindow.CalledShow);
        }
Esempio n. 3
0
        public void EndWaiting_WillCloseWindow_Always()
        {
            var waitIndicator = new Fake_WaitIndicator();
            waitIndicator.BeginWaiting(0, 0, 0, 0);

            waitIndicator.EndWaiting();

            Assert.IsTrue(waitIndicator.CreatedWindow.CalledClose);
        }
Esempio n. 4
0
        public void BeginWaiting_WillShowWindowInSeparateThread_Always()
        {
            var waitIndicator = new Fake_WaitIndicator();
            int callerThreadId = Thread.CurrentThread.ManagedThreadId;

            waitIndicator.BeginWaiting(0, 0, 0, 0);

            Assert.AreEqual(ApartmentState.STA, waitIndicator.CreatedWindow.CalledShowApartmentState);
            Assert.AreNotEqual(callerThreadId, waitIndicator.CreatedWindow.CalledShowThreadId);
        }
Esempio n. 5
0
        public void EndWaiting_WillCloseWindow_Always()
        {
            var waitIndicator = new Fake_WaitIndicator();

            waitIndicator.BeginWaiting(0, 0, 0, 0);

            waitIndicator.EndWaiting();

            Assert.IsTrue(waitIndicator.CreatedWindow.CalledClose);
        }
Esempio n. 6
0
        public void BeginWaiting_WillShowWindowInSeparateThread_Always()
        {
            var waitIndicator  = new Fake_WaitIndicator();
            int callerThreadId = Thread.CurrentThread.ManagedThreadId;

            waitIndicator.BeginWaiting(0, 0, 0, 0);

            Assert.AreEqual(ApartmentState.STA, waitIndicator.CreatedWindow.CalledShowApartmentState);
            Assert.AreNotEqual(callerThreadId, waitIndicator.CreatedWindow.CalledShowThreadId);
        }
Esempio n. 7
0
        public void EndWaiting_WillCloseWindowInSeparateThread_Always()
        {
            int callerThreadId = Thread.CurrentThread.ManagedThreadId;
            var waitIndicator = new Fake_WaitIndicator();
            waitIndicator.BeginWaiting(0, 0, 0, 0);

            waitIndicator.EndWaiting();

            Assert.AreNotEqual(callerThreadId, waitIndicator.CreatedWindow.CalledCloseThreadId);
        }
Esempio n. 8
0
        public void EndWaiting_WillAbortBackgroundGuiThread_Always()
        {
            var waitIndicator = new Fake_WaitIndicator();
            waitIndicator.ForcedThreadExecutionMillisecs = 2000;
            waitIndicator.BeginWaiting(0, 0, 0, 0);

            waitIndicator.EndWaiting();

            Assert.IsFalse(waitIndicator.IsThreadRunning);
        }
Esempio n. 9
0
        public void BeginWaiting_WillShowWindow_Always()
        {
            var waitIndicator = new Fake_WaitIndicator();
            var dummyAppearance = new Mock<IWaitIndicatorAppearance>();

            waitIndicator.BeginWaiting(dummyAppearance.Object, 0, 0, 0, 0);

            Assert.IsTrue(waitIndicator.CreatedWindow.CalledShow);
            waitIndicator.EndWaiting();
        }
Esempio n. 10
0
        public void EndWaiting_WillAbortBackgroundGuiThread_Always()
        {
            var waitIndicator = new Fake_WaitIndicator();

            waitIndicator.ForcedThreadExecutionMillisecs = 2000;
            waitIndicator.BeginWaiting(0, 0, 0, 0);

            waitIndicator.EndWaiting();

            Assert.IsFalse(waitIndicator.IsThreadRunning);
        }
Esempio n. 11
0
        public void BeginWaiting_WillShowWindowAtSpecifiedSizeAndPosition_Always()
        {
            var waitIndicator = new Fake_WaitIndicator();

            waitIndicator.BeginWaiting(10, 20, 30, 40);

            Assert.AreEqual(10, waitIndicator.CreatedWindow.CalledShowLeft);
            Assert.AreEqual(20, waitIndicator.CreatedWindow.CalledShowTop);
            Assert.AreEqual(30, waitIndicator.CreatedWindow.CalledShowWidth);
            Assert.AreEqual(40, waitIndicator.CreatedWindow.CalledShowHeight);
        }
Esempio n. 12
0
        public void EndWaiting_WillCloseWindowInSeparateThread_Always()
        {
            int callerThreadId = Thread.CurrentThread.ManagedThreadId;
            var waitIndicator  = new Fake_WaitIndicator();

            waitIndicator.BeginWaiting(0, 0, 0, 0);

            waitIndicator.EndWaiting();

            Assert.AreNotEqual(callerThreadId, waitIndicator.CreatedWindow.CalledCloseThreadId);
        }
Esempio n. 13
0
        public void EndWaiting_WillAbortBackgroundGuiThread_Always()
        {
            var waitIndicator = new Fake_WaitIndicator();
            waitIndicator.ForcedThreadExecutionMillisecs = 2000;
            var dummyAppearance = new Mock<IWaitIndicatorAppearance>();
            waitIndicator.BeginWaiting(dummyAppearance.Object, 0, 0, 0, 0);

            waitIndicator.EndWaiting();

            Assert.IsFalse(waitIndicator.IsThreadRunning);
        }
Esempio n. 14
0
        public void BeginWaiting_WillShowWindowAtSpecifiedSizeAndPosition_Always()
        {
            var waitIndicator = new Fake_WaitIndicator();

            waitIndicator.BeginWaiting(10, 20, 30, 40);

            Assert.AreEqual(10, waitIndicator.CreatedWindow.CalledShowLeft);
            Assert.AreEqual(20, waitIndicator.CreatedWindow.CalledShowTop);
            Assert.AreEqual(30, waitIndicator.CreatedWindow.CalledShowWidth);
            Assert.AreEqual(40, waitIndicator.CreatedWindow.CalledShowHeight);
        }
Esempio n. 15
0
        public void Dispose_WillCallEndWaiting_Always()
        {
            Fake_WaitIndicator waitIndicator = null;
            using (waitIndicator = new Fake_WaitIndicator())
            {
                waitIndicator.ForcedThreadExecutionMillisecs = 2000;
                var dummyAppearance = new Mock<IWaitIndicatorAppearance>();
                waitIndicator.BeginWaiting(dummyAppearance.Object, 0, 0, 0, 0);
            }

            Assert.IsFalse(waitIndicator.IsThreadRunning);
        }
Esempio n. 16
0
        public void BeginWaiting_WillShowWindowInSeparateThread_Always()
        {
            var waitIndicator = new Fake_WaitIndicator();
            int callerThreadId = Thread.CurrentThread.ManagedThreadId;
            var dummyAppearance = new Mock<IWaitIndicatorAppearance>();

            waitIndicator.BeginWaiting(dummyAppearance.Object, 0, 0, 0, 0);

            Assert.AreEqual(ApartmentState.STA, waitIndicator.CreatedWindow.CalledShowApartmentState);
            Assert.AreNotEqual(callerThreadId, waitIndicator.CreatedWindow.CalledShowThreadId);
            waitIndicator.EndWaiting();
        }
Esempio n. 17
0
        public void BeginWaiting_WillShowWindowAtSpecifiedSizeAndPosition_Always()
        {
            var waitIndicator = new Fake_WaitIndicator();
            var dummyAppearance = new Mock<IWaitIndicatorAppearance>();

            waitIndicator.BeginWaiting(dummyAppearance.Object, 10, 20, 30, 40);

            Assert.AreEqual(10, waitIndicator.CreatedWindow.CalledShowLeft);
            Assert.AreEqual(20, waitIndicator.CreatedWindow.CalledShowTop);
            Assert.AreEqual(30, waitIndicator.CreatedWindow.CalledShowWidth);
            Assert.AreEqual(40, waitIndicator.CreatedWindow.CalledShowHeight);
            waitIndicator.EndWaiting();
        }
Esempio n. 18
0
        public void EndWaiting_WontDeadlock_WhenCalledMoreThanOnce()
        {
            var waitIndicator = new Fake_WaitIndicator();
            waitIndicator.ForcedThreadExecutionMillisecs = 2000;
            var dummyAppearance = new Mock<IWaitIndicatorAppearance>();
            waitIndicator.BeginWaiting(dummyAppearance.Object, 0, 0, 0, 0);

            waitIndicator.EndWaiting();
            waitIndicator.EndWaiting();
        }