{"id":19538263,"url":"https://github.com/raschmitt/date-override","last_synced_at":"2026-04-12T07:38:02.523Z","repository":{"id":133113430,"uuid":"279723378","full_name":"raschmitt/date-override","owner":"raschmitt","description":"Simple solution for mocking date properties with private setters in C#.","archived":false,"fork":false,"pushed_at":"2021-03-20T19:12:35.000Z","size":122,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-16T23:17:16.232Z","etag":null,"topics":["datetime","dotnet","mocking","nuget","testing"],"latest_commit_sha":null,"homepage":"https://www.nuget.org/packages/DateOverride/","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/raschmitt.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":"2020-07-15T00:34:38.000Z","updated_at":"2021-03-20T19:12:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"c0a77f0d-64ec-4a45-8c7b-62b91c00d923","html_url":"https://github.com/raschmitt/date-override","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/raschmitt/date-override","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raschmitt%2Fdate-override","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raschmitt%2Fdate-override/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raschmitt%2Fdate-override/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raschmitt%2Fdate-override/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raschmitt","download_url":"https://codeload.github.com/raschmitt/date-override/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raschmitt%2Fdate-override/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31707953,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-12T06:22:27.080Z","status":"ssl_error","status_checked_at":"2026-04-12T06:21:52.710Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["datetime","dotnet","mocking","nuget","testing"],"created_at":"2024-11-11T02:33:24.103Z","updated_at":"2026-04-12T07:38:02.503Z","avatar_url":"https://github.com/raschmitt.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DateOverride [\u003cimg src=\"https://raw.githubusercontent.com/raschmitt/date-override/master/icon.png\" align='right' /\u003e](https://github.com/raschmitt/date-override)\n\n[![Azure DevOps builds](https://img.shields.io/azure-devops/build/raschmitt/7618d927-8467-43e2-b5e9-1aeddc1fbfdc/15?label=Build%20%26%20Test\u0026style=flat-square)](https://dev.azure.com/raschmitt/raschmitt/_build?definitionId=15)\n[![Azure DevOps builds](https://img.shields.io/azure-devops/build/raschmitt/7618d927-8467-43e2-b5e9-1aeddc1fbfdc/17?label=Deploy\u0026style=flat-square)](https://dev.azure.com/raschmitt/raschmitt/_build?definitionId=17)\n[![Sonar Coverage](https://img.shields.io/sonar/coverage/raschmitt_date-override?label=Code%20Coverage\u0026server=https%3A%2F%2Fsonarcloud.io\u0026style=flat-square)](https://sonarcloud.io/dashboard?id=raschmitt_date-override)\n[![Nuget](https://img.shields.io/nuget/v/DateOverride?label=Nuget\u0026style=flat-square)](https://www.nuget.org/packages/DateOverride/)\n[![Nuget](https://img.shields.io/nuget/dt/DateOverride?color=Blue\u0026label=Downloads\u0026style=flat-square)](https://www.nuget.org/stats/packages/DateOverride?groupby=Version)\n\nDateOverride is a simple solution for mocking date properties with private setters in C#.\n\n## Dependencies\n\n- [.NET Standard 2.0](https://docs.microsoft.com/en-us/dotnet/standard/net-standard)\n\n## Install\n\n- ### Package Manager Console\n\n```\nInstall-Package DateOverride\n```\n\n- ### .Net CLI\n\n```\ndotnet add package DateOverride\n```\n\n## How to use\n\nDateOverride can set any `DateTime` or `DateTimeOffset` property, with the `SetDate()` extension method, trough the following syntax:\n\n```c#\nobject.SetDate(property, date);\n```\nWhere:\n\n- obejct : the object containing the property to be set\n- property : the property name as a string\n- date : the date which to set the property\n\n### Sample\n\n```c#\npublic class Item\n{\n    public DateTime CreatedAt { get; private set; }\n}\n\n[Fact]\npublic void Should_set_DateTime()\n{\n    //Arrange\n    var item = new Item();   \n    \n    var today = DateTime.Now;\n    var tomorrow = DateTime.Now.AddDays(1);\n    \n    //Act\n    item.SetDate(nameof(item.CreatedAt), tomorrow);\n    \n    //Assert\n    item.Date.Should().BeAfter(today);\n}\n```\n\n## Contributions\n\n  Contributions and feature requests are always welcome.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraschmitt%2Fdate-override","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraschmitt%2Fdate-override","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraschmitt%2Fdate-override/lists"}