~halega/+junk/sharpdevelop

« back to all changes in this revision

Viewing changes to src/AddIns/BackendBindings/Scripting/Test/Utils/TestableThreadSafeScriptingConsoleEvents.cs

  • Committer: sk
  • Date: 2011-09-10 05:17:57 UTC
  • Revision ID: halega@halega.com-20110910051757-qfouz1llya9m6boy
4.1.0.7915 Release Candidate 1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
 
2
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
 
3
 
 
4
using System;
 
5
 
 
6
namespace ICSharpCode.Scripting.Tests.Utils
 
7
{
 
8
        public class TestableThreadSafeScriptingConsoleEvents : ThreadSafeScriptingConsoleEvents
 
9
        {
 
10
                public FakeScriptingConsole NonThreadSafeScriptingConsole;
 
11
                public FakeControlDispatcher Dispatcher;
 
12
                
 
13
                public bool IsWaitForLineCalled;
 
14
                public bool WaitForLineReturnValue;
 
15
                public bool DispatcherCheckAccessReturnValueAfterWaitForLineCalled;
 
16
                public bool IsLineReceivedEventResetBeforeReadLineCalled;
 
17
                public bool IsLineReceivedEventReset;
 
18
                public bool IsSetDisposedEventCalled;
 
19
                public bool IsSetLineReceivedEventCalled;
 
20
                
 
21
                public override bool WaitForLine()
 
22
                {
 
23
                        IsWaitForLineCalled = true;
 
24
                        Dispatcher.CheckAccessReturnValue = DispatcherCheckAccessReturnValueAfterWaitForLineCalled;
 
25
                        return WaitForLineReturnValue;
 
26
                }
 
27
                
 
28
                public override void ResetLineReceivedEvent()
 
29
                {
 
30
                        IsLineReceivedEventReset = true;
 
31
                        IsLineReceivedEventResetBeforeReadLineCalled = !NonThreadSafeScriptingConsole.IsReadLineCalled;
 
32
                }
 
33
                
 
34
                public override void SetDisposedEvent()
 
35
                {
 
36
                        IsSetDisposedEventCalled = true;
 
37
                }
 
38
                
 
39
                public override void SetLineReceivedEvent()
 
40
                {
 
41
                        IsSetLineReceivedEventCalled = true;
 
42
                }
 
43
        }
 
44
}