{"id":19792729,"url":"https://github.com/devpro/withywoods","last_synced_at":"2025-05-01T02:30:31.847Z","repository":{"id":38361847,"uuid":"145459136","full_name":"devpro/withywoods","owner":"devpro","description":"Shared .NET libraries to do more with less code!","archived":false,"fork":false,"pushed_at":"2023-03-08T04:58:47.000Z","size":1148,"stargazers_count":10,"open_issues_count":12,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-18T18:56:34.217Z","etag":null,"topics":["dal","dotnet-core","mongodb","nuget","rabbitmq","selenium","swagger","testing"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devpro.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":"2018-08-20T19:03:26.000Z","updated_at":"2024-07-04T05:13:30.000Z","dependencies_parsed_at":"2024-06-20T21:48:47.913Z","dependency_job_id":"397ac931-c0dc-4030-82ad-ff81f701d10e","html_url":"https://github.com/devpro/withywoods","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devpro%2Fwithywoods","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devpro%2Fwithywoods/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devpro%2Fwithywoods/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devpro%2Fwithywoods/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devpro","download_url":"https://codeload.github.com/devpro/withywoods/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251590127,"owners_count":21613901,"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":["dal","dotnet-core","mongodb","nuget","rabbitmq","selenium","swagger","testing"],"created_at":"2024-11-12T07:07:51.144Z","updated_at":"2025-05-01T02:30:30.933Z","avatar_url":"https://github.com/devpro.png","language":"C#","readme":"﻿# Devpro Withywoods - Shared .NET libraries\n\n[![Build Status](https://dev.azure.com/devprofr/open-source/_apis/build/status/libraries/withywoods-ci?branchName=master)](https://dev.azure.com/devprofr/open-source/_build/latest?definitionId=31\u0026branchName=master)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=withywoods\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=withywoods)\n[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=withywoods\u0026metric=coverage)](https://sonarcloud.io/dashboard?id=withywoods)\n\nWhithywoods is a set of small independant .NET libraries (Standard/Core). The goal is to do better with less code and capitalize on best practices (#KISS #DRY).\n\nAll libraries are available on [nuget.org](https://www.nuget.org/). Feel free to report any issue or ask for a change. You can also contribute with Pull Requests on GitHub!\n\nNB: The name _Whithywoods_ comes from [Robin Hobb](https://twitter.com/robinhobb)'s incredible writing.\n\n## How to use\n\n### Common / Configuration library\n\n[![Version](https://img.shields.io/nuget/v/Withywoods.Configuration.svg)](https://www.nuget.org/packages/Withywoods.Configuration/)\n[![Downloads](https://img.shields.io/nuget/dt/Withywoods.Configuration.svg)](https://www.nuget.org/packages/Withywoods.Configuration/)\n\n_tl;dr_ New extension method to access configuration: `configuration.TryGetSection()`\n\n[More information](./src/Configuration/README.md)\n\n### Common / Net HTTP library\n\n[![Version](https://img.shields.io/nuget/v/Withywoods.Net.Http.svg)](https://www.nuget.org/packages/Withywoods.Net.Http/)\n[![Downloads](https://img.shields.io/nuget/dt/Withywoods.Net.Http.svg)](https://www.nuget.org/packages/Withywoods.Net.Http/)\n\n_tl;dr_ New exception: `ConnectivityException`\n\n[More information](./src/Net.Http/README.md)\n\n### Common / Serialization library\n\n[![Version](https://img.shields.io/nuget/v/Withywoods.Serialization.svg)](https://www.nuget.org/packages/Withywoods.Serialization/)\n[![Downloads](https://img.shields.io/nuget/dt/Withywoods.Serialization.svg)](https://www.nuget.org/packages/Withywoods.Serialization/)\n\n_tl;dr_ New extension methods to serialize/deserialize from Json: `myObject.ToJson()` and `myString.FromJson()`\n\n[More information](./src/Serialization/README.md)\n\n### Common / System library\n\n[![Version](https://img.shields.io/nuget/v/Withywoods.System.svg)](https://www.nuget.org/packages/Withywoods.System/)\n[![Downloads](https://img.shields.io/nuget/dt/Withywoods.System.svg)](https://www.nuget.org/packages/Withywoods.System/)\n\n_tl;dr_ New string extensions: `myString.FirstCharToUpper()`\n\n[More information](./src/System/README.md)\n\n### Common / Unit testing\n\n[![Version](https://img.shields.io/nuget/v/Withywoods.UnitTesting.svg)](https://www.nuget.org/packages/Withywoods.UnitTesting/)\n[![Downloads](https://img.shields.io/nuget/dt/Withywoods.UnitTesting.svg)](https://www.nuget.org/packages/Withywoods.UnitTesting/)\n\n_tl;dr_ Enable unit testing on HTTP calls: `HttpRepositoryTestBase` abstract class with `BuildHttpClientFactory()` method\n\n[More information](./src/UnitTesting/README.md)\n\n### Data Access / MongoDB library\n\n[![Version](https://img.shields.io/nuget/v/Withywoods.Dal.MongoDb.svg)](https://www.nuget.org/packages/Withywoods.Dal.MongoDb/)\n[![Downloads](https://img.shields.io/nuget/dt/Withywoods.Dal.MongoDb.svg)](https://www.nuget.org/packages/Withywoods.Dal.MongoDb/)\n\n_tl;dr_ Get access to a MongoDB database in a few lines by using best practices.\n\n[More information](./src/Dal.MongoDb/README.md)\n\n### Message Broker / RabbitMQ library\n\n[![Version](https://img.shields.io/nuget/v/Withywoods.RabbitMq.svg)](https://www.nuget.org/packages/Withywoods.RabbitMq/)\n[![Downloads](https://img.shields.io/nuget/dt/Withywoods.RabbitMq.svg)](https://www.nuget.org/packages/Withywoods.RabbitMq/)\n\n_tl;dr_ Clean channel factory to ease the use of RabbitMQ as well as enabling decoupling through interfaces.\n\n[More information](./src/RabbitMq/README.md)\n\n### Web / Selenium library\n\n[![Version](https://img.shields.io/nuget/v/Withywoods.Selenium.svg)](https://www.nuget.org/packages/Withywoods.Selenium/)\n[![Downloads](https://img.shields.io/nuget/dt/Withywoods.Selenium.svg)](https://www.nuget.org/packages/Withywoods.Selenium/)\n\n_tl;dr_ New extension method to find an element with a wait: `driver.FindElement(By.ClassName(\"title\"), 360);`.\n\n[More information](./src/Selenium/README.md)\n\n### Web / Web Application library\n\n[![Version](https://img.shields.io/nuget/v/Withywoods.AspNetCore.svg)](https://www.nuget.org/packages/Withywoods.AspNetCore/)\n[![Downloads](https://img.shields.io/nuget/dt/Withywoods.AspNetCore.svg)](https://www.nuget.org/packages/Withywoods.AspNetCore/)\n\n_tl;dr_ Easily add Swagger self-generated web page, only two lines in your Startup class!\n\n```csharp\nservices.AddSwaggerGen(_webAppConfiguration); // in ConfigureServices()\n\napp.UseSwagger(_webAppConfiguration); // in Configure()\n```\n\n[More information](./src/AspNetCore/README.md)\n\n### Web / Web Testing library\n\n[![Version](https://img.shields.io/nuget/v/Withywoods.WebTesting.svg)](https://www.nuget.org/packages/Withywoods.WebTesting/)\n[![Downloads](https://img.shields.io/nuget/dt/Withywoods.WebTesting.svg)](https://www.nuget.org/packages/Withywoods.WebTesting/)\n\n_tl;dr_ Use Selenium web driver inside ASP.NET Integration tests? Yes, that's possible with `LocalServerFactory` class!\n\n```csharp\npublic class SwaggerResourceTest : IClassFixture\u003cLocalServerFactory\u003cStartup\u003e\u003e, IDisposable\n{\n    [Fact]\n    public void AspNetCoreApiSampleSwaggerResourceGet_ReturnsHttpOk()\n    {\n        // Arrange \u0026 Act\n        _webDriver.Navigate().GoToUrl($\"{_server.RootUri}/{_ResourceEndpoint}\");\n\n        // Assert\n        _webDriver.FindElement(By.ClassName(\"title\"), 360);\n        _webDriver.Title.Should().Be(\"Swagger UI\");\n        _webDriver.FindElementByClassName(\"title\").Text.Should().Contain(\"My API\");\n    }\n}\n```\n\nWant to write easy API Rest tests? Sure, just use the `TestRunner` class!\n\n```csharp\n[Fact]\npublic async Task AspNetCoreApiSampleTaskResourceFullCycle_IsOk()\n{\n    var initialTasks = await _restRunner.GetResources\u003cTaskDto\u003e(_client);\n    initialTasks.Count.Should().Be(0);\n\n    var created = await _restRunner.CreateResource\u003cTaskDto\u003e(_client);\n\n    await _restRunner.GetResourceById(created.Id, _client, created);\n\n    await _restRunner.UpdateResource(created.Id, created, _client);\n\n    var existingTasks = await _restRunner.GetResources\u003cTaskDto\u003e(_client);\n    existingTasks.Count.Should().Be(1);\n\n    await _restRunner.DeleteResource(created.Id, _client);\n\n    var expectedNotFound = new ProblemDetails\n    {\n        Title = \"Not Found\",\n        Status = 404,\n        Type = \"https://tools.ietf.org/html/rfc7231#section-6.5.4\"\n    };\n    await _restRunner.GetResourceById(created.Id, _client, expectedNotFound, HttpStatusCode.NotFound, config =\u003e config.Excluding(x =\u003e x.Extensions));\n\n    var finalTasks = await _restRunner.GetResources\u003cTaskDto\u003e(_client);\n    finalTasks.Count.Should().Be(0);\n}\n```\n\n[More information](./src/WebTesting/README.md)\n\n## How to build\n\n```bash\n# check .NET Core SDK is installed (download from https://dotnet.microsoft.com/download)\ndotnet --version\n\n# restore NuGet packages\ndotnet restore\n\n# build the solution\ndotnet build\n```\n\n## How to test\n\n/!\\ MongoDB DAL integration tests require a local MongoDB server (through Docker for instance)\n\n```bash\ndotnet test\n```\n\n## Samples\n\n### AspNetCoreApiSample\n\nThis is a fully working example, with Swagger generation, API controllers, completely tested by integration tests.\n\n### RabbitMQ\n\nThere are two console projects to publish and consumes messages through RabbitMQ, using Withywoods RabbitMQ library.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevpro%2Fwithywoods","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevpro%2Fwithywoods","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevpro%2Fwithywoods/lists"}