From a259e1660cb3fd1cc5ab81684af15086bcd81905 Mon Sep 17 00:00:00 2001 From: Sarabjot Singh Date: Thu, 26 Oct 2017 14:43:41 +0530 Subject: [PATCH 1/2] Adding the missing property LocalExtensionData in TestCase --- src/Microsoft.TestPlatform.ObjectModel/TestCase.cs | 11 ++++------- .../TestCaseTests.cs | 8 ++++++++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/Microsoft.TestPlatform.ObjectModel/TestCase.cs b/src/Microsoft.TestPlatform.ObjectModel/TestCase.cs index 55c631c32e..786af5c29a 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/TestCase.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/TestCase.cs @@ -18,13 +18,12 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel [DataContract] public sealed class TestCase : TestObject { -#if TODO /// /// LocalExtensionData which can be used by Adapter developers for local transfer of extended properties. /// Note that this data is available only for in-Proc execution, and may not be available for OutProc executors /// - private Object m_localExtensionData; -#endif + private Object localExtensionData; + private Guid defaultId = Guid.Empty; private Guid id; private string displayName; @@ -70,17 +69,15 @@ public TestCase(string fullyQualifiedName, Uri executorUri, string source) #region Properties -#if TODO /// /// LocalExtensionData which can be used by Adapter developers for local transfer of extended properties. /// Note that this data is available only for in-Proc execution, and may not be available for OutProc executors /// public Object LocalExtensionData { - get { return m_localExtensionData; } - set { m_localExtensionData = value; } + get { return localExtensionData; } + set { localExtensionData = value; } } -#endif /// /// Gets or sets the id of the test case. diff --git a/test/Microsoft.TestPlatform.ObjectModel.UnitTests/TestCaseTests.cs b/test/Microsoft.TestPlatform.ObjectModel.UnitTests/TestCaseTests.cs index 70630bf9af..ecb4d35914 100644 --- a/test/Microsoft.TestPlatform.ObjectModel.UnitTests/TestCaseTests.cs +++ b/test/Microsoft.TestPlatform.ObjectModel.UnitTests/TestCaseTests.cs @@ -53,6 +53,14 @@ public void TestCaseIdShouldReturnIdSetExplicitlyEvenIfNameOrSourceInfoChanges() Assert.AreEqual(testGuid, testCase.Id); } + [TestMethod] + public void TestCaseLocalExtensionDataIsPubliclySettableGettableProperty() + { + var dummyData = new string[] { "foo"}; + this.testCase.LocalExtensionData = dummyData; + Assert.AreEqual("foo", this.testCase.LocalExtensionData); + } + #region GetSetPropertyValue Tests [TestMethod] From 4aaf298790d8cd29e68859aee9b451e47ce8f0fa Mon Sep 17 00:00:00 2001 From: Sarabjot Singh Date: Thu, 26 Oct 2017 15:11:04 +0530 Subject: [PATCH 2/2] Fixed the test. --- .../TestCaseTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Microsoft.TestPlatform.ObjectModel.UnitTests/TestCaseTests.cs b/test/Microsoft.TestPlatform.ObjectModel.UnitTests/TestCaseTests.cs index ecb4d35914..4923d4898a 100644 --- a/test/Microsoft.TestPlatform.ObjectModel.UnitTests/TestCaseTests.cs +++ b/test/Microsoft.TestPlatform.ObjectModel.UnitTests/TestCaseTests.cs @@ -56,7 +56,7 @@ public void TestCaseIdShouldReturnIdSetExplicitlyEvenIfNameOrSourceInfoChanges() [TestMethod] public void TestCaseLocalExtensionDataIsPubliclySettableGettableProperty() { - var dummyData = new string[] { "foo"}; + var dummyData = "foo"; this.testCase.LocalExtensionData = dummyData; Assert.AreEqual("foo", this.testCase.LocalExtensionData); }