diff options
author | David Karlaš <david.karlas@xamarin.com> | 2015-01-02 18:20:10 +0300 |
---|---|---|
committer | David Karlaš <david.karlas@xamarin.com> | 2015-01-02 18:20:10 +0300 |
commit | a4db202400afa747d769e6394cb27826b41486bf (patch) | |
tree | ef27010795bdf21c73e41d4e758ede5f448ccb4b /main/src/addins/MonoDevelop.Debugger | |
parent | 220fe04b598fa11cfa9a253337341ab72cb67bd4 (diff) |
[DebuggerTests] Added tests for GetType and operator "is"(ignored atm)
Diffstat (limited to 'main/src/addins/MonoDevelop.Debugger')
-rw-r--r-- | main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/EvaluationTests.cs | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/EvaluationTests.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/EvaluationTests.cs index 2b8a16e2cd..878658cd0e 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/EvaluationTests.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/EvaluationTests.cs @@ -1868,5 +1868,55 @@ namespace MonoDevelop.Debugger.Tests Assert.AreEqual ("dynamic {string}", val.TypeName); Assert.AreEqual ("\"Hello dynamic objects!\"", val.Value); } + + [Test] + public void GetTypeTest () + { + if (Session.GetType ().Name == "CorDebuggerSession") { + Assert.Ignore ("TODO: GetType() is not implemented in CorDebugger"); + } + ObjectValue val; + val = Eval ("a.GetType()"); + if (!AllowTargetInvokes) { + var options = Session.Options.EvaluationOptions.Clone (); + options.AllowTargetInvoke = true; + + Assert.IsTrue (val.IsNotSupported); + val.Refresh (options); + val = val.Sync (); + } + Assert.AreEqual ("System.MonoType", val.TypeName);//Should this be System.Type? + Assert.AreEqual ("{A}", val.Value); + + val = Eval ("this.GetType()"); + if (!AllowTargetInvokes) { + var options = Session.Options.EvaluationOptions.Clone (); + options.AllowTargetInvoke = true; + + Assert.IsTrue (val.IsNotSupported); + val.Refresh (options); + val = val.Sync (); + } + Assert.AreEqual ("System.MonoType", val.TypeName);//Should this be System.Type? + Assert.AreEqual ("{MonoDevelop.Debugger.Tests.TestApp.TestEvaluation}", val.Value); + } + + [Test] + [Ignore ("Operator \"is\" is not implemented")] + public void IsOperatorTest () + { + ObjectValue val; + val = Eval ("b is A"); + Assert.AreEqual ("bool", val.TypeName); + Assert.AreEqual ("true", val.Value); + + val = Eval ("b is B"); + Assert.AreEqual ("bool", val.TypeName); + Assert.AreEqual ("true", val.Value); + + val = Eval ("b is C"); + Assert.AreEqual ("bool", val.TypeName); + Assert.AreEqual ("false", val.Value); + } } } |