Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AVRO-2161: Upgrade to NUnit 3 #299

Closed
wants to merge 1 commit into from
Closed

AVRO-2161: Upgrade to NUnit 3 #299

wants to merge 1 commit into from

Conversation

blachniet
Copy link
Member

  1. NuGet Packages: Added references to the NUnit and
    NUnit3TestAdapter NuGet packages. The latter
    allows developers to run unit tests in Visual Studio's Test Explorer. Adding a reference to the
    test adapter from the test library is standard operating procedure
    (see here). Now that we are using NuGet
    packages, developers must execute a NuGet restore before building. This happens automatically when
    using Visual Studio. On Linux this is done with mono nuget.exe restore. I updated the README to reflect
    these changes.
  2. NUnit 2 to 3: Handled breaking changes in the NUnit tests when upgrading from v2 to v3. These breaking changes
    are documented in the NUnit Breaking Changes for
    the v3 release. Below are the specific changes that applied to the Avro unit test code base:
    1. ExpectedExceptionAttribute: No longer supported. Use Assert.Throws or Assert.That.
    2. TestFixtureSetUpAttribute: Deprecated. Use OneTimeSetUpAttribute.
    3. TestFixtureTearDownAttribute: Deprecated. Use OneTimeTearDownAttribute.
    4. CurrentDirectory: No longer set to the directory containing the test assembly. Use
      TestContext.CurrentContext.TestDirectory to locate that directory.
    5. TestCaseAttribute: Named parameter Result= is no longer supported. Use ExpectedResult=.
      Named parameter Ignore= now takes a string, giving the reason for ignoring the test.
    6. TestCaseSourceAttribute: The attribute forms using a string argument to refer to the data source
      must now use only static fields, properties or methods.
  3. Long Test Names: Some test names which where auto-generated from TestCase attribute contents were too long,
    resulting in errors loading the tests. For these, I added a TestName parameter to provide a short, human readable
    name for the test.
  4. Duplicates: Removed some duplicate TestCases (NUnit identified these with warnings while loading tests)
  5. Visual 2017: Upgraded to Microsoft Visual Studio Community 2017. This is required to support the new
    PackageReference element in the *.csproj files for describing NuGet package dependencies.

I've tested these changes and confirmed 520 passing unit tests in the following environments:

  • Windows 10, Microsoft Visual Studio 2017
  • Ubuntu 17.10, Mono 5.10.0.160

@blachniet blachniet changed the title Upgrade to NUnit 3 AVRO-2161: Upgrade to NUnit 3 Mar 17, 2018
@blachniet
Copy link
Member Author

Closing in favor of #307

@blachniet blachniet closed this May 26, 2018
@blachniet blachniet deleted the AVRO-2161 branch January 20, 2019 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant