From: sri Date: Thu, 28 May 2020 09:32:05 +0000 (+0530) Subject: [Non-ACR][Tizen.System.PowerUsage.Tests] Handling no record data case X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F56%2F234756%2F1;p=test%2Ftct%2Fcsharp%2Fapi.git [Non-ACR][Tizen.System.PowerUsage.Tests] Handling no record data case Change-Id: I7524e8b9aa7682b4a5b07ac332477cd54361acfa Signed-off-by: sri --- diff --git a/tct-suite-vs/Tizen.System.PowerUsage.Tests/testcase/TSPowerUsage.cs b/tct-suite-vs/Tizen.System.PowerUsage.Tests/testcase/TSPowerUsage.cs index cf28c02..4521e90 100755 --- a/tct-suite-vs/Tizen.System.PowerUsage.Tests/testcase/TSPowerUsage.cs +++ b/tct-suite-vs/Tizen.System.PowerUsage.Tests/testcase/TSPowerUsage.cs @@ -579,6 +579,10 @@ namespace Tizen.System.Tests Assert.IsTrue(powerUsage is double, "GetPowerUsage() should return power usage value in double by a resource for certain time interval"); Assert.IsTrue((double)powerUsage >= 0, "GetPowerUsage() should return usage value by a resource for certain time interval"); } + catch (ArgumentException) + { + Assert.Pass("No data record corresponding to given resource type"); + } catch (Exception e) { LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, e.ToString()); @@ -684,6 +688,10 @@ namespace Tizen.System.Tests { object powerUsage = PowerUsage.GetPowerUsage(PowerUsageResourceType.Cpu, startTime, endTime); } + catch (ArgumentException) + { + Assert.Pass("No data record corresponding to given resource type"); + } catch (Exception ex) { Assert.IsTrue(ex.GetType() == typeof(InvalidOperationException), "This operation will raise InvalidOperationException incase of any system error");