Qml tests: converted DateTimeOffsetTests

This commit is contained in:
Michael Lamers 2018-08-06 22:19:38 +02:00
parent c5e2bf5319
commit dce07f1294

View file

@ -33,17 +33,11 @@ namespace Qml.Net.Tests.Qml
Mock.SetupGet(x => x.Property).Returns(value);
Mock.SetupSet(x => x.Property = value);
NetTestHelper.RunQml(qmlApplicationEngine,
RunQmlTest(
"test",
@"
import QtQuick 2.0
import tests 1.0
DateTimeOffsetTestsQml {
id: test
Component.onCompleted: function() {
test.property = test.property
}
}
");
test.property = test.property
");
Mock.VerifyGet(x => x.Property, Times.Once);
Mock.VerifySet(x => x.Property = value, Times.Once);
@ -58,17 +52,11 @@ namespace Qml.Net.Tests.Qml
Mock.SetupGet(x => x.Nullable).Returns(value);
Mock.SetupSet(x => x.Nullable = value);
NetTestHelper.RunQml(qmlApplicationEngine,
RunQmlTest(
"test",
@"
import QtQuick 2.0
import tests 1.0
DateTimeOffsetTestsQml {
id: test
Component.onCompleted: function() {
var v = test.nullable
test.nullable = v
}
}
var v = test.nullable
test.nullable = v
");
Mock.VerifyGet(x => x.Nullable, Times.Once);
@ -81,17 +69,11 @@ namespace Qml.Net.Tests.Qml
Mock.SetupGet(x => x.Nullable).Returns((DateTimeOffset?)null);
Mock.SetupSet(x => x.Nullable = null);
NetTestHelper.RunQml(qmlApplicationEngine,
RunQmlTest(
"test",
@"
import QtQuick 2.0
import tests 1.0
DateTimeOffsetTestsQml {
id: test
Component.onCompleted: function() {
var v = test.nullable
test.nullable = v
}
}
var v = test.nullable
test.nullable = v
");
Mock.VerifyGet(x => x.Nullable, Times.Once);