示例#1
0
        public void BeginWaiting_WillShowWindow_Always()
        {
            var waitIndicator = new Fake_WaitIndicator();

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

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

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

            Assert.IsTrue(waitIndicator.CreatedWindow.CalledShow);
        }
示例#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);
        }
示例#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);
        }
示例#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);
        }
示例#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);
        }
示例#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);
        }
示例#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);
        }
示例#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();
        }
示例#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);
        }
示例#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);
        }
示例#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);
        }
示例#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);
        }
示例#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);
        }
示例#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);
        }
示例#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();
        }
示例#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();
        }
示例#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();
        }