1
+ package com.example.beyondnetsampleandroid
2
+
3
+ import androidx.test.ext.junit.runners.AndroidJUnit4
4
+ import com.example.beyondnetsampleandroid.dn.*
5
+ import org.junit.Assert.*
6
+ import org.junit.Test
7
+ import org.junit.runner.RunWith
8
+
9
+ @RunWith(AndroidJUnit4 ::class )
10
+ class SystemVersionTests {
11
+ @Test
12
+ fun testSystemVersionFromComponents () {
13
+
14
+ val major = 1
15
+ val minor = 2
16
+ val build = 3
17
+ val revision = 4
18
+
19
+ val versionString = " $major .$minor .$build .$revision "
20
+
21
+ val version = System_Version (major,
22
+ minor,
23
+ build,
24
+ revision)
25
+
26
+ val systemVersionType = System_Version .typeOf()
27
+ val versionFromComponentsType = version.getType()
28
+ assertTrue(version.`is `(systemVersionType))
29
+ assertTrue(systemVersionType == versionFromComponentsType)
30
+ assertTrue(System_Object .equals(systemVersionType, versionFromComponentsType))
31
+
32
+ val majorRet = version.major_get()
33
+ assertEquals(major, majorRet)
34
+
35
+ val minorRet = version.minor_get()
36
+ assertEquals(minor, minorRet)
37
+
38
+ val buildRet = version.build_get()
39
+ assertEquals(build, buildRet)
40
+
41
+ val revisionRet = version.revision_get()
42
+ assertEquals(revision, revisionRet)
43
+
44
+ assertEquals(versionString, version.dnToString().toKString())
45
+ }
46
+ }
0 commit comments