}
else
{
- Assert.IsTrue(e.GetType().Name.Equals("NotSupportedException"), "Should be throw NotSupportedException");
+ Assert.IsTrue(e.GetType().Name.Equals("NotSupportedException"), "Must throw NotSupportedException");
+ }
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Test if get for Device.IR.Transmit method is working properly")]
+ [Property("SPEC", "Tizen.System.IR.Transmit M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Youngjae Cho, y0.cho@samsung.com")]
+ public void Transmit_INVALID_PATTERN_ARGUMENT()
+ {
+ /* TEST CODE */
+ bool value;
+ var result = Tizen.System.Information.TryGetValue<bool>("http://tizen.org/feature/consumer_ir", out value);
+ try
+ {
+ //TODO: Not able to find a way to check the transmit success.
+ if (result && value)
+ {
+ List<int> pattern = new List<int>();
+ IR.Transmit(10, pattern);
+ Assert.IsTrue(false, "ArgumentException should be thrown for invalid parameter value.");
+ }
+ }
+ catch (Exception e)
+ {
+ if (result && value)
+ {\r
+ Assert.IsInstanceOf<ArgumentException>(e, "ArgumentException should be thrown for invalid parameter value.");
+ }
+ else
+ {
+ Assert.IsTrue(e.GetType().Name.Equals("NotSupportedException"), "Must throw NotSupportedException");
}
}
}
}
else
{
- Assert.IsTrue(e.GetType().Name.Equals("NotSupportedException"), "Should be throw NotSupportedException");
+ Assert.IsTrue(e.GetType().Name.Equals("NotSupportedException"), "Must throw NotSupportedException");
}
}
}
}
else
{
- Assert.IsTrue(e.GetType().Name.Equals("NotSupportedException"), "Should be throw NotSupportedException");
+ Assert.IsTrue(e.GetType().Name.Equals("NotSupportedException"), "Must throw NotSupportedException");
}
}
}
}
else
{
- Assert.IsTrue(e.GetType().Name.Equals("NotSupportedException"), "Should be throw NotSupportedException");
+ Assert.IsTrue(e.GetType().Name.Equals("NotSupportedException"), "Must throw NotSupportedException");
+ }
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Test if get for Device.Led:Play Method is working properly")]
+ [Property("SPEC", "Tizen.System.Led.Play M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Youngjae Cho, y0.cho@samsung.com")]
+ public void Play_INVALID_ON_ARGUMENT()
+ {
+ /* TEST CODE */
+ bool value;
+ var result = Tizen.System.Information.TryGetValue<bool>("http://tizen.org/feature/led", out value);
+ try
+ {
+ if (result && value)
+ {
+ Led.Play(-1, 200, Color.FromRgba(255, 255, 255, 1));
+ Assert.IsTrue(false, "ArgumentException should be thorwn for negative on value.");
+ }
+ }
+ catch (Exception e)
+ {
+ if (result && value)
+ {
+ Assert.IsInstanceOf<ArgumentException>(e, "ArgumentException should be thrown for negative on value.");
+ }
+ else
+ {
+ Assert.IsTrue(e.GetType().Name.Equals("NotSupportedException"), "Must throw NotSupportedException");
+ }
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Test if get for Device.Led:Play Method is working properly")]
+ [Property("SPEC", "Tizen.System.Led.Play M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Youngjae Cho, y0.cho@samsung.com")]
+ public void Play_INVALID_OFF_ARGUMENT()
+ {
+ /* TEST CODE */
+ bool value;
+ var result = Tizen.System.Information.TryGetValue<bool>("http://tizen.org/feature/led", out value);
+ try
+ {
+ if (result && value)
+ {
+ Led.Play(500, -1, Color.FromRgba(255, 255, 255, 1));
+ Assert.IsTrue(false, "ArgumentException should be thorwn for negative off value.");
+ }
+ }
+ catch (Exception e)
+ {
+ if (result && value)
+ {
+ Assert.IsInstanceOf<ArgumentException>(e, "ArgumentException should be thrown for negative off value.");
+ }
+ else
+ {
+ Assert.IsTrue(e.GetType().Name.Equals("NotSupportedException"), "Must throw NotSupportedException");
}
}
}
}
else
{
- Assert.IsTrue(e.GetType().Name.Equals("NotSupportedException"), "Should be throw NotSupportedException");
+ Assert.IsTrue(e.GetType().Name.Equals("NotSupportedException"), "Must throw NotSupportedException");
}
}
}
/* TEST CODE */
try
{
- Power.RequestCpuLock(2000);
+ Power.RequestLock(PowerLock.Cpu, 2000);
}
catch (Exception e)
{
}
}
+ [Test]
+ [Category("P2")]
+ [Description("Test if get for Tizen.System.Power:RequestCpuLock method is working properly")]
+ [Property("SPEC", "Tizen.System.Power.RequestCpuLock M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Youngjae Cho, y0.cho@samsung.com")]
+ public void RequestCpuLock_INVALID_TIMEOUT_ARGUMENT()
+ {
+ /* TEST CODE */
+ try
+ {
+ Power.RequestLock(PowerLock.Cpu, -1);
+ Assert.IsTrue(false, "ArgumentException should be thrown for negative timeout value.");
+ }
+ catch (Exception e)
+ {
+ Assert.IsInstanceOf<ArgumentException>(e, "ArgumentException should be thrown for negative timeout value.");
+ }
+ }
+
[Test]
[Category("P1")]
[Description("Test if get for Tizen.System.Power:ReleaseCpuLock method is working properly")]
/* TEST CODE */
try
{
- Power.ReleaseCpuLock();
+ Power.ReleaseLock(PowerLock.Cpu);
}
catch (Exception e)
{
}
}
+ [Test]
+ [Category("P1")]
+ [Description("Test if Tizen.System.Vibrator.Vibrate method can throw exception when invalid argument is passed")]
+ [Property("SPEC", "Tizen.System.Vibrator.Vibrate M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Youngjae Cho, y0.cho@samsung.com")]
+ public void Vibrate_INVALID_DURATION_ARGUMENT()
+ {
+ if (!support)
+ return;
+
+ Assert.IsTrue(Vibrator.Vibrators.Count > 0, "Number of vibrators can't be zero");
+ Vibrator vib = Vibrator.Vibrators[0];
+
+ try
+ {
+ vib.Vibrate(-1, 50);
+ Assert.IsTrue(false, "ArgumentException should be thrown for negative duration value.");
+ }
+ catch (Exception e)
+ {
+ Assert.IsInstanceOf<ArgumentException>(e, "ArgumentException should be thrown for negative duration value.");
+ }
+ }
+
[Test]
[Category("P1")]
[Description("Test if Tizen.System.Vibrator.Stop method can be invoked without any exception")]