|
3 | 3 |
|
4 | 4 | namespace MSTestAdapter.PlatformServices.Tests.Deployment;
|
5 | 5 |
|
6 |
| -#if NETCOREAPP |
7 |
| -using Microsoft.VisualStudio.TestTools.UnitTesting; |
8 |
| -#else |
9 |
| -extern alias FrameworkV1; |
10 |
| - |
11 |
| -using Assert = FrameworkV1.Microsoft.VisualStudio.TestTools.UnitTesting.Assert; |
12 |
| -using TestClass = FrameworkV1.Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttribute; |
13 |
| -using TestMethod = FrameworkV1.Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute; |
14 |
| -#endif |
15 | 6 | using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices;
|
16 | 7 | using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Deployment;
|
17 | 8 |
|
18 |
| -[TestClass] |
19 |
| -public class DeploymentItemTests |
| 9 | +using TestFramework.ForTestingMSTest; |
| 10 | + |
| 11 | +public class DeploymentItemTests : TestContainer |
20 | 12 | {
|
21 |
| - [TestMethod] |
22 | 13 | public void EqualsShouldReturnFalseIfOtherItemIsNull()
|
23 | 14 | {
|
24 | 15 | DeploymentItem item = new("e:\\temp\\temp1.dll");
|
25 | 16 |
|
26 |
| - Assert.IsFalse(item.Equals(null)); |
| 17 | + Verify(!item.Equals(null)); |
27 | 18 | }
|
28 | 19 |
|
29 |
| - [TestMethod] |
30 | 20 | public void EqualsShouldReturnFalseIfOtherItemIsNotDeploymentItem()
|
31 | 21 | {
|
32 | 22 | DeploymentItem item = new("e:\\temp\\temp1.dll");
|
33 | 23 |
|
34 |
| - Assert.IsFalse(item.Equals(new DeploymentItemTests())); |
| 24 | + Verify(!item.Equals(new DeploymentItemTests())); |
35 | 25 | }
|
36 | 26 |
|
37 |
| - [TestMethod] |
38 | 27 | public void EqualsShouldReturnFalseIfSourcePathIsDifferent()
|
39 | 28 | {
|
40 | 29 | DeploymentItem item1 = new("e:\\temp\\temp1.dll");
|
41 | 30 | DeploymentItem item2 = new("e:\\temp\\temp2.dll");
|
42 | 31 |
|
43 |
| - Assert.IsFalse(item1.Equals(item2)); |
| 32 | + Verify(!item1.Equals(item2)); |
44 | 33 | }
|
45 | 34 |
|
46 |
| - [TestMethod] |
47 | 35 | public void EqualsShouldReturnFalseIfRelativeOutputDirectoryIsDifferent()
|
48 | 36 | {
|
49 | 37 | DeploymentItem item1 = new("e:\\temp\\temp1.dll", "foo1");
|
50 | 38 | DeploymentItem item2 = new("e:\\temp\\temp1.dll", "foo2");
|
51 | 39 |
|
52 |
| - Assert.IsFalse(item1.Equals(item2)); |
| 40 | + Verify(!item1.Equals(item2)); |
53 | 41 | }
|
54 | 42 |
|
55 |
| - [TestMethod] |
56 | 43 | public void EqualsShouldReturnTrueIfSourcePathDiffersByCase()
|
57 | 44 | {
|
58 | 45 | DeploymentItem item1 = new("e:\\temp\\temp1.dll");
|
59 | 46 | DeploymentItem item2 = new("e:\\temp\\Temp1.dll");
|
60 | 47 |
|
61 |
| - Assert.IsTrue(item1.Equals(item2)); |
| 48 | + Verify(item1.Equals(item2)); |
62 | 49 | }
|
63 | 50 |
|
64 |
| - [TestMethod] |
65 | 51 | public void EqualsShouldReturnTrueIfRelativeOutputDirectoryDiffersByCase()
|
66 | 52 | {
|
67 | 53 | DeploymentItem item1 = new("e:\\temp\\temp1.dll", "foo1");
|
68 | 54 | DeploymentItem item2 = new("e:\\temp\\temp1.dll", "Foo1");
|
69 | 55 |
|
70 |
| - Assert.IsTrue(item1.Equals(item2)); |
| 56 | + Verify(item1.Equals(item2)); |
71 | 57 | }
|
72 | 58 |
|
73 |
| - [TestMethod] |
74 | 59 | public void EqualsShouldReturnTrueIfSourceAndRelativeOutputDirectoryAreSame()
|
75 | 60 | {
|
76 | 61 | DeploymentItem item1 = new("e:\\temp\\temp1.dll", "foo1");
|
77 | 62 | DeploymentItem item2 = new("e:\\temp\\temp1.dll", "foo1");
|
78 | 63 |
|
79 |
| - Assert.IsTrue(item1.Equals(item2)); |
| 64 | + Verify(item1.Equals(item2)); |
80 | 65 | }
|
81 | 66 |
|
82 |
| - [TestMethod] |
83 | 67 | public void GetHashCodeShouldConsiderSourcePathAndRelativeOutputDirectory()
|
84 | 68 | {
|
85 | 69 | var sourcePath = "e:\\temp\\temp1.dll";
|
86 | 70 | var relativeOutputDirectory = "foo1";
|
87 | 71 | DeploymentItem item = new(sourcePath, relativeOutputDirectory);
|
88 | 72 |
|
89 |
| - Assert.AreEqual(sourcePath.GetHashCode() + relativeOutputDirectory.GetHashCode(), item.GetHashCode()); |
| 73 | + Verify(sourcePath.GetHashCode() + relativeOutputDirectory.GetHashCode() == item.GetHashCode()); |
90 | 74 | }
|
91 | 75 |
|
92 |
| - [TestMethod] |
93 | 76 | public void ToStringShouldReturnDeploymentItemIfRelativeOutputDirectoryIsNotSpecified()
|
94 | 77 | {
|
95 | 78 | var sourcePath = "e:\\temp\\temp1.dll";
|
96 | 79 | DeploymentItem item = new(sourcePath);
|
97 | 80 |
|
98 |
| - Assert.AreEqual(string.Format(Resource.DeploymentItem, sourcePath), item.ToString()); |
| 81 | + Verify(string.Format(Resource.DeploymentItem, sourcePath) == item.ToString()); |
99 | 82 | }
|
100 | 83 |
|
101 |
| - [TestMethod] |
102 | 84 | public void ToStringShouldReturnDeploymentItemAndRelativeOutputDirectory()
|
103 | 85 | {
|
104 | 86 | var sourcePath = "e:\\temp\\temp1.dll";
|
105 | 87 | var relativeOutputDirectory = "foo1";
|
106 | 88 | DeploymentItem item = new(sourcePath, relativeOutputDirectory);
|
107 | 89 |
|
108 |
| - Assert.AreEqual(string.Format(Resource.DeploymentItemWithOutputDirectory, sourcePath, relativeOutputDirectory), item.ToString()); |
| 90 | + Verify(string.Format(Resource.DeploymentItemWithOutputDirectory, sourcePath, relativeOutputDirectory) == item.ToString()); |
109 | 91 | }
|
110 | 92 | }
|
0 commit comments