Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
s3i_flutter
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KWH40
s3i_flutter
Commits
78762ab9
Commit
78762ab9
authored
1 month ago
by
Anil Riza Bektas
Browse files
Options
Downloads
Patches
Plain Diff
solving error in tests, using updated implementation of Property
parent
f04fb4c0
Branches
web
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/unit_tests/message_test.dart
+42
-19
42 additions, 19 deletions
test/unit_tests/message_test.dart
with
42 additions
and
19 deletions
test/unit_tests/message_test.dart
+
42
−
19
View file @
78762ab9
...
...
@@ -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:
'H
a
llo'
),
//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:
'H
e
llo'
),
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:
ReferenceType
s
.
ExternalReference
,
keys:
[
ReferenceKey
(
type:
ReferenceKeyType
s
.
GlobalReference
,
value:
"mySemanticReference"
)]),
value:
'myValue'
));
var
parsedReplyMessage
=
I40Message
.
fromJson
(
replyMessage
.
toJson
());
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment