├── .github └── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── .gitignore ├── .gitmodules ├── ATDD.TestScriptor.VSCodeExtension.code-workspace ├── LICENSE ├── README.md ├── azure-pipelines.yml ├── build.ps1 ├── demo └── ATTD.TestScriptor.VSCode 20200516.jpg ├── flowcharts ├── Use Case (#27) - Adding Given-When-Then.drawio ├── Use Case (#27) - Adding Given-When-Then.jpg ├── Use Case (#27) - Adding Given-When-Then.vsdx ├── Use Case (#28) - Removing Given-When-Then.drawio ├── Use Case (#28) - Removing Given-When-Then.jpg ├── Use Case (#28) - Removing Given-When-Then.vsdx ├── Use Case (#29) - Moving Given-When-Then.drawio ├── Use Case (#29) - Moving Given-When-Then.jpg ├── Use Case (#29) - Moving Given-When-Then.vsdx ├── Use Case (#30) - Updating Given-When-Then.drawio ├── Use Case (#30) - Updating Given-When-Then.jpg ├── Use Case (#30) - Updating Given-When-Then.vsdx ├── Use Case (#38) - Adding Scenario.drawio ├── Use Case (#38) - Adding Scenario.jpg ├── Use Case (#38) - Adding Scenario.vsdx ├── Use Case (#39) - Removing Scenario.drawio ├── Use Case (#39) - Removing Scenario.jpg ├── Use Case (#39) - Removing Scenario.vsdx ├── Use Case (#60) - Updating Scenario.drawio ├── Use Case (#60) - Updating Scenario.jpg ├── Use Case (#60) - Updating Scenario.vsdx ├── Use Case (#61) - Adding Feature.drawio ├── Use Case (#61) - Adding Feature.jpg ├── Use Case (#61) - Adding Feature.vsdx ├── Use Case (#62) - Removing Feature.drawio ├── Use Case (#62) - Removing Feature.jpg ├── Use Case (#62) - Removing Feature.vsdx ├── Use Case (#65) - Copying Scenario.drawio ├── Use Case (#65) - Copying Scenario.jpg └── Use Case (#65) - Copying Scenario.vsdx ├── media ├── ATDDEditor.gif ├── ATDDResizablePanels.gif ├── ATDDTheming.gif ├── Communcation Flows.vsdx ├── Converting ATDD information.gif ├── Opening ATDD.TestScriptor.gif ├── homepage.PNG └── idea.png ├── packages └── atdd-testscriptor-0.1.278.vsix ├── services ├── .gitignore ├── ATDD.TestScriptor.BackendServices.sln ├── ATDD.TestScriptor.BackendServices │ ├── ATDD.TestScriptor.BackendServices.csproj │ ├── Hubs │ │ ├── ATDDHub.cs │ │ └── IATDDHub.cs │ ├── Models │ │ └── Message.cs │ ├── Program.cs │ ├── Properties │ │ ├── PublishProfiles │ │ │ ├── FolderProfile.pubxml │ │ │ └── FolderProfile_Linux.pubxml │ │ └── launchSettings.json │ ├── Services │ │ └── ALObjectService.cs │ ├── Startup.cs │ ├── appsettings.Development.json │ └── appsettings.json └── ATDD.TestScriptor.Library │ ├── ALObjectCollector.cs │ ├── ALProjectCollector.cs │ ├── ATDD.TestScriptor.Library.csproj │ ├── Helpers │ ├── ALMethodHelper.cs │ ├── ALTestCodeunitHelper.cs │ ├── ALTestMethodHelper.cs │ ├── CollectorItemComparer.cs │ ├── FileInfoNameComparer.cs │ ├── TestFeatureComparer.cs │ ├── TestFeatureNameComparer.cs │ ├── TestScenarioComparer.cs │ ├── TestScenarioElementComparer.cs │ └── TestScenarioIDComparer.cs │ ├── Models │ ├── ALParserConfig.cs │ ├── ALProject.cs │ ├── CollectorItem.cs │ ├── SymbolData.cs │ ├── SymbolReference.cs │ ├── SymbolReferenceInfo.cs │ ├── TestALCodeunit.cs │ ├── TestALMethod.cs │ ├── TestFeature.cs │ ├── TestScenario.cs │ └── TestScenarioElement.cs │ └── Parsers │ ├── ALTestCodeunitReader.cs │ └── ALTestCodeunitWriter.cs ├── test ├── ATTDTestScriptor test-project.code-workspace ├── test-project - no tags │ ├── .gitignore │ ├── .vscode │ │ └── settings.json │ ├── app.json │ ├── images │ │ └── logo.png │ └── test │ │ ├── FirstTestObject.Codeunit.al │ │ ├── FourthTestObjectUIHandler.Codeunit.al │ │ ├── SecondTestObject.Codeunit.al │ │ └── ThirdTestObjectInitialize.Codeunit.al ├── test-project │ ├── .gitignore │ ├── .vscode │ │ └── settings.json │ ├── app.json │ ├── images │ │ └── logo.png │ └── test │ │ ├── DuplicateTestObject.Codeunit.al │ │ ├── DuplicateTestObject2.Codeunit.al │ │ ├── TestObject.Codeunit.al │ │ ├── TestObject1WithSameFeature.Codeunit.al │ │ ├── TestObject2WithSameFeature.Codeunit.al │ │ ├── TestObjectHoleInScenarioNos.Codeunit.al │ │ ├── TestObjectWithInitialize.Codeunit.al │ │ ├── TestObjectWithTwoFeatures.Codeunit.al │ │ ├── TestObjectWithUIHandler.Codeunit.al │ │ └── UnnumberedTestObject.Codeunit.al └── test-scenarios │ ├── atdd-test-results-archive.xlsx │ └── atdd-test-scenarios-and-results.xlsx ├── vscode-extension ├── .gitignore ├── .vscode │ ├── extensions.json │ ├── launch.json │ ├── settings.json │ └── tasks.json ├── .vscodeignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── WebView │ └── index.html ├── images │ └── ATDDTestScriptorIcon.png ├── package.json ├── src │ ├── App logic │ │ ├── AL Code Actions │ │ │ ├── alCodeActionsExtension.ts │ │ │ ├── apiInterface.ts │ │ │ └── typeDetectiveInterface.ts │ │ ├── AL Code Outline Ext │ │ │ ├── ToolsGetSyntaxTreeSymbolsRequest.ts │ │ │ ├── alFullSyntaxTreeNodeExt.ts │ │ │ ├── azSymbolInformationExt.ts │ │ │ ├── fullSyntaxTreeNodeKind.ts │ │ │ ├── syntaxTreeExt.ts │ │ │ ├── textPositionExt.ts │ │ │ ├── textRangeExt.ts │ │ │ ├── toolsGetSyntaxTreeRequest.ts │ │ │ └── toolsGetSyntaxTreeResponse.ts │ │ ├── AL Code Outline │ │ │ ├── AZSymbolInformation.ts │ │ │ ├── alFullSyntaxTreeNode.ts │ │ │ ├── azALDocumentSymbolsService.ts │ │ │ ├── azSymbolKind.ts │ │ │ ├── devToolsExtensionContext.ts │ │ │ ├── syntaxTree.ts │ │ │ ├── textPosition.ts │ │ │ ├── textRange.ts │ │ │ ├── toolsGetFullSyntaxTreeRequest.ts │ │ │ └── toolsGetFullSyntaxTreeResponse.ts │ │ ├── CRS AL Language Extension │ │ │ └── CRSExtensionPublicApiInterfaces.d.ts │ │ ├── Entities │ │ │ ├── messageDetailsImpl.ts │ │ │ ├── messageImpl.ts │ │ │ └── testMethod.ts │ │ ├── Services │ │ │ └── ObjectService.ts │ │ └── Utils │ │ │ ├── config.ts │ │ │ ├── elementDeletionUtils.ts │ │ │ ├── elementInsertionUtils.ts │ │ │ ├── elementModificationUtils.ts │ │ │ ├── elementUtils.ts │ │ │ ├── messageParser.ts │ │ │ ├── objectToMessageUtils.ts │ │ │ ├── preChecks.ts │ │ │ ├── rangeUtils.ts │ │ │ ├── stringUtils.ts │ │ │ ├── testCodeunitUtils.ts │ │ │ ├── testMethodUtils.ts │ │ │ └── userInteraction.ts │ ├── Application.ts │ ├── Services │ │ ├── ExcelService.ts │ │ ├── LogService.ts │ │ ├── MiddlewareService.ts │ │ ├── UIService.ts │ │ ├── VSCommandService.ts │ │ └── WebPanelCommandService.ts │ ├── WebPanel.ts │ ├── extension.ts │ ├── test │ │ ├── BlockingDeletionWarehouse.test.ts │ │ ├── atddTestScenariosAndResults_Add.test.ts │ │ ├── atddTestScenariosAndResults_AddFeature.test.ts │ │ ├── atddTestScenariosAndResults_AddScenario.test.ts │ │ ├── atddTestScenariosAndResults_Remove.test.ts │ │ ├── atddTestScenariosAndResults_RemoveScenario.test.ts │ │ ├── atddTestScenariosAndResults_Update.test.ts │ │ ├── atddTestScenariosAndResults_UpdateScenario.test.ts │ │ ├── extension.test.ts │ │ ├── index.ts │ │ ├── orgs │ │ │ ├── DuplicateTestObject.Codeunit.al │ │ │ ├── TestObject.Codeunit.al │ │ │ ├── TestObjectWithInitialize.Codeunit.al │ │ │ ├── TestObjectWithUIHandler.Codeunit.al │ │ │ └── UnnumberedTestObject.Codeunit.al │ │ ├── results │ │ │ ├── scenario001.al │ │ │ ├── scenario002.al │ │ │ ├── scenario003.al │ │ │ ├── scenario004.al │ │ │ ├── scenario005.al │ │ │ ├── scenario006.al │ │ │ ├── scenario010.al │ │ │ ├── scenario011.al │ │ │ ├── scenario012.al │ │ │ ├── scenario013.al │ │ │ ├── scenario014.al │ │ │ ├── scenario015.al │ │ │ ├── scenario017.al │ │ │ ├── scenario019.al │ │ │ ├── scenario021.al │ │ │ ├── scenario023.al │ │ │ ├── scenario025.al │ │ │ ├── scenario027.al │ │ │ ├── scenario030.al │ │ │ ├── scenario032.al │ │ │ ├── scenario035.al │ │ │ ├── scenario037.al │ │ │ ├── scenario038.al │ │ │ ├── scenario039.al │ │ │ ├── scenario040.al │ │ │ ├── scenario041.al │ │ │ ├── scenario042.al │ │ │ ├── scenario044.al │ │ │ ├── scenario049.al │ │ │ ├── scenario051.al │ │ │ ├── scenario053.al │ │ │ ├── scenario055.al │ │ │ ├── scenario058.al │ │ │ ├── scenario060.al │ │ │ ├── scenario061.al │ │ │ ├── scenario062.al │ │ │ ├── scenario068.al │ │ │ ├── scenario069.al │ │ │ ├── scenario070.al │ │ │ ├── scenario071.al │ │ │ ├── scenario072.al │ │ │ ├── scenario073.al │ │ │ ├── scenario078.al │ │ │ ├── scenario079.al │ │ │ ├── scenario081.al │ │ │ ├── scenario086.al │ │ │ ├── scenario087.al │ │ │ └── scenario088.al │ │ ├── runTest.ts │ │ └── testHelper.ts │ └── typings │ │ └── types.ts ├── tsconfig.json ├── tslint.json └── webpack.config.js └── web-ui ├── .dockerignore ├── .gitignore ├── .vscode ├── extensions.json ├── launch.json ├── settings.json └── tasks.json ├── Dockerfile ├── README.md ├── aurelia_project ├── aurelia.json ├── environments │ ├── dev.ts │ ├── prod.ts │ └── stage.ts ├── generators │ ├── attribute.json │ ├── attribute.ts │ ├── binding-behavior.json │ ├── binding-behavior.ts │ ├── component.json │ ├── component.ts │ ├── element.json │ ├── element.ts │ ├── generator.json │ ├── generator.ts │ ├── task.json │ ├── task.ts │ ├── value-converter.json │ └── value-converter.ts └── tasks │ ├── build.json │ ├── build.ts │ ├── clear-cache.json │ ├── clear-cache.ts │ ├── copy-files.ts │ ├── css-bundle.ts │ ├── jest.json │ ├── jest.ts │ ├── lint.json │ ├── lint.ts │ ├── process-css.ts │ ├── process-json.ts │ ├── process-markup.ts │ ├── run.json │ ├── run.ts │ ├── test.json │ ├── test.ts │ ├── transpile.ts │ └── watch.ts ├── config ├── environment.json └── environment.production.json ├── docker-compose.yml ├── index.html ├── package.json ├── src ├── app.html ├── app.ts ├── backend │ ├── CommandHandlerService.ts │ ├── commands │ │ ├── DeleteScenarioCommand.ts │ │ ├── ExportCommand.ts │ │ ├── NewFeatureCommand.ts │ │ ├── NewScenarioCommand.ts │ │ └── SaveChangesCommand.ts │ └── connectors │ │ ├── DummyConnector.ts │ │ ├── IBackendConnector.ts │ │ └── VSCodeConnector.ts ├── main.ts ├── resources │ ├── elements │ │ ├── entry-form-group.html │ │ ├── entry-form-group.ts │ │ ├── entry-form.html │ │ ├── entry-form.ts │ │ ├── feature-list.html │ │ ├── feature-list.ts │ │ ├── loader.html │ │ ├── test-list.html │ │ ├── test-list.ts │ │ ├── toolbar.html │ │ └── toolbar.ts │ └── index.ts ├── services │ ├── app-service.ts │ ├── backend-service.ts │ └── deep-observable.ts ├── styles │ ├── bootstrap │ │ ├── _variables.scss │ │ └── bootstrap.min.css │ └── common.less └── types.ts ├── test ├── jest-pretest.ts ├── mock-css.js └── unit │ ├── app.spec.ts │ ├── entry-form-group.spec.ts │ ├── entry-form.spec.ts │ ├── standalone-connector.spec.ts │ ├── test-list.spec.ts │ ├── toolbar.spec.ts │ └── vscode-connector.spec.ts ├── tsconfig.json └── tslint.json /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Result** 21 | A clear and concise description of what the current result is. 22 | 23 | **Expected behavior/result** 24 | A clear and concise description of what you expected to happen and what the result should be. 25 | 26 | **Screenshots** 27 | If applicable, add screenshots or videos to help explain your problem. 28 | 29 | **Additional context** 30 | Add any other context about the problem here. 31 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/04b744265ea0cc8a58016ec42148c18fcb695422/.gitignore -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/04b744265ea0cc8a58016ec42148c18fcb695422/.gitmodules -------------------------------------------------------------------------------- /ATDD.TestScriptor.VSCodeExtension.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "path": "web-ui" 5 | }, 6 | { 7 | "path": "vscode-extension" 8 | }, 9 | { 10 | "path": "services\\middleware" 11 | } 12 | ] 13 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 fluxxus.nl 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /build.ps1: -------------------------------------------------------------------------------- 1 | $targetPlatformWin = "win-x64" 2 | $buildConfiguration = "Release" 3 | 4 | cd "./services/ATDD.TestScriptor.BackendServices" 5 | dotnet publish --configuration $buildConfiguration --output ../../vscode-extension/bin/windows --self-contained -r $targetPlatformWin /p:PublishSingleFile=true /p:PublishTrimmed=true 6 | cd "./../../web-ui" 7 | yarn build 8 | cd "./../vscode-extension" 9 | ((Get-Content -path ./package.json -Raw) -replace '"debugMode": true','"debugMode": false') | Set-Content -Path ./package.json 10 | vsce package -------------------------------------------------------------------------------- /demo/ATTD.TestScriptor.VSCode 20200516.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/04b744265ea0cc8a58016ec42148c18fcb695422/demo/ATTD.TestScriptor.VSCode 20200516.jpg -------------------------------------------------------------------------------- /flowcharts/Use Case (#27) - Adding Given-When-Then.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/04b744265ea0cc8a58016ec42148c18fcb695422/flowcharts/Use Case (#27) - Adding Given-When-Then.jpg -------------------------------------------------------------------------------- /flowcharts/Use Case (#27) - Adding Given-When-Then.vsdx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/04b744265ea0cc8a58016ec42148c18fcb695422/flowcharts/Use Case (#27) - Adding Given-When-Then.vsdx -------------------------------------------------------------------------------- /flowcharts/Use Case (#28) - Removing Given-When-Then.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/04b744265ea0cc8a58016ec42148c18fcb695422/flowcharts/Use Case (#28) - Removing Given-When-Then.jpg -------------------------------------------------------------------------------- /flowcharts/Use Case (#28) - Removing Given-When-Then.vsdx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/04b744265ea0cc8a58016ec42148c18fcb695422/flowcharts/Use Case (#28) - Removing Given-When-Then.vsdx -------------------------------------------------------------------------------- /flowcharts/Use Case (#29) - Moving Given-When-Then.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/04b744265ea0cc8a58016ec42148c18fcb695422/flowcharts/Use Case (#29) - Moving Given-When-Then.jpg -------------------------------------------------------------------------------- /flowcharts/Use Case (#29) - Moving Given-When-Then.vsdx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/04b744265ea0cc8a58016ec42148c18fcb695422/flowcharts/Use Case (#29) - Moving Given-When-Then.vsdx -------------------------------------------------------------------------------- /flowcharts/Use Case (#30) - Updating Given-When-Then.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/04b744265ea0cc8a58016ec42148c18fcb695422/flowcharts/Use Case (#30) - Updating Given-When-Then.jpg -------------------------------------------------------------------------------- /flowcharts/Use Case (#30) - Updating Given-When-Then.vsdx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/04b744265ea0cc8a58016ec42148c18fcb695422/flowcharts/Use Case (#30) - Updating Given-When-Then.vsdx -------------------------------------------------------------------------------- /flowcharts/Use Case (#38) - Adding Scenario.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/04b744265ea0cc8a58016ec42148c18fcb695422/flowcharts/Use Case (#38) - Adding Scenario.jpg -------------------------------------------------------------------------------- /flowcharts/Use Case (#38) - Adding Scenario.vsdx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/04b744265ea0cc8a58016ec42148c18fcb695422/flowcharts/Use Case (#38) - Adding Scenario.vsdx -------------------------------------------------------------------------------- /flowcharts/Use Case (#39) - Removing Scenario.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/04b744265ea0cc8a58016ec42148c18fcb695422/flowcharts/Use Case (#39) - Removing Scenario.jpg -------------------------------------------------------------------------------- /flowcharts/Use Case (#39) - Removing Scenario.vsdx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/04b744265ea0cc8a58016ec42148c18fcb695422/flowcharts/Use Case (#39) - Removing Scenario.vsdx -------------------------------------------------------------------------------- /flowcharts/Use Case (#60) - Updating Scenario.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/04b744265ea0cc8a58016ec42148c18fcb695422/flowcharts/Use Case (#60) - Updating Scenario.jpg -------------------------------------------------------------------------------- /flowcharts/Use Case (#60) - Updating Scenario.vsdx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/04b744265ea0cc8a58016ec42148c18fcb695422/flowcharts/Use Case (#60) - Updating Scenario.vsdx -------------------------------------------------------------------------------- /flowcharts/Use Case (#61) - Adding Feature.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/04b744265ea0cc8a58016ec42148c18fcb695422/flowcharts/Use Case (#61) - Adding Feature.jpg -------------------------------------------------------------------------------- /flowcharts/Use Case (#61) - Adding Feature.vsdx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/04b744265ea0cc8a58016ec42148c18fcb695422/flowcharts/Use Case (#61) - Adding Feature.vsdx -------------------------------------------------------------------------------- /flowcharts/Use Case (#62) - Removing Feature.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/04b744265ea0cc8a58016ec42148c18fcb695422/flowcharts/Use Case (#62) - Removing Feature.jpg -------------------------------------------------------------------------------- /flowcharts/Use Case (#62) - Removing Feature.vsdx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/04b744265ea0cc8a58016ec42148c18fcb695422/flowcharts/Use Case (#62) - Removing Feature.vsdx -------------------------------------------------------------------------------- /flowcharts/Use Case (#65) - Copying Scenario.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/04b744265ea0cc8a58016ec42148c18fcb695422/flowcharts/Use Case (#65) - Copying Scenario.jpg -------------------------------------------------------------------------------- /flowcharts/Use Case (#65) - Copying Scenario.vsdx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/04b744265ea0cc8a58016ec42148c18fcb695422/flowcharts/Use Case (#65) - Copying Scenario.vsdx -------------------------------------------------------------------------------- /media/ATDDEditor.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/04b744265ea0cc8a58016ec42148c18fcb695422/media/ATDDEditor.gif -------------------------------------------------------------------------------- /media/ATDDResizablePanels.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/04b744265ea0cc8a58016ec42148c18fcb695422/media/ATDDResizablePanels.gif -------------------------------------------------------------------------------- /media/ATDDTheming.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/04b744265ea0cc8a58016ec42148c18fcb695422/media/ATDDTheming.gif -------------------------------------------------------------------------------- /media/Communcation Flows.vsdx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/04b744265ea0cc8a58016ec42148c18fcb695422/media/Communcation Flows.vsdx -------------------------------------------------------------------------------- /media/Converting ATDD information.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/04b744265ea0cc8a58016ec42148c18fcb695422/media/Converting ATDD information.gif -------------------------------------------------------------------------------- /media/Opening ATDD.TestScriptor.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/04b744265ea0cc8a58016ec42148c18fcb695422/media/Opening ATDD.TestScriptor.gif -------------------------------------------------------------------------------- /media/homepage.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/04b744265ea0cc8a58016ec42148c18fcb695422/media/homepage.PNG -------------------------------------------------------------------------------- /media/idea.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/04b744265ea0cc8a58016ec42148c18fcb695422/media/idea.png -------------------------------------------------------------------------------- /packages/atdd-testscriptor-0.1.278.vsix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/04b744265ea0cc8a58016ec42148c18fcb695422/packages/atdd-testscriptor-0.1.278.vsix -------------------------------------------------------------------------------- /services/.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # You may want to customise this file depending on your Operating System 3 | # and the editor that you use. 4 | # 5 | # We recommend that you use a Global Gitignore for files that are not related 6 | # to the project. (https://help.github.com/articles/ignoring-files/#create-a-global-gitignore) 7 | 8 | # OS 9 | # 10 | # Ref: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore 11 | # Ref: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore 12 | # Ref: https://github.com/github/gitignore/blob/master/Global/Linux.gitignore 13 | .DS_STORE 14 | Thumbs.db 15 | 16 | # Editors 17 | # 18 | # Ref: https://github.com/github/gitignore/blob/master/Global 19 | # Ref: https://github.com/github/gitignore/blob/master/Global/JetBrains.gitignore 20 | # Ref: https://github.com/github/gitignore/blob/master/Global/VisualStudioCode.gitignore 21 | .idea 22 | .chrome 23 | .vscode/* 24 | !.vscode/settings.json 25 | !.vscode/tasks.json 26 | !.vscode/launch.json 27 | !.vscode/extensions.json 28 | 29 | # Dependencies 30 | node_modules 31 | 32 | # Compiled files 33 | /scripts 34 | /src/environment.js 35 | /src/environment.ts 36 | /dist 37 | /test/coverage-jest 38 | /test/coverage-karma 39 | .vs/ 40 | .config/ 41 | bin/ 42 | obj/ 43 | ATDD.TestScriptor.BackendServices.csproj.user 44 | ATDD.TestScriptor.BackendServices.exe -------------------------------------------------------------------------------- /services/ATDD.TestScriptor.BackendServices/ATDD.TestScriptor.BackendServices.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp3.1 5 | 0.0.4 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /services/ATDD.TestScriptor.BackendServices/Hubs/ATDDHub.cs: -------------------------------------------------------------------------------- 1 | using ATDD.TestScriptor.BackendServices.Models; 2 | using ATDD.TestScriptor.BackendServices.Services; 3 | using ATDD.TestScriptor.Library; 4 | using Microsoft.AspNetCore.SignalR; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Threading.Tasks; 9 | 10 | namespace ATDD.TestScriptor.BackendServices.Hubs 11 | { 12 | public class ATDDHub : Hub 13 | { 14 | protected IALObjectService objectService { get; set; } 15 | 16 | public ATDDHub(IALObjectService alObjectService) 17 | { 18 | objectService = alObjectService; 19 | } 20 | 21 | public async Task QueryProjects(IEnumerable msg) 22 | { 23 | var projects = ALProjectCollector.Discover(msg.ToList()); 24 | 25 | await Clients.All.GetProjects(projects); 26 | } 27 | 28 | public async Task QueryObjects(IEnumerable msg) 29 | { 30 | var result = await objectService.GetTests(msg); 31 | 32 | await Clients.All.GetObjects(result); 33 | } 34 | 35 | public async Task SaveChanges(MessageUpdate msg, Configurations config) 36 | { 37 | objectService.SaveChanges(msg, config); 38 | await Clients.All.SaveChangesResponse(true); 39 | } 40 | public async Task CheckSaveChanges(MessageUpdate msg, Configurations config) 41 | { 42 | bool procedureCanBeRemovedAfterwards = objectService.checkSaveChanges(msg, config); 43 | await Clients.All.CheckSaveChangesResponse(procedureCanBeRemovedAfterwards); 44 | } 45 | 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /services/ATDD.TestScriptor.BackendServices/Hubs/IATDDHub.cs: -------------------------------------------------------------------------------- 1 | using ATDD.TestScriptor.BackendServices.Models; 2 | using ATDD.TestScriptor.Library; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Threading.Tasks; 6 | 7 | namespace ATDD.TestScriptor.BackendServices.Hubs 8 | { 9 | public interface IATDDHub 10 | { 11 | Task GetProjects(IEnumerable msg); 12 | Task GetObjects(IEnumerable msg); 13 | Task SaveChangesResponse(bool response); 14 | Task CheckSaveChangesResponse(bool response); 15 | } 16 | } -------------------------------------------------------------------------------- /services/ATDD.TestScriptor.BackendServices/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace ATDD.TestScriptor.BackendServices 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /services/ATDD.TestScriptor.BackendServices/Properties/PublishProfiles/FolderProfile.pubxml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | FileSystem 9 | FileSystem 10 | Release 11 | Any CPU 12 | 13 | True 14 | False 15 | netcoreapp3.1 16 | 79ff08bb-a4cf-4ce6-8b5e-64f9ee6ed8ad 17 | true 18 | ..\..\vscode-extension\bin\windows 19 | True 20 | win-x64 21 | True 22 | True 23 | False 24 | 25 | -------------------------------------------------------------------------------- /services/ATDD.TestScriptor.BackendServices/Properties/PublishProfiles/FolderProfile_Linux.pubxml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | FileSystem 9 | FileSystem 10 | Release 11 | Any CPU 12 | 13 | True 14 | False 15 | netcoreapp3.1 16 | 79ff08bb-a4cf-4ce6-8b5e-64f9ee6ed8ad 17 | true 18 | ..\..\vscode-extension\bin\linux 19 | True 20 | linux-x64 21 | True 22 | True 23 | False 24 | 25 | -------------------------------------------------------------------------------- /services/ATDD.TestScriptor.BackendServices/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:51561", 7 | "sslPort": 0 8 | } 9 | }, 10 | "$schema": "http://json.schemastore.org/launchsettings.json", 11 | "profiles": { 12 | "IIS Express": { 13 | "commandName": "IISExpress", 14 | "launchBrowser": true, 15 | "environmentVariables": { 16 | "ASPNETCORE_ENVIRONMENT": "Development" 17 | } 18 | }, 19 | "ATDD.TestScriptor.BackendServices": { 20 | "commandName": "Project", 21 | "launchUrl": "weatherforecast", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | }, 25 | "applicationUrl": "http://localhost:5000" 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /services/ATDD.TestScriptor.BackendServices/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /services/ATDD.TestScriptor.BackendServices/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /services/ATDD.TestScriptor.Library/ATDD.TestScriptor.Library.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /services/ATDD.TestScriptor.Library/Helpers/CollectorItemComparer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Text; 5 | 6 | namespace ATDD.TestScriptor.Library 7 | { 8 | public class CollectorItemComparer : IEqualityComparer 9 | { 10 | public bool Equals(CollectorItem x, CollectorItem y) 11 | { 12 | return x.TypeId == y.TypeId && x.Id == y.Id && x.Name == y.Name; 13 | } 14 | 15 | public int GetHashCode(CollectorItem obj) 16 | { 17 | return ($"{obj.TypeId}{obj.Id}{obj.Name}").GetHashCode(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /services/ATDD.TestScriptor.Library/Helpers/FileInfoNameComparer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Text; 5 | 6 | namespace ATDD.TestScriptor.Library 7 | { 8 | public class FileInfoNameComparer : IEqualityComparer 9 | { 10 | public bool Equals(FileInfo x, FileInfo y) 11 | { 12 | return x.Name == y.Name; 13 | } 14 | 15 | public int GetHashCode(FileInfo obj) 16 | { 17 | return ($"{obj.Name}").GetHashCode(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /services/ATDD.TestScriptor.Library/Helpers/TestFeatureComparer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace ATDD.TestScriptor.Library 7 | { 8 | public class TestFeatureComparer : IEqualityComparer 9 | { 10 | public bool Equals(ITestFeature x, ITestFeature y) 11 | { 12 | return x.Name == y.Name && Enumerable.SequenceEqual(x.Scenarios, y.Scenarios, new TestScenarioComparer()); 13 | } 14 | 15 | public int GetHashCode(ITestFeature obj) 16 | { 17 | return (obj.Name).GetHashCode(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /services/ATDD.TestScriptor.Library/Helpers/TestFeatureNameComparer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace ATDD.TestScriptor.Library 7 | { 8 | public class TestFeatureNameComparer : IEqualityComparer 9 | { 10 | public bool Equals(ITestFeature x, ITestFeature y) 11 | { 12 | return x.Name == y.Name; 13 | } 14 | 15 | public int GetHashCode(ITestFeature obj) 16 | { 17 | return (obj.Name).GetHashCode(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /services/ATDD.TestScriptor.Library/Helpers/TestScenarioComparer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace ATDD.TestScriptor.Library 7 | { 8 | public class TestScenarioComparer : IEqualityComparer 9 | { 10 | public bool Equals(ITestScenario x, ITestScenario y) 11 | { 12 | return x.Name == y.Name && x.ID == y.ID && Enumerable.SequenceEqual(x.Elements, y.Elements, new TestScenarioElementComparer()); 13 | } 14 | 15 | public int GetHashCode(ITestScenario obj) 16 | { 17 | return ($"{obj.ID}{obj.Name}").GetHashCode(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /services/ATDD.TestScriptor.Library/Helpers/TestScenarioElementComparer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace ATDD.TestScriptor.Library 6 | { 7 | public class TestScenarioElementComparer : IEqualityComparer 8 | { 9 | public bool Equals(ITestScenarioElement x, ITestScenarioElement y) 10 | { 11 | return x.Type == y.Type && x.Value == y.Value; 12 | } 13 | 14 | public int GetHashCode(ITestScenarioElement obj) 15 | { 16 | return ($"{obj.Type}{obj.Value}").GetHashCode(); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /services/ATDD.TestScriptor.Library/Helpers/TestScenarioIDComparer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace ATDD.TestScriptor.Library 7 | { 8 | public class TestScenarioIDComparer : IEqualityComparer 9 | { 10 | public bool Equals(ITestScenario x, ITestScenario y) 11 | { 12 | return x.ID == y.ID; 13 | } 14 | 15 | public int GetHashCode(ITestScenario obj) 16 | { 17 | return ($"{obj.ID}{obj.Name}").GetHashCode(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /services/ATDD.TestScriptor.Library/Models/ALParserConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace ATDD.TestScriptor.Library 6 | { 7 | public class ALParserConfig 8 | { 9 | public ALParserConfig() 10 | { 11 | GivenFunctionPrefix = "Create"; 12 | WhenFunctionPrefix = "Assign"; 13 | ThenFunctionPrefix = "Verify"; 14 | } 15 | 16 | public int CodeunitId { get; set; } 17 | public string CodeunitName { get; set; } 18 | public string FilePath { get; set; } 19 | public bool InitializeFunction { get; set; } 20 | public string GivenFunctionPrefix { get; set; } 21 | public string WhenFunctionPrefix { get; set; } 22 | public string ThenFunctionPrefix { get; set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /services/ATDD.TestScriptor.Library/Models/ALProject.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace ATDD.TestScriptor.Library 6 | { 7 | public class ALProject 8 | { 9 | public Guid id { get; set; } 10 | public string name { get; set; } 11 | public string publisher { get; set; } 12 | public IEnumerable supportedLocales { get; set; } 13 | public Version? application { get; set; } 14 | public Version? platform { get; set; } 15 | public Version version { get; set; } 16 | public string runtime { get; set; } 17 | 18 | public string FilePath { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /services/ATDD.TestScriptor.Library/Models/CollectorItem.cs: -------------------------------------------------------------------------------- 1 | using ALObjectParser.Library; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace ATDD.TestScriptor.Library 7 | { 8 | public class CollectorItem 9 | { 10 | public CollectorItem() 11 | { 12 | } 13 | 14 | public ALObjectParser.ALObjectType TypeId { get; set; } 15 | public string Type { get; set; } 16 | public int? Id { get; set; } 17 | public string Name { get; set; } 18 | public string TargetObject { get; set; } 19 | public string Application { get; set; } 20 | public string Publisher { get; set; } 21 | public string Version { get; set; } 22 | public string FsPath { get; set; } 23 | public SymbolData SymbolData { get; set; } 24 | public IALObject Symbol { get; set; } 25 | public bool IsLocal { get; set; } 26 | public string ProjectPath { get; set; } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /services/ATDD.TestScriptor.Library/Models/SymbolData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace ATDD.TestScriptor.Library 6 | { 7 | public class SymbolData 8 | { 9 | public string Path { get; set; } 10 | public ALObjectParser.ALObjectType Type { get; set; } 11 | public int Index { get; set; } 12 | public string Name { get; set; } 13 | public string SymbolZipName { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /services/ATDD.TestScriptor.Library/Models/SymbolReference.cs: -------------------------------------------------------------------------------- 1 | using ALObjectParser.Library; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace ATDD.TestScriptor.Library 7 | { 8 | public class SymbolReference 9 | { 10 | public SymbolReference() 11 | { 12 | Codeunits = new List(); 13 | Symbols = new List(); 14 | } 15 | 16 | public Guid AppId { get; set; } 17 | public string Name { get; set; } 18 | public string Publisher { get; set; } 19 | public Version Version { get; set; } 20 | public IEnumerable Codeunits { get; set; } 21 | public string Path { get; set; } 22 | public List Symbols { get; set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /services/ATDD.TestScriptor.Library/Models/SymbolReferenceInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Text; 5 | 6 | namespace ATDD.TestScriptor.Library 7 | { 8 | public class SymbolReferenceInfo 9 | { 10 | public string Name { get; set; } 11 | public string FullPath { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /services/ATDD.TestScriptor.Library/Models/TestALCodeunit.cs: -------------------------------------------------------------------------------- 1 | using ALObjectParser.Library; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | 7 | namespace ATDD.TestScriptor.Library 8 | { 9 | public class TestALCodeunit : ALCodeunit 10 | { 11 | public TestALCodeunit() : base() 12 | { 13 | 14 | } 15 | 16 | public new List Methods { get; set; } 17 | public List Features { get; set; } 18 | 19 | public List getMethodsByName(string methodName) 20 | { 21 | return this.Methods.Where(method => method.Name.ToLower().Equals(methodName.ToLower())).ToList(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /services/ATDD.TestScriptor.Library/Models/TestALMethod.cs: -------------------------------------------------------------------------------- 1 | using ALObjectParser.Library; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace ATDD.TestScriptor.Library 7 | { 8 | public class TestALMethod : ALMethod 9 | { 10 | public ITestScenario Scenario { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /services/ATDD.TestScriptor.Library/Models/TestFeature.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace ATDD.TestScriptor.Library 6 | { 7 | public class TestFeature : ITestFeature 8 | { 9 | public TestFeature() 10 | { 11 | Scenarios = new List(); 12 | } 13 | 14 | public string Name { get; set; } 15 | 16 | public ICollection Scenarios { get; set; } 17 | } 18 | 19 | public interface ITestFeature 20 | { 21 | string Name { get; set; } 22 | 23 | ICollection Scenarios { get; set; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /services/ATDD.TestScriptor.Library/Models/TestScenario.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace ATDD.TestScriptor.Library 6 | { 7 | /// 8 | /// Test Scenario object 9 | /// 10 | public class TestScenario : ITestScenario 11 | { 12 | /// 13 | /// Default constructor 14 | /// 15 | public TestScenario() 16 | { 17 | Elements = new List(); 18 | } 19 | 20 | public int ID { get; set; } 21 | public string Name { get; set; } 22 | public string MethodName { get; set; } 23 | public ITestFeature Feature { get; set; } 24 | public ICollection Elements { get; set; } 25 | } 26 | 27 | public interface ITestScenario 28 | { 29 | int ID { get; set; } 30 | string Name { get; set; } 31 | string MethodName { get; set; } 32 | ITestFeature Feature { get; set; } 33 | ICollection Elements { get; set; } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /services/ATDD.TestScriptor.Library/Models/TestScenarioElement.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace ATDD.TestScriptor.Library 6 | { 7 | public class TestScenarioElement : ITestScenarioElement 8 | { 9 | public ScenarioElementType Type { get; set; } 10 | public string Value { get; set; } 11 | public string LineText { get; set; } 12 | 13 | public string getMethodName() 14 | { 15 | return ALMethodHelper.GetProcedurename(Type, Value, "", "", ""); //TODO: Get config 16 | } 17 | } 18 | 19 | public enum ScenarioElementType 20 | { 21 | FEATURE = 0, 22 | SCENARIO, 23 | GIVEN, 24 | WHEN, 25 | THEN 26 | } 27 | 28 | public interface ITestScenarioElement 29 | { 30 | ScenarioElementType Type { get; set; } 31 | string Value { get; set; } 32 | string LineText { get; set; } 33 | 34 | string getMethodName(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /test/ATTDTestScriptor test-project.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "path": "test-project" 5 | }, 6 | { 7 | "path": "test-project - no tags" 8 | } 9 | ], 10 | "settings": { 11 | // "atddTestScriptor.maxLengthOfDescription": 10 12 | // "atddTestScriptor.prefixGiven": "Make", 13 | // "atddTestScriptor.prefixGivenHistory": ["Create"] 14 | // "atddTestScriptor.prefixThen": "Check", 15 | // "atddTestScriptor.prefixThenHistory": ["Verify"] 16 | // "atddTestScriptor.addException": false 17 | } 18 | } -------------------------------------------------------------------------------- /test/test-project - no tags/.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignores generated binary files and temporary files from Visual Studio and Visual Studio code 2 | 3 | # Binary files 4 | .alpackages/ 5 | *.app 6 | 7 | # Temp files 8 | **//.vs/ 9 | **/.vscode/** 10 | !**/.vscode/settings.json -------------------------------------------------------------------------------- /test/test-project - no tags/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "CRS.ObjectNameSuffix": "FLX", 3 | "CRS.FileNamePattern": "..al", 4 | "CRS.FileNamePatternExtensions": "..al", 5 | "CRS.ExtensionObjectNamePattern": "", 6 | "CRS.RemoveSuffixFromFilename": true 7 | } -------------------------------------------------------------------------------- /test/test-project - no tags/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "40b76ed1-4750-403b-8dcd-587c05d41983", 3 | "name": "Test Project - No Tags", 4 | "publisher": "fluxxus.nl", 5 | "version": "1.0.0.0", 6 | "brief": "ATDD.TestScriptor.VSCodeExtension test project that has no ATDD tags", 7 | "description": "VSCode project to test ATDD.TestScriptor.VSCodeExtension", 8 | "privacyStatement": "", 9 | "EULA": "", 10 | "help": "https://github.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension", 11 | "url": "http://www.fluxxus.nl", 12 | "logo": "images/logo.png", 13 | "screenshots": [], 14 | "platform": "16.0.0.0", 15 | "application": "16.0.0.0", 16 | "dependencies": [ 17 | { 18 | "id": "5d86850b-0d76-4eca-bd7b-951ad998e997", 19 | "name": "Tests-TestLibraries", 20 | "publisher": "Microsoft", 21 | "version": "16.0.0.0" 22 | } 23 | ], 24 | "idRanges": [ 25 | { 26 | "from": 50200, 27 | "to": 50249 28 | } 29 | ], 30 | "contextSensitiveHelpUrl": "https://TestProject.com/help/", 31 | "showMyCode": true, 32 | "runtime": "5.0" 33 | } -------------------------------------------------------------------------------- /test/test-project - no tags/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/04b744265ea0cc8a58016ec42148c18fcb695422/test/test-project - no tags/images/logo.png -------------------------------------------------------------------------------- /test/test-project - no tags/test/FirstTestObject.Codeunit.al: -------------------------------------------------------------------------------- 1 | codeunit 50200 "FirstTestObjectFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | end; 8 | 9 | [Test] 10 | procedure FirstTestFunction() 11 | begin 12 | CreateValidGiven(); 13 | ValidWhen(); 14 | VerifyValidThen(); 15 | end; 16 | 17 | local procedure CreateValidGiven() 18 | begin 19 | Error('Procedure CreateValidGiven not yet implemented.'); 20 | end; 21 | 22 | local procedure ValidWhen() 23 | begin 24 | Error('Procedure ValidWhen not yet implemented.'); 25 | end; 26 | 27 | local procedure VerifyValidThen() 28 | begin 29 | Error('Procedure VerifyValidThen not yet implemented.'); 30 | end; 31 | } -------------------------------------------------------------------------------- /test/test-project - no tags/test/FourthTestObjectUIHandler.Codeunit.al: -------------------------------------------------------------------------------- 1 | codeunit 50204 "FourthTestObjectUIHandlerFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | end; 8 | 9 | [Test] 10 | [HandlerFunctions('AMessageHandler')] 11 | procedure FifthTestFunctionWithUIHandler() 12 | begin 13 | Initialize(); 14 | CreateValidGiven(); 15 | ValidWhen(); 16 | VerifyValidThen(); 17 | end; 18 | 19 | local procedure Initialize() 20 | var 21 | LibraryTestInitialize: Codeunit "Library - Test Initialize"; 22 | begin 23 | LibraryTestInitialize.OnTestInitialize(Codeunit::FourthTestObjectUIHandlerFLX); 24 | 25 | if IsInitialized then 26 | exit; 27 | 28 | LibraryTestInitialize.OnBeforeTestSuiteInitialize(Codeunit::FourthTestObjectUIHandlerFLX); 29 | 30 | IsInitialized := true; 31 | Commit(); 32 | 33 | LibraryTestInitialize.OnAfterTestSuiteInitialize(Codeunit::FourthTestObjectUIHandlerFLX); 34 | end; 35 | 36 | local procedure CreateValidGiven() 37 | begin 38 | Error('Procedure CreateValidGiven not yet implemented.'); 39 | end; 40 | 41 | local procedure ValidWhen() 42 | begin 43 | Error('Procedure ValidWhen not yet implemented.'); 44 | end; 45 | 46 | local procedure VerifyValidThen() 47 | begin 48 | Error('Procedure VerifyValidThen not yet implemented.'); 49 | end; 50 | 51 | [MessageHandler] 52 | procedure AMessageHandler(Msg: Text) 53 | begin 54 | end; 55 | 56 | var 57 | IsInitialized: Boolean; 58 | } -------------------------------------------------------------------------------- /test/test-project - no tags/test/SecondTestObject.Codeunit.al: -------------------------------------------------------------------------------- 1 | codeunit 50201 "SecondTestObjectFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | end; 8 | 9 | [Test] 10 | procedure SecondTestFunction() 11 | begin 12 | CreateValidGiven(); 13 | ValidWhen(); 14 | VerifyValidThen(); 15 | end; 16 | 17 | [Test] 18 | procedure ThirdTestFunction() 19 | begin 20 | CreateValidGiven(); 21 | ValidWhen(); 22 | VerifyValidThen(); 23 | end; 24 | 25 | local procedure CreateValidGiven() 26 | begin 27 | Error('Procedure CreateValidGiven not yet implemented.'); 28 | end; 29 | 30 | local procedure ValidWhen() 31 | begin 32 | Error('Procedure ValidWhen not yet implemented.'); 33 | end; 34 | 35 | local procedure VerifyValidThen() 36 | begin 37 | Error('Procedure VerifyValidThen not yet implemented.'); 38 | end; 39 | } -------------------------------------------------------------------------------- /test/test-project - no tags/test/ThirdTestObjectInitialize.Codeunit.al: -------------------------------------------------------------------------------- 1 | codeunit 50203 "ThirdTestObjectInitializeFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | end; 8 | 9 | [Test] 10 | procedure FourthTestFunctionWithInitialize() 11 | begin 12 | Initialize(); 13 | CreateValidGiven(); 14 | ValidWhen(); 15 | VerifyValidThen(); 16 | end; 17 | 18 | local procedure Initialize() 19 | var 20 | LibraryTestInitialize: Codeunit "Library - Test Initialize"; 21 | begin 22 | LibraryTestInitialize.OnTestInitialize(Codeunit::ThirdTestObjectInitializeFLX); 23 | 24 | if IsInitialized then 25 | exit; 26 | 27 | LibraryTestInitialize.OnBeforeTestSuiteInitialize(Codeunit::ThirdTestObjectInitializeFLX); 28 | 29 | IsInitialized := true; 30 | Commit(); 31 | 32 | LibraryTestInitialize.OnAfterTestSuiteInitialize(Codeunit::ThirdTestObjectInitializeFLX); 33 | end; 34 | 35 | local procedure CreateValidGiven() 36 | begin 37 | Error('Procedure CreateValidGiven not yet implemented.'); 38 | end; 39 | 40 | local procedure ValidWhen() 41 | begin 42 | Error('Procedure ValidWhen not yet implemented.'); 43 | end; 44 | 45 | local procedure VerifyValidThen() 46 | begin 47 | Error('Procedure VerifyValidThen not yet implemented.'); 48 | end; 49 | 50 | var 51 | IsInitialized: Boolean; 52 | } -------------------------------------------------------------------------------- /test/test-project/.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignores generated binary files and temporary files from Visual Studio and Visual Studio code 2 | 3 | # Binary files 4 | .alpackages/ 5 | *.app 6 | 7 | # Temp files 8 | **//.vs/ 9 | **/.vscode/** 10 | !**/.vscode/settings.json -------------------------------------------------------------------------------- /test/test-project/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "CRS.ObjectNameSuffix": "FLX", 3 | "CRS.FileNamePattern": "..al", 4 | "CRS.FileNamePatternExtensions": "..al", 5 | "CRS.ExtensionObjectNamePattern": "", 6 | "CRS.RemoveSuffixFromFilename": true 7 | } -------------------------------------------------------------------------------- /test/test-project/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "2d359ec2-844b-4380-9529-0c73279b176d", 3 | "name": "Test Project", 4 | "publisher": "fluxxus.nl", 5 | "version": "1.0.0.0", 6 | "brief": "ATDD.TestScriptor.VSCodeExtension test project", 7 | "description": "VSCode project to test ATDD.TestScriptor.VSCodeExtension", 8 | "privacyStatement": "", 9 | "EULA": "", 10 | "help": "https://github.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension", 11 | "url": "http://www.fluxxus.nl", 12 | "logo": "images/logo.png", 13 | "screenshots": [], 14 | "platform": "16.0.0.0", 15 | "application": "16.0.0.0", 16 | "dependencies": [ 17 | { 18 | "id": "5d86850b-0d76-4eca-bd7b-951ad998e997", 19 | "name": "Tests-TestLibraries", 20 | "publisher": "Microsoft", 21 | "version": "16.0.0.0" 22 | } 23 | ], 24 | "idRanges": [ 25 | { 26 | "from": 50100, 27 | "to": 50149 28 | } 29 | ], 30 | "contextSensitiveHelpUrl": "https://TestProject.com/help/", 31 | "showMyCode": true, 32 | "runtime": "5.0" 33 | } -------------------------------------------------------------------------------- /test/test-project/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/04b744265ea0cc8a58016ec42148c18fcb695422/test/test-project/images/logo.png -------------------------------------------------------------------------------- /test/test-project/test/DuplicateTestObject.Codeunit.al: -------------------------------------------------------------------------------- 1 | codeunit 50101 "DuplicateTestObjectFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] Duplicate test object 8 | end; 9 | 10 | [Test] 11 | procedure SecondTestFunctionWithValidGivenWhenThenStructure() 12 | // [FEATURE] Duplicate test object 13 | begin 14 | // [SCENARIO 0002] Second test function with valid Given-When-Then structure 15 | // [Given] Valid Given 16 | CreateValidGiven(); 17 | // [When] Valid When 18 | ValidWhen(); 19 | // [Then] Valid Then 20 | VerifyValidThen(); 21 | end; 22 | 23 | [Test] 24 | procedure ThirdTestFunctionWithValidGivenWhenThenStructure() 25 | // [FEATURE] Duplicate test object 26 | begin 27 | // [SCENARIO 0003] Third test function with valid Given-When-Then structure 28 | // [Given] Valid Given 29 | CreateValidGiven(); 30 | // [When] Valid When 31 | ValidWhen(); 32 | // [Then] Valid Then 33 | VerifyValidThen(); 34 | end; 35 | 36 | local procedure CreateValidGiven() 37 | begin 38 | Error('Procedure CreateValidGiven not yet implemented.'); 39 | end; 40 | 41 | local procedure ValidWhen() 42 | begin 43 | Error('Procedure ValidWhen not yet implemented.'); 44 | end; 45 | 46 | local procedure VerifyValidThen() 47 | begin 48 | Error('Procedure VerifyValidThen not yet implemented.'); 49 | end; 50 | } -------------------------------------------------------------------------------- /test/test-project/test/DuplicateTestObject2.Codeunit.al: -------------------------------------------------------------------------------- 1 | codeunit 50106 "DuplicateTestObject_2FLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] Duplicate test object 8 | // [FEATURE] Some other feature 9 | end; 10 | 11 | [Test] 12 | procedure TwelfthTestFunctionWithValidGivenWhenThenStructure() 13 | // [FEATURE] Duplicate test object 14 | begin 15 | // [SCENARIO 0012] Twelfth test function with valid Given-When-Then structure 16 | // [Given] Valid Given 17 | CreateValidGiven(); 18 | // [When] Valid When 19 | ValidWhen(); 20 | // [Then] Valid Then 21 | VerifyValidThen(); 22 | end; 23 | 24 | [Test] 25 | procedure ThirdteenthTestFunctionWithValidGivenWhenThenStructure() 26 | // [FEATURE] Some other feature 27 | begin 28 | // [SCENARIO 0013] Thirdteenth test function with valid Given-When-Then structure 29 | // [Given] Valid Given 30 | CreateValidGiven(); 31 | // [When] Valid When 32 | ValidWhen(); 33 | // [Then] Valid Then 34 | VerifyValidThen(); 35 | end; 36 | 37 | local procedure CreateValidGiven() 38 | begin 39 | Error('Procedure CreateValidGiven not yet implemented.'); 40 | end; 41 | 42 | local procedure ValidWhen() 43 | begin 44 | Error('Procedure ValidWhen not yet implemented.'); 45 | end; 46 | 47 | local procedure VerifyValidThen() 48 | begin 49 | Error('Procedure VerifyValidThen not yet implemented.'); 50 | end; 51 | } -------------------------------------------------------------------------------- /test/test-project/test/TestObject.Codeunit.al: -------------------------------------------------------------------------------- 1 | codeunit 50100 "TestObjectFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] First test object 8 | end; 9 | 10 | [Test] 11 | procedure FirstTestFunctionWithValidGivenWhenThenStructure() 12 | // [FEATURE] First test object 13 | begin 14 | // [SCENARIO 0001] First test function with valid Given-When-Then structure 15 | // [GIVEN] Valid Given 16 | CreateValidGiven(); 17 | // [WHEN] Valid When 18 | ValidWhen(); 19 | // [THEN] Valid Then 20 | VerifyValidThen(); 21 | end; 22 | 23 | local procedure CreateValidGiven() 24 | begin 25 | Error('Procedure CreateValidGiven not yet implemented.'); 26 | end; 27 | 28 | local procedure ValidWhen() 29 | begin 30 | Error('Procedure ValidWhen not yet implemented.'); 31 | end; 32 | 33 | local procedure VerifyValidThen() 34 | begin 35 | Error('Procedure VerifyValidThen not yet implemented.'); 36 | end; 37 | } -------------------------------------------------------------------------------- /test/test-project/test/TestObject1WithSameFeature.Codeunit.al: -------------------------------------------------------------------------------- 1 | codeunit 50107 "TestObject1WithSameFeatureFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] Same Feature 8 | end; 9 | 10 | [Test] 11 | procedure TestFunction11() 12 | // [FEATURE] Same Feature 13 | begin 14 | // [SCENARIO 0011] Test function 11 15 | // [Given] Valid Given 16 | CreateValidGiven(); 17 | // [When] Valid When 18 | ValidWhen(); 19 | // [Then] Valid Then 20 | VerifyValidThen(); 21 | end; 22 | 23 | [Test] 24 | procedure TestFunction12() 25 | // [FEATURE] Same Feature 26 | begin 27 | // [SCENARIO 0012] Test function 12 28 | // [Given] Valid Given 29 | CreateValidGiven_2(); 30 | // [When] Valid When 31 | ValidWhen_2(); 32 | // [Then] Valid Then 33 | VerifyValidThen_2(); 34 | end; 35 | 36 | local procedure CreateValidGiven() 37 | begin 38 | Error('Procedure CreateValidGiven not yet implemented.'); 39 | end; 40 | 41 | local procedure ValidWhen() 42 | begin 43 | Error('Procedure ValidWhen not yet implemented.'); 44 | end; 45 | 46 | local procedure VerifyValidThen() 47 | begin 48 | Error('Procedure VerifyValidThen not yet implemented.'); 49 | end; 50 | 51 | local procedure CreateValidGiven_2() 52 | begin 53 | Error('Procedure CreateValidGiven not yet implemented.'); 54 | end; 55 | 56 | local procedure ValidWhen_2() 57 | begin 58 | Error('Procedure ValidWhen not yet implemented.'); 59 | end; 60 | 61 | local procedure VerifyValidThen_2() 62 | begin 63 | Error('Procedure VerifyValidThen not yet implemented.'); 64 | end; 65 | } -------------------------------------------------------------------------------- /test/test-project/test/TestObject2WithSameFeature.Codeunit.al: -------------------------------------------------------------------------------- 1 | codeunit 50108 "TestObject2WithSameFeatureFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] Same Feature 8 | end; 9 | 10 | [Test] 11 | procedure TestFunction21() 12 | // [FEATURE] Same Feature 13 | begin 14 | // [SCENARIO 0021] Test function 21 15 | // [Given] Valid Given 16 | CreateValidGiven(); 17 | // [When] Valid When 18 | ValidWhen(); 19 | // [Then] Valid Then 20 | VerifyValidThen(); 21 | end; 22 | 23 | local procedure CreateValidGiven() 24 | begin 25 | Error('Procedure CreateValidGiven not yet implemented.'); 26 | end; 27 | 28 | local procedure ValidWhen() 29 | begin 30 | Error('Procedure ValidWhen not yet implemented.'); 31 | end; 32 | 33 | local procedure VerifyValidThen() 34 | begin 35 | Error('Procedure VerifyValidThen not yet implemented.'); 36 | end; 37 | } -------------------------------------------------------------------------------- /test/test-project/test/TestObjectHoleInScenarioNos.Codeunit.al: -------------------------------------------------------------------------------- 1 | codeunit 50109 "TestObjectHoleInScenarioNosFLX" 2 | { 3 | Subtype = Test; 4 | 5 | var 6 | IsInitialized: Boolean; 7 | 8 | trigger OnRun() 9 | begin 10 | // [FEATURE] Feature 11 | end; 12 | 13 | [Test] 14 | procedure TestFunctionForScenario1() 15 | // [FEATURE] Feature 16 | begin 17 | // [SCENARIO 0001] Test function for scenario 1 18 | Initialize(); 19 | end; 20 | 21 | [Test] 22 | procedure TestFunctionorScenario3() 23 | // [FEATURE] Feature 24 | begin 25 | // [SCENARIO 0003] Test function for scenario 3 26 | Initialize(); 27 | end; 28 | 29 | local procedure Initialize() 30 | var 31 | LibraryTestInitialize: Codeunit "Library - Test Initialize"; 32 | begin 33 | LibraryTestInitialize.OnTestInitialize(Codeunit::"TestObjectHoleInScenarioNosFLX"); 34 | 35 | if IsInitialized then 36 | exit; 37 | 38 | LibraryTestInitialize.OnBeforeTestSuiteInitialize(Codeunit::"TestObjectHoleInScenarioNosFLX"); 39 | 40 | IsInitialized := true; 41 | Commit(); 42 | 43 | LibraryTestInitialize.OnAfterTestSuiteInitialize(Codeunit::"TestObjectHoleInScenarioNosFLX"); 44 | end; 45 | } -------------------------------------------------------------------------------- /test/test-project/test/TestObjectWithInitialize.Codeunit.al: -------------------------------------------------------------------------------- 1 | codeunit 50103 "TestObjectWithInitializeFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] Test object with Initialize 8 | end; 9 | 10 | [Test] 11 | procedure FourthTestFunctionWithValidGivenWhenThenStructureAndInitialize() 12 | // [FEATURE] Test object with Initialize 13 | begin 14 | // [SCENARIO 0004] Fourth test function with valid Given-When-Then structure and Initialize 15 | Initialize(); 16 | // [GIVEN] Valid Given 17 | CreateValidGiven(); 18 | // [WHEN] Valid When 19 | ValidWhen(); 20 | // [THEN] Valid Then 21 | VerifyValidThen(); 22 | end; 23 | 24 | local procedure Initialize() 25 | var 26 | LibraryTestInitialize: Codeunit "Library - Test Initialize"; 27 | begin 28 | LibraryTestInitialize.OnTestInitialize(Codeunit::"TestObjectWithInitializeFLX"); 29 | 30 | if IsInitialized then 31 | exit; 32 | 33 | LibraryTestInitialize.OnBeforeTestSuiteInitialize(Codeunit::"TestObjectWithInitializeFLX"); 34 | 35 | IsInitialized := true; 36 | Commit(); 37 | 38 | LibraryTestInitialize.OnAfterTestSuiteInitialize(Codeunit::"TestObjectWithInitializeFLX"); 39 | end; 40 | 41 | local procedure CreateValidGiven() 42 | begin 43 | Error('Procedure CreateValidGiven not yet implemented.'); 44 | end; 45 | 46 | local procedure ValidWhen() 47 | begin 48 | Error('Procedure ValidWhen not yet implemented.'); 49 | end; 50 | 51 | local procedure VerifyValidThen() 52 | begin 53 | Error('Procedure VerifyValidThen not yet implemented.'); 54 | end; 55 | 56 | var 57 | IsInitialized: Boolean; 58 | } -------------------------------------------------------------------------------- /test/test-project/test/TestObjectWithUIHandler.Codeunit.al: -------------------------------------------------------------------------------- 1 | codeunit 50104 "TestObjectWithUIHandlerFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] Test object with UI Handler 8 | end; 9 | 10 | [Test] 11 | [HandlerFunctions('AMessageHandler')] 12 | procedure FifthTestFunctionWithValidGivenWhenThenStructureAndUIHandler() 13 | // [FEATURE] Test object with UI Handler 14 | begin 15 | // [SCENARIO 0005] Fifth test function with valid Given-When-Then structure and UI handler 16 | Initialize(); 17 | // [GIVEN] Valid Given 18 | CreateValidGiven(); 19 | // [WHEN] Valid When 20 | ValidWhen(); 21 | // [THEN] Valid Then 22 | VerifyValidThen(); 23 | end; 24 | 25 | local procedure Initialize() 26 | var 27 | LibraryTestInitialize: Codeunit "Library - Test Initialize"; 28 | begin 29 | LibraryTestInitialize.OnTestInitialize(Codeunit::"TestObjectWithInitializeFLX"); 30 | 31 | if IsInitialized then 32 | exit; 33 | 34 | LibraryTestInitialize.OnBeforeTestSuiteInitialize(Codeunit::"TestObjectWithInitializeFLX"); 35 | 36 | IsInitialized := true; 37 | Commit(); 38 | 39 | LibraryTestInitialize.OnAfterTestSuiteInitialize(Codeunit::"TestObjectWithInitializeFLX"); 40 | end; 41 | 42 | local procedure CreateValidGiven() 43 | begin 44 | Error('Procedure CreateValidGiven not yet implemented.'); 45 | end; 46 | 47 | local procedure ValidWhen() 48 | begin 49 | Error('Procedure ValidWhen not yet implemented.'); 50 | end; 51 | 52 | local procedure VerifyValidThen() 53 | begin 54 | Error('Procedure VerifyValidThen not yet implemented.'); 55 | end; 56 | 57 | [MessageHandler] 58 | procedure AMessageHandler(Msg: Text) 59 | begin 60 | end; 61 | 62 | var 63 | IsInitialized: Boolean; 64 | } -------------------------------------------------------------------------------- /test/test-scenarios/atdd-test-results-archive.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/04b744265ea0cc8a58016ec42148c18fcb695422/test/test-scenarios/atdd-test-results-archive.xlsx -------------------------------------------------------------------------------- /test/test-scenarios/atdd-test-scenarios-and-results.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/04b744265ea0cc8a58016ec42148c18fcb695422/test/test-scenarios/atdd-test-scenarios-and-results.xlsx -------------------------------------------------------------------------------- /vscode-extension/.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # You may want to customise this file depending on your Operating System 3 | # and the editor that you use. 4 | # 5 | # We recommend that you use a Global Gitignore for files that are not related 6 | # to the project. (https://help.github.com/articles/ignoring-files/#create-a-global-gitignore) 7 | 8 | # OS 9 | # 10 | # Ref: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore 11 | # Ref: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore 12 | # Ref: https://github.com/github/gitignore/blob/master/Global/Linux.gitignore 13 | .DS_STORE 14 | Thumbs.db 15 | 16 | # Editors 17 | # 18 | # Ref: https://github.com/github/gitignore/blob/master/Global 19 | # Ref: https://github.com/github/gitignore/blob/master/Global/JetBrains.gitignore 20 | # Ref: https://github.com/github/gitignore/blob/master/Global/VisualStudioCode.gitignore 21 | .idea 22 | .chrome 23 | out 24 | .vscode-test/* 25 | .vscode/* 26 | !.vscode/settings.json 27 | !.vscode/tasks.json 28 | !.vscode/launch.json 29 | !.vscode/extensions.json 30 | *.js 31 | *.js.map 32 | 33 | # Dependencies 34 | node_modules 35 | package-lock.json 36 | yarn.lock 37 | 38 | # Compiled files 39 | /scripts 40 | /src/environment.js 41 | /src/environment.ts 42 | /dist 43 | /test/coverage-jest 44 | /test/coverage-karma 45 | bin/ 46 | *.lock 47 | *.vsix -------------------------------------------------------------------------------- /vscode-extension/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // See http://go.microsoft.com/fwlink/?LinkId=827846 3 | // for the documentation about the extensions.json format 4 | "recommendations": [ 5 | "eg2.tslint" 6 | ] 7 | } -------------------------------------------------------------------------------- /vscode-extension/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | // A launch configuration that compiles the extension and then opens it inside a new window 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | { 6 | "version": "0.2.0", 7 | "configurations": [ 8 | { 9 | "name": "Extension", 10 | "type": "extensionHost", 11 | "request": "launch", 12 | "runtimeExecutable": "${execPath}", 13 | "args": [ 14 | "--extensionDevelopmentPath=${workspaceFolder}" 15 | ], 16 | "outFiles": [ 17 | "${workspaceFolder}/out/**/*.js" 18 | ], 19 | "preLaunchTask": "npm: compile", 20 | "skipFiles": [ 21 | "${workspaceFolder}/node_modules/**/*.js", 22 | "${workspaceFolder}/lib/**/*.js", 23 | "/**/*.js", 24 | "**/extensionHostProcess.js" 25 | ] 26 | }, 27 | { 28 | "name": "Extension Tests", 29 | "type": "extensionHost", 30 | "request": "launch", 31 | "runtimeExecutable": "${execPath}", 32 | "args": [ 33 | "${workspaceFolder}/../test/test-project", //load test-project 34 | // "${workspaceFolder}/../../Test-Automation-Examples/VSCode/Blocking Deletion of Warehouse Shipment Lines/Blocking Deletion of Warehouse Shipment Lines.code-workspace", //load test-project 35 | "--extensionDevelopmentPath=${workspaceFolder}", 36 | "--extensionTestsPath=${workspaceFolder}/out/test" 37 | ], 38 | "outFiles": [ 39 | "${workspaceFolder}/out/test/**/*.js" 40 | ], 41 | "preLaunchTask": "npm: watch" 42 | } 43 | ] 44 | } -------------------------------------------------------------------------------- /vscode-extension/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | // Place your settings in this file to overwrite default and user settings. 2 | { 3 | "files.exclude": { 4 | "out": false // set this to true to hide the "out" folder with the compiled JS files 5 | }, 6 | "search.exclude": { 7 | "out": true // set this to false to include "out" folder in search results 8 | }, 9 | // Turn off tsc task auto detection since we have the necessary tasks as npm scripts 10 | "typescript.tsc.autoDetect": "off" 11 | } -------------------------------------------------------------------------------- /vscode-extension/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | // See https://go.microsoft.com/fwlink/?LinkId=733558 2 | // for the documentation about the tasks.json format 3 | { 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "type": "npm", 8 | "script": "watch", 9 | "problemMatcher": "$tsc-watch", 10 | "isBackground": true, 11 | "presentation": { 12 | "reveal": "never" 13 | }, 14 | "group": { 15 | "kind": "build", 16 | "isDefault": true 17 | } 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /vscode-extension/.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/** 2 | .vscode-test/** 3 | out/test/** 4 | src/** 5 | /node_modules 6 | .gitignore 7 | vsc-extension-quickstart.md 8 | **/tsconfig.json 9 | **/tslint.json 10 | **/*.map 11 | **/*.ts -------------------------------------------------------------------------------- /vscode-extension/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | ## [Unreleased] 4 | - Use Case: **Moving Given-When-Then** [#29](https://github.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/issues/29) 5 | - Use Case: **Moving Scenario** [#59](https://github.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/issues/59) 6 | - Use Case: **Updating Feature** [#64](https://github.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/issues/64) 7 | - Use Case: **Copying Scenario** [#65](https://github.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/issues/65) 8 | ## Beta 9 | Initial release 10 | - Use Case: **Adding Given-When-Then** [#27](https://github.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/issues/27) 11 | - Use Case: **Removing Given-When-Then** [#28](https://github.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/issues/28) 12 | - Use Case: **Update Given-When-Then** [#30](https://github.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/issues/30) 13 | - Use Case: **Adding Scenario** [#38](https://github.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/issues/38) 14 | - Use Case: **Removing Scenario** [#39](https://github.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/issues/39) 15 | - Use Case: **Updating Scenario** [#60](https://github.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/issues/60) 16 | - Use Case: **Adding Feature** [#61](https://github.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/issues/61) 17 | - Use Case: **Removing Feature** [#62](https://github.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/issues/62) -------------------------------------------------------------------------------- /vscode-extension/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 fluxxus.nl 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vscode-extension/WebView/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ATDD.TestScriptor 6 | 7 | 8 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /vscode-extension/images/ATDDTestScriptorIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluxxus-nl/ATDD.TestScriptor.VSCodeExtension/04b744265ea0cc8a58016ec42148c18fcb695422/vscode-extension/images/ATDDTestScriptorIcon.png -------------------------------------------------------------------------------- /vscode-extension/src/App logic/AL Code Actions/alCodeActionsExtension.ts: -------------------------------------------------------------------------------- 1 | import * as vscode from 'vscode'; 2 | import { APIInterface } from './apiInterface'; 3 | 4 | export class ALCodeActionsExtension { 5 | private static alCodeActionsExtension: ALCodeActionsExtension; 6 | private alCodeOutlineExtension: any; 7 | private constructor(alCodeOutlineExtension: vscode.Extension) { 8 | this.alCodeOutlineExtension = alCodeOutlineExtension; 9 | } 10 | 11 | public static async getInstance(): Promise { 12 | if (!this.alCodeActionsExtension) { 13 | this.setInstance(); 14 | } 15 | await this.alCodeActionsExtension.activate(); 16 | return this.alCodeActionsExtension; 17 | } 18 | 19 | private static setInstance() { 20 | let vsCodeExtension = vscode.extensions.getExtension('davidfeldhoff.al-codeactions'); 21 | if (!vsCodeExtension) { 22 | throw new Error('AL Code Outline has to be installed.'); 23 | } 24 | this.alCodeActionsExtension = new ALCodeActionsExtension(vsCodeExtension as vscode.Extension); 25 | } 26 | 27 | private async activate() { 28 | if (!this.alCodeOutlineExtension.isActive) { 29 | await this.alCodeOutlineExtension.activate(); 30 | } 31 | } 32 | 33 | public getAPI(): APIInterface { 34 | return this.alCodeOutlineExtension.exports; 35 | } 36 | 37 | } -------------------------------------------------------------------------------- /vscode-extension/src/App logic/AL Code Actions/apiInterface.ts: -------------------------------------------------------------------------------- 1 | import { TextDocument } from "vscode"; 2 | import { ALFullSyntaxTreeNode } from "../AL Code Outline/alFullSyntaxTreeNode"; 3 | import { TypeDetectiveInterface } from "./typeDetectiveInterface"; 4 | 5 | export interface APIInterface { 6 | typeDetectiveFactory(document: TextDocument, treeNode: ALFullSyntaxTreeNode): TypeDetectiveInterface; 7 | } -------------------------------------------------------------------------------- /vscode-extension/src/App logic/AL Code Actions/typeDetectiveInterface.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface TypeDetectiveInterface { 3 | getType(): string; 4 | getName(): string; 5 | getIsVar(): boolean; 6 | getIsTemporary(): boolean; 7 | 8 | analyzeTypeOfTreeNode(): Promise; 9 | } -------------------------------------------------------------------------------- /vscode-extension/src/App logic/AL Code Outline Ext/ToolsGetSyntaxTreeSymbolsRequest.ts: -------------------------------------------------------------------------------- 1 | export class ToolsGetSyntaxTreeSymbolsRequest { 2 | path: string; 3 | symbolPath: number[]; 4 | 5 | constructor(newPath: string, newSymbolPath: number[]) { 6 | this.path = newPath; 7 | this.symbolPath = newSymbolPath; 8 | } 9 | } -------------------------------------------------------------------------------- /vscode-extension/src/App logic/AL Code Outline Ext/azSymbolInformationExt.ts: -------------------------------------------------------------------------------- 1 | import { AZSymbolInformation } from "../AL Code Outline/AZSymbolInformation"; 2 | import { AZSymbolKind } from '../AL Code Outline/azSymbolKind'; 3 | 4 | export class AZSymbolInformationExt { 5 | public static collectChildNodes(azSymbolInformation: AZSymbolInformation, kindsOfSymbolInformation: AZSymbolKind[], searchAllLevels: boolean, outList: AZSymbolInformation[]) { 6 | if (azSymbolInformation.childSymbols) { 7 | for (let i = 0; i < azSymbolInformation.childSymbols.length; i++) { 8 | if (kindsOfSymbolInformation.includes(azSymbolInformation.childSymbols[i].kind)) { 9 | outList.push(azSymbolInformation.childSymbols[i]); 10 | } 11 | if (searchAllLevels) { 12 | this.collectChildNodes(azSymbolInformation.childSymbols[i], kindsOfSymbolInformation, searchAllLevels, outList); 13 | } 14 | } 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /vscode-extension/src/App logic/AL Code Outline Ext/textPositionExt.ts: -------------------------------------------------------------------------------- 1 | import * as vscode from 'vscode'; 2 | export class TextPositionExt { 3 | public static compareVsPosition(textPosition: any, vsPosition: vscode.Position): number { 4 | if (vsPosition.line === textPosition.line) { 5 | return (textPosition.character - vsPosition.character); 6 | } else { 7 | return (textPosition.line - vsPosition.line); 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /vscode-extension/src/App logic/AL Code Outline Ext/textRangeExt.ts: -------------------------------------------------------------------------------- 1 | import * as vscode from 'vscode'; 2 | import { TextPositionExt } from './textPositionExt'; 3 | 4 | export class TextRangeExt { 5 | public static createVSCodeRange(textRange: any): vscode.Range { 6 | let vscodeRange: vscode.Range = new vscode.Range(textRange.start.line, textRange.start.character, textRange.end.line, textRange.end.character); 7 | return vscodeRange; 8 | } 9 | public static insideVsRange(textRange: any, vsRange: vscode.Range): boolean { 10 | if (!textRange.start || !textRange.end) { 11 | return false; 12 | } 13 | return ((TextPositionExt.compareVsPosition(textRange.start, vsRange.start) <= 0) && 14 | (TextPositionExt.compareVsPosition(textRange.end, vsRange.end) >= 0)); 15 | } 16 | } -------------------------------------------------------------------------------- /vscode-extension/src/App logic/AL Code Outline Ext/toolsGetSyntaxTreeRequest.ts: -------------------------------------------------------------------------------- 1 | export class ToolsGetSyntaxTreeRequest { 2 | source : string; 3 | path : string; 4 | open: boolean; 5 | 6 | constructor(newSourceCode : string, newPath: string, newOpen: boolean) { 7 | this.source = newSourceCode; 8 | this.path = newPath; 9 | this.open = newOpen; 10 | } 11 | 12 | } -------------------------------------------------------------------------------- /vscode-extension/src/App logic/AL Code Outline Ext/toolsGetSyntaxTreeResponse.ts: -------------------------------------------------------------------------------- 1 | export class ToolsGetSyntaxTreeResponse { 2 | root: any; 3 | 4 | constructor() { 5 | } 6 | 7 | } -------------------------------------------------------------------------------- /vscode-extension/src/App logic/AL Code Outline/AZSymbolInformation.ts: -------------------------------------------------------------------------------- 1 | import { AZSymbolKind } from "./azSymbolKind"; 2 | import { TextRange } from "./textRange"; 3 | 4 | export class AZSymbolInformation { 5 | id: number; 6 | idx: number; 7 | name: string; 8 | subtype: string | undefined; 9 | elementsubtype: string | undefined; 10 | fullName: string; 11 | kind: AZSymbolKind; 12 | icon: string; 13 | childSymbols: AZSymbolInformation[] | undefined; 14 | range: TextRange | undefined; 15 | selectionRange: TextRange | undefined; 16 | contentRange: TextRange | undefined; 17 | source: string | undefined; 18 | extends: string | undefined; 19 | parent: AZSymbolInformation | undefined; 20 | 21 | constructor() { 22 | this.id = 0; 23 | this.idx = -1; 24 | this.name = ''; 25 | this.fullName = ''; 26 | this.subtype = undefined; 27 | this.elementsubtype = undefined; 28 | this.icon = ''; 29 | this.kind = AZSymbolKind.Undefined; 30 | this.childSymbols = undefined; 31 | this.range = undefined; 32 | this.selectionRange = undefined; 33 | this.contentRange = undefined; 34 | this.source = undefined; 35 | this.extends = undefined; 36 | this.parent = undefined; 37 | } 38 | } -------------------------------------------------------------------------------- /vscode-extension/src/App logic/AL Code Outline/alFullSyntaxTreeNode.ts: -------------------------------------------------------------------------------- 1 | import { TextRange } from "./textRange"; 2 | 3 | export class ALFullSyntaxTreeNode { 4 | name: string | undefined; 5 | kind: string | undefined; 6 | span: TextRange | undefined; 7 | fullSpan: TextRange | undefined; 8 | childNodes: ALFullSyntaxTreeNode[] | undefined; 9 | parentNode: ALFullSyntaxTreeNode | undefined; 10 | 11 | attributes: ALFullSyntaxTreeNode[] | undefined; 12 | openBraceToken: ALFullSyntaxTreeNode | undefined; 13 | closeBraceToken: ALFullSyntaxTreeNode | undefined; 14 | varKeyword: ALFullSyntaxTreeNode | undefined; 15 | accessModifier: string | undefined; 16 | identifier: string | undefined; 17 | dataType: string | undefined; 18 | temporary: string | undefined; 19 | } -------------------------------------------------------------------------------- /vscode-extension/src/App logic/AL Code Outline/devToolsExtensionContext.ts: -------------------------------------------------------------------------------- 1 | import * as vscode from 'vscode'; 2 | import { isNullOrUndefined } from "util"; 3 | 4 | export class ALCodeOutlineExtension { 5 | private static alCodeOutlineExtensionObject: ALCodeOutlineExtension; 6 | private alCodeOutlineExtension: any; 7 | private constructor(alCodeOutlineExtension: vscode.Extension) { 8 | this.alCodeOutlineExtension = alCodeOutlineExtension; 9 | } 10 | 11 | public static async getInstance(): Promise { 12 | if (isNullOrUndefined(this.alCodeOutlineExtensionObject)) { 13 | this.setInstance(); 14 | } 15 | await this.alCodeOutlineExtensionObject.activate(); 16 | return this.alCodeOutlineExtensionObject; 17 | } 18 | 19 | private static setInstance() { 20 | let vsCodeExtension = vscode.extensions.getExtension('andrzejzwierzchowski.al-code-outline'); 21 | if (isNullOrUndefined(vsCodeExtension)) { 22 | throw new Error('AL Code Outline has to be installed.'); 23 | } 24 | this.alCodeOutlineExtensionObject = new ALCodeOutlineExtension(vsCodeExtension as vscode.Extension); 25 | } 26 | 27 | private async activate() { 28 | if (!this.alCodeOutlineExtension.isActive) { 29 | await this.alCodeOutlineExtension.activate(); 30 | } 31 | } 32 | 33 | public getAPI() { 34 | return this.alCodeOutlineExtension.exports; 35 | } 36 | 37 | } -------------------------------------------------------------------------------- /vscode-extension/src/App logic/AL Code Outline/textPosition.ts: -------------------------------------------------------------------------------- 1 | import * as vscode from 'vscode'; 2 | 3 | export class TextPosition { 4 | line : number; 5 | character : number; 6 | 7 | constructor() { 8 | this.line = 0; 9 | this.character = 0; 10 | } 11 | 12 | static fromAny(source : any) { 13 | let val : TextPosition = new TextPosition(); 14 | if (source.line) 15 | val.line = source.line; 16 | if (source.character) 17 | val.character = source.character; 18 | return val; 19 | } 20 | 21 | public compareVsPosition(position : vscode.Position) : number { 22 | if (position.line == this.line) 23 | return (this.character - position.character); 24 | else 25 | return (this.line - position.line); 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /vscode-extension/src/App logic/AL Code Outline/toolsGetFullSyntaxTreeRequest.ts: -------------------------------------------------------------------------------- 1 | export class ToolsGetFullSyntaxTreeRequest { 2 | source: string | undefined; 3 | path: string | undefined; 4 | 5 | constructor(newSource: string, newPath: string) { 6 | this.source = newSource; 7 | this.path = newPath; 8 | } 9 | 10 | } -------------------------------------------------------------------------------- /vscode-extension/src/App logic/AL Code Outline/toolsGetFullSyntaxTreeResponse.ts: -------------------------------------------------------------------------------- 1 | import { ALFullSyntaxTreeNode } from "./alFullSyntaxTreeNode"; 2 | 3 | export class ToolsGetFullSyntaxTreeResponse { 4 | root: ALFullSyntaxTreeNode | undefined; 5 | } -------------------------------------------------------------------------------- /vscode-extension/src/App logic/CRS AL Language Extension/CRSExtensionPublicApiInterfaces.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'crs-al-language-extension-api' { 2 | 3 | export interface ICRSExtensionPublicApi { 4 | RunObjectApi : IRunObjectApi; 5 | ObjectNamesApi : IObjectNamesApi; 6 | } 7 | 8 | export interface IObjectNamesApi { 9 | GetObjectFileName(objectType: string, objectId : string, objectName: string) : string; 10 | GetObjectExtensionFileName(objectType: string, objectId : string, objectName: string, extendedObjectId : string, extendedObjectName : string) : string; 11 | GetObjectExtensionName(objectType: string, objectId : string, objectName: string, extendedObjectId : string, extendedObjectName : string) : string; 12 | GetBestPracticeAbbreviatedObjectType(ObjectType: String): string; 13 | } 14 | 15 | export interface IRunObjectApi { 16 | RunObjectInWebClient(objecttype: any, objectid: any) : void; 17 | RunObjectInTabletClient(objecttype: any, objectid: any) : void; 18 | RunObjectInPhoneClient(objecttype: any, objectid: any) : void; 19 | RunObjectInWindowsClient(objecttype: any, objectid: any) : void; 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /vscode-extension/src/App logic/Entities/messageDetailsImpl.ts: -------------------------------------------------------------------------------- 1 | import { MessageDetails } from "../../typings/types"; 2 | 3 | export class MessageDetailsImpl implements MessageDetails { 4 | feature!: string; 5 | name!: string; 6 | given!: string[]; 7 | when!: string[]; 8 | then!: string[]; 9 | constructor() { 10 | this.given = []; 11 | this.when = []; 12 | this.then = []; 13 | } 14 | } -------------------------------------------------------------------------------- /vscode-extension/src/App logic/Entities/messageImpl.ts: -------------------------------------------------------------------------------- 1 | import { Message, MessageState, ALTestRunnerResult, MessageDetails } from "../../typings/types"; 2 | 3 | export class MessageImpl implements Message { 4 | Uid!: string; 5 | Project!: string; 6 | Feature!: string; 7 | Id?: number | undefined; 8 | Scenario!: string; 9 | Codeunit!: string; 10 | FsPath!: string; 11 | MethodName!: string; 12 | IsDirty!: boolean; 13 | State!: MessageState; 14 | TestRunnerResult!: ALTestRunnerResult; 15 | Details!: MessageDetails; 16 | constructor() { } 17 | } -------------------------------------------------------------------------------- /vscode-extension/src/App logic/Entities/testMethod.ts: -------------------------------------------------------------------------------- 1 | import { ALFullSyntaxTreeNode } from "../AL Code Outline/alFullSyntaxTreeNode"; 2 | 3 | export class TestMethod{ 4 | methodTreeNode: ALFullSyntaxTreeNode; 5 | 6 | constructor(methodTreeNode: ALFullSyntaxTreeNode){ 7 | this.methodTreeNode = methodTreeNode; 8 | } 9 | } -------------------------------------------------------------------------------- /vscode-extension/src/App logic/Utils/messageParser.ts: -------------------------------------------------------------------------------- 1 | import { Uri, TextDocument, workspace } from "vscode"; 2 | import { Message } from "../../typings/types"; 3 | import { ALFullSyntaxTreeNode } from "../AL Code Outline/alFullSyntaxTreeNode"; 4 | import { ObjectToMessageUtils } from "./objectToMessageUtils"; 5 | import { TestCodeunitUtils } from "./testCodeunitUtils"; 6 | 7 | export class MessageParser{ 8 | public static async getMessageObjectFromTestUri(testUri: Uri): Promise { 9 | let newMesssages: Message[] = []; 10 | let document: TextDocument = await workspace.openTextDocument(testUri.fsPath); 11 | let testMethods: ALFullSyntaxTreeNode[] = await TestCodeunitUtils.getTestMethodsOfDocument(document); 12 | let featureCodeunitLevel: string | undefined; 13 | if (testMethods.length > 0) { 14 | featureCodeunitLevel = ObjectToMessageUtils.getUniqueFeature(document, testMethods[0]); 15 | } 16 | for (let a = 0; a < testMethods.length; a++) 17 | newMesssages.push(await ObjectToMessageUtils.testMethodToMessage(document, testMethods[a], featureCodeunitLevel)); 18 | return newMesssages; 19 | } 20 | } -------------------------------------------------------------------------------- /vscode-extension/src/App logic/Utils/stringUtils.ts: -------------------------------------------------------------------------------- 1 | export class StringUtils { 2 | text: string; 3 | constructor(text: string){ 4 | this.text = text; 5 | } 6 | public titleCase(): StringUtils { 7 | this.text = this.text.replace(/\w+/g, function (txt) { 8 | return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase(); 9 | }); 10 | return this; 11 | } 12 | public removeSpecialChars(): StringUtils { 13 | this.text = this.text.replace(/[^\w]/g, ''); 14 | return this; 15 | } 16 | public value(){ 17 | return this.text; 18 | } 19 | } -------------------------------------------------------------------------------- /vscode-extension/src/Services/ExcelService.ts: -------------------------------------------------------------------------------- 1 | import { Application } from './../Application'; 2 | import { singleton } from 'aurelia-dependency-injection'; 3 | import { Message } from '../typings/types'; 4 | import { Workbook } from 'exceljs'; 5 | 6 | @singleton(true) 7 | export class ExcelService { 8 | 9 | async export(entries: Array) { 10 | 11 | let filename = await Application.ui.filepicker({ 12 | 'Excel': ['xlsx'] 13 | }); 14 | 15 | if (!filename) { 16 | return; 17 | } 18 | 19 | let workbook = new Workbook(); 20 | let worksheet = workbook.addWorksheet('ATDD'); 21 | 22 | worksheet.columns = [ 23 | { header: 'Project', key: 'project', width: 10 }, 24 | { header: 'Feature', key: 'feature', width: 20 }, 25 | { header: 'ID', key: 'id', width: 10 }, 26 | { header: 'Scenario', key: 'scenario', width: 30 }, 27 | { header: 'MethodName', key: 'methodname', width: 30 }, 28 | { header: 'Codeunit', key: 'codeunit', width: 30 }, 29 | { header: 'FsPath', key: 'fspath', width: 30 }, 30 | ]; 31 | 32 | // Add an array of rows 33 | let rows = entries 34 | .map((m) => { 35 | return { 36 | Project: m.Project, 37 | Feature: m.Feature, 38 | Id: m.Id, 39 | Scenario: m.Scenario, 40 | MethodName: m.MethodName, 41 | Codeunit: m.Codeunit, 42 | FsPath: m.FsPath 43 | } 44 | }) 45 | .map(m => Object.values(m)); 46 | worksheet.addRows(rows); 47 | 48 | await workbook.xlsx.writeFile(filename); 49 | } 50 | } -------------------------------------------------------------------------------- /vscode-extension/src/Services/UIService.ts: -------------------------------------------------------------------------------- 1 | import { singleton } from 'aurelia-dependency-injection'; 2 | import { window, Progress, CancellationToken, ProgressLocation } from 'vscode'; 3 | 4 | @singleton(true) 5 | export class UIService { 6 | public async info(message: string) { 7 | return await window.showInformationMessage(message); 8 | } 9 | 10 | public async warn(message: string) { 11 | return await window.showWarningMessage(message); 12 | } 13 | 14 | public async error(message: string) { 15 | return await window.showErrorMessage(message); 16 | } 17 | 18 | public async progress(message: string, task: (progress: Progress<{ message?: string; increment?: number }>, token: CancellationToken) => Promise): Promise { 19 | return await window.withProgress({ 20 | location: ProgressLocation.Window, 21 | title: message, 22 | cancellable: true 23 | }, task); 24 | } 25 | 26 | public async filepicker(filters?: { [name: string]: string[] }, label?: string): Promise { 27 | let uri = await window.showSaveDialog({ filters: filters, saveLabel: label }); 28 | return uri?.fsPath; 29 | } 30 | } -------------------------------------------------------------------------------- /vscode-extension/src/extension.ts: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import 'reflect-metadata'; 4 | import { Application } from './Application'; 5 | import { ExtensionContext } from 'vscode'; 6 | 7 | export async function activate(context: ExtensionContext) { 8 | Application.context = context; 9 | await Application.activate(); 10 | } 11 | 12 | export async function deactivate() { 13 | await Application.deactivate(); 14 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/atddTestScenariosAndResults_AddFeature.test.ts: -------------------------------------------------------------------------------- 1 | import { Uri, workspace } from 'vscode'; 2 | import { MessageState, MessageUpdate, TypeChanged } from '../typings/types'; 3 | import { TestHelper } from './testHelper'; 4 | 5 | 6 | suite('AddFeature', function () { 7 | this.beforeAll(async function () { 8 | await TestHelper.resetFiles(); 9 | }) 10 | this.beforeEach(async function () { 11 | await TestHelper.resetConfigurations(); 12 | }); 13 | 14 | test('Scenario 086 - Add Feature 2a', async () => { 15 | //Given Test Directory 16 | await workspace.getConfiguration('atddTestScriptor', Uri.file(TestHelper.pathOfTestProject)).update('testDirectory', 'src/codeunit') 17 | //When User selects "Add Scenario" action 18 | let messageUpdate: MessageUpdate = { 19 | Scenario: '', 20 | Feature: '', 21 | Type: TypeChanged.Feature, 22 | State: MessageState.New, 23 | OldValue: '', 24 | NewValue: 'New Feature', 25 | FsPath: '', 26 | Project: 'Test Project' //name of project in app.json 27 | } 28 | //Then 29 | await TestHelper.verifyChangeIsValid(messageUpdate); 30 | await TestHelper.verifyResult(messageUpdate, 'scenario086.al', true); 31 | }) 32 | }); 33 | -------------------------------------------------------------------------------- /vscode-extension/src/test/index.ts: -------------------------------------------------------------------------------- 1 | import * as path from 'path'; 2 | import * as Mocha from 'mocha'; 3 | import * as glob from 'glob'; 4 | 5 | export function run(): Promise { 6 | // Create the mocha test 7 | const mocha = new Mocha({ 8 | ui: 'tdd', 9 | reporter: 'xunit' 10 | }); 11 | mocha.useColors(true); 12 | mocha.timeout(0); 13 | 14 | const testsRoot = path.resolve(__dirname, '..'); 15 | 16 | return new Promise((c, e) => { 17 | glob('**/**.test.js', { cwd: testsRoot }, (err, files) => { 18 | if (err) { 19 | return e(err); 20 | } 21 | 22 | // Add files to the test suite 23 | files.forEach(f => mocha.addFile(path.resolve(testsRoot, f))); 24 | 25 | try { 26 | // Run the mocha test 27 | mocha.run(failures => { 28 | if (failures > 0) { 29 | e(new Error(`${failures} tests failed.`)); 30 | } else { 31 | c(); 32 | } 33 | }); 34 | } catch (err) { 35 | console.error(err); 36 | e(err); 37 | } 38 | }); 39 | }); 40 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/orgs/DuplicateTestObject.Codeunit.al: -------------------------------------------------------------------------------- 1 | codeunit 50101 "DuplicateTestObjectFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] Duplicate test object 8 | end; 9 | 10 | [Test] 11 | procedure SecondTestFunctionWithValidGivenWhenThenStructure() 12 | // [FEATURE] Duplicate test object 13 | begin 14 | // [SCENARIO 0002] Second test function with valid Given-When-Then structure 15 | // [Given] Valid Given 16 | CreateValidGiven(); 17 | // [When] Valid When 18 | ValidWhen(); 19 | // [Then] Valid Then 20 | VerifyValidThen(); 21 | end; 22 | 23 | [Test] 24 | procedure ThirdTestFunctionWithValidGivenWhenThenStructure() 25 | // [FEATURE] Duplicate test object 26 | begin 27 | // [SCENARIO 0003] Third test function with valid Given-When-Then structure 28 | // [Given] Valid Given 29 | CreateValidGiven(); 30 | // [When] Valid When 31 | ValidWhen(); 32 | // [Then] Valid Then 33 | VerifyValidThen(); 34 | end; 35 | 36 | local procedure CreateValidGiven() 37 | begin 38 | Error('Procedure CreateValidGiven not yet implemented.'); 39 | end; 40 | 41 | local procedure ValidWhen() 42 | begin 43 | Error('Procedure ValidWhen not yet implemented.'); 44 | end; 45 | 46 | local procedure VerifyValidThen() 47 | begin 48 | Error('Procedure VerifyValidThen not yet implemented.'); 49 | end; 50 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/orgs/TestObject.Codeunit.al: -------------------------------------------------------------------------------- 1 | codeunit 50100 "TestObjectFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] First test object 8 | end; 9 | 10 | [Test] 11 | procedure FirstTestFunctionWithValidGivenWhenThenStructure() 12 | // [FEATURE] First test object 13 | begin 14 | // [SCENARIO 0001] First test function with valid Given-When-Then structure 15 | // [GIVEN] Valid Given 16 | CreateValidGiven(); 17 | // [WHEN] Valid When 18 | ValidWhen(); 19 | // [THEN] Valid Then 20 | VerifyValidThen(); 21 | end; 22 | 23 | local procedure CreateValidGiven() 24 | begin 25 | Error('Procedure CreateValidGiven not yet implemented.'); 26 | end; 27 | 28 | local procedure ValidWhen() 29 | begin 30 | Error('Procedure ValidWhen not yet implemented.'); 31 | end; 32 | 33 | local procedure VerifyValidThen() 34 | begin 35 | Error('Procedure VerifyValidThen not yet implemented.'); 36 | end; 37 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/orgs/TestObjectWithInitialize.Codeunit.al: -------------------------------------------------------------------------------- 1 | codeunit 50103 "TestObjectWithInitializeFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] Test object with Initialize 8 | end; 9 | 10 | [Test] 11 | procedure FourthTestFunctionWithValidGivenWhenThenStructureAndInitialize() 12 | // [FEATURE] Test object with Initialize 13 | begin 14 | // [SCENARIO 0004] Fourth test function with valid Given-When-Then structure and Initialize 15 | Initialize(); 16 | // [GIVEN] Valid Given 17 | CreateValidGiven(); 18 | // [WHEN] Valid When 19 | ValidWhen(); 20 | // [THEN] Valid Then 21 | VerifyValidThen(); 22 | end; 23 | 24 | local procedure Initialize() 25 | var 26 | LibraryTestInitialize: Codeunit "Library - Test Initialize"; 27 | begin 28 | LibraryTestInitialize.OnTestInitialize(Codeunit::"TestObjectWithInitializeFLX"); 29 | 30 | if IsInitialized then 31 | exit; 32 | 33 | LibraryTestInitialize.OnBeforeTestSuiteInitialize(Codeunit::"TestObjectWithInitializeFLX"); 34 | 35 | IsInitialized := true; 36 | Commit(); 37 | 38 | LibraryTestInitialize.OnAfterTestSuiteInitialize(Codeunit::"TestObjectWithInitializeFLX"); 39 | end; 40 | 41 | local procedure CreateValidGiven() 42 | begin 43 | Error('Procedure CreateValidGiven not yet implemented.'); 44 | end; 45 | 46 | local procedure ValidWhen() 47 | begin 48 | Error('Procedure ValidWhen not yet implemented.'); 49 | end; 50 | 51 | local procedure VerifyValidThen() 52 | begin 53 | Error('Procedure VerifyValidThen not yet implemented.'); 54 | end; 55 | 56 | var 57 | IsInitialized: Boolean; 58 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/orgs/TestObjectWithUIHandler.Codeunit.al: -------------------------------------------------------------------------------- 1 | codeunit 50104 "TestObjectWithUIHandlerFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] Test object with UI Handler 8 | end; 9 | 10 | [Test] 11 | [HandlerFunctions('AMessageHandler')] 12 | procedure FifthTestFunctionWithValidGivenWhenThenStructureAndUIHandler() 13 | // [FEATURE] Test object with UI Handler 14 | begin 15 | // [SCENARIO 0005] Fifth test function with valid Given-When-Then structure and UI handler 16 | Initialize(); 17 | // [GIVEN] Valid Given 18 | CreateValidGiven(); 19 | // [WHEN] Valid When 20 | ValidWhen(); 21 | // [THEN] Valid Then 22 | VerifyValidThen(); 23 | end; 24 | 25 | local procedure Initialize() 26 | var 27 | LibraryTestInitialize: Codeunit "Library - Test Initialize"; 28 | begin 29 | LibraryTestInitialize.OnTestInitialize(Codeunit::"TestObjectWithInitializeFLX"); 30 | 31 | if IsInitialized then 32 | exit; 33 | 34 | LibraryTestInitialize.OnBeforeTestSuiteInitialize(Codeunit::"TestObjectWithInitializeFLX"); 35 | 36 | IsInitialized := true; 37 | Commit(); 38 | 39 | LibraryTestInitialize.OnAfterTestSuiteInitialize(Codeunit::"TestObjectWithInitializeFLX"); 40 | end; 41 | 42 | local procedure CreateValidGiven() 43 | begin 44 | Error('Procedure CreateValidGiven not yet implemented.'); 45 | end; 46 | 47 | local procedure ValidWhen() 48 | begin 49 | Error('Procedure ValidWhen not yet implemented.'); 50 | end; 51 | 52 | local procedure VerifyValidThen() 53 | begin 54 | Error('Procedure VerifyValidThen not yet implemented.'); 55 | end; 56 | 57 | [MessageHandler] 58 | procedure AMessageHandler(Msg: Text) 59 | begin 60 | end; 61 | 62 | var 63 | IsInitialized: Boolean; 64 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/results/scenario001.al: -------------------------------------------------------------------------------- 1 | codeunit 50100 "TestObjectFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] First test object 8 | end; 9 | 10 | [Test] 11 | procedure FirstTestFunctionWithValidGivenWhenThenStructure() 12 | // [FEATURE] First test object 13 | begin 14 | // [SCENARIO 0001] First test function with valid Given-When-Then structure 15 | // [GIVEN] Valid Given 16 | CreateValidGiven(); 17 | // [Given] New Given 18 | CreateNewGiven(); 19 | // [WHEN] Valid When 20 | ValidWhen(); 21 | // [THEN] Valid Then 22 | VerifyValidThen(); 23 | end; 24 | 25 | local procedure CreateValidGiven() 26 | begin 27 | Error('Procedure CreateValidGiven not yet implemented.'); 28 | end; 29 | 30 | local procedure ValidWhen() 31 | begin 32 | Error('Procedure ValidWhen not yet implemented.'); 33 | end; 34 | 35 | local procedure VerifyValidThen() 36 | begin 37 | Error('Procedure VerifyValidThen not yet implemented.'); 38 | end; 39 | 40 | local procedure CreateNewGiven() 41 | begin 42 | Error('Procedure CreateNewGiven not yet implemented.'); 43 | end; 44 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/results/scenario002.al: -------------------------------------------------------------------------------- 1 | codeunit 50100 "TestObjectFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] First test object 8 | end; 9 | 10 | [Test] 11 | procedure FirstTestFunctionWithValidGivenWhenThenStructure() 12 | // [FEATURE] First test object 13 | begin 14 | // [SCENARIO 0001] First test function with valid Given-When-Then structure 15 | // [GIVEN] Valid Given 16 | CreateValidGiven(); 17 | // [Given] New Given 18 | CreateNewGiven(); 19 | // [Given] New Given 2 20 | CreateNewGiven2(); 21 | // [WHEN] Valid When 22 | ValidWhen(); 23 | // [THEN] Valid Then 24 | VerifyValidThen(); 25 | end; 26 | 27 | local procedure CreateValidGiven() 28 | begin 29 | Error('Procedure CreateValidGiven not yet implemented.'); 30 | end; 31 | 32 | local procedure ValidWhen() 33 | begin 34 | Error('Procedure ValidWhen not yet implemented.'); 35 | end; 36 | 37 | local procedure VerifyValidThen() 38 | begin 39 | Error('Procedure VerifyValidThen not yet implemented.'); 40 | end; 41 | 42 | local procedure CreateNewGiven() 43 | begin 44 | Error('Procedure CreateNewGiven not yet implemented.'); 45 | end; 46 | 47 | local procedure CreateNewGiven2() 48 | begin 49 | Error('Procedure CreateNewGiven2 not yet implemented.'); 50 | end; 51 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/results/scenario003.al: -------------------------------------------------------------------------------- 1 | codeunit 50100 "TestObjectFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] First test object 8 | end; 9 | 10 | [Test] 11 | procedure FirstTestFunctionWithValidGivenWhenThenStructure() 12 | // [FEATURE] First test object 13 | begin 14 | // [SCENARIO 0001] First test function with valid Given-When-Then structure 15 | // [GIVEN] Valid Given 16 | CreateValidGiven(); 17 | // [Given] Valid Given 18 | CreateValidGiven(); 19 | // [WHEN] Valid When 20 | ValidWhen(); 21 | // [THEN] Valid Then 22 | VerifyValidThen(); 23 | end; 24 | 25 | local procedure CreateValidGiven() 26 | begin 27 | Error('Procedure CreateValidGiven not yet implemented.'); 28 | end; 29 | 30 | local procedure ValidWhen() 31 | begin 32 | Error('Procedure ValidWhen not yet implemented.'); 33 | end; 34 | 35 | local procedure VerifyValidThen() 36 | begin 37 | Error('Procedure VerifyValidThen not yet implemented.'); 38 | end; 39 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/results/scenario004.al: -------------------------------------------------------------------------------- 1 | codeunit 50100 "TestObjectFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] First test object 8 | end; 9 | 10 | [Test] 11 | procedure FirstTestFunctionWithValidGivenWhenThenStructure() 12 | // [FEATURE] First test object 13 | begin 14 | // [SCENARIO 0001] First test function with valid Given-When-Then structure 15 | // [GIVEN] Valid Given 16 | CreateValidGiven(); 17 | // [WHEN] Valid When 18 | ValidWhen(); 19 | // [THEN] Valid Then 20 | VerifyValidThen(); 21 | // [Then] New Then 22 | VerifyNewThen(); 23 | end; 24 | 25 | local procedure CreateValidGiven() 26 | begin 27 | Error('Procedure CreateValidGiven not yet implemented.'); 28 | end; 29 | 30 | local procedure ValidWhen() 31 | begin 32 | Error('Procedure ValidWhen not yet implemented.'); 33 | end; 34 | 35 | local procedure VerifyValidThen() 36 | begin 37 | Error('Procedure VerifyValidThen not yet implemented.'); 38 | end; 39 | 40 | local procedure VerifyNewThen() 41 | begin 42 | Error('Procedure VerifyNewThen not yet implemented.'); 43 | end; 44 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/results/scenario005.al: -------------------------------------------------------------------------------- 1 | codeunit 50100 "TestObjectFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] First test object 8 | end; 9 | 10 | [Test] 11 | procedure FirstTestFunctionWithValidGivenWhenThenStructure() 12 | // [FEATURE] First test object 13 | begin 14 | // [SCENARIO 0001] First test function with valid Given-When-Then structure 15 | // [GIVEN] Valid Given 16 | CreateValidGiven(); 17 | // [WHEN] Valid When 18 | ValidWhen(); 19 | // [THEN] Valid Then 20 | VerifyValidThen(); 21 | // [Then] New Then 22 | VerifyNewThen(); 23 | // [Then] New Then 2 24 | VerifyNewThen2(); 25 | end; 26 | 27 | local procedure CreateValidGiven() 28 | begin 29 | Error('Procedure CreateValidGiven not yet implemented.'); 30 | end; 31 | 32 | local procedure ValidWhen() 33 | begin 34 | Error('Procedure ValidWhen not yet implemented.'); 35 | end; 36 | 37 | local procedure VerifyValidThen() 38 | begin 39 | Error('Procedure VerifyValidThen not yet implemented.'); 40 | end; 41 | 42 | local procedure VerifyNewThen() 43 | begin 44 | Error('Procedure VerifyNewThen not yet implemented.'); 45 | end; 46 | 47 | local procedure VerifyNewThen2() 48 | begin 49 | Error('Procedure VerifyNewThen2 not yet implemented.'); 50 | end; 51 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/results/scenario006.al: -------------------------------------------------------------------------------- 1 | codeunit 50100 "TestObjectFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] First test object 8 | end; 9 | 10 | [Test] 11 | procedure FirstTestFunctionWithValidGivenWhenThenStructure() 12 | // [FEATURE] First test object 13 | begin 14 | // [SCENARIO 0001] First test function with valid Given-When-Then structure 15 | // [GIVEN] Valid Given 16 | CreateValidGiven(); 17 | // [WHEN] Valid When 18 | ValidWhen(); 19 | // [THEN] Valid Then 20 | VerifyValidThen(); 21 | // [Then] Valid Then 22 | VerifyValidThen(); 23 | end; 24 | 25 | local procedure CreateValidGiven() 26 | begin 27 | Error('Procedure CreateValidGiven not yet implemented.'); 28 | end; 29 | 30 | local procedure ValidWhen() 31 | begin 32 | Error('Procedure ValidWhen not yet implemented.'); 33 | end; 34 | 35 | local procedure VerifyValidThen() 36 | begin 37 | Error('Procedure VerifyValidThen not yet implemented.'); 38 | end; 39 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/results/scenario010.al: -------------------------------------------------------------------------------- 1 | codeunit 50100 "TestObjectFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] First test object 8 | end; 9 | 10 | [Test] 11 | procedure FirstTestFunctionWithValidGivenWhenThenStructure() 12 | // [FEATURE] First test object 13 | begin 14 | // [SCENARIO 0001] First test function with valid Given-When-Then structure 15 | // [GIVEN] Valid Given 16 | CreateValidGiven(); 17 | // [Given] New Given !@#$%^&*() 18 | CreateNewGiven(); 19 | // [WHEN] Valid When 20 | ValidWhen(); 21 | // [THEN] Valid Then 22 | VerifyValidThen(); 23 | end; 24 | 25 | local procedure CreateValidGiven() 26 | begin 27 | Error('Procedure CreateValidGiven not yet implemented.'); 28 | end; 29 | 30 | local procedure ValidWhen() 31 | begin 32 | Error('Procedure ValidWhen not yet implemented.'); 33 | end; 34 | 35 | local procedure VerifyValidThen() 36 | begin 37 | Error('Procedure VerifyValidThen not yet implemented.'); 38 | end; 39 | 40 | local procedure CreateNewGiven() 41 | begin 42 | Error('Procedure CreateNewGiven not yet implemented.'); 43 | end; 44 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/results/scenario011.al: -------------------------------------------------------------------------------- 1 | codeunit 50100 "TestObjectFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] First test object 8 | end; 9 | 10 | [Test] 11 | procedure FirstTestFunctionWithValidGivenWhenThenStructure() 12 | // [FEATURE] First test object 13 | begin 14 | // [SCENARIO 0001] First test function with valid Given-When-Then structure 15 | // [GIVEN] Valid Given 16 | CreateValidGiven(); 17 | // [WHEN] Valid When 18 | ValidWhen(); 19 | // [THEN] Valid Then 20 | VerifyValidThen(); 21 | // [Then] New Then !@#$%^&*() 22 | VerifyNewThen(); 23 | end; 24 | 25 | local procedure CreateValidGiven() 26 | begin 27 | Error('Procedure CreateValidGiven not yet implemented.'); 28 | end; 29 | 30 | local procedure ValidWhen() 31 | begin 32 | Error('Procedure ValidWhen not yet implemented.'); 33 | end; 34 | 35 | local procedure VerifyValidThen() 36 | begin 37 | Error('Procedure VerifyValidThen not yet implemented.'); 38 | end; 39 | 40 | local procedure VerifyNewThen() 41 | begin 42 | Error('Procedure VerifyNewThen not yet implemented.'); 43 | end; 44 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/results/scenario012.al: -------------------------------------------------------------------------------- 1 | codeunit 50100 "TestObjectFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] First test object 8 | end; 9 | 10 | [Test] 11 | procedure FirstTestFunctionWithValidGivenWhenThenStructure() 12 | // [FEATURE] First test object 13 | begin 14 | // [SCENARIO 0001] First test function with valid Given-When-Then structure 15 | // [GIVEN] Valid Given 16 | CreateValidGiven(); 17 | // [Given] new given all lowercase 18 | CreateNewGivenAllLowercase(); 19 | // [WHEN] Valid When 20 | ValidWhen(); 21 | // [THEN] Valid Then 22 | VerifyValidThen(); 23 | end; 24 | 25 | local procedure CreateValidGiven() 26 | begin 27 | Error('Procedure CreateValidGiven not yet implemented.'); 28 | end; 29 | 30 | local procedure ValidWhen() 31 | begin 32 | Error('Procedure ValidWhen not yet implemented.'); 33 | end; 34 | 35 | local procedure VerifyValidThen() 36 | begin 37 | Error('Procedure VerifyValidThen not yet implemented.'); 38 | end; 39 | 40 | local procedure CreateNewGivenAllLowercase() 41 | begin 42 | Error('Procedure CreateNewGivenAllLowercase not yet implemented.'); 43 | end; 44 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/results/scenario013.al: -------------------------------------------------------------------------------- 1 | codeunit 50100 "TestObjectFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] First test object 8 | end; 9 | 10 | [Test] 11 | procedure FirstTestFunctionWithValidGivenWhenThenStructure() 12 | // [FEATURE] First test object 13 | begin 14 | // [SCENARIO 0001] First test function with valid Given-When-Then structure 15 | // [GIVEN] Valid Given 16 | CreateValidGiven(); 17 | // [WHEN] Valid When 18 | ValidWhen(); 19 | // [THEN] Valid Then 20 | VerifyValidThen(); 21 | // [Then] new then all lowercase 22 | VerifyNewThenAllLowercase(); 23 | end; 24 | 25 | local procedure CreateValidGiven() 26 | begin 27 | Error('Procedure CreateValidGiven not yet implemented.'); 28 | end; 29 | 30 | local procedure ValidWhen() 31 | begin 32 | Error('Procedure ValidWhen not yet implemented.'); 33 | end; 34 | 35 | local procedure VerifyValidThen() 36 | begin 37 | Error('Procedure VerifyValidThen not yet implemented.'); 38 | end; 39 | 40 | local procedure VerifyNewThenAllLowercase() 41 | begin 42 | Error('Procedure VerifyNewThenAllLowercase not yet implemented.'); 43 | end; 44 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/results/scenario014.al: -------------------------------------------------------------------------------- 1 | codeunit 50100 "TestObjectFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] First test object 8 | end; 9 | 10 | [Test] 11 | procedure FirstTestFunctionWithValidGivenWhenThenStructure() 12 | // [FEATURE] First test object 13 | begin 14 | // [SCENARIO 0001] First test function with valid Given-When-Then structure 15 | // [GIVEN] Valid Given 16 | CreateValidGiven(); 17 | // [Given] New Given 18 | MakeNewGiven(); 19 | // [WHEN] Valid When 20 | ValidWhen(); 21 | // [THEN] Valid Then 22 | VerifyValidThen(); 23 | end; 24 | 25 | local procedure CreateValidGiven() 26 | begin 27 | Error('Procedure CreateValidGiven not yet implemented.'); 28 | end; 29 | 30 | local procedure ValidWhen() 31 | begin 32 | Error('Procedure ValidWhen not yet implemented.'); 33 | end; 34 | 35 | local procedure VerifyValidThen() 36 | begin 37 | Error('Procedure VerifyValidThen not yet implemented.'); 38 | end; 39 | 40 | local procedure MakeNewGiven() 41 | begin 42 | Error('Procedure MakeNewGiven not yet implemented.'); 43 | end; 44 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/results/scenario015.al: -------------------------------------------------------------------------------- 1 | codeunit 50100 "TestObjectFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] First test object 8 | end; 9 | 10 | [Test] 11 | procedure FirstTestFunctionWithValidGivenWhenThenStructure() 12 | // [FEATURE] First test object 13 | begin 14 | // [SCENARIO 0001] First test function with valid Given-When-Then structure 15 | // [GIVEN] Valid Given 16 | CreateValidGiven(); 17 | // [WHEN] Valid When 18 | ValidWhen(); 19 | // [THEN] Valid Then 20 | VerifyValidThen(); 21 | // [Then] New Then 22 | CheckNewThen(); 23 | end; 24 | 25 | local procedure CreateValidGiven() 26 | begin 27 | Error('Procedure CreateValidGiven not yet implemented.'); 28 | end; 29 | 30 | local procedure ValidWhen() 31 | begin 32 | Error('Procedure ValidWhen not yet implemented.'); 33 | end; 34 | 35 | local procedure VerifyValidThen() 36 | begin 37 | Error('Procedure VerifyValidThen not yet implemented.'); 38 | end; 39 | 40 | local procedure CheckNewThen() 41 | begin 42 | Error('Procedure CheckNewThen not yet implemented.'); 43 | end; 44 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/results/scenario017.al: -------------------------------------------------------------------------------- 1 | codeunit 50100 "TestObjectFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] First test object 8 | end; 9 | 10 | [Test] 11 | procedure FirstTestFunctionWithValidGivenWhenThenStructure() 12 | // [FEATURE] First test object 13 | begin 14 | // [SCENARIO 0001] First test function with valid Given-When-Then structure 15 | // [Given] Renamed Valid Given 16 | CreateRenamedValidGiven(); 17 | // [WHEN] Valid When 18 | ValidWhen(); 19 | // [THEN] Valid Then 20 | VerifyValidThen(); 21 | end; 22 | 23 | local procedure CreateRenamedValidGiven() 24 | begin 25 | Error('Procedure CreateRenamedValidGiven not yet implemented.'); 26 | end; 27 | 28 | local procedure ValidWhen() 29 | begin 30 | Error('Procedure ValidWhen not yet implemented.'); 31 | end; 32 | 33 | local procedure VerifyValidThen() 34 | begin 35 | Error('Procedure VerifyValidThen not yet implemented.'); 36 | end; 37 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/results/scenario019.al: -------------------------------------------------------------------------------- 1 | codeunit 50100 "TestObjectFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] First test object 8 | end; 9 | 10 | [Test] 11 | procedure FirstTestFunctionWithValidGivenWhenThenStructure() 12 | // [FEATURE] First test object 13 | begin 14 | // [SCENARIO 0001] First test function with valid Given-When-Then structure 15 | // [Given] Valid Given 16 | CreateValidGiven(); 17 | // [WHEN] Valid When 18 | ValidWhen(); 19 | // [THEN] Valid Then 20 | VerifyValidThen(); 21 | end; 22 | 23 | local procedure CreateValidGiven() 24 | begin 25 | Error('Procedure CreateValidGiven not yet implemented.'); 26 | end; 27 | 28 | local procedure ValidWhen() 29 | begin 30 | Error('Procedure ValidWhen not yet implemented.'); 31 | end; 32 | 33 | local procedure VerifyValidThen() 34 | begin 35 | Error('Procedure VerifyValidThen not yet implemented.'); 36 | end; 37 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/results/scenario021.al: -------------------------------------------------------------------------------- 1 | codeunit 50100 "TestObjectFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] First test object 8 | end; 9 | 10 | [Test] 11 | procedure FirstTestFunctionWithValidGivenWhenThenStructure() 12 | // [FEATURE] First test object 13 | begin 14 | // [SCENARIO 0001] First test function with valid Given-When-Then structure 15 | // [GIVEN] Valid Given 16 | CreateValidGiven(); 17 | // [When] Renamed Valid When 18 | RenamedValidWhen(); 19 | // [THEN] Valid Then 20 | VerifyValidThen(); 21 | end; 22 | 23 | local procedure CreateValidGiven() 24 | begin 25 | Error('Procedure CreateValidGiven not yet implemented.'); 26 | end; 27 | 28 | local procedure RenamedValidWhen() 29 | begin 30 | Error('Procedure RenamedValidWhen not yet implemented.'); 31 | end; 32 | 33 | local procedure VerifyValidThen() 34 | begin 35 | Error('Procedure VerifyValidThen not yet implemented.'); 36 | end; 37 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/results/scenario023.al: -------------------------------------------------------------------------------- 1 | codeunit 50100 "TestObjectFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] First test object 8 | end; 9 | 10 | [Test] 11 | procedure FirstTestFunctionWithValidGivenWhenThenStructure() 12 | // [FEATURE] First test object 13 | begin 14 | // [SCENARIO 0001] First test function with valid Given-When-Then structure 15 | // [GIVEN] Valid Given 16 | CreateValidGiven(); 17 | // [When] Valid When 18 | ValidWhen(); 19 | // [THEN] Valid Then 20 | VerifyValidThen(); 21 | end; 22 | 23 | local procedure CreateValidGiven() 24 | begin 25 | Error('Procedure CreateValidGiven not yet implemented.'); 26 | end; 27 | 28 | local procedure ValidWhen() 29 | begin 30 | Error('Procedure ValidWhen not yet implemented.'); 31 | end; 32 | 33 | local procedure VerifyValidThen() 34 | begin 35 | Error('Procedure VerifyValidThen not yet implemented.'); 36 | end; 37 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/results/scenario025.al: -------------------------------------------------------------------------------- 1 | codeunit 50100 "TestObjectFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] First test object 8 | end; 9 | 10 | [Test] 11 | procedure FirstTestFunctionWithValidGivenWhenThenStructure() 12 | // [FEATURE] First test object 13 | begin 14 | // [SCENARIO 0001] First test function with valid Given-When-Then structure 15 | // [GIVEN] Valid Given 16 | CreateValidGiven(); 17 | // [WHEN] Valid When 18 | ValidWhen(); 19 | // [Then] Renamed Valid Then 20 | VerifyRenamedValidThen(); 21 | end; 22 | 23 | local procedure CreateValidGiven() 24 | begin 25 | Error('Procedure CreateValidGiven not yet implemented.'); 26 | end; 27 | 28 | local procedure ValidWhen() 29 | begin 30 | Error('Procedure ValidWhen not yet implemented.'); 31 | end; 32 | 33 | local procedure VerifyRenamedValidThen() 34 | begin 35 | Error('Procedure VerifyRenamedValidThen not yet implemented.'); 36 | end; 37 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/results/scenario027.al: -------------------------------------------------------------------------------- 1 | codeunit 50100 "TestObjectFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] First test object 8 | end; 9 | 10 | [Test] 11 | procedure FirstTestFunctionWithValidGivenWhenThenStructure() 12 | // [FEATURE] First test object 13 | begin 14 | // [SCENARIO 0001] First test function with valid Given-When-Then structure 15 | // [GIVEN] Valid Given 16 | CreateValidGiven(); 17 | // [WHEN] Valid When 18 | ValidWhen(); 19 | // [Then] Valid Then 20 | VerifyValidThen(); 21 | end; 22 | 23 | local procedure CreateValidGiven() 24 | begin 25 | Error('Procedure CreateValidGiven not yet implemented.'); 26 | end; 27 | 28 | local procedure ValidWhen() 29 | begin 30 | Error('Procedure ValidWhen not yet implemented.'); 31 | end; 32 | 33 | local procedure VerifyValidThen() 34 | begin 35 | Error('Procedure VerifyValidThen not yet implemented.'); 36 | end; 37 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/results/scenario030.al: -------------------------------------------------------------------------------- 1 | codeunit 50100 "TestObjectFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] First test object 8 | end; 9 | 10 | [Test] 11 | procedure FirstTestFunctionWithValidGivenWhenThenStructure() 12 | // [FEATURE] First test object 13 | begin 14 | // [SCENARIO 0001] First test function with valid Given-When-Then structure 15 | // [WHEN] Valid When 16 | ValidWhen(); 17 | // [THEN] Valid Then 18 | VerifyValidThen(); 19 | end; 20 | 21 | local procedure ValidWhen() 22 | begin 23 | Error('Procedure ValidWhen not yet implemented.'); 24 | end; 25 | 26 | local procedure VerifyValidThen() 27 | begin 28 | Error('Procedure VerifyValidThen not yet implemented.'); 29 | end; 30 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/results/scenario032.al: -------------------------------------------------------------------------------- 1 | codeunit 50100 "TestObjectFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] First test object 8 | end; 9 | 10 | [Test] 11 | procedure FirstTestFunctionWithValidGivenWhenThenStructure() 12 | // [FEATURE] First test object 13 | begin 14 | // [SCENARIO 0001] First test function with valid Given-When-Then structure 15 | // [WHEN] Valid When 16 | ValidWhen(); 17 | // [THEN] Valid Then 18 | VerifyValidThen(); 19 | end; 20 | 21 | local procedure CreateValidGiven() 22 | begin 23 | Error('Procedure CreateValidGiven not yet implemented.'); 24 | end; 25 | 26 | local procedure ValidWhen() 27 | begin 28 | Error('Procedure ValidWhen not yet implemented.'); 29 | end; 30 | 31 | local procedure VerifyValidThen() 32 | begin 33 | Error('Procedure VerifyValidThen not yet implemented.'); 34 | end; 35 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/results/scenario035.al: -------------------------------------------------------------------------------- 1 | codeunit 50100 "TestObjectFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] First test object 8 | end; 9 | 10 | [Test] 11 | procedure FirstTestFunctionWithValidGivenWhenThenStructure() 12 | // [FEATURE] First test object 13 | begin 14 | // [SCENARIO 0001] First test function with valid Given-When-Then structure 15 | // [GIVEN] Valid Given 16 | CreateValidGiven(); 17 | // [WHEN] Valid When 18 | ValidWhen(); 19 | end; 20 | 21 | local procedure CreateValidGiven() 22 | begin 23 | Error('Procedure CreateValidGiven not yet implemented.'); 24 | end; 25 | 26 | local procedure ValidWhen() 27 | begin 28 | Error('Procedure ValidWhen not yet implemented.'); 29 | end; 30 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/results/scenario037.al: -------------------------------------------------------------------------------- 1 | codeunit 50100 "TestObjectFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] First test object 8 | end; 9 | 10 | [Test] 11 | procedure FirstTestFunctionWithValidGivenWhenThenStructure() 12 | // [FEATURE] First test object 13 | begin 14 | // [SCENARIO 0001] First test function with valid Given-When-Then structure 15 | // [GIVEN] Valid Given 16 | CreateValidGiven(); 17 | // [WHEN] Valid When 18 | ValidWhen(); 19 | end; 20 | 21 | local procedure CreateValidGiven() 22 | begin 23 | Error('Procedure CreateValidGiven not yet implemented.'); 24 | end; 25 | 26 | local procedure ValidWhen() 27 | begin 28 | Error('Procedure ValidWhen not yet implemented.'); 29 | end; 30 | 31 | local procedure VerifyValidThen() 32 | begin 33 | Error('Procedure VerifyValidThen not yet implemented.'); 34 | end; 35 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/results/scenario038.al: -------------------------------------------------------------------------------- 1 | codeunit 50100 "TestObjectFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] First test object 8 | end; 9 | 10 | [Test] 11 | procedure FirstTestFunctionWithValidGivenWhenThenStructure() 12 | // [FEATURE] First test object 13 | begin 14 | // [SCENARIO 0001] First test function with valid Given-When-Then structure 15 | // [GIVEN] Valid Given 16 | CreateValidGiven(); 17 | // [WHEN] Valid When 18 | ValidWhen(); 19 | // [THEN] Valid Then 20 | VerifyValidThen(); 21 | end; 22 | 23 | local procedure CreateValidGiven() 24 | begin 25 | Error('Procedure CreateValidGiven not yet implemented.'); 26 | end; 27 | 28 | local procedure ValidWhen() 29 | begin 30 | Error('Procedure ValidWhen not yet implemented.'); 31 | end; 32 | 33 | local procedure VerifyValidThen() 34 | begin 35 | Error('Procedure VerifyValidThen not yet implemented.'); 36 | end; 37 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/results/scenario039.al: -------------------------------------------------------------------------------- 1 | codeunit 50100 "TestObjectFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] First test object 8 | end; 9 | 10 | [Test] 11 | procedure FirstTestFunctionWithValidGivenWhenThenStructure() 12 | // [FEATURE] First test object 13 | begin 14 | // [SCENARIO 0001] First test function with valid Given-When-Then structure 15 | // [GIVEN] Valid Given 16 | CreateValidGiven(); 17 | // [WHEN] Valid When 18 | ValidWhen(); 19 | // [THEN] Valid Then 20 | VerifyValidThen(); 21 | end; 22 | 23 | local procedure CreateValidGiven() 24 | begin 25 | Error('Procedure CreateValidGiven not yet implemented.'); 26 | end; 27 | 28 | local procedure ValidWhen() 29 | begin 30 | Error('Procedure ValidWhen not yet implemented.'); 31 | end; 32 | 33 | local procedure VerifyValidThen() 34 | begin 35 | Error('Procedure VerifyValidThen not yet implemented.'); 36 | end; 37 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/results/scenario040.al: -------------------------------------------------------------------------------- 1 | codeunit 50100 "TestObjectFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] First test object 8 | end; 9 | 10 | [Test] 11 | procedure FirstTestFunctionWithValidGivenWhenThenStructure() 12 | // [FEATURE] First test object 13 | begin 14 | // [SCENARIO 0001] First test function with valid Given-When-Then structure 15 | // [GIVEN] Valid Given 16 | CreateValidGiven(); 17 | // [WHEN] Valid When 18 | ValidWhen(); 19 | // [THEN] Valid Then 20 | VerifyValidThen(); 21 | end; 22 | 23 | local procedure CreateValidGiven() 24 | begin 25 | Error('Procedure CreateValidGiven not yet implemented.'); 26 | end; 27 | 28 | local procedure ValidWhen() 29 | begin 30 | Error('Procedure ValidWhen not yet implemented.'); 31 | end; 32 | 33 | local procedure VerifyValidThen() 34 | begin 35 | Error('Procedure VerifyValidThen not yet implemented.'); 36 | end; 37 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/results/scenario041.al: -------------------------------------------------------------------------------- 1 | codeunit 50100 "TestObjectFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] First test object 8 | end; 9 | 10 | [Test] 11 | procedure FirstTestFunctionWithValidGivenWhenThenStructure() 12 | // [FEATURE] First test object 13 | begin 14 | // [SCENARIO 0001] First test function with valid Given-When-Then structure 15 | // [GIVEN] Valid Given 16 | CreateValidGiven(); 17 | // [Given] New Given !@#$%^&*() 18 | CreateNewGiven(); 19 | // [WHEN] Valid When 20 | ValidWhen(); 21 | // [THEN] Valid Then 22 | VerifyValidThen(); 23 | end; 24 | 25 | local procedure CreateValidGiven() 26 | begin 27 | Error('Procedure CreateValidGiven not yet implemented.'); 28 | end; 29 | 30 | local procedure ValidWhen() 31 | begin 32 | Error('Procedure ValidWhen not yet implemented.'); 33 | end; 34 | 35 | local procedure VerifyValidThen() 36 | begin 37 | Error('Procedure VerifyValidThen not yet implemented.'); 38 | end; 39 | 40 | local procedure CreateNewGiven() 41 | begin 42 | Error('Procedure CreateNewGiven not yet implemented.'); 43 | end; 44 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/results/scenario042.al: -------------------------------------------------------------------------------- 1 | codeunit 50100 "TestObjectFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] First test object 8 | end; 9 | 10 | [Test] 11 | procedure FirstTestFunctionWithValidGivenWhenThenStructure() 12 | // [FEATURE] First test object 13 | begin 14 | // [SCENARIO 0001] First test function with valid Given-When-Then structure 15 | // [GIVEN] Valid Given 16 | CreateValidGiven(); 17 | // [WHEN] Valid When 18 | ValidWhen(); 19 | // [THEN] Valid Then 20 | VerifyValidThen(); 21 | end; 22 | 23 | local procedure CreateValidGiven() 24 | begin 25 | Error('Procedure CreateValidGiven not yet implemented.'); 26 | end; 27 | 28 | local procedure ValidWhen() 29 | begin 30 | Error('Procedure ValidWhen not yet implemented.'); 31 | end; 32 | 33 | local procedure VerifyValidThen() 34 | begin 35 | Error('Procedure VerifyValidThen not yet implemented.'); 36 | end; 37 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/results/scenario044.al: -------------------------------------------------------------------------------- 1 | codeunit 50100 "TestObjectFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] First test object 8 | end; 9 | 10 | [Test] 11 | procedure FirstTestFunctionWithValidGivenWhenThenStructure() 12 | // [FEATURE] First test object 13 | begin 14 | // [SCENARIO 0001] First test function with valid Given-When-Then structure 15 | // [Given] Renamed Valid Given 16 | MakeRenamedValidGiven(); 17 | // [WHEN] Valid When 18 | ValidWhen(); 19 | // [THEN] Valid Then 20 | VerifyValidThen(); 21 | end; 22 | 23 | local procedure MakeRenamedValidGiven() 24 | begin 25 | Error('Procedure MakeRenamedValidGiven not yet implemented.'); 26 | end; 27 | 28 | local procedure ValidWhen() 29 | begin 30 | Error('Procedure ValidWhen not yet implemented.'); 31 | end; 32 | 33 | local procedure VerifyValidThen() 34 | begin 35 | Error('Procedure VerifyValidThen not yet implemented.'); 36 | end; 37 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/results/scenario049.al: -------------------------------------------------------------------------------- 1 | codeunit 50100 "TestObjectFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] First test object 8 | end; 9 | 10 | [Test] 11 | procedure FirstTestFunctionWithValidGivenWhenThenStructure() 12 | // [FEATURE] First test object 13 | begin 14 | // [SCENARIO 0001] First test function with valid Given-When-Then structure 15 | // [GIVEN] Valid Given 16 | CreateValidGiven(); 17 | // [WHEN] Valid When 18 | ValidWhen(); 19 | // [Then] Renamed Valid Then 20 | CheckRenamedValidThen(); 21 | end; 22 | 23 | local procedure CreateValidGiven() 24 | begin 25 | Error('Procedure CreateValidGiven not yet implemented.'); 26 | end; 27 | 28 | local procedure ValidWhen() 29 | begin 30 | Error('Procedure ValidWhen not yet implemented.'); 31 | end; 32 | 33 | local procedure CheckRenamedValidThen() 34 | begin 35 | Error('Procedure CheckRenamedValidThen not yet implemented.'); 36 | end; 37 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/results/scenario051.al: -------------------------------------------------------------------------------- 1 | codeunit 50100 "TestObjectFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] First test object 8 | end; 9 | 10 | [Test] 11 | procedure FirstTestFunctionWithValidGivenWhenThenStructure() 12 | // [FEATURE] First test object 13 | begin 14 | // [SCENARIO 0001] First test function with valid Given-When-Then structure 15 | // [GIVEN] Valid Given 16 | CreateValidGiven(); 17 | // [Given] Renamed Valid Given 18 | CreateRenamedValidGiven(); 19 | // [WHEN] Valid When 20 | ValidWhen(); 21 | // [THEN] Valid Then 22 | VerifyValidThen(); 23 | end; 24 | 25 | local procedure CreateValidGiven() 26 | begin 27 | Error('Procedure CreateValidGiven not yet implemented.'); 28 | end; 29 | 30 | local procedure ValidWhen() 31 | begin 32 | Error('Procedure ValidWhen not yet implemented.'); 33 | end; 34 | 35 | local procedure VerifyValidThen() 36 | begin 37 | Error('Procedure VerifyValidThen not yet implemented.'); 38 | end; 39 | 40 | local procedure CreateRenamedValidGiven() 41 | begin 42 | Error('Procedure CreateRenamedValidGiven not yet implemented.'); 43 | end; 44 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/results/scenario053.al: -------------------------------------------------------------------------------- 1 | codeunit 50100 "TestObjectFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] First test object 8 | end; 9 | 10 | [Test] 11 | procedure FirstTestFunctionWithValidGivenWhenThenStructure() 12 | // [FEATURE] First test object 13 | begin 14 | // [SCENARIO 0001] First test function with valid Given-When-Then structure 15 | // [GIVEN] Valid Given 16 | CreateValidGiven(); 17 | // [WHEN] Valid When 18 | ValidWhen(); 19 | // [THEN] Valid Then 20 | VerifyValidThen(); 21 | // [Then] Renamed Valid Then 22 | VerifyRenamedValidThen(); 23 | end; 24 | 25 | local procedure CreateValidGiven() 26 | begin 27 | Error('Procedure CreateValidGiven not yet implemented.'); 28 | end; 29 | 30 | local procedure ValidWhen() 31 | begin 32 | Error('Procedure ValidWhen not yet implemented.'); 33 | end; 34 | 35 | local procedure VerifyValidThen() 36 | begin 37 | Error('Procedure VerifyValidThen not yet implemented.'); 38 | end; 39 | 40 | local procedure VerifyRenamedValidThen() 41 | begin 42 | Error('Procedure VerifyRenamedValidThen not yet implemented.'); 43 | end; 44 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/results/scenario055.al: -------------------------------------------------------------------------------- 1 | codeunit 50100 "TestObjectFLX" 2 | { 3 | Subtype = Test; 4 | 5 | var 6 | IsInitialized: Boolean; 7 | 8 | trigger OnRun() 9 | begin 10 | // [FEATURE] First test object 11 | end; 12 | 13 | [Test] 14 | procedure FirstTestFunctionWithValidGivenWhenThenStructure() 15 | // [FEATURE] First test object 16 | begin 17 | // [SCENARIO 0001] First test function with valid Given-When-Then structure 18 | // [GIVEN] Valid Given 19 | CreateValidGiven(); 20 | // [WHEN] Valid When 21 | ValidWhen(); 22 | // [THEN] Valid Then 23 | VerifyValidThen(); 24 | end; 25 | 26 | [Test] 27 | procedure NewScenario2() 28 | begin 29 | // [Scenario #0002] New Scenario (2) 30 | Initialize(); 31 | end; 32 | 33 | local procedure CreateValidGiven() 34 | begin 35 | Error('Procedure CreateValidGiven not yet implemented.'); 36 | end; 37 | 38 | local procedure ValidWhen() 39 | begin 40 | Error('Procedure ValidWhen not yet implemented.'); 41 | end; 42 | 43 | local procedure VerifyValidThen() 44 | begin 45 | Error('Procedure VerifyValidThen not yet implemented.'); 46 | end; 47 | 48 | local procedure Initialize() 49 | var 50 | LibraryTestInitialize: Codeunit "Library - Test Initialize"; 51 | begin 52 | LibraryTestInitialize.OnTestInitialize(Codeunit::"TestObjectFLX"); 53 | 54 | if IsInitialized then 55 | exit; 56 | 57 | LibraryTestInitialize.OnBeforeTestSuiteInitialize(Codeunit::"TestObjectFLX"); 58 | 59 | IsInitialized := true; 60 | Commit(); 61 | 62 | LibraryTestInitialize.OnAfterTestSuiteInitialize(Codeunit::"TestObjectFLX"); 63 | end; 64 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/results/scenario058.al: -------------------------------------------------------------------------------- 1 | codeunit 50100 "TestObjectFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] First test object 8 | end; 9 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/results/scenario060.al: -------------------------------------------------------------------------------- 1 | codeunit 50100 "TestObjectFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] First test object 8 | end; 9 | 10 | local procedure CreateValidGiven() 11 | begin 12 | Error('Procedure CreateValidGiven not yet implemented.'); 13 | end; 14 | 15 | local procedure ValidWhen() 16 | begin 17 | Error('Procedure ValidWhen not yet implemented.'); 18 | end; 19 | 20 | local procedure VerifyValidThen() 21 | begin 22 | Error('Procedure VerifyValidThen not yet implemented.'); 23 | end; 24 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/results/scenario061.al: -------------------------------------------------------------------------------- 1 | codeunit 50100 "TestObjectFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] First test object 8 | end; 9 | 10 | [Test] 11 | procedure FirstTestFunctionWithValidGivenWhenThenStructure() 12 | // [FEATURE] First test object 13 | begin 14 | // [SCENARIO 0001] First test function with valid Given-When-Then structure 15 | // [GIVEN] Valid Given 16 | CreateValidGiven(); 17 | // [Given] New Given 18 | CreateNewGiven(); 19 | // [WHEN] Valid When 20 | ValidWhen(); 21 | // [THEN] Valid Then 22 | VerifyValidThen(); 23 | end; 24 | 25 | local procedure CreateValidGiven() 26 | begin 27 | Error('Procedure CreateValidGiven not yet implemented.'); 28 | end; 29 | 30 | local procedure ValidWhen() 31 | begin 32 | Error('Procedure ValidWhen not yet implemented.'); 33 | end; 34 | 35 | local procedure VerifyValidThen() 36 | begin 37 | Error('Procedure VerifyValidThen not yet implemented.'); 38 | end; 39 | 40 | local procedure CreateNewGiven() 41 | begin 42 | end; 43 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/results/scenario062.al: -------------------------------------------------------------------------------- 1 | codeunit 50100 "TestObjectFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] First test object 8 | end; 9 | 10 | [Test] 11 | procedure FirstTestFunctionWithValidGivenWhenThenStructure() 12 | // [FEATURE] First test object 13 | begin 14 | // [SCENARIO 0001] First test function with valid Given-When-Then structure 15 | // [GIVEN] Valid Given 16 | CreateValidGiven(); 17 | // [WHEN] Valid When 18 | ValidWhen(); 19 | // [THEN] Valid Then 20 | VerifyValidThen(); 21 | // [Then] New Then 22 | VerifyNewThen(); 23 | end; 24 | 25 | local procedure CreateValidGiven() 26 | begin 27 | Error('Procedure CreateValidGiven not yet implemented.'); 28 | end; 29 | 30 | local procedure ValidWhen() 31 | begin 32 | Error('Procedure ValidWhen not yet implemented.'); 33 | end; 34 | 35 | local procedure VerifyValidThen() 36 | begin 37 | Error('Procedure VerifyValidThen not yet implemented.'); 38 | end; 39 | 40 | local procedure VerifyNewThen() 41 | begin 42 | end; 43 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/results/scenario068.al: -------------------------------------------------------------------------------- 1 | codeunit 50103 "TestObjectWithInitializeFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] Test object with Initialize 8 | end; 9 | 10 | local procedure Initialize() 11 | var 12 | LibraryTestInitialize: Codeunit "Library - Test Initialize"; 13 | begin 14 | LibraryTestInitialize.OnTestInitialize(Codeunit::"TestObjectWithInitializeFLX"); 15 | 16 | if IsInitialized then 17 | exit; 18 | 19 | LibraryTestInitialize.OnBeforeTestSuiteInitialize(Codeunit::"TestObjectWithInitializeFLX"); 20 | 21 | IsInitialized := true; 22 | Commit(); 23 | 24 | LibraryTestInitialize.OnAfterTestSuiteInitialize(Codeunit::"TestObjectWithInitializeFLX"); 25 | end; 26 | 27 | var 28 | IsInitialized: Boolean; 29 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/results/scenario069.al: -------------------------------------------------------------------------------- 1 | codeunit 50104 "TestObjectWithUIHandlerFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] Test object with UI Handler 8 | end; 9 | 10 | local procedure Initialize() 11 | var 12 | LibraryTestInitialize: Codeunit "Library - Test Initialize"; 13 | begin 14 | LibraryTestInitialize.OnTestInitialize(Codeunit::"TestObjectWithInitializeFLX"); 15 | 16 | if IsInitialized then 17 | exit; 18 | 19 | LibraryTestInitialize.OnBeforeTestSuiteInitialize(Codeunit::"TestObjectWithInitializeFLX"); 20 | 21 | IsInitialized := true; 22 | Commit(); 23 | 24 | LibraryTestInitialize.OnAfterTestSuiteInitialize(Codeunit::"TestObjectWithInitializeFLX"); 25 | end; 26 | 27 | var 28 | IsInitialized: Boolean; 29 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/results/scenario070.al: -------------------------------------------------------------------------------- 1 | codeunit 50104 "TestObjectWithUIHandlerFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] Test object with UI Handler 8 | end; 9 | 10 | local procedure Initialize() 11 | var 12 | LibraryTestInitialize: Codeunit "Library - Test Initialize"; 13 | begin 14 | LibraryTestInitialize.OnTestInitialize(Codeunit::"TestObjectWithInitializeFLX"); 15 | 16 | if IsInitialized then 17 | exit; 18 | 19 | LibraryTestInitialize.OnBeforeTestSuiteInitialize(Codeunit::"TestObjectWithInitializeFLX"); 20 | 21 | IsInitialized := true; 22 | Commit(); 23 | 24 | LibraryTestInitialize.OnAfterTestSuiteInitialize(Codeunit::"TestObjectWithInitializeFLX"); 25 | end; 26 | 27 | [MessageHandler] 28 | procedure AMessageHandler(Msg: Text) 29 | begin 30 | end; 31 | 32 | var 33 | IsInitialized: Boolean; 34 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/results/scenario071.al: -------------------------------------------------------------------------------- 1 | codeunit 50103 "TestObjectWithInitializeFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] Test object with Initialize 8 | end; 9 | 10 | local procedure Initialize() 11 | var 12 | LibraryTestInitialize: Codeunit "Library - Test Initialize"; 13 | begin 14 | LibraryTestInitialize.OnTestInitialize(Codeunit::"TestObjectWithInitializeFLX"); 15 | 16 | if IsInitialized then 17 | exit; 18 | 19 | LibraryTestInitialize.OnBeforeTestSuiteInitialize(Codeunit::"TestObjectWithInitializeFLX"); 20 | 21 | IsInitialized := true; 22 | Commit(); 23 | 24 | LibraryTestInitialize.OnAfterTestSuiteInitialize(Codeunit::"TestObjectWithInitializeFLX"); 25 | end; 26 | 27 | var 28 | IsInitialized: Boolean; 29 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/results/scenario072.al: -------------------------------------------------------------------------------- 1 | codeunit 50103 "TestObjectWithInitializeFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] Test object with Initialize 8 | end; 9 | 10 | local procedure Initialize() 11 | var 12 | LibraryTestInitialize: Codeunit "Library - Test Initialize"; 13 | begin 14 | LibraryTestInitialize.OnTestInitialize(Codeunit::"TestObjectWithInitializeFLX"); 15 | 16 | if IsInitialized then 17 | exit; 18 | 19 | LibraryTestInitialize.OnBeforeTestSuiteInitialize(Codeunit::"TestObjectWithInitializeFLX"); 20 | 21 | IsInitialized := true; 22 | Commit(); 23 | 24 | LibraryTestInitialize.OnAfterTestSuiteInitialize(Codeunit::"TestObjectWithInitializeFLX"); 25 | end; 26 | 27 | local procedure CreateValidGiven() 28 | begin 29 | Error('Procedure CreateValidGiven not yet implemented.'); 30 | end; 31 | 32 | local procedure ValidWhen() 33 | begin 34 | Error('Procedure ValidWhen not yet implemented.'); 35 | end; 36 | 37 | local procedure VerifyValidThen() 38 | begin 39 | Error('Procedure VerifyValidThen not yet implemented.'); 40 | end; 41 | 42 | var 43 | IsInitialized: Boolean; 44 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/results/scenario081.al: -------------------------------------------------------------------------------- 1 | codeunit 50100 "TestObjectFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] First test object 8 | end; 9 | 10 | [Test] 11 | procedure ValidGivenWhenThenStructure() 12 | // [FEATURE] First test object 13 | begin 14 | // [SCENARIO 0001] Valid Given-When-Then structure 15 | // [GIVEN] Valid Given 16 | CreateValidGiven(); 17 | // [WHEN] Valid When 18 | ValidWhen(); 19 | // [THEN] Valid Then 20 | VerifyValidThen(); 21 | end; 22 | 23 | local procedure CreateValidGiven() 24 | begin 25 | Error('Procedure CreateValidGiven not yet implemented.'); 26 | end; 27 | 28 | local procedure ValidWhen() 29 | begin 30 | Error('Procedure ValidWhen not yet implemented.'); 31 | end; 32 | 33 | local procedure VerifyValidThen() 34 | begin 35 | Error('Procedure VerifyValidThen not yet implemented.'); 36 | end; 37 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/results/scenario086.al: -------------------------------------------------------------------------------- 1 | codeunit 50109 "New Feature" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [Feature] New Feature 8 | end; 9 | 10 | var 11 | IsInitialized: Boolean; 12 | 13 | [Test] 14 | procedure NewTestProcedure() 15 | begin 16 | // [Scenario #0001] New Test Procedure 17 | Initialize(); 18 | end; 19 | 20 | local procedure Initialize() 21 | var 22 | LibraryTestInitialize: Codeunit "Library - Test Initialize"; 23 | begin 24 | LibraryTestInitialize.OnTestInitialize(Codeunit::"New Feature"); 25 | 26 | if IsInitialized then 27 | exit; 28 | 29 | LibraryTestInitialize.OnBeforeTestSuiteInitialize(Codeunit::"New Feature"); 30 | 31 | IsInitialized := true; 32 | Commit(); 33 | 34 | LibraryTestInitialize.OnAfterTestSuiteInitialize(Codeunit::"New Feature"); 35 | end; 36 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/results/scenario087.al: -------------------------------------------------------------------------------- 1 | codeunit 50100 "TestObjectFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] First test object 8 | end; 9 | 10 | [Test] 11 | procedure FirstTestFunctionWithValidGivenWhenThenStructure() 12 | // [FEATURE] First test object 13 | begin 14 | // [SCENARIO 0001] First test function with valid Given-When-Then structure 15 | // [Given] Renamed Valid Given 16 | MakeRenamedValidGiven(); 17 | CreateValidGiven(); 18 | // [WHEN] Valid When 19 | ValidWhen(); 20 | // [THEN] Valid Then 21 | VerifyValidThen(); 22 | end; 23 | 24 | local procedure CreateValidGiven() 25 | begin 26 | Error('Procedure CreateValidGiven not yet implemented.'); 27 | end; 28 | 29 | local procedure ValidWhen() 30 | begin 31 | Error('Procedure ValidWhen not yet implemented.'); 32 | end; 33 | 34 | local procedure VerifyValidThen() 35 | begin 36 | Error('Procedure VerifyValidThen not yet implemented.'); 37 | end; 38 | 39 | local procedure MakeRenamedValidGiven() 40 | begin 41 | Error('Procedure MakeRenamedValidGiven not yet implemented.'); 42 | end; 43 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/results/scenario088.al: -------------------------------------------------------------------------------- 1 | codeunit 50100 "TestObjectFLX" 2 | { 3 | Subtype = Test; 4 | 5 | trigger OnRun() 6 | begin 7 | // [FEATURE] First test object 8 | end; 9 | 10 | [Test] 11 | procedure FirstTestFunctionWithValidGivenWhenThenStructure() 12 | // [FEATURE] First test object 13 | begin 14 | // [SCENARIO 0001] First test function with valid Given-When-Then structure 15 | // [GIVEN] Valid Given 16 | CreateValidGiven(); 17 | // [WHEN] Valid When 18 | ValidWhen(); 19 | // [Then] Renamed Valid Then 20 | CheckRenamedValidThen(); 21 | VerifyValidThen(); 22 | end; 23 | 24 | local procedure CreateValidGiven() 25 | begin 26 | Error('Procedure CreateValidGiven not yet implemented.'); 27 | end; 28 | 29 | local procedure ValidWhen() 30 | begin 31 | Error('Procedure ValidWhen not yet implemented.'); 32 | end; 33 | 34 | local procedure VerifyValidThen() 35 | begin 36 | Error('Procedure VerifyValidThen not yet implemented.'); 37 | end; 38 | 39 | local procedure CheckRenamedValidThen() 40 | begin 41 | Error('Procedure CheckRenamedValidThen not yet implemented.'); 42 | end; 43 | } -------------------------------------------------------------------------------- /vscode-extension/src/test/runTest.ts: -------------------------------------------------------------------------------- 1 | import * as path from 'path'; 2 | 3 | import { runTests } from '@vscode/test-electron'; 4 | 5 | async function main() { 6 | try { 7 | // The folder containing the Extension Manifest package.json 8 | // Passed to `--extensionDevelopmentPath` 9 | const extensionDevelopmentPath = path.resolve(__dirname, '../../'); 10 | 11 | // The path to the extension test script 12 | // Passed to --extensionTestsPath 13 | const extensionTestsPath = path.resolve(__dirname, './index'); 14 | 15 | // Download VS Code, unzip it and run the integration test 16 | await runTests({ extensionDevelopmentPath, extensionTestsPath }); 17 | } catch (err) { 18 | console.error('Failed to run tests'); 19 | process.exit(1); 20 | } 21 | } 22 | 23 | main(); -------------------------------------------------------------------------------- /vscode-extension/src/typings/types.ts: -------------------------------------------------------------------------------- 1 | export interface IMessageBase { 2 | Command?: string; 3 | Params?: any; 4 | Data?: any; 5 | } 6 | 7 | export interface Message { 8 | Uid: string; 9 | Project: string; 10 | Feature: string; 11 | Id?: number; 12 | Scenario: string; 13 | Codeunit: string; 14 | FsPath: string; 15 | MethodName: string; 16 | IsDirty: boolean; 17 | State: MessageState; 18 | TestRunnerResult: ALTestRunnerResult; 19 | Details: MessageDetails; 20 | } 21 | 22 | export interface MessageDetails { 23 | given: Array; 24 | when: Array; 25 | then: Array; 26 | } 27 | 28 | export enum ALTestRunnerResult { 29 | NoInfo, 30 | Success, 31 | Failure 32 | } 33 | 34 | export enum MessageState { 35 | Unchanged, 36 | New, 37 | Modified, 38 | Deleted 39 | } 40 | 41 | export interface MessageUpdate { 42 | Scenario: string; 43 | Feature: string; 44 | Type: TypeChanged; 45 | State: MessageState; 46 | OldValue: string; 47 | NewValue: string; 48 | Id?: number; 49 | FsPath: string; 50 | Project: string; 51 | ProceduresToDelete?: Array<{ procedureName: string, parameterTypes: string[] }>; 52 | UpdateProcedureCall?: boolean; 53 | ArrayIndex?: number; 54 | MethodName?: string; 55 | internalCall?: boolean; 56 | } 57 | 58 | export enum TypeChanged { 59 | Feature, 60 | ScenarioFeature, 61 | ScenarioId, 62 | ScenarioName, 63 | Given, 64 | When, 65 | Then 66 | } -------------------------------------------------------------------------------- /vscode-extension/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es6", 5 | "outDir": "out", 6 | "lib": [ 7 | "es6", 8 | "dom" 9 | ], 10 | "types": ["node"], 11 | "sourceMap": true, 12 | "emitDecoratorMetadata": true, 13 | "experimentalDecorators": true, 14 | "rootDir": "src", 15 | /* Strict Type-Checking Option */ 16 | "strict": true, /* enable all strict type-checking options */ 17 | /* Additional Checks */ 18 | "noUnusedLocals": true /* Report errors on unused locals. */ 19 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ 20 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ 21 | // "noUnusedParameters": true, /* Report errors on unused parameters. */ 22 | }, 23 | "exclude": [ 24 | "node_modules", 25 | ".vscode-test" 26 | ] 27 | } -------------------------------------------------------------------------------- /vscode-extension/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "no-string-throw": true, 4 | "no-unused-expression": true, 5 | "no-duplicate-variable": true, 6 | "curly": true, 7 | "class-name": true, 8 | "semicolon": [ 9 | true, 10 | "always" 11 | ], 12 | "triple-equals": true 13 | }, 14 | "defaultSeverity": "warning" 15 | } -------------------------------------------------------------------------------- /vscode-extension/webpack.config.js: -------------------------------------------------------------------------------- 1 | // Source: https://github.com/microsoft/vscode-iot-workbench 2 | 3 | const path = require("path"); 4 | const cp = require("child_process"); 5 | const fs = require("fs-plus"); 6 | 7 | function getDependeciesFromNpm(mod) { 8 | let list = []; 9 | const deps = mod.dependencies; 10 | if (!deps) { 11 | return list; 12 | } 13 | for (const m of Object.keys(deps)) { 14 | list.push(m); 15 | list = list.concat(getDependeciesFromNpm(deps[m])); 16 | } 17 | return list; 18 | } 19 | 20 | function getEntry() { 21 | const entry = {}; 22 | const npmListRes = cp.execSync("npm list -only prod -json", { 23 | encoding: "utf8" 24 | }); 25 | const mod = JSON.parse(npmListRes); 26 | const unbundledModule = []; 27 | for (const mod of unbundledModule) { 28 | switch (mod) { 29 | default: 30 | let p = "node_modules/" + mod; 31 | fs.copySync(p, "out/node_modules/" + mod); 32 | break; 33 | } 34 | } 35 | 36 | const list = getDependeciesFromNpm(mod); 37 | const moduleList = list.filter((value, index, self) => { 38 | return self.indexOf(value) === index && unbundledModule.indexOf(value) === -1 && !/^@types\//.test(value); 39 | }); 40 | 41 | for (const mod of moduleList) { 42 | entry[mod] = "./node_modules/" + mod; 43 | } 44 | 45 | return entry; 46 | } 47 | 48 | /**@type {import('webpack').Configuration}*/ 49 | const config = { 50 | target: "node", 51 | 52 | entry: getEntry(), 53 | output: { 54 | path: path.resolve(__dirname, "out/node_modules"), 55 | filename: "[name].js", 56 | libraryTarget: "commonjs2", 57 | devtoolModuleFilenameTemplate: "../[resource-path]" 58 | }, 59 | node: { 60 | __dirname: false, 61 | __filename: false, 62 | global: true, 63 | }, 64 | externals: { 65 | vscode: "commonjs vscode" 66 | }, 67 | resolve: { 68 | extensions: [".js", ".json"] 69 | } 70 | }; 71 | 72 | module.exports = config; 73 | -------------------------------------------------------------------------------- /web-ui/.dockerignore: -------------------------------------------------------------------------------- 1 | Dockerfile 2 | .dockerignore 3 | docker-compose.yml 4 | 5 | node_modules 6 | 7 | .git 8 | .gitignore 9 | .eslintrc.json 10 | .editorconfig 11 | 12 | .DS_STORE 13 | Thumbs.db 14 | 15 | .idea 16 | .vscode/* 17 | !.vscode/settings.json 18 | !.vscode/tasks.json 19 | !.vscode/launch.json 20 | !.vscode/extensions.json 21 | 22 | **/*.csproj 23 | **/*.cs 24 | **/*.cshtml 25 | Views 26 | Controllers 27 | **/*.Development.* 28 | -------------------------------------------------------------------------------- /web-ui/.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # You may want to customise this file depending on your Operating System 3 | # and the editor that you use. 4 | # 5 | # We recommend that you use a Global Gitignore for files that are not related 6 | # to the project. (https://help.github.com/articles/ignoring-files/#create-a-global-gitignore) 7 | 8 | # OS 9 | # 10 | # Ref: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore 11 | # Ref: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore 12 | # Ref: https://github.com/github/gitignore/blob/master/Global/Linux.gitignore 13 | .DS_STORE 14 | Thumbs.db 15 | 16 | # Editors 17 | # 18 | # Ref: https://github.com/github/gitignore/blob/master/Global 19 | # Ref: https://github.com/github/gitignore/blob/master/Global/JetBrains.gitignore 20 | # Ref: https://github.com/github/gitignore/blob/master/Global/VisualStudioCode.gitignore 21 | .idea 22 | .chrome 23 | package-lock.json 24 | yarn.lock 25 | .vscode/* 26 | !.vscode/settings.json 27 | !.vscode/tasks.json 28 | !.vscode/launch.json 29 | !.vscode/extensions.json 30 | 31 | # Dependencies 32 | node_modules 33 | 34 | # Compiled files 35 | /scripts 36 | /src/environment.js 37 | /src/environment.ts 38 | /dist 39 | /test/coverage-jest 40 | /test/coverage-karma 41 | -------------------------------------------------------------------------------- /web-ui/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "AureliaEffect.aurelia", 4 | "msjsdiag.debugger-for-chrome", 5 | "steoates.autoimport", 6 | "EditorConfig.EditorConfig", 7 | "christian-kohler.path-intellisense", 8 | "behzad88.Aurelia" 9 | ] 10 | } -------------------------------------------------------------------------------- /web-ui/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Chrome Debugger", 6 | "type": "chrome", 7 | "request": "launch", 8 | "url": "http://localhost:9000", 9 | "webRoot": "${workspaceRoot}/src", 10 | "userDataDir": "${workspaceRoot}/.chrome", 11 | "sourceMapPathOverrides": { 12 | "../src/*": "${webRoot}/*" 13 | } 14 | }, 15 | { 16 | "type": "chrome", 17 | "request": "attach", 18 | "name": "Attach Karma Chrome", 19 | "address": "localhost", 20 | "port": 9333, 21 | "sourceMaps": true, 22 | "pathMapping": { 23 | "/": "${workspaceRoot}", 24 | "/base/": "${workspaceRoot}/" 25 | }, 26 | "sourceMapPathOverrides": { 27 | "../src/*": "${webRoot}/*" 28 | } 29 | } 30 | ] 31 | } -------------------------------------------------------------------------------- /web-ui/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "typescript.tsdk": "node_modules/typescript/lib", 3 | "html.suggest.angular1": false, 4 | "html.suggest.ionic": false 5 | } -------------------------------------------------------------------------------- /web-ui/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=733558 3 | // for the documentation about the tasks.json format 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "label": "build", 8 | "type": "shell", 9 | "command": [ 10 | "au build", 11 | "\r\n", 12 | "au copy-files" 13 | ], 14 | "isBackground": true, 15 | "problemMatcher": [ 16 | "$go" 17 | ], 18 | "group": { 19 | "kind": "build", 20 | "isDefault": true 21 | } 22 | } 23 | ] 24 | } -------------------------------------------------------------------------------- /web-ui/Dockerfile: -------------------------------------------------------------------------------- 1 | # build stage 2 | FROM node:lts as build-stage 3 | 4 | 5 | RUN npm install -g aurelia-cli@^1.2.0 6 | 7 | 8 | WORKDIR /app 9 | 10 | # install dependencies 11 | COPY ./*.json ./ 12 | RUN npm install 13 | 14 | COPY config ./config 15 | COPY aurelia_project ./aurelia_project 16 | 17 | 18 | 19 | # Copy files in the root folder 20 | COPY *.* ./ 21 | 22 | # Copy source files 23 | COPY src ./src 24 | 25 | 26 | # Copy test, unit & e2e 27 | COPY test ./test 28 | 29 | 30 | # RUN UNIT TESTS 31 | RUN au test 32 | 33 | 34 | # build 35 | FROM build-stage as publish-stage 36 | RUN au build --env prod 37 | 38 | # production stage 39 | FROM nginx:alpine as production-stage 40 | COPY nginx.conf /etc/nginx/nginx.conf 41 | WORKDIR /usr/share/nginx/html 42 | 43 | 44 | 45 | 46 | COPY --from=publish-stage /app/scripts/ ./scripts/ 47 | COPY --from=publish-stage /app/index.html/ . 48 | 49 | EXPOSE 80 50 | 51 | CMD ["nginx", "-g", "daemon off;"] 52 | -------------------------------------------------------------------------------- /web-ui/README.md: -------------------------------------------------------------------------------- 1 | # `atdd-web-ui` 2 | 3 | This project is bootstrapped by [aurelia-cli](https://github.com/aurelia/cli). 4 | 5 | For more information, go to https://aurelia.io/docs/cli/cli-bundler 6 | 7 | ## Run dev app 8 | 9 | Run `au run`, then open `http://localhost:9000` 10 | 11 | To open browser automatically, do `au run --open`. 12 | 13 | To change dev server port, do `au run --port 8888`. 14 | 15 | To change dev server host, do `au run --host 127.0.0.1` 16 | 17 | 18 | **PS:** You could mix all the flags as well, `au run --host 127.0.0.1 --port 7070 --open` 19 | 20 | ## Build for production 21 | 22 | Run `au build --env prod`. 23 | 24 | ## Unit tests 25 | 26 | Run `au test` (or `au jest`). 27 | 28 | To run in watch mode, `au test --watch` or `au jest --watch`. 29 | 30 | 31 | ## Build for Docker 32 | 33 | This is as simple as running a command: 34 | 35 | `yarn docker:build` or `npm run docker:build` 36 | 37 | if you want to bring up an instance on your machine run: 38 | 39 | `yarn docker:start` or `npm run docker:build` 40 | 41 | to stop the previously started instance: 42 | 43 | `yarn docker:stop` or `npm run docker:stop` 44 | -------------------------------------------------------------------------------- /web-ui/aurelia_project/environments/dev.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | debug: true, 3 | testing: true 4 | }; 5 | -------------------------------------------------------------------------------- /web-ui/aurelia_project/environments/prod.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | debug: false, 3 | testing: false 4 | }; 5 | -------------------------------------------------------------------------------- /web-ui/aurelia_project/environments/stage.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | debug: true, 3 | testing: false 4 | }; 5 | -------------------------------------------------------------------------------- /web-ui/aurelia_project/generators/attribute.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "attribute", 3 | "description": "Creates a custom attribute class and places it in the project resources." 4 | } -------------------------------------------------------------------------------- /web-ui/aurelia_project/generators/attribute.ts: -------------------------------------------------------------------------------- 1 | import {inject} from 'aurelia-dependency-injection'; 2 | import {Project, ProjectItem, CLIOptions, UI} from 'aurelia-cli'; 3 | 4 | @inject(Project, CLIOptions, UI) 5 | export default class AttributeGenerator { 6 | constructor(private project: Project, private options: CLIOptions, private ui: UI) { } 7 | 8 | async execute() { 9 | const name = await this.ui.ensureAnswer( 10 | this.options.args[0], 11 | 'What would you like to call the custom attribute?' 12 | ); 13 | 14 | let fileName = this.project.makeFileName(name); 15 | let className = this.project.makeClassName(name); 16 | 17 | this.project.attributes.add( 18 | ProjectItem.text(`${fileName}.ts`, this.generateSource(className)) 19 | ); 20 | 21 | await this.project.commitChanges(); 22 | await this.ui.log(`Created ${fileName}.`); 23 | } 24 | 25 | generateSource(className) { 26 | return `import {autoinject} from 'aurelia-framework'; 27 | 28 | @autoinject() 29 | export class ${className}CustomAttribute { 30 | constructor(private element: Element) { } 31 | 32 | valueChanged(newValue, oldValue) { 33 | // 34 | } 35 | } 36 | `; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /web-ui/aurelia_project/generators/binding-behavior.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "binding-behavior", 3 | "description": "Creates a binding behavior class and places it in the project resources." 4 | } -------------------------------------------------------------------------------- /web-ui/aurelia_project/generators/binding-behavior.ts: -------------------------------------------------------------------------------- 1 | import {inject} from 'aurelia-dependency-injection'; 2 | import {Project, ProjectItem, CLIOptions, UI} from 'aurelia-cli'; 3 | 4 | @inject(Project, CLIOptions, UI) 5 | export default class BindingBehaviorGenerator { 6 | constructor(private project: Project, private options: CLIOptions, private ui: UI) { } 7 | 8 | async execute() { 9 | const name = await this.ui.ensureAnswer( 10 | this.options.args[0], 11 | 'What would you like to call the binding behavior?' 12 | ); 13 | 14 | let fileName = this.project.makeFileName(name); 15 | let className = this.project.makeClassName(name); 16 | 17 | this.project.bindingBehaviors.add( 18 | ProjectItem.text(`${fileName}.ts`, this.generateSource(className)) 19 | ); 20 | 21 | await this.project.commitChanges(); 22 | await this.ui.log(`Created ${fileName}.`); 23 | } 24 | 25 | generateSource(className) { 26 | return `export class ${className}BindingBehavior { 27 | bind(binding, source) { 28 | // 29 | } 30 | 31 | unbind(binding, source) { 32 | // 33 | } 34 | } 35 | ` 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /web-ui/aurelia_project/generators/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "component", 3 | "description": "Creates a custom component class and template (view model and view), placing them in the project source folder (or optionally in sub folders)." 4 | } -------------------------------------------------------------------------------- /web-ui/aurelia_project/generators/component.ts: -------------------------------------------------------------------------------- 1 | import { inject } from 'aurelia-dependency-injection'; 2 | import { Project, ProjectItem, CLIOptions, UI } from 'aurelia-cli'; 3 | 4 | var path = require('path'); 5 | 6 | @inject(Project, CLIOptions, UI) 7 | export default class ElementGenerator { 8 | constructor(private project: Project, private options: CLIOptions, private ui: UI) { } 9 | 10 | async execute() { 11 | const name = await this.ui.ensureAnswer( 12 | this.options.args[0], 13 | 'What would you like to call the component?' 14 | ); 15 | 16 | const subFolders = await this.ui.ensureAnswer( 17 | this.options.args[1], 18 | 'What sub-folder would you like to add it to?\nIf it doesn\'t exist it will be created for you.\n\nDefault folder is the source folder (src).', "." 19 | ); 20 | 21 | let fileName = this.project.makeFileName(name); 22 | let className = this.project.makeClassName(name); 23 | 24 | this.project.root.add( 25 | ProjectItem.text(path.join(subFolders, fileName + '.ts'), this.generateJSSource(className)), 26 | ProjectItem.text(path.join(subFolders, fileName + '.html'), this.generateHTMLSource(className)) 27 | ); 28 | 29 | await this.project.commitChanges(); 30 | await this.ui.log(`Created ${name} in the '${path.join(this.project.root.name, subFolders)}' folder`); 31 | } 32 | 33 | generateJSSource(className) { 34 | return `export class ${className} { 35 | message: string; 36 | 37 | constructor() { 38 | this.message = 'Hello world'; 39 | } 40 | } 41 | ` 42 | } 43 | 44 | generateHTMLSource(className) { 45 | return ` 48 | ` 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /web-ui/aurelia_project/generators/element.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "element", 3 | "description": "Creates a custom element class and template, placing them in the project resources." 4 | } -------------------------------------------------------------------------------- /web-ui/aurelia_project/generators/element.ts: -------------------------------------------------------------------------------- 1 | import {inject} from 'aurelia-dependency-injection'; 2 | import {Project, ProjectItem, CLIOptions, UI} from 'aurelia-cli'; 3 | 4 | @inject(Project, CLIOptions, UI) 5 | export default class ElementGenerator { 6 | constructor(private project: Project, private options: CLIOptions, private ui: UI) { } 7 | 8 | async execute() { 9 | const name = await this.ui.ensureAnswer( 10 | this.options.args[0], 11 | 'What would you like to call the custom element?' 12 | ); 13 | 14 | let fileName = this.project.makeFileName(name); 15 | let className = this.project.makeClassName(name); 16 | 17 | this.project.elements.add( 18 | ProjectItem.text(`${fileName}.ts`, this.generateJSSource(className)), 19 | ProjectItem.text(`${fileName}.html`, this.generateHTMLSource(className)) 20 | ); 21 | 22 | await this.project.commitChanges(); 23 | await this.ui.log(`Created ${fileName}.`); 24 | } 25 | 26 | generateJSSource(className) { 27 | return `import {bindable} from 'aurelia-framework'; 28 | 29 | export class ${className} { 30 | @bindable value; 31 | 32 | valueChanged(newValue, oldValue) { 33 | // 34 | } 35 | } 36 | `; 37 | } 38 | 39 | generateHTMLSource(className) { 40 | return ` 43 | `; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /web-ui/aurelia_project/generators/generator.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "generator", 3 | "description": "Creates a generator class and places it in the project generators folder." 4 | } -------------------------------------------------------------------------------- /web-ui/aurelia_project/generators/task.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "task", 3 | "description": "Creates a task and places it in the project tasks folder." 4 | } -------------------------------------------------------------------------------- /web-ui/aurelia_project/generators/task.ts: -------------------------------------------------------------------------------- 1 | import {inject} from 'aurelia-dependency-injection'; 2 | import {Project, ProjectItem, CLIOptions, UI} from 'aurelia-cli'; 3 | 4 | @inject(Project, CLIOptions, UI) 5 | export default class TaskGenerator { 6 | constructor(private project: Project, private options: CLIOptions, private ui: UI) { } 7 | 8 | async execute() { 9 | const name = await this.ui.ensureAnswer( 10 | this.options.args[0], 11 | 'What would you like to call the task?' 12 | ); 13 | 14 | let fileName = this.project.makeFileName(name); 15 | let functionName = this.project.makeFunctionName(name); 16 | 17 | this.project.tasks.add( 18 | ProjectItem.text(`${fileName}.ts`, this.generateSource(functionName)) 19 | ); 20 | 21 | await this.project.commitChanges(); 22 | await this.ui.log(`Created ${fileName}.`); 23 | } 24 | 25 | generateSource(functionName) { 26 | return `import * as gulp from 'gulp'; 27 | import * as project from '../aurelia.json'; 28 | 29 | export default function ${functionName}() { 30 | return gulp.src(project.paths.???) 31 | .pipe(gulp.dest(project.paths.output)); 32 | } 33 | `; 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /web-ui/aurelia_project/generators/value-converter.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "value-converter", 3 | "description": "Creates a value converter class and places it in the project resources." 4 | } -------------------------------------------------------------------------------- /web-ui/aurelia_project/generators/value-converter.ts: -------------------------------------------------------------------------------- 1 | import {inject} from 'aurelia-dependency-injection'; 2 | import {Project, ProjectItem, CLIOptions, UI} from 'aurelia-cli'; 3 | 4 | @inject(Project, CLIOptions, UI) 5 | export default class ValueConverterGenerator { 6 | constructor(private project: Project, private options: CLIOptions, private ui: UI) { } 7 | 8 | async execute() { 9 | const name = await this.ui.ensureAnswer( 10 | this.options.args[0], 11 | 'What would you like to call the value converter?' 12 | ); 13 | 14 | let fileName = this.project.makeFileName(name); 15 | let className = this.project.makeClassName(name); 16 | 17 | this.project.valueConverters.add( 18 | ProjectItem.text(`${fileName}.ts`, this.generateSource(className)) 19 | ); 20 | 21 | await this.project.commitChanges(); 22 | await this.ui.log(`Created ${fileName}.`); 23 | } 24 | 25 | generateSource(className) { 26 | return `export class ${className}ValueConverter { 27 | toView(value) { 28 | // 29 | } 30 | 31 | fromView(value) { 32 | // 33 | } 34 | } 35 | `; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /web-ui/aurelia_project/tasks/build.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "build", 3 | "description": "Builds and processes all application assets.", 4 | "flags": [ 5 | { 6 | "name": "env", 7 | "description": "Sets the build environment.", 8 | "type": "string" 9 | }, 10 | { 11 | "name": "watch", 12 | "description": "Watches source files for changes and refreshes the bundles automatically.", 13 | "type": "boolean" 14 | } 15 | ] 16 | } -------------------------------------------------------------------------------- /web-ui/aurelia_project/tasks/build.ts: -------------------------------------------------------------------------------- 1 | import * as gulp from 'gulp'; 2 | import * as project from '../aurelia.json'; 3 | import {CLIOptions, build as buildCLI} from 'aurelia-cli'; 4 | import transpile from './transpile'; 5 | import processMarkup from './process-markup'; 6 | import processJson from './process-json'; 7 | import processCSS from './process-css'; 8 | import copyFiles from './copy-files'; 9 | import cssBundle from './css-bundle'; 10 | import watch from './watch'; 11 | 12 | let build = gulp.series( 13 | readProjectConfiguration, 14 | gulp.parallel( 15 | transpile, 16 | processMarkup, 17 | processJson, 18 | processCSS, 19 | cssBundle 20 | ), 21 | writeBundles, 22 | copyFiles 23 | ); 24 | 25 | let main; 26 | 27 | if (CLIOptions.taskName() === 'build' && CLIOptions.hasFlag('watch')) { 28 | main = gulp.series( 29 | build, 30 | (done) => { watch(); done(); } 31 | ); 32 | } else { 33 | main = build; 34 | } 35 | 36 | function readProjectConfiguration() { 37 | return buildCLI.src(project); 38 | } 39 | 40 | function writeBundles() { 41 | return buildCLI.dest(); 42 | } 43 | 44 | export { main as default }; 45 | -------------------------------------------------------------------------------- /web-ui/aurelia_project/tasks/clear-cache.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "clear-cache", 3 | "description": "Clear both transpile cache (only for esnext), and tracing-cache (for CLI built-in tracer)." 4 | } -------------------------------------------------------------------------------- /web-ui/aurelia_project/tasks/clear-cache.ts: -------------------------------------------------------------------------------- 1 | import * as gulp from 'gulp'; 2 | import {build} from 'aurelia-cli'; 3 | 4 | export default function clearCache() { 5 | return build.clearCache(); 6 | } 7 | -------------------------------------------------------------------------------- /web-ui/aurelia_project/tasks/copy-files.ts: -------------------------------------------------------------------------------- 1 | import * as gulp from 'gulp'; 2 | import * as path from 'path'; 3 | import * as minimatch from 'minimatch'; 4 | import * as project from '../aurelia.json'; 5 | 6 | export default function copyFiles(done) { 7 | if (typeof project.build.copyFiles !== 'object') { 8 | done(); 9 | return; 10 | } 11 | 12 | const instruction = getNormalizedInstruction(); 13 | const files = Object.keys(instruction); 14 | 15 | return gulp.src(files, {since: gulp.lastRun(copyFiles)}) 16 | .pipe(gulp.dest(x => { 17 | const filePath = prepareFilePath(x.path); 18 | const key = files.find(f => minimatch(filePath, f)); 19 | return instruction[key]; 20 | })); 21 | } 22 | 23 | function getNormalizedInstruction() { 24 | const files = project.build.copyFiles; 25 | let normalizedInstruction = {}; 26 | 27 | for (let key in files) { 28 | normalizedInstruction[path.posix.normalize(key)] = files[key]; 29 | } 30 | 31 | return normalizedInstruction; 32 | } 33 | 34 | function prepareFilePath(filePath) { 35 | let preparedPath = filePath.replace(process.cwd(), '').slice(1); 36 | 37 | //if we are running on windows we have to fix the path 38 | if (/^win/.test(process.platform)) { 39 | preparedPath = preparedPath.replace(/\\/g, '/'); 40 | } 41 | 42 | return preparedPath; 43 | } 44 | -------------------------------------------------------------------------------- /web-ui/aurelia_project/tasks/css-bundle.ts: -------------------------------------------------------------------------------- 1 | import * as gulp from 'gulp'; 2 | import * as project from '../aurelia.json'; 3 | import {build} from 'aurelia-cli'; 4 | 5 | export default function bundleCss() { 6 | return gulp.src(project.bundleCss.source) 7 | .pipe(build.bundle()); 8 | }; 9 | -------------------------------------------------------------------------------- /web-ui/aurelia_project/tasks/jest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jest", 3 | "description": "Runs Jest and reports the results.", 4 | "flags": [ 5 | { 6 | "name": "watch", 7 | "description": "Watches test files for changes and re-runs the tests automatically.", 8 | "type": "boolean" 9 | } 10 | ] 11 | } -------------------------------------------------------------------------------- /web-ui/aurelia_project/tasks/jest.ts: -------------------------------------------------------------------------------- 1 | export {default} from './test'; 2 | -------------------------------------------------------------------------------- /web-ui/aurelia_project/tasks/lint.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lint", 3 | "description": "Lint source files", 4 | "flags": [] 5 | } -------------------------------------------------------------------------------- /web-ui/aurelia_project/tasks/lint.ts: -------------------------------------------------------------------------------- 1 | import * as gulp from 'gulp'; 2 | import tslint from 'gulp-tslint'; 3 | import * as project from '../aurelia.json'; 4 | 5 | export default function lint() { 6 | return gulp.src(project.transpiler.source) 7 | .pipe(tslint({ 8 | tslint: require("tslint"), 9 | formatter: 'prose' 10 | })) 11 | .pipe(tslint.report()); 12 | } 13 | -------------------------------------------------------------------------------- /web-ui/aurelia_project/tasks/process-css.ts: -------------------------------------------------------------------------------- 1 | import {build} from 'aurelia-cli'; 2 | import * as gulp from 'gulp'; 3 | import * as project from '../aurelia.json'; 4 | import * as plumber from 'gulp-plumber'; 5 | import * as notify from 'gulp-notify'; 6 | import * as less from 'gulp-less'; 7 | import * as postcss from 'gulp-postcss'; 8 | import * as autoprefixer from 'autoprefixer'; 9 | import * as cssnano from 'cssnano'; 10 | import * as postcssUrl from 'postcss-url'; 11 | 12 | export default function processCSS() { 13 | return gulp.src(project.cssProcessor.source, {sourcemaps: true}) 14 | .pipe(plumber({ errorHandler: notify.onError('Error: <%= error.message %>') })) 15 | .pipe(less()) 16 | .pipe(postcss([ 17 | autoprefixer(), 18 | postcssUrl({url: 'inline', encodeType: 'base64'}), 19 | cssnano() 20 | ])) 21 | .pipe(build.bundle()); 22 | } 23 | 24 | -------------------------------------------------------------------------------- /web-ui/aurelia_project/tasks/process-json.ts: -------------------------------------------------------------------------------- 1 | import * as gulp from 'gulp'; 2 | import * as project from '../aurelia.json'; 3 | import {build} from 'aurelia-cli'; 4 | 5 | export default function processJson() { 6 | return gulp.src(project.jsonProcessor.source, {since: gulp.lastRun(processJson)}) 7 | .pipe(build.bundle()); 8 | } 9 | 10 | -------------------------------------------------------------------------------- /web-ui/aurelia_project/tasks/process-markup.ts: -------------------------------------------------------------------------------- 1 | import {build} from 'aurelia-cli'; 2 | import * as gulp from 'gulp'; 3 | import * as project from '../aurelia.json'; 4 | import * as htmlmin from 'gulp-htmlmin'; 5 | import * as plumber from 'gulp-plumber'; 6 | import * as notify from 'gulp-notify'; 7 | 8 | export default function processMarkup() { 9 | return gulp.src(project.markupProcessor.source, {sourcemaps: true, since: gulp.lastRun(processMarkup)}) 10 | .pipe(plumber({errorHandler: notify.onError('Error: <%= error.message %>')})) 11 | .pipe(htmlmin({ 12 | removeComments: true, 13 | collapseWhitespace: true, 14 | minifyCSS: true, 15 | minifyJS: true, 16 | ignoreCustomFragments: [/\${.*?}/g] // ignore interpolation expressions 17 | })) 18 | .pipe(build.bundle()); 19 | } 20 | 21 | -------------------------------------------------------------------------------- /web-ui/aurelia_project/tasks/run.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "run", 3 | "description": "Builds the application and serves up the assets via a local web server, watching files for changes as you work.", 4 | "flags": [ 5 | { 6 | "name": "env", 7 | "description": "Sets the build environment.", 8 | "type": "string" 9 | }, 10 | { 11 | "name": "open", 12 | "description": "Open the default browser at the application location.", 13 | "type": "boolean" 14 | }, 15 | { 16 | "name": "host", 17 | "description": "Set host address of the dev server, the accessible URL", 18 | "type": "string" 19 | }, 20 | { 21 | "name": "port", 22 | "description": "Set port number of the dev server", 23 | "type": "string" 24 | } 25 | ] 26 | } -------------------------------------------------------------------------------- /web-ui/aurelia_project/tasks/run.ts: -------------------------------------------------------------------------------- 1 | import * as gulp from 'gulp'; 2 | import * as browserSync from 'browser-sync'; 3 | import * as historyApiFallback from 'connect-history-api-fallback/lib'; 4 | import * as project from '../aurelia.json'; 5 | import {CLIOptions} from 'aurelia-cli'; 6 | import build from './build'; 7 | import watch from './watch'; 8 | 9 | const bs = browserSync.create(); 10 | 11 | let serve = gulp.series( 12 | build, 13 | done => { 14 | bs.init({ 15 | online: false, 16 | open: CLIOptions.hasFlag('open') || project.platform.open, 17 | port: CLIOptions.getFlagValue('port') || project.platform.port, 18 | host: CLIOptions.getFlagValue('host') || project.platform.host || "localhost", 19 | logLevel: 'silent', 20 | server: { 21 | baseDir: [project.platform.baseDir], 22 | middleware: [historyApiFallback(), function(req, res, next) { 23 | res.setHeader('Access-Control-Allow-Origin', '*'); 24 | next(); 25 | }] 26 | } 27 | }, function (err, bs) { 28 | if (err) return done(err); 29 | let urls = bs.options.get('urls').toJS(); 30 | let host = bs.options.get('host'); 31 | let port = bs.options.get('port'); 32 | 33 | if( host !== "localhost" ) 34 | log(`Application Available At: http://${host}:${port}`); 35 | 36 | log(`Application Available At: ${urls.local}`); 37 | log(`BrowserSync Available At: ${urls.ui}`); 38 | done(); 39 | }); 40 | } 41 | ); 42 | 43 | function log(message) { 44 | console.log(message); //eslint-disable-line no-console 45 | } 46 | 47 | function reload() { 48 | log('Refreshing the browser'); 49 | bs.reload(); 50 | } 51 | 52 | const run = gulp.series( 53 | serve, 54 | done => { watch(reload); done(); } 55 | ); 56 | 57 | const shutdownAppServer = () => { 58 | bs.exit(); 59 | }; 60 | 61 | export { run as default, serve , shutdownAppServer }; 62 | -------------------------------------------------------------------------------- /web-ui/aurelia_project/tasks/test.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test", 3 | "description": "Runs Jest and reports the results.", 4 | "flags": [ 5 | { 6 | "name": "watch", 7 | "description": "Watches test files for changes and re-runs the tests automatically.", 8 | "type": "boolean" 9 | } 10 | ] 11 | } -------------------------------------------------------------------------------- /web-ui/aurelia_project/tasks/test.ts: -------------------------------------------------------------------------------- 1 | import * as jest from 'jest-cli'; 2 | import * as path from 'path'; 3 | import * as packageJson from '../../package.json'; 4 | 5 | import { CLIOptions } from 'aurelia-cli'; 6 | 7 | export default (cb) => { 8 | let options = packageJson.jest; 9 | 10 | if (CLIOptions.hasFlag('watch')) { 11 | Object.assign(options, { watchAll: true}); 12 | } 13 | 14 | 15 | jest.runCLI(options, [path.resolve(__dirname, '../../')]).then(({ results }) => { 16 | if (results.numFailedTests || results.numFailedTestSuites) { 17 | cb('Tests Failed'); 18 | } else { 19 | cb(); 20 | } 21 | }); 22 | }; 23 | -------------------------------------------------------------------------------- /web-ui/aurelia_project/tasks/transpile.ts: -------------------------------------------------------------------------------- 1 | import * as gulp from 'gulp'; 2 | import * as plumber from 'gulp-plumber'; 3 | import * as notify from 'gulp-notify'; 4 | import * as rename from 'gulp-rename'; 5 | import * as ts from 'gulp-typescript'; 6 | import * as project from '../aurelia.json'; 7 | import * as fs from 'fs'; 8 | import * as through from 'through2'; 9 | import { CLIOptions, build, Configuration } from 'aurelia-cli'; 10 | 11 | function configureEnvironment() { 12 | let env = CLIOptions.getEnvironment(); 13 | 14 | return gulp.src(`aurelia_project/environments/${env}.ts`, { since: gulp.lastRun(configureEnvironment) }) 15 | .pipe(rename('environment.ts')) 16 | .pipe(through.obj(function (file, _, cb) { 17 | // https://github.com/aurelia/cli/issues/1031 18 | fs.unlink(`${project.paths.root}/${file.relative}`, function () { cb(null, file); }); 19 | })) 20 | .pipe(gulp.dest(project.paths.root)); 21 | } 22 | 23 | var typescriptCompiler = typescriptCompiler || null; 24 | 25 | function buildTypeScript() { 26 | typescriptCompiler = ts.createProject('tsconfig.json', { 27 | typescript: require('typescript') 28 | }); 29 | 30 | return gulp.src(project.transpiler.dtsSource) 31 | .pipe(gulp.src(project.transpiler.source, { 32 | sourcemaps: true, 33 | since: gulp.lastRun(buildTypeScript) 34 | })) 35 | .pipe(plumber({ errorHandler: notify.onError('Error: <%= error.message %>') })) 36 | .pipe(typescriptCompiler()) 37 | .pipe(build.bundle()); 38 | } 39 | 40 | export default gulp.series( 41 | configureEnvironment, 42 | buildTypeScript 43 | ); 44 | 45 | -------------------------------------------------------------------------------- /web-ui/config/environment.json: -------------------------------------------------------------------------------- 1 | { 2 | "debug": true, 3 | "testing": true 4 | } -------------------------------------------------------------------------------- /web-ui/config/environment.production.json: -------------------------------------------------------------------------------- 1 | { 2 | "debug": false, 3 | "testing": false 4 | } -------------------------------------------------------------------------------- /web-ui/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.7" 2 | 3 | services: 4 | atdd-web-ui: 5 | image: atdd-web-ui:0.1.0 6 | build: 7 | context: . # relative to docker-compose.yml 8 | dockerfile: Dockerfile 9 | ports: 10 | - "5050:80" 11 | restart: unless-stopped 12 | -------------------------------------------------------------------------------- /web-ui/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ATDD.TestScriptor 6 | 7 | 8 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /web-ui/src/app.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /web-ui/src/backend/CommandHandlerService.ts: -------------------------------------------------------------------------------- 1 | import { BackendService } from 'services/backend-service'; 2 | import { autoinject, NewInstance, Container } from "aurelia-framework"; 3 | 4 | @autoinject() 5 | export class CommandHandlerService implements ICommandHandlerService { 6 | 7 | constructor(protected backendService: BackendService) { 8 | 9 | } 10 | 11 | async dispatch(commandName: string, payload: any): Promise { 12 | 13 | let className = `${commandName}Command`; 14 | let moduleName = `backend/commands/${className}`; 15 | 16 | //@ts-ignore 17 | require([moduleName], async (loadedModule: any) => { 18 | let command = Container.instance.get(loadedModule[className]); 19 | await command.execute(payload); 20 | }); 21 | } 22 | 23 | } 24 | 25 | export interface ICommandHandlerService { 26 | dispatch(commandName: string, payload: any): Promise; 27 | } 28 | 29 | export interface ICommand { 30 | 31 | execute(payload: any): Promise; 32 | } -------------------------------------------------------------------------------- /web-ui/src/backend/commands/DeleteScenarioCommand.ts: -------------------------------------------------------------------------------- 1 | import { MessageState, AppEventPublisher } from 'types'; 2 | import { ICommand } from "backend/CommandHandlerService"; 3 | import { autoinject } from "aurelia-framework"; 4 | import { EventAggregator } from 'aurelia-event-aggregator'; 5 | import { Message, ALTestRunnerResult } from "types"; 6 | import { AppService } from 'services/app-service'; 7 | 8 | @autoinject() 9 | export class DeleteScenarioCommand implements ICommand { 10 | 11 | constructor(private eventAggregator: EventAggregator, private appService: AppService) { 12 | } 13 | 14 | async execute(payload: any): Promise { 15 | let scenario = this.appService.selectedEntry; 16 | this.eventAggregator.publish(AppEventPublisher.onDeleteScenario, scenario); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /web-ui/src/backend/commands/ExportCommand.ts: -------------------------------------------------------------------------------- 1 | import { MessageState, AppEventPublisher } from './../../types'; 2 | import { ICommand } from "backend/CommandHandlerService"; 3 | import { transient, autoinject } from "aurelia-framework"; 4 | import { EventAggregator } from 'aurelia-event-aggregator'; 5 | import { Message, ALTestRunnerResult } from "types"; 6 | import { AppService } from 'services/app-service'; 7 | 8 | @autoinject() 9 | export class ExportCommand implements ICommand { 10 | 11 | constructor(private eventAggregator: EventAggregator, private appService: AppService) { 12 | } 13 | 14 | async execute(payload: any): Promise { 15 | this.eventAggregator.publish(AppEventPublisher.export); 16 | console.log('Export Command'); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /web-ui/src/backend/commands/NewFeatureCommand.ts: -------------------------------------------------------------------------------- 1 | import { AppEditMode } from './../../types'; 2 | import { ICommand } from "backend/CommandHandlerService"; 3 | import { transient } from "aurelia-framework"; 4 | import { AppService } from "services/app-service"; 5 | 6 | @transient() 7 | export class NewFeatureCommand implements ICommand { 8 | constructor(private appService: AppService) { 9 | } 10 | 11 | async execute(payload: any): Promise { 12 | if (this.appService.editMode == AppEditMode.Feature) { 13 | this.appService.editMode = AppEditMode.Scenario; 14 | } else { 15 | this.appService.editMode = AppEditMode.Feature; 16 | } 17 | console.log('NewFeature Command', this.appService.editMode); 18 | } 19 | 20 | } -------------------------------------------------------------------------------- /web-ui/src/backend/commands/SaveChangesCommand.ts: -------------------------------------------------------------------------------- 1 | import { MessageState, AppEventPublisher } from '../../types'; 2 | import { ICommand } from "backend/CommandHandlerService"; 3 | import { transient, autoinject } from "aurelia-framework"; 4 | import { EventAggregator } from 'aurelia-event-aggregator'; 5 | import { Message, ALTestRunnerResult } from "types"; 6 | import { AppService } from 'services/app-service'; 7 | 8 | @autoinject() 9 | export class SaveChangesCommand implements ICommand { 10 | 11 | constructor(private eventAggregator: EventAggregator, private appService: AppService) { 12 | } 13 | 14 | async execute(payload: any): Promise { 15 | this.eventAggregator.publish(AppEventPublisher.saveChanges); 16 | console.log('SaveChanges Command'); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /web-ui/src/backend/connectors/DummyConnector.ts: -------------------------------------------------------------------------------- 1 | import { IBackendConnector } from './IBackendConnector'; 2 | export class DummyConnector implements IBackendConnector { 3 | 4 | constructor() { 5 | } 6 | 7 | async send(payload: any): Promise { 8 | return new Promise(async (resolve, reject) => { 9 | console.log(payload); 10 | resolve(payload); 11 | }); 12 | } 13 | } -------------------------------------------------------------------------------- /web-ui/src/backend/connectors/IBackendConnector.ts: -------------------------------------------------------------------------------- 1 | export interface IBackendConnector { 2 | send(payload: any): Promise; 3 | } -------------------------------------------------------------------------------- /web-ui/src/backend/connectors/VSCodeConnector.ts: -------------------------------------------------------------------------------- 1 | import { PLATFORM } from 'aurelia-framework'; 2 | import { IBackendConnector } from './IBackendConnector'; 3 | export class VSCodeConnector implements IBackendConnector { 4 | 5 | protected vscode: any; 6 | 7 | constructor() { 8 | if (typeof (PLATFORM.global).vscode !== "object") { 9 | throw "acquireVsCodeApi function is not registered."; 10 | } 11 | 12 | this.vscode = (PLATFORM.global).vscode; 13 | } 14 | 15 | async send(payload: any): Promise { 16 | return new Promise((resolve, reject) => { 17 | let receiver = (event) => { 18 | console.log('vscodeconnector received', event); 19 | 20 | if (!event.data) { 21 | window.removeEventListener('message', receiver); 22 | resolve(null); 23 | } 24 | 25 | if (event.data && event.data.Command == payload.Command) { 26 | window.removeEventListener('message', receiver); 27 | resolve(event.data.Data); 28 | } 29 | }; 30 | window.addEventListener('message', receiver); 31 | 32 | console.log('payload sent', payload); 33 | this.vscode.postMessage([payload]); 34 | }); 35 | } 36 | } -------------------------------------------------------------------------------- /web-ui/src/main.ts: -------------------------------------------------------------------------------- 1 | import { Aurelia } from 'aurelia-framework' 2 | import environment from './environment'; 3 | 4 | export function configure(aurelia: Aurelia) { 5 | aurelia.use 6 | .standardConfiguration() 7 | .feature('resources') 8 | .plugin('ag-grid-aurelia'); 9 | 10 | aurelia.use.developmentLogging(environment.debug ? 'debug' : 'warn'); 11 | 12 | if (environment.testing) { 13 | aurelia.use.plugin('aurelia-testing'); 14 | } 15 | 16 | aurelia.start().then(() => aurelia.setRoot()); 17 | } 18 | -------------------------------------------------------------------------------- /web-ui/src/resources/elements/entry-form-group.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /web-ui/src/resources/elements/entry-form.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /web-ui/src/resources/elements/feature-list.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /web-ui/src/resources/elements/loader.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /web-ui/src/resources/elements/toolbar.ts: -------------------------------------------------------------------------------- 1 | import { BackendService } from 'services/backend-service'; 2 | import { autoinject, bindable } from "aurelia-framework"; 3 | import { EventAggregator } from 'aurelia-event-aggregator'; 4 | import { CommandHandlerService } from 'backend/CommandHandlerService'; 5 | import { AppEventPublisher } from 'types'; 6 | 7 | @autoinject() 8 | export class Toolbar { 9 | 10 | @bindable() 11 | searchValue: string; 12 | 13 | @bindable() 14 | noConfirmations: boolean = false; 15 | 16 | loaded: boolean = false; 17 | 18 | constructor(private backendService: BackendService, private commandHandlerService: CommandHandlerService, private eventAggregator: EventAggregator) { 19 | } 20 | 21 | async attached() { 22 | try { 23 | let currentSetting = await this.sendBackendCommand('GetConfiguration'); 24 | this.noConfirmations = currentSetting; 25 | } catch { 26 | console.log('GetConfiguration call is not yet implemented'); 27 | } 28 | 29 | this.loaded = true; 30 | } 31 | 32 | async sendCommand(command: string, data?: any) { 33 | if (command == 'Refresh') { 34 | this.eventAggregator.publish(AppEventPublisher.refresh); 35 | return; 36 | } 37 | 38 | await this.commandHandlerService.dispatch(command, data); 39 | } 40 | 41 | async sendBackendCommand(command: string, data?: any) { 42 | return await this.backendService.send({ Command: command, Data: data }); 43 | } 44 | 45 | noConfirmationsChanged(newValue: boolean) { 46 | if (this.loaded !== true) { 47 | return; 48 | } 49 | 50 | this.sendBackendCommand('SetConfiguration', newValue); 51 | } 52 | } -------------------------------------------------------------------------------- /web-ui/src/resources/index.ts: -------------------------------------------------------------------------------- 1 | import {FrameworkConfiguration} from 'aurelia-framework'; 2 | 3 | export function configure(config: FrameworkConfiguration) { 4 | config.globalResources([ 5 | './elements/toolbar', 6 | './elements/test-list', 7 | './elements/feature-list', 8 | './elements/entry-form', 9 | './elements/entry-form-group', 10 | './elements/loader.html' 11 | ]); 12 | } 13 | -------------------------------------------------------------------------------- /web-ui/src/styles/bootstrap/_variables.scss: -------------------------------------------------------------------------------- 1 | /** https://bootstrap.build/ **/ 2 | 3 | $cyan: #008089; 4 | $primary: $cyan; 5 | $teal: #39B294; 6 | $green: #35AB22; 7 | $blue: #75D8E7; 8 | $info: $blue; 9 | $red: #E65E6D; 10 | $orange: #E89E63; 11 | $yellow: #EEEA86; 12 | $warning: $orange; 13 | $font-family-sans-serif: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 14 | $border-radius: .1rem; 15 | $border-radius-sm: .1rem; 16 | $gray-600: #505C6D; 17 | $gray-900: #212121; 18 | $font-size-base: 0.875rem; -------------------------------------------------------------------------------- /web-ui/test/jest-pretest.ts: -------------------------------------------------------------------------------- 1 | import 'aurelia-polyfills'; 2 | import { Options } from 'aurelia-loader-nodejs'; 3 | import { globalize } from 'aurelia-pal-nodejs'; 4 | import * as path from 'path'; 5 | Options.relativeToDir = path.join(__dirname, 'unit'); 6 | globalize() 7 | -------------------------------------------------------------------------------- /web-ui/test/mock-css.js: -------------------------------------------------------------------------------- 1 | module.exports = ''; 2 | -------------------------------------------------------------------------------- /web-ui/test/unit/app.spec.ts: -------------------------------------------------------------------------------- 1 | import { bootstrap } from 'aurelia-bootstrapper'; 2 | import { StageComponent } from 'aurelia-testing'; 3 | 4 | describe('Stage App Component', () => { 5 | let component; 6 | 7 | beforeEach(() => { 8 | component = StageComponent 9 | .withResources('app') 10 | .inView(''); 11 | }); 12 | 13 | afterEach(() => component.dispose()); 14 | 15 | it('should have main-content', done => { 16 | component.create(bootstrap).then(() => { 17 | const elem = document.querySelector('#main-content'); 18 | expect(elem).toBeDefined(); 19 | done(); 20 | }).catch(e => { 21 | fail(e); 22 | done(); 23 | }); 24 | }); 25 | 26 | it('should have Test List', done => { 27 | component.create(bootstrap).then(() => { 28 | const elem = document.querySelector('test-list'); 29 | expect(elem).toBeDefined(); 30 | done(); 31 | }).catch(e => { 32 | fail(e); 33 | done(); 34 | }); 35 | }); 36 | 37 | it('should have Entry Form', done => { 38 | component.create(bootstrap).then(() => { 39 | const elem = document.querySelector('entry-form'); 40 | expect(elem).toBeDefined(); 41 | done(); 42 | }).catch(e => { 43 | fail(e); 44 | done(); 45 | }); 46 | }); 47 | }); 48 | -------------------------------------------------------------------------------- /web-ui/test/unit/entry-form-group.spec.ts: -------------------------------------------------------------------------------- 1 | import { bootstrap } from 'aurelia-bootstrapper'; 2 | import { StageComponent } from 'aurelia-testing'; 3 | 4 | describe('Stage Entry Form Group Component', () => { 5 | let component; 6 | 7 | beforeEach(() => { 8 | component = StageComponent 9 | .withResources('resources/elements/entry-form-group') 10 | .inView(''); 11 | }); 12 | 13 | afterEach(() => component.dispose()); 14 | 15 | it('should have loaded', done => { 16 | component.create(bootstrap).then(() => { 17 | const elem = document.querySelector('.card-body'); 18 | expect(elem).toBeDefined(); 19 | done(); 20 | }).catch(e => { 21 | fail(e); 22 | done(); 23 | }); 24 | }); 25 | 26 | it('should have button', done => { 27 | component.create(bootstrap).then(() => { 28 | const elem = document.querySelectorAll('button'); 29 | expect(elem.length).toBeGreaterThanOrEqual(1); 30 | done(); 31 | }).catch(e => { 32 | fail(e); 33 | done(); 34 | }); 35 | }); 36 | 37 | }); 38 | -------------------------------------------------------------------------------- /web-ui/test/unit/entry-form.spec.ts: -------------------------------------------------------------------------------- 1 | import { bootstrap } from 'aurelia-bootstrapper'; 2 | import { StageComponent } from 'aurelia-testing'; 3 | 4 | describe('Stage Entry Form Component', () => { 5 | let component; 6 | 7 | beforeEach(() => { 8 | component = StageComponent 9 | .withResources('resources/elements/entry-form') 10 | .inView(''); 11 | }); 12 | 13 | afterEach(() => component.dispose()); 14 | 15 | it('should have loaded', done => { 16 | component.create(bootstrap).then(() => { 17 | const elem = document.querySelector('.card-body'); 18 | expect(elem).toBeDefined(); 19 | done(); 20 | }).catch(e => { 21 | fail(e); 22 | done(); 23 | }); 24 | }); 25 | 26 | it('should have Entry Groups', done => { 27 | component.create(bootstrap).then(() => { 28 | const elem = document.querySelectorAll('entry-form-group'); 29 | expect(elem.length).toEqual(3); 30 | done(); 31 | }).catch(e => { 32 | fail(e); 33 | done(); 34 | }); 35 | }); 36 | 37 | }); 38 | -------------------------------------------------------------------------------- /web-ui/test/unit/standalone-connector.spec.ts: -------------------------------------------------------------------------------- 1 | import { BackendService } from './../../src/backend/BackendService'; 2 | import { App } from '../../src/app'; 3 | import { BackendType } from '../../src/backend/BackendType'; 4 | import { Container, view, PLATFORM, newInstance, NewInstance } from 'aurelia-framework'; 5 | import { bootstrap } from 'aurelia-bootstrapper'; 6 | import { StageComponent, ComponentTester } from 'aurelia-testing'; 7 | 8 | describe('Stage Backend Connectors', () => { 9 | let component: ComponentTester; 10 | let container: Container; 11 | let backendService: BackendService; 12 | let viewModel: App; 13 | let _window = PLATFORM.global; 14 | 15 | beforeEach(async () => { 16 | container = new Container(); 17 | backendService = NewInstance.of(BackendService).get(container); 18 | viewModel = NewInstance.of(App).get(container); 19 | 20 | component = StageComponent 21 | .withResources('app') 22 | .inView('') 23 | .boundTo(viewModel); 24 | }); 25 | 26 | afterEach(() => { 27 | component.dispose() 28 | }); 29 | 30 | it('should have Standalone backend', done => { 31 | (_window).acquireVsCodeApi = null; 32 | 33 | component.create(bootstrap).then(() => { 34 | expect(backendService.type).toEqual(BackendType.Standalone); 35 | done(); 36 | }).catch(e => { 37 | fail(e); 38 | done(); 39 | }); 40 | }); 41 | }); 42 | -------------------------------------------------------------------------------- /web-ui/test/unit/test-list.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestList } from './../../src/resources/elements/test-list'; 2 | import { Container, NewInstance } from 'aurelia-framework'; 3 | import { bootstrap } from 'aurelia-bootstrapper'; 4 | import { StageComponent, ComponentTester } from 'aurelia-testing'; 5 | 6 | describe('Stage Test List Component', () => { 7 | let component: ComponentTester; 8 | let container: Container; 9 | 10 | beforeEach(async () => { 11 | container = new Container(); 12 | 13 | component = StageComponent 14 | .withResources('resources/elements/test-list') 15 | .inView('') 16 | .boundTo({testEntry: {Feature: 'Test 1'}}); 17 | }); 18 | 19 | afterEach(() => component.dispose()); 20 | 21 | it('should have ag-grid loaded', done => { 22 | component.create(bootstrap).then(() => { 23 | const elem = document.querySelector('ag-grid-aurelia'); 24 | expect(elem).toBeDefined(); 25 | done(); 26 | }).catch(e => { 27 | fail(e); 28 | done(); 29 | }); 30 | }); 31 | 32 | it('should have state changed', done => { 33 | component.create(bootstrap).then(() => { 34 | expect(component.viewModel.currEntry.Feature).toBe('Test 1'); 35 | done(); 36 | }).catch(e => { 37 | fail(e); 38 | done(); 39 | }); 40 | }); 41 | }); 42 | -------------------------------------------------------------------------------- /web-ui/test/unit/toolbar.spec.ts: -------------------------------------------------------------------------------- 1 | import { Container } from 'aurelia-framework'; 2 | import { CommandHandlerService } from './../../src/backend/CommandHandlerService'; 3 | import { Toolbar } from './../../src/resources/elements/toolbar'; 4 | import { bootstrap } from 'aurelia-bootstrapper'; 5 | import { StageComponent } from 'aurelia-testing'; 6 | 7 | describe('Stage Toolbar Component', () => { 8 | let component; 9 | let viewModel; 10 | let container; 11 | 12 | beforeEach(() => { 13 | container = new Container(); 14 | viewModel = container.get(Toolbar); 15 | component = StageComponent 16 | .withResources('resources/elements/toolbar') 17 | .inView('') 18 | .boundTo(viewModel); 19 | }); 20 | 21 | afterEach(() => component.dispose()); 22 | 23 | it('should have brand', done => { 24 | component.create(bootstrap).then(() => { 25 | const navbarBrand = document.querySelector('.navbar-brand'); 26 | expect(navbarBrand.innerHTML).toBe('ATDD TestScriptor'); 27 | done(); 28 | }).catch(e => { 29 | fail(e); 30 | done(); 31 | }); 32 | }); 33 | 34 | it('should have search input', done => { 35 | component.create(bootstrap).then(() => { 36 | const navbarBrand = document.querySelector('.navbar input.form-control'); 37 | expect(navbarBrand.getAttribute('placeholder')).toBe('Search'); 38 | done(); 39 | }).catch(e => { 40 | fail(e); 41 | done(); 42 | }); 43 | }); 44 | 45 | }); 46 | -------------------------------------------------------------------------------- /web-ui/test/unit/vscode-connector.spec.ts: -------------------------------------------------------------------------------- 1 | import { BackendService } from '../../src/backend/BackendService'; 2 | import { App } from '../../src/app'; 3 | import { BackendType } from '../../src/backend/BackendType'; 4 | import { Container, view, PLATFORM, newInstance, NewInstance } from 'aurelia-framework'; 5 | import { bootstrap } from 'aurelia-bootstrapper'; 6 | import { StageComponent, ComponentTester } from 'aurelia-testing'; 7 | 8 | describe('Stage Backend Connectors', () => { 9 | let component: ComponentTester; 10 | let container: Container; 11 | let backendService: BackendService; 12 | let viewModel: App; 13 | let _window = PLATFORM.global; 14 | (_window).acquireVsCodeApi = function() {}; 15 | 16 | beforeEach(async () => { 17 | container = new Container(); 18 | backendService = NewInstance.of(BackendService).get(container); 19 | viewModel = NewInstance.of(App).get(container); 20 | 21 | component = StageComponent 22 | .withResources('app') 23 | .inView('') 24 | .boundTo(viewModel); 25 | }); 26 | 27 | afterEach(() => { 28 | component.dispose() 29 | }); 30 | 31 | it('should have VSCode backend', done => { 32 | component.create(bootstrap).then(() => { 33 | expect(backendService.type).toEqual(BackendType.VSCode); 34 | done(); 35 | }).catch(e => { 36 | fail(e); 37 | done(); 38 | }); 39 | }); 40 | }); 41 | -------------------------------------------------------------------------------- /web-ui/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "module": "amd", 5 | "noImplicitAny": false, 6 | "declaration": false, 7 | "typeRoots": [ 8 | "./typings" 9 | ], 10 | "removeComments": true, 11 | "emitDecoratorMetadata": true, 12 | "experimentalDecorators": true, 13 | "downlevelIteration": true, 14 | "esModuleInterop": true, 15 | "sourceMap": true, 16 | "target": "es5", 17 | "lib": ["es2017", "dom"], 18 | "moduleResolution": "node", 19 | "baseUrl": "src", 20 | "resolveJsonModule": true, 21 | "allowJs": true 22 | }, 23 | "include": [ 24 | "./src/**/*.ts" 25 | ], 26 | "exclude": [ 27 | "node_modules" 28 | ], 29 | "atom": { 30 | "rewriteTsconfig": false 31 | } 32 | } -------------------------------------------------------------------------------- /web-ui/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "no-empty": true 4 | } 5 | } --------------------------------------------------------------------------------