-
-
Notifications
You must be signed in to change notification settings - Fork 95
Add IsZero() and IsNotZero() assertions for all numeric types #3642
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
Conversation
Co-authored-by: thomhurst <30480171+thomhurst@users.noreply.github.com>
Co-authored-by: thomhurst <30480171+thomhurst@users.noreply.github.com>
|
@copilot This is a good start. Can you also add similar assertions for other numeric types? e.g. double, float, decimal, long, etc. |
Co-authored-by: thomhurst <30480171+thomhurst@users.noreply.github.com>
Done! I've added Integer types (with
Floating-point types:
Each type follows the same pattern as Commit: 5564cd3 |
|
@copilot Can you also add negative tests - Validating that the assertions throw when not meeting the assertion criteria. |
Co-authored-by: thomhurst <30480171+thomhurst@users.noreply.github.com>
Done! Added 38 negative tests that validate assertions throw
Each assertion now has both positive and negative test coverage. All 1213 tests passing. ✓ Commit: 1862adb |
|
@copilot Run the public API tests and accept the updated snapshots |
IsZero()andIsNotZero()methods forinttypeSummary
Added
IsZero()andIsNotZero()assertion methods for all numeric types in .NET with comprehensive test coverage and updated public API snapshots:Assertion Files (11 total):
int,long,short,byte,uint,ulong,ushort,sbyte(withIsEven/IsOdd)double,float,decimal(zero checks only)Test Coverage (93 tests total):
IntAssertionTests.cs: 14 tests (10 positive + 4 negative)NumericAssertionTests.cs: 79 tests (45 positive + 34 negative)AssertionExceptionis thrown when assertion criteria not metPublic API Snapshots:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.