Skip to content

TestContext.CurrentTest exposes too much internal info #1578

Description

@CharliePoole

The following problems should be fixed... and the code examined for any others...

  1. The Properties property exposes IPropertyBag, which is intended as an extensibility interface, not one for users. Among other things, it allows setting properties, which is not a good idea and potentially confusing since they would not be persisted. The internal PropertyBag should be wrapped by an adapter object, just as we wrap the test and the result.
  2. The Properties indexer returns an IList. We should determine if this can be made type-safe. If it cannot be done at the present time (IIRC, we have both string and int properties at a minimum) then this should be spun out as a separate future issue.
  3. The IList returned by the indexer gives too much access. An IEnumerable would be better. Alternatively, another layer of adapter with enumeration and Count available would do the job.

Hard to know how to prioritize this. I'm marking it Low for now, but if we see other issues arising that relate to this problem we should increase it.

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions