From b27634880fe21b889faa7a4103dd914f65083531 Mon Sep 17 00:00:00 2001 From: MuHong Byun Date: Thu, 23 Apr 2020 11:42:04 +0900 Subject: [PATCH] [Tizen.Sensor][TCSACR-313] Add TCs for new sensors * Add testcases for new type sensors (HeartRateMonitorBatch, HeartRateMonitorLEDGreenBatch). This patch includes a new sensor data type,batch data type. The batch data type is a series of sensor data. HeartRateMonitorBatch : HRM data series which collected over a period of time. HeartRateMonitorLEDGreenBatch : HRM Green sensor data series which collected over a period of time. Change-Id: I90d1c7b4ba572d152c7f0d6e4f0f17e71aa1680c Signed-off-by: MuHong Byun --- .../testcase/TSAutoRotationSensor.cs | 0 .../TSAutoRotationSensorDataUpdatedEventArgs.cs | 0 .../testcase/TSHeartRateMonitorBatch.cs | 109 ++++++++++++++ .../TSHeartRateMonitorBatchDataUpdatedEventArgs.cs | 72 +++++++++ .../testcase/TSHeartRateMonitorLEDGreenBatch.cs | 109 ++++++++++++++ ...RateMonitorLEDGreenBatchDataUpdatedEventArgs.cs | 72 +++++++++ .../testcase/TSSensorAccuracyChangedEventArgs.cs | 48 ++++++ .../testcase/TSAutoRotationSensor.cs | 0 .../Tizen.Sensor.Tests/testcase/TSBatchData.cs | 70 +++++++++ .../Tizen.Sensor.Tests/testcase/TSBatchSensor.cs | 79 ++++++++++ .../testcase/TSHeartRateMonitorBatch.cs | 163 ++++++++++++++++++++ .../testcase/TSHeartRateMonitorBatchData.cs | 81 ++++++++++ .../testcase/TSHeartRateMonitorLEDGreenBatch.cs | 164 +++++++++++++++++++++ .../TSHeartRateMonitorLEDGreenBatchData.cs | 112 ++++++++++++++ .../Tizen.Sensor.Tests/testcase/TSSensor.cs | 22 +++ 15 files changed, 1101 insertions(+) mode change 100644 => 100755 tct-suite-vs/Tizen.Sensor.Manual.Tests/testcase/TSAutoRotationSensor.cs mode change 100644 => 100755 tct-suite-vs/Tizen.Sensor.Manual.Tests/testcase/TSAutoRotationSensorDataUpdatedEventArgs.cs create mode 100755 tct-suite-vs/Tizen.Sensor.Manual.Tests/testcase/TSHeartRateMonitorBatch.cs create mode 100755 tct-suite-vs/Tizen.Sensor.Manual.Tests/testcase/TSHeartRateMonitorBatchDataUpdatedEventArgs.cs create mode 100755 tct-suite-vs/Tizen.Sensor.Manual.Tests/testcase/TSHeartRateMonitorLEDGreenBatch.cs create mode 100755 tct-suite-vs/Tizen.Sensor.Manual.Tests/testcase/TSHeartRateMonitorLEDGreenBatchDataUpdatedEventArgs.cs mode change 100644 => 100755 tct-suite-vs/Tizen.Sensor.Tests/testcase/TSAutoRotationSensor.cs create mode 100755 tct-suite-vs/Tizen.Sensor.Tests/testcase/TSBatchData.cs create mode 100755 tct-suite-vs/Tizen.Sensor.Tests/testcase/TSBatchSensor.cs create mode 100755 tct-suite-vs/Tizen.Sensor.Tests/testcase/TSHeartRateMonitorBatch.cs create mode 100755 tct-suite-vs/Tizen.Sensor.Tests/testcase/TSHeartRateMonitorBatchData.cs create mode 100755 tct-suite-vs/Tizen.Sensor.Tests/testcase/TSHeartRateMonitorLEDGreenBatch.cs create mode 100755 tct-suite-vs/Tizen.Sensor.Tests/testcase/TSHeartRateMonitorLEDGreenBatchData.cs diff --git a/tct-suite-vs/Tizen.Sensor.Manual.Tests/testcase/TSAutoRotationSensor.cs b/tct-suite-vs/Tizen.Sensor.Manual.Tests/testcase/TSAutoRotationSensor.cs old mode 100644 new mode 100755 diff --git a/tct-suite-vs/Tizen.Sensor.Manual.Tests/testcase/TSAutoRotationSensorDataUpdatedEventArgs.cs b/tct-suite-vs/Tizen.Sensor.Manual.Tests/testcase/TSAutoRotationSensorDataUpdatedEventArgs.cs old mode 100644 new mode 100755 diff --git a/tct-suite-vs/Tizen.Sensor.Manual.Tests/testcase/TSHeartRateMonitorBatch.cs b/tct-suite-vs/Tizen.Sensor.Manual.Tests/testcase/TSHeartRateMonitorBatch.cs new file mode 100755 index 0000000..df8eb26 --- /dev/null +++ b/tct-suite-vs/Tizen.Sensor.Manual.Tests/testcase/TSHeartRateMonitorBatch.cs @@ -0,0 +1,109 @@ +using System; +using System.Threading.Tasks; +using NUnit.Framework; + +namespace Tizen.Sensor.Tests +{ + [TestFixture] + [Description("Testing Tizen.Sensor.HeartRateMonitorBatch class")] + public class HeartRateMonitorBatchTests + { + private static bool _support = false; + + [OneTimeSetUp] + public void Init() + { + _support = TSSensorHelper.CheckCapability("http://tizen.org/feature/sensor.heart_rate_monitor.batch"); + } + + [Test] + [Category("P1")] + [Description("Check HeartRateMonitorBatch DataUpdated event")] + [Property("SPEC", "Tizen.Sensor.HeartRateMonitorBatch.DataUpdated E")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "EVL")] + [Property("AUTHOR", "Muhong Byun, mh.byun@samsung.com")] + [Precondition(1, "HeartRateMonitorBatch sensor should be available")] + [Step(1, "Tap the Run button")] + [Step(2, "HeartRateMonitorBatch event: Put your device on your wrist and wait a moment.")] + public async Task DataUpdated_CHECK_EVENT() + { + try + { + /* TEST CODE */ + EventHandler handler = null; + handler = (sender, e) => + { + Assert.True(true); + ManualTest.Confirm(); + }; + + var sensor = new HeartRateMonitorBatch(0); + sensor.DataUpdated += handler; + sensor.Start(); + sensor.Interval = 100; + await ManualTest.WaitForConfirm(); + sensor.Stop(); + sensor.DataUpdated -= handler; + sensor.Dispose(); + } + catch (NotSupportedException) + { + Assert.IsTrue(_support == false, "Invalid NotSupportedException"); + TSSensorHelper.DisplayLabel("HeartRateMonitorBatch"); + await ManualTest.WaitForConfirm(); + } + catch (Exception e) + { + Assert.True(false, "should not throw exception(" + e.Message + ")"); + } + } + + [Test] + [Category("P1")] + [Description("Check HeartRateMonitorBatch AccuracyChanged event")] + [Property("SPEC", "Tizen.Sensor.HeartRateMonitorBatch.AccuracyChanged E")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "EVL")] + [Property("AUTHOR", "Muhong Byun, mh.byun@samsung.com")] + [Precondition(1, "HeartRateMonitorBatch sensor should be available")] + [Step(1, "Tap the Run button")] + [Step(2, "Rotate the test device")] + public async Task AccuracyChanged_CHECK_EVENT() + { + try + { + /* TEST CODE */ + EventHandler handler = null; + handler = (sender, e) => + { + + Assert.True(true); + ManualTest.Confirm(); + }; + + var sensor = new HeartRateMonitorBatch(); + sensor.AccuracyChanged += handler; + sensor.Start(); + sensor.Interval = 100; + await ManualTest.WaitForConfirm(); + sensor.Stop(); + sensor.AccuracyChanged -= handler; + sensor.Dispose(); + } + catch (NotSupportedException) + { + Assert.IsTrue(_support == false, "Invalid NotSupportedException"); + TSSensorHelper.DisplayLabel("HeartRateMonitorBatch"); + await ManualTest.WaitForConfirm(); + } + catch (Exception e) + { + Assert.True(false, "should not throw exception(" + e.Message + ")"); + } + } + + + } +} + diff --git a/tct-suite-vs/Tizen.Sensor.Manual.Tests/testcase/TSHeartRateMonitorBatchDataUpdatedEventArgs.cs b/tct-suite-vs/Tizen.Sensor.Manual.Tests/testcase/TSHeartRateMonitorBatchDataUpdatedEventArgs.cs new file mode 100755 index 0000000..dfacf31 --- /dev/null +++ b/tct-suite-vs/Tizen.Sensor.Manual.Tests/testcase/TSHeartRateMonitorBatchDataUpdatedEventArgs.cs @@ -0,0 +1,72 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using NUnit.Framework; + +namespace Tizen.Sensor.Tests +{ + [TestFixture] + [Description("Testing Tizen.Sensor.HeartRateMonitorBatchDataUpdatedEventArgs class")] + public class HeartRateMonitorBatchDataUpdatedEventArgsTests + { + private static bool _support = false; + + [OneTimeSetUp] + public void Init() + { + _support = TSSensorHelper.CheckCapability("http://tizen.org/feature/sensor.heart_rate_monitor.batch"); + } + + [Test] + [Category("P1")] + [Description("Check heart rate when HeartRateMonitorBatch DataUpdated event is triggered")] + [Property("SPEC", "Tizen.Sensor.HeartRateMonitorBatchDataUpdatedEventArgs.Data A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Muhong Byun, mh.byun@samsung.com")] + [Precondition(1, "HeartRateMonitorBatch sensor should be available")] + [Step(1, "Tap the Run button")] + [Step(2, "Put a test device on your wrist and wait a moment.")] + public async Task Data_PROPERTY_READ_ONLY() + { + try + { + var sensor = new HeartRateMonitorBatch(); + sensor.Interval = 100; + IReadOnlyList getValue = null; + + EventHandler handler = null; + handler = (sender, e) => + { + /* TESTCODE */ + Assert.IsInstanceOf>(sensor.Data, "Data value should be IReadOnlyList of HeartRateMonitorBatchData"); + Assert.IsTrue(sensor.Data != getValue, "HeartRateMonitorBatch value should be changed."); + ManualTest.Confirm(); + }; + + sensor.DataUpdated += handler; + sensor.Start(); + + getValue = sensor.Data; + await ManualTest.WaitForConfirm(); + + sensor.Stop(); + sensor.DataUpdated -= handler; + sensor.Dispose(); + } + catch (NotSupportedException) + { + Assert.IsTrue(_support == false, "Invalid NotSupportedException"); + TSSensorHelper.DisplayLabel("HeartRateMonitorBatch"); + await ManualTest.WaitForConfirm(); + } + catch (Exception e) + { + Assert.True(false, "should not throw exception(" + e.Message + ")"); + } + } + } +} + + + diff --git a/tct-suite-vs/Tizen.Sensor.Manual.Tests/testcase/TSHeartRateMonitorLEDGreenBatch.cs b/tct-suite-vs/Tizen.Sensor.Manual.Tests/testcase/TSHeartRateMonitorLEDGreenBatch.cs new file mode 100755 index 0000000..7b72454 --- /dev/null +++ b/tct-suite-vs/Tizen.Sensor.Manual.Tests/testcase/TSHeartRateMonitorLEDGreenBatch.cs @@ -0,0 +1,109 @@ +using System; +using System.Threading.Tasks; +using NUnit.Framework; + +namespace Tizen.Sensor.Tests +{ + [TestFixture] + [Description("Testing Tizen.Sensor.HeartRateMonitorLEDGreenBatch class")] + public class HeartRateMonitorLEDGreenBatchTests + { + private static bool _support = false; + + [OneTimeSetUp] + public void Init() + { + _support = TSSensorHelper.CheckCapability("http://tizen.org/feature/sensor.heart_rate_monitor.led_green.batch"); + } + + [Test] + [Category("P1")] + [Description("Check HeartRateMonitorLEDGreenBatch DataUpdated event")] + [Property("SPEC", "Tizen.Sensor.HeartRateMonitorLEDGreenBatch.DataUpdated E")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "EVL")] + [Property("AUTHOR", "Muhong Byun, mh.byun@samsung.com")] + [Precondition(1, "HeartRateMonitorLEDGreenBatch sensor should be available")] + [Step(1, "Tap the Run button")] + [Step(2, "Heart rate monitor event: Put your device on your wrist and wait a moment.")] + public async Task DataUpdated_CHECK_EVENT() + { + try + { + /* TEST CODE */ + EventHandler handler = null; + handler = (sender, e) => + { + Assert.True(true); + ManualTest.Confirm(); + }; + + var sensor = new HeartRateMonitorLEDGreenBatch(0); + sensor.DataUpdated += handler; + sensor.Start(); + sensor.Interval = 100; + await ManualTest.WaitForConfirm(); + sensor.Stop(); + sensor.DataUpdated -= handler; + sensor.Dispose(); + } + catch (NotSupportedException) + { + Assert.IsTrue(_support == false, "Invalid NotSupportedException"); + TSSensorHelper.DisplayLabel("HeartRateMonitorLEDGreenBatch"); + await ManualTest.WaitForConfirm(); + } + catch (Exception e) + { + Assert.True(false, "should not throw exception(" + e.Message + ")"); + } + } + + [Test] + [Category("P1")] + [Description("Check HeartRateMonitorLEDGreenBatch AccuracyChanged event")] + [Property("SPEC", "Tizen.Sensor.HeartRateMonitorLEDGreenBatch.AccuracyChanged E")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "EVL")] + [Property("AUTHOR", "Muhong Byun, mh.byun@samsung.com")] + [Precondition(1, "HeartRateMonitorLEDGreenBatch sensor should be available")] + [Step(1, "Tap the Run button")] + [Step(2, "Rotate the test device")] + public async Task AccuracyChanged_CHECK_EVENT() + { + try + { + /* TEST CODE */ + EventHandler handler = null; + handler = (sender, e) => + { + + Assert.True(true); + ManualTest.Confirm(); + }; + + var sensor = new HeartRateMonitorLEDGreenBatch(); + sensor.AccuracyChanged += handler; + sensor.Start(); + sensor.Interval = 100; + await ManualTest.WaitForConfirm(); + sensor.Stop(); + sensor.AccuracyChanged -= handler; + sensor.Dispose(); + } + catch (NotSupportedException) + { + Assert.IsTrue(_support == false, "Invalid NotSupportedException"); + TSSensorHelper.DisplayLabel("HeartRateMonitorLEDGreenBatch"); + await ManualTest.WaitForConfirm(); + } + catch (Exception e) + { + Assert.True(false, "should not throw exception(" + e.Message + ")"); + } + } + + + } +} + diff --git a/tct-suite-vs/Tizen.Sensor.Manual.Tests/testcase/TSHeartRateMonitorLEDGreenBatchDataUpdatedEventArgs.cs b/tct-suite-vs/Tizen.Sensor.Manual.Tests/testcase/TSHeartRateMonitorLEDGreenBatchDataUpdatedEventArgs.cs new file mode 100755 index 0000000..348c7da --- /dev/null +++ b/tct-suite-vs/Tizen.Sensor.Manual.Tests/testcase/TSHeartRateMonitorLEDGreenBatchDataUpdatedEventArgs.cs @@ -0,0 +1,72 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using NUnit.Framework; + +namespace Tizen.Sensor.Tests +{ + [TestFixture] + [Description("Testing Tizen.Sensor.HeartRateMonitorLEDGreenBatchDataUpdatedEventArgs class")] + public class HeartRateMonitorLEDGreenBatchDataUpdatedEventArgsTests + { + private static bool _support = false; + + [OneTimeSetUp] + public void Init() + { + _support = TSSensorHelper.CheckCapability("http://tizen.org/feature/sensor.heart_rate_monitor.led_green.batch"); + } + + [Test] + [Category("P1")] + [Description("Check Data value when HeartRateMonitorLEDGreenBatch DataUpdated event is triggered")] + [Property("SPEC", "Tizen.Sensor.HeartRateMonitorLEDGreenBatchDataUpdatedEventArgs.Data A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Muhong Byun, mh.byun@samsung.com")] + [Precondition(1, "HeartRateMonitorLEDGreenBatch sensor should be available")] + [Step(1, "Tap the Run button")] + [Step(2, "Put a test device on your wrist and wait a moment.")] + public async Task Data_PROPERTY_READ_ONLY() + { + try + { + var sensor = new HeartRateMonitorLEDGreenBatch(0); + sensor.Interval = 100; + IReadOnlyList getValue = null; + + EventHandler handler = null; + handler = (sender, e) => + { + /* TESTCODE */ + Assert.IsInstanceOf>(e.Data, "Data value should be IReadOnlyList of HeartRateMonitorLEDGreenBatchData"); + Assert.IsTrue(e.Data != getValue, "Data value should be changed."); + ManualTest.Confirm(); + }; + + sensor.DataUpdated += handler; + sensor.Start(); + + getValue = sensor.Data; + await ManualTest.WaitForConfirm(); + + sensor.Stop(); + sensor.DataUpdated -= handler; + sensor.Dispose(); + } + catch (NotSupportedException) + { + Assert.IsTrue(_support == false, "Invalid NotSupportedException"); + TSSensorHelper.DisplayLabel("HeartRateMonitor"); + await ManualTest.WaitForConfirm(); + } + catch (Exception e) + { + Assert.True(false, "should not throw exception(" + e.Message + ")"); + } + } + } +} + + + diff --git a/tct-suite-vs/Tizen.Sensor.Manual.Tests/testcase/TSSensorAccuracyChangedEventArgs.cs b/tct-suite-vs/Tizen.Sensor.Manual.Tests/testcase/TSSensorAccuracyChangedEventArgs.cs index b992096..216b757 100755 --- a/tct-suite-vs/Tizen.Sensor.Manual.Tests/testcase/TSSensorAccuracyChangedEventArgs.cs +++ b/tct-suite-vs/Tizen.Sensor.Manual.Tests/testcase/TSSensorAccuracyChangedEventArgs.cs @@ -108,5 +108,53 @@ namespace Tizen.Sensor.Tests Assert.True(false, "should not throw exception(" + e.Message + ")"); } } + + [Test] + [Category("P1")] + [Description("Check timestamp when sensor event is triggered")] + [Property("SPEC", "Tizen.Sensor.SensorAccuracyChangedEventArgs.Timestamp A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRW")] + [Property("AUTHOR", "Muhong Byun, mh.byun@samsung.com")] + [Precondition(1, "RotationVectorSensor sensor should be available")] + [Step(1, "Tap the Run button")] + [Step(2, "Accuracy changed event: Its difficult to reproduce this event. Accuracy may change when make big 8-like gestures with the device OR the device is exposed to strong electromagnetic fields/ferrous metal objects.")] + public async Task Timestamp_PROPERTY_READ_ONLY() + { + try + { + /* TESTCODE */ + var sensor = new RotationVectorSensor(0); + sensor.Interval = 100; + ulong getValue = sensor.Timestamp; + + EventHandler handler = null; + handler = (sender, e) => + { + Assert.IsInstanceOf(e.Timestamp, "Timestamp value should be of type ulong"); + Assert.IsTrue(e.Timestamp != getValue, "Timestamp value should be changed."); + ManualTest.Confirm(); + }; + sensor.AccuracyChanged += handler; + + sensor.Start(); + await ManualTest.WaitForConfirm(); + sensor.Stop(); + sensor.AccuracyChanged -= handler; + sensor.Dispose(); + } + catch (NotSupportedException) + { + Assert.IsTrue(_support == false, "Invalid NotSupportedException"); + TSSensorHelper.DisplayLabel("RotationVectorSensor"); + await ManualTest.WaitForConfirm(); + } + catch (Exception e) + { + Assert.True(false, "should not throw exception(" + e.Message + ")"); + } + } + + } } diff --git a/tct-suite-vs/Tizen.Sensor.Tests/testcase/TSAutoRotationSensor.cs b/tct-suite-vs/Tizen.Sensor.Tests/testcase/TSAutoRotationSensor.cs old mode 100644 new mode 100755 diff --git a/tct-suite-vs/Tizen.Sensor.Tests/testcase/TSBatchData.cs b/tct-suite-vs/Tizen.Sensor.Tests/testcase/TSBatchData.cs new file mode 100755 index 0000000..4c3c6db --- /dev/null +++ b/tct-suite-vs/Tizen.Sensor.Tests/testcase/TSBatchData.cs @@ -0,0 +1,70 @@ +using System; +using Tizen.System; +using NUnit.Framework; +using System.Collections.Generic; + +namespace Tizen.Sensor.Tests +{ + [TestFixture] + [Description("Testing Tizen.Sensor.BatchData class")] + public class BatchDataTests + { + public class MyBatchData : BatchData + { + public MyBatchData(ulong timestamp, SensorDataAccuracy accuracy) : base(timestamp, accuracy) { } + } + + [Test] + [Category("P1")] + [Description("Test BatchData object construction")] + [Property("SPEC", "Tizen.Sensor.BatchData.BatchData C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "Muhong Byun, mh.byun@samsung.com")] + public void BatchData_INIT() + { + try + { + /* TESTCODE */ + var obj = new MyBatchData(0, SensorDataAccuracy.Good); + Assert.IsNotNull(obj, "Object should not be null after construction"); + Assert.IsInstanceOf(obj, "Object's type should be MyBatchData."); + } + catch (Exception e) + { + Assert.True(false, "should not throw exception(" + e.Message + ")"); + } + } + + [Test] + [Category("P1")] + [Description("Check the return type and value of BatchData.Timestamp")] + [Property("SPEC", "Tizen.Sensor.BatchData.Timestamp A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRW")] + [Property("AUTHOR", "Muhong Byun, mh.byun@samsung.com")] + public void Timestamp_PROPERTY_READ_ONLY() + { + /* TESTCODE */ + var obj = new MyBatchData(0, SensorDataAccuracy.Good); + Assert.IsInstanceOf(obj.Timestamp, "Object's Timestamp value should be ulong."); + Assert.True((obj.Timestamp == 0), "Timestamp value returned is different from initial value"); + } + + [Test] + [Category("P1")] + [Description("Check the return type and value of BatchData.Accuracy")] + [Property("SPEC", "Tizen.Sensor.BatchData.Accuracy A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRW")] + [Property("AUTHOR", "Muhong Byun, mh.byun@samsung.com")] + public void Accuracy_PROPERTY_READ_ONLY() + { + /* TESTCODE */ + var obj = new MyBatchData(0, SensorDataAccuracy.Good); + Assert.IsInstanceOf(obj.Accuracy, "Object's Accuracy value should be SensorDataAccuracy."); + Assert.True((obj.Accuracy == SensorDataAccuracy.Good), "Accuracy value returned is different from initial value"); + } + } +} + diff --git a/tct-suite-vs/Tizen.Sensor.Tests/testcase/TSBatchSensor.cs b/tct-suite-vs/Tizen.Sensor.Tests/testcase/TSBatchSensor.cs new file mode 100755 index 0000000..ec2a09c --- /dev/null +++ b/tct-suite-vs/Tizen.Sensor.Tests/testcase/TSBatchSensor.cs @@ -0,0 +1,79 @@ +using System; +using System.Collections.Generic; +using System.Reflection; +using NUnit.Framework; +using NUnit.Framework.TUnit; + +namespace Tizen.Sensor.Tests +{ + [TestFixture] + [Description("Testing Tizen.Sensor.BatchSensor class")] + public class BatchSensorTests + { + private static List batchSensors = new List(); + + [OneTimeSetUp] + public void Init() + { + if (HeartRateMonitorBatch.IsSupported) + batchSensors.Add(new HeartRateMonitorBatch(0)); + if (HeartRateMonitorLEDGreenBatch.IsSupported) + batchSensors.Add(new HeartRateMonitorLEDGreenBatch(0)); + } + + [OneTimeTearDown] + public void Destroy() + { + foreach (var item in batchSensors) + { + if (item != null) + item.Dispose(); + } + batchSensors.Clear(); + } + + [Test] + [Category("P1")] + [Description("Check the default value of BatchSensor.Data")] + [Property("SPEC", "Tizen.Sensor.BatchSensor.Data A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRW")] + [Property("AUTHOR", "Muhong Byun, mh.byun@samsung.com")] + public void Data_PROPERTY_READ_DEFAULT() + { + /* TESTCODE */ + foreach (var item in batchSensors) + { + var result = item.GetType().GetProperty("Data").GetValue(item); + Assert.IsNotNull(result, "Default Data value of BatchSensor should not be null."); + } + } + + [Test] + [Category("P1")] + [Description("Test stability of BatchSensor.UpdateBatchData")] + [Property("SPEC", "Tizen.Sensor.BatchSensor.UpdateBatchData M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MCST")] + [Property("AUTHOR", "Muhong Byun, mh.byun@samsung.com")] + public void UpdateBatchData_STATUS() + { + try + { + /* TESTCODE */ + foreach (var item in batchSensors) + { + MethodInfo methodInfo = item.GetType().GetMethod("UpdateBatchData", BindingFlags.NonPublic | BindingFlags.Instance); + IntPtr param1 = (IntPtr)null; + uint param2 = 0; + methodInfo.Invoke(item, new object[] { param1, param2 }); + } + } + catch (Exception e) + { + Assert.True(false, "should not throw exception(" + e.Message + ")"); + } + } + + } +} diff --git a/tct-suite-vs/Tizen.Sensor.Tests/testcase/TSHeartRateMonitorBatch.cs b/tct-suite-vs/Tizen.Sensor.Tests/testcase/TSHeartRateMonitorBatch.cs new file mode 100755 index 0000000..26e6d31 --- /dev/null +++ b/tct-suite-vs/Tizen.Sensor.Tests/testcase/TSHeartRateMonitorBatch.cs @@ -0,0 +1,163 @@ +using System; +using Tizen.System; +using NUnit.Framework; +using System.Collections.Generic; + +namespace Tizen.Sensor.Tests +{ + [TestFixture] + [Description("Testing Tizen.Sensor.HeartRateMonitorBatch class")] + public class HeartRateMonitorBatchTests + { + private static string HeartRateMonitorBatchKey = "http://tizen.org/feature/sensor.heart_rate_monitor.batch"; + private static bool support = false; + + private static bool CheckCapability() + { + bool ret = false; + if (Information.TryGetValue(HeartRateMonitorBatchKey, out ret)) + return ret; + + return false; + } + + [OneTimeSetUp] + public void Init() + { + support = CheckCapability(); + } + + [Test] + [Category("P1")] + [Description("Test HeartRateMonitorBatch object construction")] + [Property("SPEC", "Tizen.Sensor.HeartRateMonitorBatch.HeartRateMonitorBatch C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "Muhong Byun, mh.byun@samsung.com")] + [Property("COVPARAM", "")] + public void HeartRateMonitorBatch_INIT() + { + /* + * PRECONDITION + * 1. HeartRateMonitorBatch should be available + */ + try + { + /* TESTCODE */ + var obj = new HeartRateMonitorBatch(); + Assert.IsNotNull(obj, "Object should not be null after construction"); + Assert.IsInstanceOf(obj, "Object's type should be HeartRateMonitorBatch."); + + /* POST CONDITION */ + obj.Dispose(); + } + catch (Exception e) + { + if (e is NotSupportedException) + { + Assert.IsTrue(support == false, "Invalid NotSupportedException"); + } + else + { + Assert.True(false, "should not throw exception(" + e.Message + ")"); + } + } + } + + [Test] + [Category("P2")] + [Description("Check HeartRateMonitorBatch constructor for exception")] + [Property("SPEC", "Tizen.Sensor.HeartRateMonitorBatch.HeartRateMonitorBatch C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTX")] + [Property("COVPARAM", "")] + public void HeartRateMonitorBatch_INIT_NOT_SUPPORTED_EXCEPTION() + { + if (!support) + { + Assert.Throws(() => { var obj = new HeartRateMonitorBatch(); }); + } + else + { + Assert.Pass("Test skipped! Can't test not supported exception"); + } + } + + [Test] + [Category("P1")] + [Description("Check the return type and value of HeartRateMonitorBatch.IsSupported")] + [Property("SPEC", "Tizen.Sensor.HeartRateMonitorBatch.IsSupported A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Muhong Byun, mh.byun@samsung.com")] + public void IsSupported_PROPERTY_READ_ONLY() + { + /* TESTCODE */ + bool ret = HeartRateMonitorBatch.IsSupported; + Assert.IsNotNull(ret, "IsSupported value returned is null"); + Assert.True((ret == support), "IsSupported value returned is different from capability"); + } + + [Test] + [Category("P1")] + [Description("Check the return type and value of HeartRateMonitorBatch.Accuracy")] + [Property("SPEC", "Tizen.Sensor.HeartRateMonitorBatch.Accuracy A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRW")] + [Property("AUTHOR", "Muhong Byun, mh.byun@samsung.com")] + public void Accuracy_PROPERTY_READ_ONLY() + { + /* + * PRECONDITION + * 1. HeartRateMonitorBatch Sensor should be available + * 2. Sensor PausePolicy set All. + */ + try + { + var sensor = new HeartRateMonitorBatch(); + sensor.PausePolicy = SensorPausePolicy.All; + + /* TESTCODE */ + object ret = sensor.Accuracy; + Assert.IsNotNull(ret, "HeartRateMonitorBatch.Accuracy is null"); + Assert.IsTrue(sensor.Accuracy >= SensorDataAccuracy.Undefined && sensor.Accuracy <= SensorDataAccuracy.VeryGood, "Not in range"); + Assert.True((ret is SensorDataAccuracy), "Accuracy value returned is not of type SensorDataAccuracy"); + + /* POST CONDITION */ + sensor.PausePolicy = SensorPausePolicy.None; + sensor.Dispose(); + } + catch (Exception e) + { + if (!support) + Assert.IsInstanceOf(e, "NotSupportedException should be thrown for not supported sensor"); + else + Assert.True(false, "should not throw exception(" + e.Message + ")"); + } + } + + [Test] + [Category("P1")] + [Description("Check the return type and value of HeartRateMonitorBatch.Count")] + [Property("SPEC", "Tizen.Sensor.HeartRateMonitorBatch.Count A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Muhong Byun, mh.byun@samsung.com")] + public void Count_PROPERTY_READ_ONLY() + { + try + { + /* TESTCODE */ + object ret = HeartRateMonitorBatch.Count; + Assert.IsNotNull(ret, "Count value returned should not be null"); + Assert.True((ret is int), "Count value returned is not of type int"); + Assert.Greater((int)ret, -1, "Count of HeartRateMonitorBatch cant be negative"); + } + catch (Exception e) + { + Assert.True(false, "should not throw exception(" + e.Message + ")"); + } + } + } +} + diff --git a/tct-suite-vs/Tizen.Sensor.Tests/testcase/TSHeartRateMonitorBatchData.cs b/tct-suite-vs/Tizen.Sensor.Tests/testcase/TSHeartRateMonitorBatchData.cs new file mode 100755 index 0000000..93e0e6d --- /dev/null +++ b/tct-suite-vs/Tizen.Sensor.Tests/testcase/TSHeartRateMonitorBatchData.cs @@ -0,0 +1,81 @@ +using System; +using Tizen.System; +using NUnit.Framework; +using System.Collections.Generic; + +namespace Tizen.Sensor.Tests +{ + [TestFixture] + [Description("Testing Tizen.Sensor.HeartRateMonitorBatchData class")] + public class HeartRateMonitorBatchDataTests + { + + [Test] + [Category("P1")] + [Description("Test HeartRateMonitorBatchData object construction")] + [Property("SPEC", "Tizen.Sensor.HeartRateMonitorBatchData.HeartRateMonitorBatchData C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "Muhong Byun, mh.byun@samsung.com")] + public void HeartRateMonitorBatchData_INIT() + { + try + { + /* TESTCODE */ + var obj = new HeartRateMonitorBatchData(0, SensorDataAccuracy.Good, HeartRateMonitorBatchState.SENSOR_HRM_BATCH_STATE_NONE, 0, 0); + Assert.IsNotNull(obj, "Object should not be null after construction"); + Assert.IsInstanceOf(obj, "Object's type should be HeartRateMonitorBatchData."); + } + catch (Exception e) + { + Assert.True(false, "should not throw exception(" + e.Message + ")"); + } + } + + [Test] + [Category("P1")] + [Description("Check the return type and value of HeartRateMonitorBatchData.State")] + [Property("SPEC", "Tizen.Sensor.HeartRateMonitorBatchData.State A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Muhong Byun, mh.byun@samsung.com")] + public void State_PROPERTY_READ_ONLY() + { + /* TESTCODE */ + var obj = new HeartRateMonitorBatchData(0, SensorDataAccuracy.Good, HeartRateMonitorBatchState.SENSOR_HRM_BATCH_STATE_NONE, 0, 0); + Assert.IsInstanceOf(obj.State, "Object's State value should be HeartRateMonitorBatchState."); + Assert.True((obj.State == HeartRateMonitorBatchState.SENSOR_HRM_BATCH_STATE_NONE), "State value returned is different from initial value"); + } + + [Test] + [Category("P1")] + [Description("Check the return type and value of HeartRateMonitorBatchData.HeartRate")] + [Property("SPEC", "Tizen.Sensor.HeartRateMonitorBatchData.HeartRate A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Muhong Byun, mh.byun@samsung.com")] + public void HeartRate_PROPERTY_READ_ONLY() + { + /* TESTCODE */ + var obj = new HeartRateMonitorBatchData(0, SensorDataAccuracy.Good, HeartRateMonitorBatchState.SENSOR_HRM_BATCH_STATE_NONE, 0, 0); + Assert.IsInstanceOf(obj.HeartRate, "Object's HeartRate value should be int."); + Assert.True((obj.HeartRate == 0), "HeartRate value returned is different from initial value"); + } + + [Test] + [Category("P1")] + [Description("Check the return type and value of HeartRateMonitorBatchData.RRInterval")] + [Property("SPEC", "Tizen.Sensor.HeartRateMonitorBatchData.RRInterval A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Muhong Byun, mh.byun@samsung.com")] + public void RRInterval_PROPERTY_READ_ONLY() + { + /* TESTCODE */ + var obj = new HeartRateMonitorBatchData(0, SensorDataAccuracy.Good, HeartRateMonitorBatchState.SENSOR_HRM_BATCH_STATE_NONE, 0, 0); + Assert.IsInstanceOf(obj.RRInterval, "Object's RRInterval value should be int."); + Assert.True((obj.RRInterval == 0), "RRInterval value returned is different from initial value"); + } + } +} + diff --git a/tct-suite-vs/Tizen.Sensor.Tests/testcase/TSHeartRateMonitorLEDGreenBatch.cs b/tct-suite-vs/Tizen.Sensor.Tests/testcase/TSHeartRateMonitorLEDGreenBatch.cs new file mode 100755 index 0000000..7da93b6 --- /dev/null +++ b/tct-suite-vs/Tizen.Sensor.Tests/testcase/TSHeartRateMonitorLEDGreenBatch.cs @@ -0,0 +1,164 @@ +using System; +using Tizen.System; +using NUnit.Framework; +using System.Collections.Generic; + +namespace Tizen.Sensor.Tests +{ + [TestFixture] + [Description("Testing Tizen.Sensor.HeartRateMonitorLEDGreenBatch class")] + public class HeartRateMonitorLEDGreenBatchTests + { + private static string HeartRateMonitorLEDGreenBatchKey = "http://tizen.org/feature/sensor.heart_rate_monitor.led_green.batch"; + private static bool support = false; + + private static bool CheckCapability() + { + bool ret = false; + if (Information.TryGetValue(HeartRateMonitorLEDGreenBatchKey, out ret)) + return ret; + + return false; + } + + [OneTimeSetUp] + public void Init() + { + support = CheckCapability(); + } + + [Test] + [Category("P1")] + [Description("Test HeartRateMonitorLEDGreenBatch object construction")] + [Property("SPEC", "Tizen.Sensor.HeartRateMonitorLEDGreenBatch.HeartRateMonitorLEDGreenBatch C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "Muhong Byun, mh.byun@samsung.com")] + [Property("COVPARAM", "")] + public void HeartRateMonitorLEDGreenBatch_INIT() + { + /* + * PRECONDITION + * 1. HeartRateMonitorLEDGreenBatch should be available + */ + try + { + /* TESTCODE */ + var obj = new HeartRateMonitorLEDGreenBatch(); + Assert.IsNotNull(obj, "Object should not be null after construction"); + Assert.IsInstanceOf(obj, "Object's type should be HeartRateMonitorLEDGreenBatch."); + + /* POST CONDITION */ + obj.Dispose(); + } + catch (Exception e) + { + if (e is NotSupportedException) + { + Assert.IsTrue(support == false, "Invalid NotSupportedException"); + } + else + { + Assert.True(false, "should not throw exception(" + e.Message + ")"); + } + } + } + + [Test] + [Category("P2")] + [Description("Check HeartRateMonitorLEDGreenBatch constructor for exception")] + [Property("SPEC", "Tizen.Sensor.HeartRateMonitorLEDGreenBatch.HeartRateMonitorLEDGreenBatch C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("COVPARAM", "")] + public void HeartRateMonitorLEDGreenBatch_INIT_TEST_NOT_SUPPORT() + { + if (!support) + { + Assert.Throws(() => { var obj = new HeartRateMonitorLEDGreenBatch(); }); + } + else + { + Assert.Pass("Test skipped! Can't test not supported exception"); + } + } + + [Test] + [Category("P1")] + [Description("Check the return type and value of HeartRateMonitorLEDGreenBatch.IsSupported")] + [Property("SPEC", "Tizen.Sensor.HeartRateMonitorLEDGreenBatch.IsSupported A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Muhong Byun, mh.byun@samsung.com")] + public void IsSupported_PROPERTY_READ_ONLY() + { + /* TESTCODE */ + bool ret = HeartRateMonitorLEDGreenBatch.IsSupported; + Assert.IsNotNull(ret, "IsSupported value returned is null"); + Assert.True((ret == support), "IsSupported value returned is different from capability"); + } + + [Test] + [Category("P1")] + [Description("Check the return type and value of HeartRateMonitorLEDGreenBatch.Accuracy")] + [Property("SPEC", "Tizen.Sensor.HeartRateMonitorLEDGreenBatch.Accuracy A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRW")] + [Property("AUTHOR", "Muhong Byun, mh.byun@samsung.com")] + public void Accuracy_PROPERTY_READ_ONLY() + { + /* + * PRECONDITION + * 1. HeartRateMonitorBatch Sensor should be available + * 2. Sensor PausePolicy set All. + */ + try + { + var sensor = new HeartRateMonitorLEDGreenBatch(); + sensor.PausePolicy = SensorPausePolicy.All; + + /* TESTCODE */ + object ret = sensor.Accuracy; + Assert.IsNotNull(ret, "HeartRateMonitorLEDGreenBatch.Accuracy is null"); + Assert.IsTrue(sensor.Accuracy >= SensorDataAccuracy.Undefined && sensor.Accuracy <= SensorDataAccuracy.VeryGood, "Not in range"); + Assert.True((ret is SensorDataAccuracy), "Accuracy value returned is not of type SensorDataAccuracy"); + + /* POST CONDITION */ + sensor.PausePolicy = SensorPausePolicy.None; + sensor.Dispose(); + } + catch (Exception e) + { + if (!support) + Assert.IsInstanceOf(e, "NotSupportedException should be thrown for not supported sensor"); + else + Assert.True(false, "should not throw exception(" + e.Message + ")"); + } + } + + + [Test] + [Category("P1")] + [Description("Check the return type and value of HeartRateMonitorLEDGreenBatch.Count")] + [Property("SPEC", "Tizen.Sensor.HeartRateMonitorLEDGreenBatch.Count A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Muhong Byun, mh.byun@samsung.com")] + public void Count_PROPERTY_READ_ONLY() + { + try + { + /* TESTCODE */ + object ret = HeartRateMonitorLEDGreenBatch.Count; + Assert.IsNotNull(ret, "Count value returned should not be null"); + Assert.True((ret is int), "Count value returned is not of type int"); + Assert.Greater((int)ret, -1, "Count of HeartRateMonitorLEDGreenBatch cant be negative"); + } + catch (Exception e) + { + Assert.True(false, "should not throw exception(" + e.Message + ")"); + } + } + } +} + diff --git a/tct-suite-vs/Tizen.Sensor.Tests/testcase/TSHeartRateMonitorLEDGreenBatchData.cs b/tct-suite-vs/Tizen.Sensor.Tests/testcase/TSHeartRateMonitorLEDGreenBatchData.cs new file mode 100755 index 0000000..fcfdb75 --- /dev/null +++ b/tct-suite-vs/Tizen.Sensor.Tests/testcase/TSHeartRateMonitorLEDGreenBatchData.cs @@ -0,0 +1,112 @@ +using System; +using Tizen.System; +using NUnit.Framework; +using System.Collections.Generic; + +namespace Tizen.Sensor.Tests +{ + [TestFixture] + [Description("Testing Tizen.Sensor.HeartRateMonitorLEDGreenBatchData class")] + public class HeartRateMonitorLEDGreenBatchDataTests + { + [Test] + [Category("P1")] + [Description("Test HeartRateMonitorLEDGreenBatchData object construction")] + [Property("SPEC", "Tizen.Sensor.HeartRateMonitorLEDGreenBatchData.HeartRateMonitorLEDGreenBatchData C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "Muhong Byun, mh.byun@samsung.com")] + [Property("COVPARAM", "")] + public void HeartRateMonitorLEDGreenBatchData_INIT() + { + try + { + /* TESTCODE */ + var obj = new HeartRateMonitorLEDGreenBatchData(0, SensorDataAccuracy.Good, 0, 0, 0, 0, 0); + Assert.IsNotNull(obj, "Object should not be null after construction"); + Assert.IsInstanceOf(obj, "Object's type should be HeartRateMonitorLEDGreenBatchData."); + } + catch (Exception e) + { + Assert.True(false, "should not throw exception(" + e.Message + ")"); + } + } + + [Test] + [Category("P1")] + [Description("Check the return type and value of HeartRateMonitorLEDGreenBatchData.Green")] + [Property("SPEC", "Tizen.Sensor.HeartRateMonitorLEDGreenBatchData.Green A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Muhong Byun, mh.byun@samsung.com")] + public void Green_PROPERTY_READ_ONLY() + { + /* TESTCODE */ + var obj = new HeartRateMonitorLEDGreenBatchData(0, SensorDataAccuracy.Good, 0, 0, 0, 0, 0); + Assert.IsInstanceOf(obj.Green, "Object's Green value should be uint."); + Assert.True((obj.Green == 0), "Green value returned is different from initial value"); + } + + [Test] + [Category("P1")] + [Description("Check the return type and value of HeartRateMonitorLEDGreenBatchData.AccelerationX")] + [Property("SPEC", "Tizen.Sensor.HeartRateMonitorLEDGreenBatchData.AccelerationX A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Muhong Byun, mh.byun@samsung.com")] + public void AccelerationX_PROPERTY_READ_ONLY() + { + /* TESTCODE */ + var obj = new HeartRateMonitorLEDGreenBatchData(0, SensorDataAccuracy.Good, 0, 0, 0, 0, 0); + Assert.IsInstanceOf(obj.AccelerationX, "Object's AccelerationX value should be int."); + Assert.True((obj.AccelerationX == 0), "AccelerationX value returned is different from initial value"); + } + + [Test] + [Category("P1")] + [Description("Check the return type and value of HeartRateMonitorLEDGreenBatchData.AccelerationY")] + [Property("SPEC", "Tizen.Sensor.HeartRateMonitorLEDGreenBatchData.AccelerationY A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Muhong Byun, mh.byun@samsung.com")] + public void AccelerationY_PROPERTY_READ_ONLY() + { + /* TESTCODE */ + var obj = new HeartRateMonitorLEDGreenBatchData(0, SensorDataAccuracy.Good, 0, 0, 0, 0, 0); + Assert.IsInstanceOf(obj.AccelerationY, "Object's AccelerationY value should be int."); + Assert.True((obj.AccelerationY == 0), "AccelerationY value returned is different from initial value"); + } + + [Test] + [Category("P1")] + [Description("Check the return type and value of HeartRateMonitorLEDGreenBatchData.AccelerationZ")] + [Property("SPEC", "Tizen.Sensor.HeartRateMonitorLEDGreenBatchData.AccelerationZ A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Muhong Byun, mh.byun@samsung.com")] + public void AccelerationZ_PROPERTY_READ_ONLY() + { + /* TESTCODE */ + var obj = new HeartRateMonitorLEDGreenBatchData(0, SensorDataAccuracy.Good, 0, 0, 0, 0, 0); + Assert.IsInstanceOf(obj.AccelerationZ, "Object's AccelerationZ value should be int."); + Assert.True((obj.AccelerationZ == 0), "AccelerationZ value returned is different from initial value"); + } + + [Test] + [Category("P1")] + [Description("Check the return type and value of HeartRateMonitorLEDGreenBatchData.Index")] + [Property("SPEC", "Tizen.Sensor.HeartRateMonitorLEDGreenBatchData.Index A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Muhong Byun, mh.byun@samsung.com")] + public void Index_PROPERTY_READ_ONLY() + { + /* TESTCODE */ + var obj = new HeartRateMonitorLEDGreenBatchData(0, SensorDataAccuracy.Good, 0, 0, 0, 0, 0); + Assert.IsInstanceOf(obj.Index, "Object's RRInterval value should be uint."); + Assert.True((obj.Index == 0), "RRInterval value returned is different from initial value"); + } + + } +} + diff --git a/tct-suite-vs/Tizen.Sensor.Tests/testcase/TSSensor.cs b/tct-suite-vs/Tizen.Sensor.Tests/testcase/TSSensor.cs index 80410db..de2bbe4 100755 --- a/tct-suite-vs/Tizen.Sensor.Tests/testcase/TSSensor.cs +++ b/tct-suite-vs/Tizen.Sensor.Tests/testcase/TSSensor.cs @@ -34,6 +34,10 @@ namespace Tizen.Sensor.Tests sensors.Add(new LightSensor(0)); if (HeartRateMonitor.IsSupported) sensors.Add(new HeartRateMonitor(0)); + if (HeartRateMonitorBatch.IsSupported) + sensors.Add(new HeartRateMonitorBatch(0)); + if (HeartRateMonitorLEDGreenBatch.IsSupported) + sensors.Add(new HeartRateMonitorLEDGreenBatch(0)); if (Gyroscope.IsSupported) sensors.Add(new Gyroscope(0)); if (UncalibratedGyroscope.IsSupported) @@ -216,6 +220,24 @@ namespace Tizen.Sensor.Tests [Test] [Category("P1")] + [Description("Check the return type and value of Sensor.Timestamp")] + [Property("SPEC", "Tizen.Sensor.Sensor.Timestamp A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRW")] + [Property("AUTHOR", "Muhong Byun, mh.byun@samsung.com")] + public void Timestamp_PROPERTY_READ_WRITE() + { + /* TESTCODE */ + foreach (var item in sensors) + { + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "############### Testing [" + item.GetType() + "] object"); + item.Timestamp = 10; + Assert.IsTrue(item.Timestamp == 10, "Failed to read/write value"); + } + } + + [Test] + [Category("P1")] [Description("Check the return type and value of Sensor.IsSensing")] [Property("SPEC", "Tizen.Sensor.Sensor.IsSensing A")] [Property("SPEC_URL", "-")] -- 2.7.4