{"id":13591674,"url":"https://github.com/fluffynuts/PeanutButter","last_synced_at":"2025-04-08T17:32:14.730Z","repository":{"id":630512,"uuid":"14611610","full_name":"fluffynuts/PeanutButter","owner":"fluffynuts","description":"Tasty, versatile, nutritious; goes with many things in .net.","archived":false,"fork":false,"pushed_at":"2024-10-23T07:48:42.000Z","size":43050,"stargazers_count":179,"open_issues_count":8,"forks_count":32,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-10-30T04:48:47.000Z","etag":null,"topics":["csharp","duck-typing","hacktoberfest","mysql","sqlite","sqlserver","testing","utility"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-11-22T07:36:50.000Z","updated_at":"2024-10-23T07:48:46.000Z","dependencies_parsed_at":"2023-10-11T17:59:10.401Z","dependency_job_id":"e31fa2c5-2ca5-4b3b-a1ba-5ab0f98f08c9","html_url":"https://github.com/fluffynuts/PeanutButter","commit_stats":{"total_commits":2833,"total_committers":18,"mean_commits":"157.38888888888889","dds":0.2336745499470526,"last_synced_commit":"5fab6174369e1c732318f5a98cf142a883fc7ab9"},"previous_names":[],"tags_count":569,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluffynuts%2FPeanutButter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluffynuts%2FPeanutButter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluffynuts%2FPeanutButter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluffynuts%2FPeanutButter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fluffynuts","download_url":"https://codeload.github.com/fluffynuts/PeanutButter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247182383,"owners_count":20897380,"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":["csharp","duck-typing","hacktoberfest","mysql","sqlite","sqlserver","testing","utility"],"created_at":"2024-08-01T16:01:00.474Z","updated_at":"2025-04-08T17:32:14.695Z","avatar_url":"https://github.com/fluffynuts.png","language":"C#","readme":"PeanutButter\r\n============\r\n![Test status](https://github.com/fluffynuts/PeanutButter/workflows/Tests/badge.svg)\r\n\r\n![Nuget current version badge](https://img.shields.io/nuget/v/PeanutButter.Utils)\r\n\r\n### Download stats\r\n![Nuget downloads badge](https://img.shields.io/nuget/dt/PeanutButter.Utils?label=Utils)\r\n![Nuget downloads badge](https://img.shields.io/nuget/dt/PeanutButter.INI?label=INI)\r\n![Nuget downloads badge](https://img.shields.io/nuget/dt/PeanutButter.ServiceShell?label=ServiceShell)\r\n![Nuget downloads badge](https://img.shields.io/nuget/dt/PeanutButter.WindowsServiceManagement?label=WindowsServiceManagement)\r\n![Nuget downloads badge](https://img.shields.io/nuget/dt/PeanutButter.XmlUtils?label=XmlUtils)\r\n![Nuget downloads badge](https://img.shields.io/nuget/dt/PeanutButter.RandomGenerators?label=RandomGenerators)\r\n![Nuget downloads badge](https://img.shields.io/nuget/dt/PeanutButter.SimpleHttpServer?label=Utils)\r\n![Nuget downloads badge](https://img.shields.io/nuget/dt/PeanutButter.DatabaseHelpers?label=DatabaseHelpers)\r\n![Nuget downloads badge](https://img.shields.io/nuget/dt/PeanutButter.FluentMigrator?label=FluentMigrator)\r\n![Nuget downloads badge](https://img.shields.io/nuget/dt/PeanutButter.TempDb.MySql.Data?label=TempDb.MySql.Data)\r\n![Nuget downloads badge](https://img.shields.io/nuget/dt/PeanutButter.TempDb.Runner?label=TempDb.Runner)\r\n![Nuget downloads badge](https://img.shields.io/nuget/dt/PeanutButter.TempDb.MySql.Connector?label=TempDb.MySql.Connector)\r\n![Nuget downloads badge](https://img.shields.io/nuget/dt/PeanutButter.TempDb.LocalDb?label=TempDb.LocalDb)\r\n![Nuget downloads badge](https://img.shields.io/nuget/dt/PeanutButter.TempDb.Sqlite?label=TempDb.Sqlite)\r\n![Nuget downloads badge](https://img.shields.io/nuget/dt/PeanutButter.DuckTyping?label=DuckTyping)\r\n\r\n\"Some tastiness to add to your dev sandwich\"\r\n\r\nPeanutButter is a collection of projects which provide useful\r\nbits of functionality that I've often had to re-use (and also\r\nprovides some concrete examples of usage). Sometimes I can even\r\nbe bothered to write about it at\r\n[http://davydm.blogspot.co.za/search/label/PeanutButter](http://davydm.blogspot.co.za/search/label/PeanutButter).\r\n\r\nInside, you'll find, amongst other things:\r\n\r\n* Duck-typing for .NET (PeanutButter.DuckTyping)\r\n  - rigid or fuzzy duck-typing, including the ability\r\n    to wrap a dictionary with a strongly-typed interface,\r\n    even if the starting dictionary is empty.\r\n* Randomisation utilities for testing with (PeanutButter.RandomGenerators)\r\n  - Random Value Generators\r\n    - Tests with random values are usually more useful because,\r\n      if nothing else, after many runs, you've hit many test\r\n      scenarios and often an edge case which would cause you\r\n      production headaches pops out of the wood work. I prefer\r\n      to test with random values wherever possible\r\n    - In addition to the helpers in RandomValueGen which can\r\n      be used to get randomised:\r\n      - string values (arbitrary, alphabetic, or alphanumeric)\r\n      - numeric values (decimal, long)\r\n      - boolean values\r\n      - datetime values\r\n      there is also the GenericBuilder base which you can use\r\n      as a very quick and easy way to create builders for\r\n      complex types. These builders have the ability to generate\r\n      randomised or directed objects.\r\n* Test utilities:\r\n  - PeanutButter.TestUtils.Generic which allows easy TestCase\r\n    scenarios for property get/set tests with PropertyAssert\r\n    which allows easy comparison of properties by name or, indeed\r\n    relative path from the objects provided\r\n  - PeanutButter.TestUtils.MVC (sunset) which provides a JsonResultExtensions\r\n    class to simplify testing MVC actions which return JsonResults\r\n  - PeanutButter.MVC (sunset), which provides facades and interfaces to make\r\n    script and style bundles testable\r\n  - PeanutButter.TestUtils.Entity provides mechanisms for testing\r\n    your EF-based project code against temporary databases\r\n    so you can be sure that the code you deploy will work as expected.\r\n    This library is supported by PeanutButter.TempDb, so you can test\r\n    (out of the box) against LocalDb, Sqlite and SQLCE. You can also\r\n    provide your own TempDb\u003c\u003e implmentation\r\n* Arbitrary utils\r\n  - DecimalDecorator which provides relatively safe string/decimal\r\n    interchange, irrespective of culture\r\n  - XElementExtensions to make dealing with XElement text easier\r\n* On-the-fly HTTP server for testing when you simply need a WebRequest\r\n    to work\r\n* TempDb implementations (LocalDb, SqlCe and Sqlite) so you can run\r\n    tests which involve migrations and integration between your ORM\r\n    and the actual db\r\n* WindowsServiceManagement\r\n  - provides functionality for query of \u0026 interaction with win32\r\n    services using the native Win32 api, exposed in an easy-to-use\r\n    C# POCO\r\n* PeanutButter.DatabaseHelpers\r\n  - provides builders for Select, Update, Delete and Insert SQL\r\n    statements for legacy projects where you can't (at least, not\r\n    yet) get in an ORM. The builders are more testable and you can\r\n    use compile-time constants for table/column names to help to\r\n    harden your code against dev errors and code rot\r\n  - provides OleDB database executors and a data reader builder\r\n* PeanutButter.ServiceShell\r\n  - provides scaffolding for a polling win32 service: inherit\r\n    from the ServiceShell class, configure name and interval\r\n    and provide your custom logic in the RunOnce override\r\n  - resultant services can install and uninstall themselves as\r\n    well as be invoked for once-off runs from the commandline.\r\n    The project also contains a simple, but effective log4net\r\n    configuration for console and a log file\r\n* EmailSpooler.Win32Service\r\n  - harnesses PeanutButter.ServiceShell to provide a generic\r\n    SMTP email spooling service backed with a data store. You\r\n    can (theoretically) use any database which Entity can connect\r\n    to, though this project has only been tested against MSSQL\r\n  - EmailSpooler.Win32Service.DB provides FluentMigrator and\r\n    raw SQL script files for generating the required underlying\r\n    data structures.\r\n\r\nBarring the last item, none of these are stand-alone: they're all\r\njust building blocks which I've had to repeat and refine, so I\r\nfigure they may be of use to others. As far as possible, the code\r\nshould be under test, though some projects are more difficult to\r\nunit test (eg the PeanutButter.WindowsServiceManagement project,\r\nwhich was developed TDD-style but which would sometimes flake out\r\non tests because the windows service management would be hit too hard\r\nor often. But it does work (:) And some are libraries to help with\r\ntesting, so you'll soon find that they work as expected.\r\n\r\n\u003ccenter\u003eA shout out to:\u003c/center\u003e\r\n\u003ccenter style=\"background: white; padding: 15px 15px 1px 10px; border-radius: 6px;\"\u003e\r\n\r\n![Jetbrains Logo](logo_JetBrains_4.png)\r\n\u003c/center\u003e\r\nThe work on PeanutButter would have been a lot more effort without\r\nReSharper from JetBrains. The good people at JetBrains have provided\r\nfree licensing for all of their products for open-source projects like\r\nthis one. To learn more about JetBrains products, please [visit them](http://jetbrains.com)\r\n","funding_links":[],"categories":["C#","C\\#"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluffynuts%2FPeanutButter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffluffynuts%2FPeanutButter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluffynuts%2FPeanutButter/lists"}