OLD | NEW |
| (Empty) |
1 // Copyright (c) 2011 The Native Client Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #region | |
6 | |
7 using Google.MsAd7.BaseImpl; | |
8 using Microsoft.VisualStudio; | |
9 using Microsoft.VisualStudio.Debugger.Interop; | |
10 using Microsoft.VisualStudio.TestTools.UnitTesting; | |
11 | |
12 #endregion | |
13 | |
14 namespace NaClVsx.Package_UnitTestProject { | |
15 ///<summary> | |
16 /// This is a test class for BreakpointErrorTest and is intended | |
17 /// to contain all BreakpointErrorTest Unit Tests | |
18 ///</summary> | |
19 [TestClass] | |
20 public class ErrorBreakpointTest { | |
21 ///<summary> | |
22 /// Gets or sets the test context which provides | |
23 /// information about and functionality for the current test run. | |
24 ///</summary> | |
25 public TestContext TestContext { get; set; } | |
26 | |
27 #region Additional test attributes | |
28 | |
29 // | |
30 //You can use the following additional attributes as you write your tests: | |
31 // | |
32 //Use ClassInitialize to run code before running the first test in the class | |
33 //[ClassInitialize()] | |
34 //public static void MyClassInitialize(TestContext testContext) | |
35 //{ | |
36 //} | |
37 // | |
38 //Use ClassCleanup to run code after all tests in a class have run | |
39 //[ClassCleanup()] | |
40 //public static void MyClassCleanup() | |
41 //{ | |
42 //} | |
43 // | |
44 //Use TestInitialize to run code before running each test | |
45 //[TestInitialize()] | |
46 //public void MyTestInitialize() | |
47 //{ | |
48 //} | |
49 // | |
50 //Use TestCleanup to run code after each test has run | |
51 //[TestCleanup()] | |
52 //public void MyTestCleanup() | |
53 //{ | |
54 //} | |
55 // | |
56 | |
57 #endregion | |
58 | |
59 ///<summary> | |
60 /// A test for setting and getting the PendingBreakpoint | |
61 ///</summary> | |
62 [TestMethod] | |
63 public void PendingBreakpointTest() { | |
64 // These are prerequisite classes for the test. | |
65 var resolution = new ErrorBreakpointResolution(); | |
66 var target = new ErrorBreakpoint(resolution); | |
67 | |
68 var expected = | |
69 NaClPackageTestUtils.GetPendingBreakpoint(); | |
70 target.PendingBreakpoint = expected; | |
71 IDebugPendingBreakpoint2 output; | |
72 Assert.AreEqual(target.GetPendingBreakpoint(out output), VSConstants.S_OK)
; | |
73 Assert.AreEqual(output, expected); | |
74 } | |
75 | |
76 ///<summary> | |
77 /// A test for GetBreakpointResolution | |
78 ///</summary> | |
79 [TestMethod] | |
80 public void GetBreakpointResolutionTest() { | |
81 var resolution = new ErrorBreakpointResolution(); | |
82 var target = new ErrorBreakpoint(resolution); | |
83 | |
84 IDebugErrorBreakpointResolution2 ppErrorResolution; | |
85 IDebugErrorBreakpointResolution2 ppErrorResolutionExpected = resolution; | |
86 const int kExpected = VSConstants.S_OK; | |
87 var actual = target.GetBreakpointResolution(out ppErrorResolution); | |
88 Assert.AreEqual(ppErrorResolutionExpected, ppErrorResolution); | |
89 Assert.AreEqual(kExpected, actual); | |
90 } | |
91 } | |
92 } | |
OLD | NEW |