{"id":17046534,"url":"https://github.com/tkellogg/natural.nunit","last_synced_at":"2025-03-23T03:20:33.762Z","repository":{"id":2073858,"uuid":"3012867","full_name":"tkellogg/Natural.NUnit","owner":"tkellogg","description":"BDD using NUnit like an RSpec user would expect","archived":false,"fork":false,"pushed_at":"2018-07-07T00:02:57.000Z","size":3795,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-28T09:44:57.964Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tkellogg.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-12-19T15:34:33.000Z","updated_at":"2018-07-07T00:02:58.000Z","dependencies_parsed_at":"2022-08-26T13:50:16.629Z","dependency_job_id":null,"html_url":"https://github.com/tkellogg/Natural.NUnit","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkellogg%2FNatural.NUnit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkellogg%2FNatural.NUnit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkellogg%2FNatural.NUnit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkellogg%2FNatural.NUnit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tkellogg","download_url":"https://codeload.github.com/tkellogg/Natural.NUnit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245049439,"owners_count":20552682,"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-14T09:46:39.250Z","updated_at":"2025-03-23T03:20:33.739Z","avatar_url":"https://github.com/tkellogg.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"This project is an exploration into using assertion expressions that feel much\r\nmore natural to a C# developer. Instead of jumping on the \"fluent\" API bandwagon,\r\nNatural NUnit makes heavy use of overloaded operators to use the expressiveness\r\nof core C#.\r\n\r\nTheory\r\n=====================\r\n\r\nFrameworks like [Rspec](http://rspec.info/) and [Jasmine](https://jasmine.github.io/) \r\nare perfectly suited to the BDD design pattern, mostly because the \r\nlanguages they're implemented in (Ruby \u0026 JavaScript) have certain features\r\nthat make them easy to implement BDD. C# has some features in common\r\nwith Ruby \u0026 JS, but current implementations [imo] don't make effective\r\nusage of existing C# features and, as a result, they look ugly.\r\n\r\nQuick Start\r\n=====================\r\n\r\nUse operator overloads for better assertions\r\n\r\n```csharp\r\nint result = CalculateRating();\r\n\r\n// uses operator overloads instead of awkward fluent methods\r\nAssert.That(result.Should() == 5);\r\n\r\n// The == operator can also be an alias for Assert.That(actual, Is.EquivalentTo(expected))\r\nvar expected = new List\u003cint\u003e{ 5 };\r\nvar actual = new[]{ result };\r\nAssert.That(actual.Should() == expected);\r\n\r\n// it uses boolean operators to combine assertions\r\nAssert.That(result.Should() \u003e 3 \u0026\u0026 result.Should() \u003c 6);\r\n\r\n// it allows you to use parentheses for clarity. Use the !operator to negate expressions\r\nAssert.That(result.Should() \u003e 3 \u0026\u0026 !(result.Should() \u003c 6 || result.Should() \u003e 60));\r\n\r\n// Not yet implemented\r\n// it allows you to use clearer, more mathematical range specs\r\nAssert.That(3 \u003c result.Should() \u003c 6);\r\n```\r\n\r\nPlease fork \u0026 contribute!\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftkellogg%2Fnatural.nunit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftkellogg%2Fnatural.nunit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftkellogg%2Fnatural.nunit/lists"}