summaryrefslogtreecommitdiff
path: root/tests/auto/declarative_location_core/tst_ratings.qml
blob: fab4af21eb6b12b3232c18e04b217637e4729452 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

import QtTest
import QtLocation
import "utils.js" as Utils

TestCase {
    id: testCase

    name: "Ratings"

    property ratings emptyRatings

    function test_empty() {
        compare(emptyRatings.average, 0.0);
        compare(emptyRatings.maximum, 0.0);
        compare(emptyRatings.count, 0);
    }

    property ratings qmlRatings: ({ average: 3.5, maximum: 5.0, count: 7 })

    function test_qmlConstructedRatings() {
        compare(qmlRatings.average, 3.5);
        compare(qmlRatings.maximum, 5.0);
        compare(qmlRatings.count, 7);
    }
}