Skip to content

ExpectedException Support #12

Description

Description

Add back support for Expected Exception which was made obsolete. This would helps in two ways:

  1. Transition from V1 would be made much simpler.
  2. The Create IntelliTest Wizard which currently only generates method level attributes would continue to work until fixed later on.

Steps to reproduce

  1. Create a Unit Test project.
  2. Add the V2 test fx and adapter to it.
  3. Add a test method which throws an exception and add an ExpectedException attribute targeting the same exception.

Expected behavior

The test should pass.

Actual behavior

The test fails and the build throws a warning that this is an obsolete attribute.

Environment

Please share additional details about the test environment.
Operating system, Build version of vstest.console, Package version of MSTest
framework and adapter

Activity

codito commented on Sep 19, 2016

@codito
Contributor

We should add back the functionality, but still maintain the Obsolete tag. Obsolete just indicates that functionality is available but there is a better alternative, and the current one may be removed in any later version.

AbhitejJohn commented on Sep 19, 2016

@AbhitejJohn
ContributorAuthor

Was considering that but then intelliTest will generate tests with this attribute by default and a build of those test projects would result in unnecessary warnings. Last we checked fixing intelliTest to accommodate a Assert.ThrowsException<> might not be a very trivial fix.

AbhitejJohn commented on Oct 5, 2016

@AbhitejJohn
ContributorAuthor

This is fixed in the latest TestAdapter code in MSTest repo. Will port it over to GitHub.

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions