{"id":15598380,"url":"https://github.com/fluffynuts/nunit.staticexpect","last_synced_at":"2025-09-13T19:32:42.863Z","repository":{"id":40515704,"uuid":"97750298","full_name":"fluffynuts/NUnit.StaticExpect","owner":"fluffynuts","description":"Provides a mechanism for a static import of NUnit Expect() syntax (deprecated: see https://github.com/fluffynuts/NExpect for the next generation)","archived":false,"fork":false,"pushed_at":"2023-01-27T04:33:08.000Z","size":2600,"stargazers_count":3,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-02T14:05:30.218Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fluffynuts.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-19T18:46:23.000Z","updated_at":"2023-09-08T17:27:39.000Z","dependencies_parsed_at":"2023-02-15T05:30:53.408Z","dependency_job_id":null,"html_url":"https://github.com/fluffynuts/NUnit.StaticExpect","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluffynuts%2FNUnit.StaticExpect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluffynuts%2FNUnit.StaticExpect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluffynuts%2FNUnit.StaticExpect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluffynuts%2FNUnit.StaticExpect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fluffynuts","download_url":"https://codeload.github.com/fluffynuts/NUnit.StaticExpect/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232905746,"owners_count":18594798,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T01:38:45.144Z","updated_at":"2025-01-07T16:52:31.615Z","avatar_url":"https://github.com/fluffynuts.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DEPRECATED\nPlease consider https://github.com/fluffynuts/NExpect as an alternative,\nbetter in many respects:\n- more fluent syntax\n- easier to extend\n- deep equality checking\n- existing extension packages for NSubstitute and AspNetCore route / verb testing\n- active development and usage -- I use NExpect daily\n\n... on with the prior README ...\n\n# NUnit.StaticExpect\nSome users prefer a shorter form of assertion than is given by \nNUnit's `Assert.That`. If you statically import `NUnit.StaticExpect`, \nthe Expect() method may be used instead...\n\n## Usage\n1. Install the nuget package (`install-package nunit.staticexpect`)\n2. Import the static methods: add the following using statement to your test class file:\n```\n// C#\nusing static NUnit.StaticExpect.Expectations;\n```\n```\n' VB\nImports NUnit.StaticExpect.Expectations\n```\n\n3. Use the Expect() syntax:\n```\n[Test]\npublic void Expect_True_IsTrue()\n{\n  Expect(bool condition);\n  Expect(bool condition, string message, params object[] parms);\n\n  Expect(ActualValueDelegate del, IResolveConstraint constraint)\n  Expect(ActualValueDelegate del, IResolveConstraint constraint,\n        string message, params object[] parms)\n\n  Expect\u003cTActual\u003e(TActual actual, IResolveConstraint constraint)\n  Expect\u003cTActual\u003e(TActual actual, IResolveConstraint constraint,\n                  string message, params object[] parms)\n\n  Expect(TestDelegate del, IResolveConstraint constraint);\n}\n```\n\nIn addition, `NUnit.StaticExpect` allows the test fixture where the static\nimport has been done to make direct use of many of the syntactic elements\nthat would normally require you to specify the `Is`, `Has` or `Does` \nclasses in order to use them. For example, you can write...\n\n```\nExpect(actual, EqualTo(\"Hello\"));\n```\n\n`NUnit.StaticExpect` depends on `NUnit` -- indeed, installing the \n`NUnit.StaticExpect` package should also install the relevant `NUnit` package\nif not already installed. As such, all `NUnit` syntax is available, including\n`Assert.Warn` and `Assume.That`. Most of `NUnit.StaticExpect`s methods and\nproperties are simply pass-through shims to the relevant `NUnit` ones.\n\n## Why does this project exist?\nNUnit has historically had a class named `AssertionHelper` which your\ntest fixtures could inherit to provide the above syntax. [NUnit issue #1212](https://github.com/nunit/nunit/issues/1212) discusses the \ndeprecation of `AssertionHelper`. \n\nPersonally, I had been using `AssertionHelper`\nfor about 6 months before I saw it marked as deprecated after an NUnit upgrade.\n`NUnit.StaticExpect` has been made to provide the same functionality for anyone\nwho doesn't want to retrofit existing tests to use the newer `Assert.That`\nsyntax or for anyone who just plain prefers the `Expect()` syntax.\n\n## Missing something?\n`NUnit.StaticExpect` has a suite of tests to prove parity with `AssertionHelper`.\nStill, the contributors are only human, so we may have missed something.\nIf this library _is_ missing something you're used to from `AssertionHelper`, log an\nissue (: Pull requests are also welcome.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluffynuts%2Fnunit.staticexpect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffluffynuts%2Fnunit.staticexpect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluffynuts%2Fnunit.staticexpect/lists"}