This repository has been archived by the owner on Dec 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* WIP * set value * dotPath * add test * add doc * use exampleParameterPath Co-authored-by: Changlong Liu <[email protected]>
- Loading branch information
1 parent
293bdc4
commit 9ae64f3
Showing
11 changed files
with
358 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { assert } from 'chai'; | ||
import 'mocha'; | ||
import { ActionSet, ActionSetProperty, ActionSetValue } from '../src/plugins/modifier/cliDirectiveAction'; | ||
import { M4Node } from '../src/schema'; | ||
import { Metadata } from "@azure-tools/codemodel"; | ||
|
||
describe('Test Directive - Action - setValue', function () { | ||
var descriptor = { | ||
parent: null, | ||
targetIndex: -1, | ||
target: null, | ||
exampleName: 'Example1' | ||
}; | ||
|
||
it('directive setProperty - string', () => { | ||
let baseline = "someValue"; | ||
let action = new ActionSetValue(baseline, "a.b.c"); | ||
|
||
descriptor.target = new Metadata(); | ||
action.process(descriptor); | ||
assert.deepEqual(descriptor.target.a.b.c, baseline); | ||
}); | ||
|
||
it('directive setProperty - number', () => { | ||
let baseline = 123; | ||
let action = new ActionSetValue(baseline, "a.b.c"); | ||
|
||
descriptor.target = new Metadata(); | ||
action.process(descriptor); | ||
assert.deepEqual(descriptor.target.a.b.c, baseline); | ||
}); | ||
|
||
it('directive setProperty - object', () => { | ||
let baseline = { | ||
key: "someValue", | ||
}; | ||
let action = new ActionSetValue(baseline, "a.b.c"); | ||
|
||
descriptor.target = new Metadata(); | ||
action.process(descriptor); | ||
assert.deepEqual(descriptor.target.a.b.c, baseline); | ||
}); | ||
|
||
}); |
Oops, something went wrong.