{"id":25205525,"url":"https://github.com/farshaddavoudi/chargingassignment.withtests","last_synced_at":"2026-02-10T08:31:55.844Z","repository":{"id":275416629,"uuid":"926019178","full_name":"farshaddavoudi/ChargingAssignment.WithTests","owner":"farshaddavoudi","description":"Comprehensive assignment project showcasing best testing practices and methodologies, featuring robust unit, integration, and end-to-end tests. This project involves developing an API for a simplified smart charging domain. Includes CRUD operations for Groups, Charge Stations, and Connectors with strict adherence to functional requirements.","archived":false,"fork":false,"pushed_at":"2025-02-02T11:08:08.000Z","size":133,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T02:13:25.433Z","etag":null,"topics":["api","bogus","c-sharp","clean-architecture","cqrs-pattern","end-to-end-testing","fluent-assertions","integration-testing","moq-framework","onion-architecture","unit-testing","xunit"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/farshaddavoudi.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":"2025-02-02T10:54:01.000Z","updated_at":"2025-02-16T06:24:57.000Z","dependencies_parsed_at":"2025-02-02T11:39:06.120Z","dependency_job_id":null,"html_url":"https://github.com/farshaddavoudi/ChargingAssignment.WithTests","commit_stats":null,"previous_names":["farshaddavoudi/chargingassignment.withtests"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farshaddavoudi%2FChargingAssignment.WithTests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farshaddavoudi%2FChargingAssignment.WithTests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farshaddavoudi%2FChargingAssignment.WithTests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farshaddavoudi%2FChargingAssignment.WithTests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/farshaddavoudi","download_url":"https://codeload.github.com/farshaddavoudi/ChargingAssignment.WithTests/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247276188,"owners_count":20912288,"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":["api","bogus","c-sharp","clean-architecture","cqrs-pattern","end-to-end-testing","fluent-assertions","integration-testing","moq-framework","onion-architecture","unit-testing","xunit"],"created_at":"2025-02-10T10:19:49.179Z","updated_at":"2026-02-10T08:31:55.779Z","avatar_url":"https://github.com/farshaddavoudi.png","language":"C#","readme":"# Charging Assignment with Tests\n\n## Overview\nThis project is a comprehensive assignment featuring robust unit, integration, and end-to-end tests to showcase best testing practices and methodologies.\n\n## Features\n- Develop an API exposing a simplified smart charging domain.\n- Manage Groups, Charge Stations, and Connectors with full CRUD operations.\n- Ensure all operations adhere to strict functional requirements.\n- Extensive testing coverage for all functionalities.\n\n## Domain:\n\u003cimg src=\"https://github.com/farshaddavoudi/ChargingAssignment.WithTests/blob/main/docs/domain-model.png\" alt=\"domain-model\"\u003e\n\n## Functional Requirements\n1. Create, update, and remove Group/Charge Station/Connector.\n2. Removing a Group also removes all associated Charge Stations.\n3. Add/remove only one Charge Station to/from a Group per call.\n4. Charge Stations can only belong to one Group at a time.\n5. Connectors can only exist within a Charge Station.\n6. Update the Max current in Amps of existing Connectors.\n7. Group Capacity in Amps must be greater than or equal to the sum of the Max current in Amps of all Connectors in the Group.\n8. Reject operations/requests not meeting the above requirements.\n\n## How to Run/Start the Project:\nFirst, the database needs to be created and migrations to be applied. \n\n\u003e Before creating the database and applying migrations, ensure that you have the necessary SQL Server instance accessible. If your SQL Server instance is hosted on \nthe cloud or running within a Docker container, simply modify the connection string in the appsettings.json file to point \nto your SQL Server instance.\n\n\u003e The default one is set on *locally* installed SQL Server instance\n\nIt can be done following below steps:\n\n### – Modify the connection string _(if necessary)_\n\n```\n// appsettings.json file\n\"AppDbConnStr\": \"Data Source=localhost;Initial Catalog=CharginAssignment;Trusted_Connection=True;TrustServerCertificate=True;\"\n```\n\n### – Apply migrations \n\nThis can be done in two ways:\n\n1. **Visual Studio**: Open *Package Manager Console* of Visual Studio. Set *Default project* on `*.Infratructure` and *Startup project* on `*.API` one.\nThen run the update database command: `Update-Database`\n\n2. **.NET CLI**: In Windows Explorer, go to the `{project-path}/src/CharginAssignment.WithTests.Infrastructure` path, then open \na command line there and run this command: `dotnet ef database update -s  \"..\\CharginAssignment.WithTests.Web.API\"`\n\n#### _Run the project by `dotnet run` or via Visual Studio, and the Swagger page will pop up as a sign that the application has started._\n\n## Project Architecture:\n\n*Clean Architecture* has been implemented with the following projects:\n\n- API (WebAPI project)\n- Application (Class Library)\n- Infrastructure (Class Library)\n- Domain (Class Library)\n\nAlso, the CQRS pattern is followed by using the `MediatR` library.\n\n## Project Technical Description:\n\nUse .NET 8, EF Core (ORM), SQL Server as the data store, AutoMapper for mappings, Unit/Integration\ntests using `xUnit/Moq/FluentAssertions/Bogus`, In Memory DB for Integration Tests, Logging with Serilog configured the log file as target sink.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffarshaddavoudi%2Fchargingassignment.withtests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffarshaddavoudi%2Fchargingassignment.withtests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffarshaddavoudi%2Fchargingassignment.withtests/lists"}