This is the source for LUISGen, a tool for which is a tool for generating a strongly typed C# class or Typescript interface file to make consuming LUIS output easier.
This enables build-time checking and intellisense.
You need to have the .Net Core SDK installed.
If you want to run the typescript tests you need to make sure nodejs is installed.
Build the LUISGen project to build the tool. If you make changes be sure to update the project package description as well as the npm readme.md.
The LUISGenTest project tests a LUISGen C# generated class. All tests should pass if you run them since it uses a mocked interface to LUIS.
If you update LUISGen and want to test it, you should replace Contoso_App.cs with your newly generated one with this debug command:
"..\..\..\..\tests\LUISGenTest\Contoso app.json" -cs Microsoft.Bot.Builder.Ai.LUIS.Tests.Contoso_App -o ..\..\..\..\tests\LUISGenTest\
If you want to run live tests against the LUIS service you need to make changes in Tests.cs:
- Set _mock = false and supply a LUIS endpoint key in _endpointKey.
- Run the tests. This will go against the LUIS service and if there are changes from the checked in oracle files they will be added to LUISGenTest\TestData as .json.new.
- If there are failures run review.cmd to look at the changes and approve them as new oracle file.
- When all oracles are correct, make sure _mock = true and remove your _endpointKey.
The project LUISGenTestJS tests a LUISGen Typescript generated inteface. In order to build the test you should first execute npm install in the project directory. If you build and run the tests, they should all pass since it uses a mocked interface to LUIS.
If you update LUISGen and want to test it, you should replace [Contoso_App.ts)[tests\LUISGenTestJS\src\Contoso_App.ts) in LUISGenTest with your newly generated one with this debug command:
"..\..\..\..\LUISGenTest\Contoso App.json" -ts ..\..\..\..\LUISGenTestJS\src
If you want to run live tests against the LUIS service you must make changes in src\tests.ts:
- Set mockLuis = false and endpointKey to a LUIS endpoint key.
- Run the tests. This will go against the LUIS service and if there are changes from the checked in oracle files they will be added to LUISGenTestJS\src\TestData as
<test>.json.new
. - If there are failures run LUISGenTestJS\src\TestData\review.cmd to look at the changes and approve them as new oracle file.
- When all oracles are correct, make sure mockLuis = true and reset endpointKey.