nunit / nunit/nunit

Provide Asserts for System.Numerics types

Open
#3,316 28 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

design is:feature
Dominant language
C#
Stars
2.6k
Forks
766
Avg merge
1d 3h
Merged PRs (30d)
24

Description

Hi

I'm using System.Numerics.Vectors namespace quite often, and I'm used to rewrite my own assert tests every time, I am about to consider writing my own library.

Just for the sake of not reinventing the wheel, I would like to ask if it could be possible for NUnit team to consider including Asserts for these types.

I agree a lot of people would like to see the types they use often to be included with NUnit, but I believe all the types within System.Numerics can be considered intrinsic NET types. They're implicitly included in NetCore and NetStandard, and even the Roslyn compiler gives them special treatment.

The proposal would be to add a NumericsAssert static class that would cover these types:

  • BigInteger
  • Complex
  • Matrix3x2
  • Matrix4x4
  • Plane
  • Quaternion
  • Vector
  • Vector2
  • Vector3
  • Vector4

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue proposes a NumericsAssert class for BigInteger, Complex, Matrix3x2, Matrix4x4, Plane, Quaternion, Vector, Vector2, Vector3, and Vector4. Start by reviewing NUnit's existing assertion APIs and determine how these types should fit alongside them; done means the proposed System.Numerics types are covered consistently with tests for their assertions.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
testing-qa
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.