PowerShell/test
Dongbo Wang 9ceddc0dfe
Refactor ConvertTo-Json to expose JsonObject.ConvertToJson as a public API (#8682)
We have the public API `JsonObject.ConvertFromJson` to convert from JSON string in the PowerShell context. It would be good to have a public API for conversion to JSON. This PR refactors the `ConvertTo-Json` cmdlet to move the core implementation to `JsonObject.ConvertToJson`, and make `ConvertTo-Json` call that public method.

This would help the Azure Function PowerShell worker. Currently, we depends on [calling the cmdlet](729710d259/src/PowerShell/PowerShellManager.cs (L198-L205)) to convert object to JSON which is expensive. Once we have the public method `JsonObject.ConvertToJson` exposed, we can call the API directly to avoid a command invocation.

# Conflicts:
#	test/Test.Common.props
2019-01-23 10:41:19 -08:00
..
common/markdown Create Support File (#8618) 2019-01-17 12:25:07 -08:00
docker/networktest Revise use of Start-Sleep cmdlet (#8633) 2019-01-15 12:31:52 +05:00
hosting Merged PR 6644: Update hosting tests and metadata.json for 6.2.0-preview.4 release 2019-01-22 21:43:47 +00:00
packaging/windows Simplify the paths the MSI uses (#6442) 2018-04-02 10:47:29 -07:00
powershell Remove broken HelpUri from CimTest (#8688) 2019-01-22 11:21:45 -08:00
shebang Reorganize tests 2016-01-14 17:00:06 -08:00
tools Merged PR 6648: Bump SDK and Runtime Versions 2019-01-23 02:18:44 +00:00
xUnit Refactor ConvertTo-Json to expose JsonObject.ConvertToJson as a public API (#8682) 2019-01-23 10:41:19 -08:00
README.md Move xUnit tests in new folder (#8356) 2018-12-13 14:22:07 -08:00
Test.Common.props Refactor ConvertTo-Json to expose JsonObject.ConvertToJson as a public API (#8682) 2019-01-23 10:41:19 -08:00

Testing

The tests are organized by testing language. Thus Pester tests, which are written in the PowerShell language, are in ./powershell and xUnit tests, written in C#, are in ./xUnit. The third-party shebang test is in ./shebang.