Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,11 @@ public override DataRow DataRow
}

/// <inheritdoc/>
public override IDictionary Properties
public override IDictionary<string, object> Properties
{
get
{
return this.properties as IDictionary;
return this.properties;
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/TestFramework/Extension.Desktop/TestContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace Microsoft.VisualStudio.TestTools.UnitTesting
{
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Diagnostics;
Expand All @@ -19,7 +19,7 @@ public abstract class TestContext
/// <summary>
/// Gets test properties for a test.
/// </summary>
public abstract IDictionary Properties { get; }
public abstract IDictionary<string, object> Properties { get; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

abstract [](start = 15, length = 8)

I am afraid if this is a breaking change?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if folks have taken a depedency in their code for this property and they expect IDict then build will fail


In reply to: 250584995 [](ancestors = 250584995)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will release a beta package and see if get any such feedback on this change.


/// <summary>
/// Gets the current data row when test is used for data driven testing.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ public void TestContextConstructorShouldInitializeDefaultProperties()
Assert.IsNotNull(this.testContextImplementation.Properties);

CollectionAssert.Contains(
this.testContextImplementation.Properties,
this.testContextImplementation.Properties.ToList(),
new KeyValuePair<string, object>("FullyQualifiedTestClassName", "A.C.M"));
CollectionAssert.Contains(
this.testContextImplementation.Properties,
this.testContextImplementation.Properties.ToList(),
new KeyValuePair<string, object>("TestName", "M"));
}

Expand Down Expand Up @@ -115,8 +115,8 @@ public void PropertiesShouldReturnPropertiesPassedToTestContext()

this.testContextImplementation = new TestContextImplementation(this.testMethod.Object, new System.IO.StringWriter(), this.properties);

CollectionAssert.Contains(this.testContextImplementation.Properties, property1);
CollectionAssert.Contains(this.testContextImplementation.Properties, property2);
CollectionAssert.Contains(this.testContextImplementation.Properties.ToList(), property1);
CollectionAssert.Contains(this.testContextImplementation.Properties.ToList(), property2);
}

[TestMethod]
Expand Down Expand Up @@ -162,7 +162,7 @@ public void AddPropertyShouldAddPropertiesToThePropertyBag()
this.testContextImplementation.AddProperty("SomeNewProperty", "SomeValue");

CollectionAssert.Contains(
this.testContextImplementation.Properties,
this.testContextImplementation.Properties.ToList(),
new KeyValuePair<string, object>("SomeNewProperty", "SomeValue"));
}

Expand Down