{"id":19080420,"url":"https://github.com/seeminglyscience/powershellstandard-xunit-demo","last_synced_at":"2025-07-03T19:06:41.928Z","repository":{"id":87373431,"uuid":"139505947","full_name":"SeeminglyScience/PowerShellStandard-xunit-demo","owner":"SeeminglyScience","description":"Simple demo for running xunit tests against a project targeting PowerShellStandard.","archived":false,"fork":false,"pushed_at":"2018-07-03T00:02:11.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-22T05:44:00.256Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/SeeminglyScience.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-02T23:46:30.000Z","updated_at":"2018-07-03T00:02:12.000Z","dependencies_parsed_at":"2023-03-27T13:04:34.801Z","dependency_job_id":null,"html_url":"https://github.com/SeeminglyScience/PowerShellStandard-xunit-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SeeminglyScience/PowerShellStandard-xunit-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SeeminglyScience%2FPowerShellStandard-xunit-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SeeminglyScience%2FPowerShellStandard-xunit-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SeeminglyScience%2FPowerShellStandard-xunit-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SeeminglyScience%2FPowerShellStandard-xunit-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SeeminglyScience","download_url":"https://codeload.github.com/SeeminglyScience/PowerShellStandard-xunit-demo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SeeminglyScience%2FPowerShellStandard-xunit-demo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263385599,"owners_count":23458736,"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-11-09T02:23:33.433Z","updated_at":"2025-07-03T19:06:41.906Z","avatar_url":"https://github.com/SeeminglyScience.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PowerShell xunit demo\n\nSimple example project showing how to use xunit with PowerShell projects that target `netstandard`.\n\n## Things to note\n\n- To pull in `Microsoft.PowerShell.SDK` you need the `nuget.config` file.\n- The SDK is required when running tests because `xunit` tries to use the reference library. All of\n  the methods/properties in the reference library are empty and return null\n- A new configuration was added for `Test` that must be specified when running `xunit` tests\n- Customizations in the `sln` file prevent the tests from being built in any configuration other than `Test`.\n  See \"Solution File Changes\" for more info\n\n## Solution File Changes\n\n1. The configuration `Test` was added for all projects\n1. The `.Build.0` option was removed for all configurations other than `Test` in the xunit project.\n\nYou can make these changes with the configuration manager in Visual Studio, or you can do the following\nmanually.\n\n1. Under the following text\n    ```none\n        Release|Any CPU = Release|Any CPU\n        Release|x64 = Release|x64\n        Release|x86 = Release|x86\n    ```\n\n    Add this\n\n    ```none\n        Test|Any CPU = Test|Any CPU\n        Test|x64 = Test|x64\n        Test|x86 = Test|x86\n    ```\n\n1. Find the text that looks like this, except where `{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}` is the\n    Guid of your test project.\n\n    ```none\n        {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n        {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}.Debug|Any CPU.Build.0 = Debug|Any CPU\n        {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}.Debug|x64.ActiveCfg = Debug|x64\n        {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}.Debug|x64.Build.0 = Debug|x64\n        {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}.Debug|x86.ActiveCfg = Debug|x86\n        {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}.Debug|x86.Build.0 = Debug|x86\n        {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}.Release|Any CPU.ActiveCfg = Release|Any CPU\n        {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}.Release|Any CPU.Build.0 = Release|Any CPU\n        {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}.Release|x64.ActiveCfg = Release|x64\n        {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}.Release|x64.Build.0 = Release|x64\n        {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}.Release|x86.ActiveCfg = Release|x86\n        {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}.Release|x86.Build.0 = Release|x86\n    ```\n\n    And modify it to look like this\n\n    ```none\n        {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n        {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}.Debug|x64.ActiveCfg = Debug|x64\n        {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}.Debug|x86.ActiveCfg = Debug|x86\n        {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}.Release|Any CPU.ActiveCfg = Release|Any CPU\n        {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}.Release|x64.ActiveCfg = Release|x64\n        {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}.Release|x86.ActiveCfg = Release|x86\n        {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}.Test|Any CPU.ActiveCfg = Test|Any CPU\n        {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}.Test|Any CPU.Build.0 = Test|Any CPU\n        {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}.Test|x64.ActiveCfg = Test|x64\n        {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}.Test|x64.Build.0 = Test|x64\n        {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}.Test|x86.ActiveCfg = Test|x86\n        {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}.Test|x86.Build.0 = Test|x86\n    ```\n\n    *Note*: Make sure to remove the lines with `.Build.0` for configurations other than test.\n\n## Running xunit\n\n1. `cd .\\test\\DemoAssembly.Tests`\n1. `dotnet xunit -fxversion 2.0.5 --configuration Test`\n\n\u003csub\u003e**Note**: \"fxversion\" will vary depending on what runtimes are installed.\u003c/sub\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseeminglyscience%2Fpowershellstandard-xunit-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseeminglyscience%2Fpowershellstandard-xunit-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseeminglyscience%2Fpowershellstandard-xunit-demo/lists"}