From da63d881a4eae6aed17c9985342d2706648a88e5 Mon Sep 17 00:00:00 2001 From: InHong Han Date: Tue, 10 May 2022 13:02:20 +0900 Subject: [PATCH] [Sticker][Non-ACR] Fix nullreferenceexception issue Change-Id: I111521e56b56db3ed17dc1b866b3da5a32794a3b --- .../testcase/TSDeletedEventArgs.cs | 17 ++- .../Tizen.Sticker.Tests/testcase/TSGroupImage.cs | 103 +++---------- .../testcase/TSInsertedEventArgs.cs | 19 ++- .../testcase/TSStickerConsumer.cs | 100 ++++++------- .../Tizen.Sticker.Tests/testcase/TSStickerData.cs | 160 ++++++++++----------- .../testcase/TSStickerProvider.cs | 90 ++++++------ .../testcase/TSUpdatedEventArgs.cs | 19 ++- 7 files changed, 226 insertions(+), 282 deletions(-) diff --git a/tct-suite-vs/Tizen.Sticker.Tests/testcase/TSDeletedEventArgs.cs b/tct-suite-vs/Tizen.Sticker.Tests/testcase/TSDeletedEventArgs.cs index 92242b3..0e95383 100644 --- a/tct-suite-vs/Tizen.Sticker.Tests/testcase/TSDeletedEventArgs.cs +++ b/tct-suite-vs/Tizen.Sticker.Tests/testcase/TSDeletedEventArgs.cs @@ -60,10 +60,15 @@ namespace Tizen.Uix.Sticker.Tests [TearDown] public void Destroy() { - StickerProvider.Deinitialize(); - StickerConsumer.Deleted -= DeleteEventOccurred; - StickerConsumer.Deinitialize(); LogUtils.Write(LogUtils.DEBUG , LogUtils.TAG , "Postconditions for each TEST"); + + if (_featureSupported) + { + StickerProvider.Deinitialize(); + StickerConsumer.Deleted -= DeleteEventOccurred; + StickerConsumer.Deinitialize(); + } + GC.Collect(); } @@ -109,10 +114,10 @@ namespace Tizen.Uix.Sticker.Tests catch (Exception e) { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); - if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + if (!_featureSupported) + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } } diff --git a/tct-suite-vs/Tizen.Sticker.Tests/testcase/TSGroupImage.cs b/tct-suite-vs/Tizen.Sticker.Tests/testcase/TSGroupImage.cs index fa805db..6cf28de 100644 --- a/tct-suite-vs/Tizen.Sticker.Tests/testcase/TSGroupImage.cs +++ b/tct-suite-vs/Tizen.Sticker.Tests/testcase/TSGroupImage.cs @@ -26,20 +26,13 @@ namespace Tizen.Uix.Sticker.Tests public class GroupImageTests { private const string LogTag = "Sticker.Tests"; - private static bool _featureSupported = false; - private static string _stickerFeature = "http://tizen.org/feature/ui_service.sticker"; private static GroupImage _groupImage; [SetUp] public void Init() { LogUtils.Write(LogUtils.DEBUG, LogTag, "Preconditions for each TEST"); - System.Information.TryGetValue(_stickerFeature, out _featureSupported); - - if (_featureSupported) - { - _groupImage = new GroupImage("test", UriType.WebResource, "www.samsung.com"); - } + _groupImage = new GroupImage("test", UriType.WebResource, "www.samsung.com"); } [TearDown] @@ -58,39 +51,10 @@ namespace Tizen.Uix.Sticker.Tests [Property("AUTHOR", "Inhong Han, inhong1.han@samsung.com")] public void GroupImage_CONSTR() { - try - { - LogUtils.Write(LogUtils.INFO, LogTag, "Executing TC:GroupImage_CONSTR"); - GroupImage groupImage = new GroupImage("test", UriType.WebResource, "www.samsung.com"); - Assert.IsInstanceOf(groupImage, "Should return StickerData instance."); - LogUtils.Write(LogUtils.INFO, LogTag, "Completed TC:GroupImage_CONSTR"); - } - catch (Exception e) - { - LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); - if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); - else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P2")] - [Description("Check working of GroupImage constructor for exception")] - [Property("SPEC", "Tizen.Uix.Sticker.GroupImage.GroupImage C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTX")] - [Property("AUTHOR", "Inhong Han, inhong1.han@samsung.com")] - public void GroupImage_CONSTX() - { - - LogUtils.Write(LogUtils.INFO, LogTag, "Executing TC:GroupImage_CONSTX"); - if (!_featureSupported) - { - Assert.Throws(() => { GroupImage groupImage = new GroupImage("test", UriType.WebResource, "www.samsung.com"); }); - } - LogUtils.Write(LogUtils.INFO, LogTag, "Completed TC:GroupImage_CONSTX"); + LogUtils.Write(LogUtils.INFO, LogTag, "Executing TC:GroupImage_CONSTR"); + GroupImage groupImage = new GroupImage("test", UriType.WebResource, "www.samsung.com"); + Assert.IsInstanceOf(groupImage, "Should return StickerData instance."); + LogUtils.Write(LogUtils.INFO, LogTag, "Completed TC:GroupImage_CONSTR"); } [Test] @@ -102,21 +66,10 @@ namespace Tizen.Uix.Sticker.Tests [Property("AUTHOR", "Inhong Han, inhong1.han@samsung.com")] public void GroupName_READ_ONLY() { - try - { - LogUtils.Write(LogUtils.INFO, LogTag, "Executing TC:GroupName_READ_ONLY"); - string groupName = _groupImage.GroupName; - Assert.IsNotNull(groupName); - LogUtils.Write(LogUtils.INFO, LogTag, "Completed TC:GroupName_READ_ONLY"); - } - catch (Exception e) - { - LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); - if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); - else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); - } + LogUtils.Write(LogUtils.INFO, LogTag, "Executing TC:GroupName_READ_ONLY"); + string groupName = _groupImage.GroupName; + Assert.IsNotNull(groupName); + LogUtils.Write(LogUtils.INFO, LogTag, "Completed TC:GroupName_READ_ONLY"); } [Test] @@ -128,21 +81,10 @@ namespace Tizen.Uix.Sticker.Tests [Property("AUTHOR", "Inhong Han, inhong1.han@samsung.com")] public void UriType_READ_ONLY() { - try - { - LogUtils.Write(LogUtils.INFO, LogTag, "Executing TC:UriType_READ_ONLY"); - UriType uriType = _groupImage.UriType; - Assert.IsTrue(uriType == UriType.WebResource); - LogUtils.Write(LogUtils.INFO, LogTag, "Completed TC:UriType_READ_ONLY"); - } - catch (Exception e) - { - LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); - if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); - else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); - } + LogUtils.Write(LogUtils.INFO, LogTag, "Executing TC:UriType_READ_ONLY"); + UriType uriType = _groupImage.UriType; + Assert.IsTrue(uriType == UriType.WebResource); + LogUtils.Write(LogUtils.INFO, LogTag, "Completed TC:UriType_READ_ONLY"); } [Test] @@ -154,21 +96,10 @@ namespace Tizen.Uix.Sticker.Tests [Property("AUTHOR", "Inhong Han, inhong1.han@samsung.com")] public void Uri_READ_ONLY() { - try - { - LogUtils.Write(LogUtils.INFO, LogTag, "Executing TC:Uri_READ_ONLY"); - string uri = _groupImage.Uri; - Assert.IsNotNull(uri); - LogUtils.Write(LogUtils.INFO, LogTag, "Completed TC:Uri_READ_ONLY"); - } - catch (Exception e) - { - LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); - if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); - else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); - } + LogUtils.Write(LogUtils.INFO, LogTag, "Executing TC:Uri_READ_ONLY"); + string uri = _groupImage.Uri; + Assert.IsNotNull(uri); + LogUtils.Write(LogUtils.INFO, LogTag, "Completed TC:Uri_READ_ONLY"); } [Test] diff --git a/tct-suite-vs/Tizen.Sticker.Tests/testcase/TSInsertedEventArgs.cs b/tct-suite-vs/Tizen.Sticker.Tests/testcase/TSInsertedEventArgs.cs index 54cd083..6d6dfbd 100644 --- a/tct-suite-vs/Tizen.Sticker.Tests/testcase/TSInsertedEventArgs.cs +++ b/tct-suite-vs/Tizen.Sticker.Tests/testcase/TSInsertedEventArgs.cs @@ -59,11 +59,16 @@ namespace Tizen.Uix.Sticker.Tests [TearDown] public void Destroy() { - StickerProvider.DeleteData(_testData); - StickerProvider.Deinitialize(); - StickerConsumer.Inserted -= InsertEventOccurred; - StickerConsumer.Deinitialize(); LogUtils.Write(LogUtils.DEBUG , LogUtils.TAG , "Postconditions for each TEST"); + + if (_featureSupported) + { + StickerProvider.DeleteData(_testData); + StickerProvider.Deinitialize(); + StickerConsumer.Inserted -= InsertEventOccurred; + StickerConsumer.Deinitialize(); + } + GC.Collect(); } @@ -109,10 +114,10 @@ namespace Tizen.Uix.Sticker.Tests catch (Exception e) { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); - if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + if (!_featureSupported) + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } } diff --git a/tct-suite-vs/Tizen.Sticker.Tests/testcase/TSStickerConsumer.cs b/tct-suite-vs/Tizen.Sticker.Tests/testcase/TSStickerConsumer.cs index a1a7a4f..2cedea1 100644 --- a/tct-suite-vs/Tizen.Sticker.Tests/testcase/TSStickerConsumer.cs +++ b/tct-suite-vs/Tizen.Sticker.Tests/testcase/TSStickerConsumer.cs @@ -107,9 +107,9 @@ namespace Tizen.Uix.Sticker.Tests { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } @@ -133,9 +133,9 @@ namespace Tizen.Uix.Sticker.Tests { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } @@ -176,9 +176,9 @@ namespace Tizen.Uix.Sticker.Tests { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } @@ -204,9 +204,9 @@ namespace Tizen.Uix.Sticker.Tests { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } @@ -230,7 +230,7 @@ namespace Tizen.Uix.Sticker.Tests LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) { - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); } else if (e is ArgumentException) { @@ -240,7 +240,7 @@ namespace Tizen.Uix.Sticker.Tests } else { - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } } @@ -267,9 +267,9 @@ namespace Tizen.Uix.Sticker.Tests { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } @@ -293,7 +293,7 @@ namespace Tizen.Uix.Sticker.Tests LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) { - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); } else if (e is ArgumentException) { @@ -303,7 +303,7 @@ namespace Tizen.Uix.Sticker.Tests } else { - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } } @@ -330,9 +330,9 @@ namespace Tizen.Uix.Sticker.Tests { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } @@ -356,7 +356,7 @@ namespace Tizen.Uix.Sticker.Tests LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) { - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); } else if (e is ArgumentException) { @@ -366,7 +366,7 @@ namespace Tizen.Uix.Sticker.Tests } else { - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } } @@ -393,9 +393,9 @@ namespace Tizen.Uix.Sticker.Tests { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } @@ -419,7 +419,7 @@ namespace Tizen.Uix.Sticker.Tests LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) { - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); } else if (e is ArgumentException) { @@ -429,7 +429,7 @@ namespace Tizen.Uix.Sticker.Tests } else { - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } } @@ -456,9 +456,9 @@ namespace Tizen.Uix.Sticker.Tests { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } @@ -482,7 +482,7 @@ namespace Tizen.Uix.Sticker.Tests LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) { - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); } else if (e is ArgumentException) { @@ -492,7 +492,7 @@ namespace Tizen.Uix.Sticker.Tests } else { - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } } @@ -519,9 +519,9 @@ namespace Tizen.Uix.Sticker.Tests { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } @@ -547,9 +547,9 @@ namespace Tizen.Uix.Sticker.Tests { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } @@ -573,7 +573,7 @@ namespace Tizen.Uix.Sticker.Tests LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) { - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); } else if (e is ArgumentException) { @@ -583,7 +583,7 @@ namespace Tizen.Uix.Sticker.Tests } else { - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } } @@ -610,9 +610,9 @@ namespace Tizen.Uix.Sticker.Tests { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } @@ -638,9 +638,9 @@ namespace Tizen.Uix.Sticker.Tests { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } @@ -665,7 +665,7 @@ namespace Tizen.Uix.Sticker.Tests LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) { - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); } else if (e is ArgumentException) { @@ -675,7 +675,7 @@ namespace Tizen.Uix.Sticker.Tests } else { - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } } @@ -703,9 +703,9 @@ namespace Tizen.Uix.Sticker.Tests { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } @@ -729,7 +729,7 @@ namespace Tizen.Uix.Sticker.Tests LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) { - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); } else if (e is ArgumentException) { @@ -739,7 +739,7 @@ namespace Tizen.Uix.Sticker.Tests } else { - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } } @@ -788,9 +788,9 @@ namespace Tizen.Uix.Sticker.Tests { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } @@ -838,9 +838,9 @@ namespace Tizen.Uix.Sticker.Tests { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } @@ -890,9 +890,9 @@ namespace Tizen.Uix.Sticker.Tests { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } @@ -921,9 +921,9 @@ namespace Tizen.Uix.Sticker.Tests { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } } diff --git a/tct-suite-vs/Tizen.Sticker.Tests/testcase/TSStickerData.cs b/tct-suite-vs/Tizen.Sticker.Tests/testcase/TSStickerData.cs index 442d656..27f8111 100644 --- a/tct-suite-vs/Tizen.Sticker.Tests/testcase/TSStickerData.cs +++ b/tct-suite-vs/Tizen.Sticker.Tests/testcase/TSStickerData.cs @@ -78,9 +78,9 @@ namespace Tizen.Uix.Sticker.Tests { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } @@ -120,10 +120,10 @@ namespace Tizen.Uix.Sticker.Tests catch (Exception e) { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); - if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + if (!_featureSupported) + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } @@ -147,7 +147,7 @@ namespace Tizen.Uix.Sticker.Tests LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) { - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); } else if (e is InvalidOperationException) { @@ -156,7 +156,7 @@ namespace Tizen.Uix.Sticker.Tests } else { - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } } @@ -180,10 +180,10 @@ namespace Tizen.Uix.Sticker.Tests catch (Exception e) { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); - if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + if (!_featureSupported) + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } @@ -207,7 +207,7 @@ namespace Tizen.Uix.Sticker.Tests LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) { - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); } else if (e is InvalidOperationException) { @@ -216,7 +216,7 @@ namespace Tizen.Uix.Sticker.Tests } else { - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } } @@ -240,10 +240,10 @@ namespace Tizen.Uix.Sticker.Tests catch (Exception e) { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); - if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + if (!_featureSupported) + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } @@ -267,7 +267,7 @@ namespace Tizen.Uix.Sticker.Tests LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) { - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); } else if (e is InvalidOperationException) { @@ -276,7 +276,7 @@ namespace Tizen.Uix.Sticker.Tests } else { - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } } @@ -299,10 +299,10 @@ namespace Tizen.Uix.Sticker.Tests catch (Exception e) { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); - if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + if (!_featureSupported) + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } @@ -323,9 +323,9 @@ namespace Tizen.Uix.Sticker.Tests catch (Exception e) { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); - if ((!_featureSupported) && (e is NotSupportedException)) + if (!_featureSupported) { - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); } else if (e is ArgumentException) { @@ -334,7 +334,7 @@ namespace Tizen.Uix.Sticker.Tests } else { - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } } @@ -357,10 +357,10 @@ namespace Tizen.Uix.Sticker.Tests catch (Exception e) { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); - if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + if (!_featureSupported) + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } @@ -381,9 +381,9 @@ namespace Tizen.Uix.Sticker.Tests catch (Exception e) { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); - if ((!_featureSupported) && (e is NotSupportedException)) + if (!_featureSupported) { - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); } else if (e is ArgumentException) { @@ -392,7 +392,7 @@ namespace Tizen.Uix.Sticker.Tests } else { - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } } @@ -415,10 +415,10 @@ namespace Tizen.Uix.Sticker.Tests catch (Exception e) { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); - if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + if (!_featureSupported) + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } @@ -439,9 +439,9 @@ namespace Tizen.Uix.Sticker.Tests catch (Exception e) { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); - if ((!_featureSupported) && (e is NotSupportedException)) + if (!_featureSupported) { - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); } else if (e is ArgumentException) { @@ -450,7 +450,7 @@ namespace Tizen.Uix.Sticker.Tests } else { - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } } @@ -474,10 +474,10 @@ namespace Tizen.Uix.Sticker.Tests catch (Exception e) { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); - if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + if (!_featureSupported) + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } @@ -501,7 +501,7 @@ namespace Tizen.Uix.Sticker.Tests LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) { - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); } else if (e is InvalidOperationException) { @@ -510,7 +510,7 @@ namespace Tizen.Uix.Sticker.Tests } else { - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } } @@ -534,10 +534,10 @@ namespace Tizen.Uix.Sticker.Tests catch (Exception e) { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); - if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + if (!_featureSupported) + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } @@ -561,7 +561,7 @@ namespace Tizen.Uix.Sticker.Tests LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) { - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); } else if (e is InvalidOperationException) { @@ -570,7 +570,7 @@ namespace Tizen.Uix.Sticker.Tests } else { - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } } @@ -593,10 +593,10 @@ namespace Tizen.Uix.Sticker.Tests catch (Exception e) { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); - if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + if (!_featureSupported) + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } @@ -618,15 +618,13 @@ namespace Tizen.Uix.Sticker.Tests catch (Exception e) { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); - if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + if (!_featureSupported) + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } - - [Test] [Category("P1")] [Description("Check working of StickerData Thumbnail property for no exception")] @@ -646,10 +644,10 @@ namespace Tizen.Uix.Sticker.Tests catch (Exception e) { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); - if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + if (!_featureSupported) + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } @@ -673,7 +671,7 @@ namespace Tizen.Uix.Sticker.Tests LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) { - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); } else if (e is ArgumentException) { @@ -682,7 +680,7 @@ namespace Tizen.Uix.Sticker.Tests } else { - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } } @@ -706,10 +704,10 @@ namespace Tizen.Uix.Sticker.Tests catch (Exception e) { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); - if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + if (!_featureSupported) + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } @@ -731,10 +729,10 @@ namespace Tizen.Uix.Sticker.Tests catch (Exception e) { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); - if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + if (!_featureSupported) + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } @@ -767,9 +765,9 @@ namespace Tizen.Uix.Sticker.Tests { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } @@ -793,7 +791,7 @@ namespace Tizen.Uix.Sticker.Tests LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) { - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); } else if (e is InvalidOperationException) { @@ -802,7 +800,7 @@ namespace Tizen.Uix.Sticker.Tests } else { - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } } @@ -826,10 +824,10 @@ namespace Tizen.Uix.Sticker.Tests catch (Exception e) { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); - if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + if (!_featureSupported) + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } @@ -851,10 +849,10 @@ namespace Tizen.Uix.Sticker.Tests catch (Exception e) { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); - if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + if (!_featureSupported) + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } @@ -878,7 +876,7 @@ namespace Tizen.Uix.Sticker.Tests LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) { - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); } else if (e is ArgumentException) { @@ -887,7 +885,7 @@ namespace Tizen.Uix.Sticker.Tests } else { - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } } @@ -909,10 +907,10 @@ namespace Tizen.Uix.Sticker.Tests catch (Exception e) { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); - if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + if (!_featureSupported) + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } @@ -936,9 +934,9 @@ namespace Tizen.Uix.Sticker.Tests { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } } diff --git a/tct-suite-vs/Tizen.Sticker.Tests/testcase/TSStickerProvider.cs b/tct-suite-vs/Tizen.Sticker.Tests/testcase/TSStickerProvider.cs index f6230be..1785c56 100644 --- a/tct-suite-vs/Tizen.Sticker.Tests/testcase/TSStickerProvider.cs +++ b/tct-suite-vs/Tizen.Sticker.Tests/testcase/TSStickerProvider.cs @@ -81,9 +81,9 @@ namespace Tizen.Uix.Sticker.Tests { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } @@ -107,9 +107,9 @@ namespace Tizen.Uix.Sticker.Tests { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } @@ -150,9 +150,9 @@ namespace Tizen.Uix.Sticker.Tests { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } @@ -179,9 +179,9 @@ namespace Tizen.Uix.Sticker.Tests { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } @@ -207,7 +207,7 @@ namespace Tizen.Uix.Sticker.Tests LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) { - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); } else if (e is ArgumentException) { @@ -217,7 +217,7 @@ namespace Tizen.Uix.Sticker.Tests } else { - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } } @@ -232,10 +232,10 @@ namespace Tizen.Uix.Sticker.Tests [Property("COVPARAM", "Tizen.Uix.Sticker.StickerData")] public void InsertData_InvalidOperationException() { - StickerProvider.Initialize(); try { LogUtils.Write(LogUtils.INFO, LogTag, "Executing TC:InsertData_InvalidOperationException"); + StickerProvider.Initialize(); StickerData stickerData = new StickerData(); stickerData.SetUri(UriType.WebResource, "www.StickerProviderTests.com/emoji/smile"); stickerData.AddKeyword("smile"); @@ -252,7 +252,7 @@ namespace Tizen.Uix.Sticker.Tests LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) { - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); } else if (e is InvalidOperationException) { @@ -263,7 +263,7 @@ namespace Tizen.Uix.Sticker.Tests } else { - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } } @@ -291,9 +291,9 @@ namespace Tizen.Uix.Sticker.Tests { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } @@ -318,7 +318,7 @@ namespace Tizen.Uix.Sticker.Tests LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) { - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); } else if (e is ArgumentException) { @@ -328,7 +328,7 @@ namespace Tizen.Uix.Sticker.Tests } else { - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } } @@ -356,9 +356,9 @@ namespace Tizen.Uix.Sticker.Tests { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } @@ -383,7 +383,7 @@ namespace Tizen.Uix.Sticker.Tests LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) { - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); } else if (e is ArgumentException) { @@ -393,7 +393,7 @@ namespace Tizen.Uix.Sticker.Tests } else { - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } } @@ -407,10 +407,10 @@ namespace Tizen.Uix.Sticker.Tests [Property("AUTHOR", "Inhong Han, inhong1.han@samsung.com")] public void UpdateData_InvalidOperationException() { - StickerProvider.Initialize(); try { LogUtils.Write(LogUtils.INFO, LogTag, "Executing TC:UpdateData_InvalidOperationException"); + StickerProvider.Initialize(); StickerProvider.InsertData(_stickerData); StickerProvider.UpdateData(_stickerData); } @@ -419,7 +419,7 @@ namespace Tizen.Uix.Sticker.Tests LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) { - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); } else if (e is InvalidOperationException) { @@ -430,7 +430,7 @@ namespace Tizen.Uix.Sticker.Tests } else { - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } } @@ -458,9 +458,9 @@ namespace Tizen.Uix.Sticker.Tests { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } @@ -485,7 +485,7 @@ namespace Tizen.Uix.Sticker.Tests LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) { - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); } else if (e is ArgumentException) { @@ -495,7 +495,7 @@ namespace Tizen.Uix.Sticker.Tests } else { - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } } @@ -523,9 +523,9 @@ namespace Tizen.Uix.Sticker.Tests { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } @@ -550,7 +550,7 @@ namespace Tizen.Uix.Sticker.Tests LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) { - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); } else if (e is InvalidOperationException) { @@ -560,7 +560,7 @@ namespace Tizen.Uix.Sticker.Tests } else { - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } } @@ -589,9 +589,9 @@ namespace Tizen.Uix.Sticker.Tests { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } @@ -619,9 +619,9 @@ namespace Tizen.Uix.Sticker.Tests { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } @@ -645,7 +645,7 @@ namespace Tizen.Uix.Sticker.Tests LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) { - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); } else if (e is ArgumentException) { @@ -655,7 +655,7 @@ namespace Tizen.Uix.Sticker.Tests } else { - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } } @@ -684,9 +684,9 @@ namespace Tizen.Uix.Sticker.Tests { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } @@ -710,7 +710,7 @@ namespace Tizen.Uix.Sticker.Tests LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) { - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); } else if (e is ArgumentException) { @@ -720,7 +720,7 @@ namespace Tizen.Uix.Sticker.Tests } else { - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } } @@ -734,10 +734,10 @@ namespace Tizen.Uix.Sticker.Tests [Property("AUTHOR", "Inhong Han, inhong1.han@samsung.com")] public void SetGroupImage_InvalidOperationException() { - StickerProvider.Initialize(); try { LogUtils.Write(LogUtils.INFO, LogTag, "Executing TC:SetGroupImage_InvalidOperationException"); + StickerProvider.Initialize(); StickerProvider.InsertData(_stickerData); GroupImage groupImage = new GroupImage("tizen", UriType.LocalPath, "/res/invalid.png"); StickerProvider.SetGroupImage(groupImage); @@ -747,7 +747,7 @@ namespace Tizen.Uix.Sticker.Tests LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); if ((!_featureSupported) && (e is NotSupportedException)) { - Assert.IsTrue(true); + Assert.Pass("Sticker feature is not supported"); } else if (e is InvalidOperationException) { @@ -758,7 +758,7 @@ namespace Tizen.Uix.Sticker.Tests } else { - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } } diff --git a/tct-suite-vs/Tizen.Sticker.Tests/testcase/TSUpdatedEventArgs.cs b/tct-suite-vs/Tizen.Sticker.Tests/testcase/TSUpdatedEventArgs.cs index 71dbbf1..6609922 100644 --- a/tct-suite-vs/Tizen.Sticker.Tests/testcase/TSUpdatedEventArgs.cs +++ b/tct-suite-vs/Tizen.Sticker.Tests/testcase/TSUpdatedEventArgs.cs @@ -60,11 +60,16 @@ namespace Tizen.Uix.Sticker.Tests [TearDown] public void Destroy() { - StickerProvider.DeleteData(_testData); - StickerProvider.Deinitialize(); - StickerConsumer.Updated -= UpdateEventOccurred; - StickerConsumer.Deinitialize(); LogUtils.Write(LogUtils.DEBUG , LogUtils.TAG , "Postconditions for each TEST"); + + if (_featureSupported) + { + StickerProvider.DeleteData(_testData); + StickerProvider.Deinitialize(); + StickerConsumer.Updated -= UpdateEventOccurred; + StickerConsumer.Deinitialize(); + } + GC.Collect(); } @@ -111,10 +116,10 @@ namespace Tizen.Uix.Sticker.Tests catch (Exception e) { LogUtils.Write(LogUtils.INFO, LogTag, "Caught Exception" + e.ToString()); - if ((!_featureSupported) && (e is NotSupportedException)) - Assert.IsTrue(true); + if (!_featureSupported) + Assert.Pass("Sticker feature is not supported"); else - Assert.IsTrue(false, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } } } -- 2.7.4