Skip to content

Simplify property retrieval in DefaultTestAssemblyBuilder.Build() #4049

Closed
@stevenaw

Description

@stevenaw

DefaultTestAssemblyBuilder.Build() contains code which maps values in an IDictionary<string, object> to statically defined properties. The current code uses the following pattern:

if (options.ContainsKey(name))
{
    var value = options[name] as {Type};
    if (value != null)
    {
      // Sets the property here
    }
}

I think this code predated the addition of TryGetValue() in the .net framework. We should consider updating it to use TryGetValue along with any other modernizations like pattern matching.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions