Skip to content
Snippets Groups Projects
Commit 78762ab9 authored by Anil Riza Bektas's avatar Anil Riza Bektas
Browse files

solving error in tests, using updated implementation of Property

parent f04fb4c0
Branches web
No related tags found
No related merge requests found
......@@ -7,13 +7,13 @@ void mainMessageTests() {
final List<SubmodelElement> inputList = <SubmodelElement>[
Property<int>(idShort: 'a', value: 1),
Property<bool>(idShort: 'b', value: true),
Property<String>(idShort: 'c', value: 'Hallo'),
//TODO: is this working?
Property<SubmodelElementCollection>(
idShort: 'pose',
value: SubmodelElementCollection(
idShort: 'pose',
)..elements = <SubmodelElement>[Property<int>(idShort: 'x', value: 1), Property<int>(idShort: 'y', value: 2)])
Property<String>(idShort: 'c', value: 'Hello'),
SubmodelElementCollection(
idShort: 'd',
)..elements = <SubmodelElement>[
Property<int>(idShort: 'x', value: 1),
Property<int>(idShort: 'y', value: 2)
]
];
final I40InvokeOperationAsyncRequest requestMessage = I40InvokeOperationAsyncRequest(
submodelId: 'mySubmodel',
......@@ -31,22 +31,45 @@ void mainMessageTests() {
expect(parsedRequestMessage.sender, 'mySender');
expect(parsedRequestMessage.receiver, 'myReceiver');
//TODO
// expect(parsedRequestMessage.inputMap['a'], 1);
// expect(parsedRequestMessage.inputMap['b'], true);
// expect(parsedRequestMessage.inputMap['c'], 'Hallo');
// expect(parsedRequestMessage.inputMap['d'], {'x': 1, 'y': 2});
expect(
(parsedRequestMessage.inputVariables.firstWhere(
(SubmodelElement element) => element.idShort == 'a')
as Property<int>)
.value,
1);
expect(
(parsedRequestMessage.inputVariables.firstWhere(
(SubmodelElement element) => element.idShort == 'b')
as Property<bool>)
.value,
true);
expect(
(parsedRequestMessage.inputVariables.firstWhere(
(SubmodelElement element) => element.idShort == 'c')
as Property<String>)
.value,
'Hello');
expect(
(parsedRequestMessage.inputVariables.firstWhere(
(SubmodelElement element) => element.idShort == 'd')
as SubmodelElementCollection)
.elements,
<SubmodelElement>[
Property<int>(idShort: 'x', value: 1),
Property<int>(idShort: 'y', value: 2)
]);
}
final List<SubmodelElement> outputList = <SubmodelElement>[
Property<int>(idShort: 'a', value: 1),
Property<bool>(idShort: 'b', value: true),
Property<String>(idShort: 'c', value: 'Hallo'),
//TODO: is this working?
Property<SubmodelElementCollection>(
idShort: 'pose',
value: SubmodelElementCollection(
idShort: 'pose',
)..elements = <SubmodelElement>[Property<int>(idShort: 'x', value: 1), Property<int>(idShort: 'y', value: 2)])
SubmodelElementCollection(
idShort: 'd',
)..elements = <SubmodelElement>[
Property<int>(idShort: 'x', value: 1),
Property<int>(idShort: 'y', value: 2)
]
];
final I40InvokeOperationAsyncReply replyMsg = I40InvokeOperationAsyncReply(
sender: 'mySender',
......@@ -85,8 +108,8 @@ void mainMessageTests() {
submodelElement: Property<String>(
idShort: 'myElement',
semanticId: Reference(
type: ReferenceType.ExternalReference,
keys: [ReferenceKey(type: ReferenceKeyType.GlobalReference, value: "mySemanticReference")]),
type: ReferenceTypes.ExternalReference,
keys: [ReferenceKey(type: ReferenceKeyTypes.GlobalReference, value: "mySemanticReference")]),
value: 'myValue'));
var parsedReplyMessage = I40Message.fromJson(replyMessage.toJson());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment