From 05b48aa31e86676d8c457b67f409e08ae464fb93 Mon Sep 17 00:00:00 2001 From: Michael Lamers Date: Mon, 6 Aug 2018 22:19:38 +0200 Subject: [PATCH] Qml tests: converted DateTimeOffsetTests --- .../Qml.Net.Tests/Qml/DateTimeOffsetTests.cs | 42 ++++++------------- 1 file changed, 12 insertions(+), 30 deletions(-) diff --git a/src/net/Qml.Net.Tests/Qml/DateTimeOffsetTests.cs b/src/net/Qml.Net.Tests/Qml/DateTimeOffsetTests.cs index b16d387f..5ebc0613 100644 --- a/src/net/Qml.Net.Tests/Qml/DateTimeOffsetTests.cs +++ b/src/net/Qml.Net.Tests/Qml/DateTimeOffsetTests.cs @@ -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);