[MachineLearning.Train][Non-ACR][Add Assert.Pass to [SetUp] insted of body check... 89/281289/5
authorhyunil park <hyunil46.park@samsung.com>
Thu, 15 Sep 2022 07:49:07 +0000 (16:49 +0900)
committerhyunil park <hyunil46.park@samsung.com>
Mon, 19 Sep 2022 05:32:40 +0000 (14:32 +0900)
- Add Assert.Pass to [Setup]
- Remove Assert.IsTrue from body of all TCs

Change-Id: I4b7048bd8a0a377ce80637ae2862640e6d691b3e
Signed-off-by: hyunil park <hyunil46.park@samsung.com>
tct-suite-vs/Tizen.MachineLearning.Train.Tests/testcase/TSDataset.cs
tct-suite-vs/Tizen.MachineLearning.Train.Tests/testcase/TSLayer.cs
tct-suite-vs/Tizen.MachineLearning.Train.Tests/testcase/TSModel.cs
tct-suite-vs/Tizen.MachineLearning.Train.Tests/testcase/TSOptimizer.cs

index 2e4a45b..8a9e927 100755 (executable)
@@ -46,6 +46,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             if (!_isMachineLeanringTrainSupported)
             {
                 LogUtils.Write(LogUtils.DEBUG, TAG, "MachineLearning Train feature is not supported.");
+                Assert.Pass("MachineLearning Train feature is not supported.");
             }
         }
 
@@ -78,16 +79,8 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    Assert.Fail(e.ToString());
-                }
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -121,17 +114,9 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch(Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    dataset.Dispose();
-                    Assert.Fail(e.ToString());
-                }
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                dataset.Dispose();
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -156,12 +141,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch(Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     dataset.Dispose();
@@ -196,12 +176,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch(Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     dataset.Dispose();
@@ -236,12 +211,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch(Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     dataset.Dispose();
@@ -276,12 +246,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch(Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     dataset.Dispose();
@@ -316,12 +281,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch(Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     dataset.Dispose();
@@ -356,12 +316,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch(Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     dataset.Dispose();
@@ -398,17 +353,9 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch(Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    dataset.Dispose();
-                    Assert.Fail(e.ToString());
-                }
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                dataset.Dispose();
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -433,12 +380,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch(Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     dataset.Dispose();
@@ -475,12 +417,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch(Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     dataset.Dispose();
index e56bb95..28b115a 100755 (executable)
@@ -45,6 +45,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             if (!_isMachineLeanringTrainSupported)
             {
                 LogUtils.Write(LogUtils.DEBUG, TAG, "MachineLearning Train feature is not supported.");
+                Assert.Pass("MachineLearning Train feature is not supported.");
             }
         }
 
@@ -77,16 +78,8 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    Assert.Fail(e.ToString());
-                }
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -147,16 +140,8 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    Assert.Fail(e.ToString());
-                }
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -179,12 +164,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     Assert.Pass(e.ToString());
@@ -216,17 +196,8 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    Assert.Fail(e.ToString());
-                }
-
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -250,12 +221,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     layer.Dispose();
@@ -291,16 +257,8 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    Assert.Fail(e.ToString());
-                }
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -324,12 +282,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     layer.Dispose();
@@ -363,16 +316,8 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    Assert.Fail(e.ToString());
-                }
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -396,12 +341,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     layer.Dispose();
@@ -435,16 +375,8 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    Assert.Fail(e.ToString());
-                }
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -468,12 +400,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     layer.Dispose();
@@ -507,16 +434,8 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    Assert.Fail(e.ToString());
-                }
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -540,12 +459,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     layer.Dispose();
@@ -579,16 +493,8 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    Assert.Fail(e.ToString());
-                }
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -612,12 +518,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     layer.Dispose();
@@ -651,16 +552,8 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    Assert.Fail(e.ToString());
-                }
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -684,12 +577,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     layer.Dispose();
@@ -723,16 +611,8 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    Assert.Fail(e.ToString());
-                }
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -756,12 +636,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     layer.Dispose();
@@ -795,16 +670,8 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    Assert.Fail(e.ToString());
-                }
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -828,12 +695,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     layer.Dispose();
@@ -867,16 +729,8 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    Assert.Fail(e.ToString());
-                }
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -900,12 +754,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     layer.Dispose();
@@ -939,16 +788,8 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    Assert.Fail(e.ToString());
-                }
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -972,12 +813,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     layer.Dispose();
@@ -1011,16 +847,8 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    Assert.Fail(e.ToString());
-                }
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -1044,12 +872,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     layer.Dispose();
@@ -1083,16 +906,8 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    Assert.Fail(e.ToString());
-                }
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -1116,12 +931,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     layer.Dispose();
@@ -1155,16 +965,8 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    Assert.Fail(e.ToString());
-                }
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -1188,12 +990,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     layer.Dispose();
@@ -1227,16 +1024,8 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    Assert.Fail(e.ToString());
-                }
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -1260,12 +1049,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     layer.Dispose();
@@ -1299,16 +1083,8 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    Assert.Fail(e.ToString());
-                }
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -1332,12 +1108,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     layer.Dispose();
@@ -1371,16 +1142,8 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    Assert.Fail(e.ToString());
-                }
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -1404,12 +1167,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     layer.Dispose();
@@ -1443,16 +1201,8 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    Assert.Fail(e.ToString());
-                }
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -1476,12 +1226,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     layer.Dispose();
@@ -1515,16 +1260,8 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    Assert.Fail(e.ToString());
-                }
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -1548,12 +1285,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     layer.Dispose();
@@ -1587,16 +1319,8 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    Assert.Fail(e.ToString());
-                }
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -1620,12 +1344,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     layer.Dispose();
@@ -1659,16 +1378,8 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    Assert.Fail(e.ToString());
-                }
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -1692,12 +1403,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     layer.Dispose();
@@ -1731,16 +1437,8 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    Assert.Fail(e.ToString());
-                }
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -1764,12 +1462,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     layer.Dispose();
@@ -1803,16 +1496,8 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    Assert.Fail(e.ToString());
-                }
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -1836,12 +1521,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     layer.Dispose();
@@ -1875,16 +1555,8 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    Assert.Fail(e.ToString());
-                }
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -1908,12 +1580,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     layer.Dispose();
@@ -1947,17 +1614,8 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    Assert.Fail(e.ToString());
-                }
-
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -1981,12 +1639,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     layer.Dispose();
@@ -2020,16 +1673,8 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    Assert.Fail(e.ToString());
-                }
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -2053,12 +1698,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     layer.Dispose();
@@ -2092,16 +1732,8 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    Assert.Fail(e.ToString());
-                }
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -2125,12 +1757,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     layer.Dispose();
@@ -2164,16 +1791,8 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    Assert.Fail(e.ToString());
-                }
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -2197,12 +1816,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     layer.Dispose();
index 765f3f1..6326492 100755 (executable)
@@ -50,6 +50,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             if (!_isMachineLeanringTrainSupported)
             {
                 LogUtils.Write(LogUtils.DEBUG, TAG, "MachineLearning Train feature is not supported.");
+                Assert.Pass("MachineLearning Train feature is not supported.");
             }
         }
 
@@ -83,17 +84,8 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    Assert.Fail(e.ToString());
-                }
-
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -117,16 +109,8 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    Assert.Fail(e.ToString());
-                }
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -149,12 +133,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     Assert.Pass(e.ToString());
@@ -183,12 +162,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     Assert.Pass(e.ToString());
@@ -221,17 +195,9 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch(Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    model.Dispose();
-                    Assert.Fail(e.ToString());
-                }
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                model.Dispose();
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -262,12 +228,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch(Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     model.Dispose();
@@ -312,12 +273,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch(Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     model.Dispose();
@@ -359,17 +315,9 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch(Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    model.Dispose();
-                    Assert.Fail(e.ToString());
-                }
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                model.Dispose();
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -404,12 +352,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch(Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     model.Dispose();
@@ -447,12 +390,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch(Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     model.Dispose();
@@ -492,17 +430,9 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch(Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    model.Dispose();
-                    Assert.Fail(e.ToString());
-                }
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                model.Dispose();
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -537,12 +467,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch(Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     model.Dispose();
@@ -579,12 +504,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch(Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     model.Dispose();
@@ -628,17 +548,9 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch(Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.ERROR, TAG, "Exception occurs");
-                    model.Dispose();
-                    Assert.Fail(e.ToString());
-                }
+                LogUtils.Write(LogUtils.ERROR, TAG, "Exception occurs");
+                model.Dispose();
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -664,12 +576,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch(Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     model.Dispose();
@@ -703,17 +610,9 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    model.Dispose();
-                    Assert.Fail(e.ToString());
-                }
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                model.Dispose();
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -738,12 +637,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     model.Dispose();
@@ -779,17 +673,9 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    model.Dispose();
-                    Assert.Fail(e.ToString());
-                }
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                model.Dispose();
+                Assert.Fail(e.ToString());
             }
 
         }
@@ -815,12 +701,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     model.Dispose();
@@ -866,17 +747,9 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    model.Dispose();
-                    Assert.Fail(e.ToString());
-                }
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                model.Dispose();
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -901,12 +774,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     model.Dispose();
@@ -943,12 +811,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     Assert.Pass(e.ToString());
@@ -992,17 +855,9 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    model.Dispose();
-                    Assert.Fail(e.ToString());
-                }
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                model.Dispose();
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -1027,12 +882,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     model.Dispose();
@@ -1069,12 +919,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     Assert.Pass(e.ToString());
@@ -1113,12 +958,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     model.Dispose();
@@ -1165,17 +1005,9 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    model.Dispose();
-                    Assert.Fail(e.ToString());
-                }
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                model.Dispose();
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -1201,12 +1033,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException)
+                if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     model.Dispose();
@@ -1242,17 +1069,9 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    saveModel.Dispose();
-                    Assert.Fail(e.ToString());
-                }
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                saveModel.Dispose();
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -1286,18 +1105,10 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    saveModel.Dispose();
-                    loadModel.Dispose();
-                    Assert.Fail(e.ToString());
-                }
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                saveModel.Dispose();
+                loadModel.Dispose();
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -1322,18 +1133,9 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    saveModel.Dispose();
-                    Assert.Pass(e.ToString());
-                }
-                Assert.Fail("Should be occured exception");
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                saveModel.Dispose();
+                Assert.Pass(e.ToString());
             }
         }
 
@@ -1364,19 +1166,10 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    saveModel.Dispose();
-                    loadModel.Dispose();
-                    Assert.Pass(e.ToString());
-                }
-                Assert.Fail("Should be occured exception");
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                saveModel.Dispose();
+                loadModel.Dispose();
+                Assert.Pass(e.ToString());
             }
         }
     }
index 9d82d83..9f23fa0 100755 (executable)
@@ -45,6 +45,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             if (!_isMachineLeanringTrainSupported)
             {
                 LogUtils.Write(LogUtils.DEBUG, TAG, "MachineLearning Train feature is not supported.");
+                Assert.Pass("MachineLearning Train feature is not supported.");
             }
         }
 
@@ -77,16 +78,8 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    Assert.Fail(e.ToString());
-                }
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -109,12 +102,7 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch (Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else if (e is ArgumentException) {
+                if (e is ArgumentException) {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");
                     Assert.Pass(e.ToString());
                 }
@@ -142,17 +130,9 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch(Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-                else
-                {
-                    LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
-                    optimizer.Dispose();
-                    Assert.Fail(e.ToString());
-                }
+                LogUtils.Write(LogUtils.DEBUG, TAG, "Exception occurs");
+                optimizer.Dispose();
+                Assert.Fail(e.ToString());
             }
         }
 
@@ -178,12 +158,6 @@ namespace Tizen.MachineLearning.Train.Tests {
             }
             catch(Exception e)
             {
-                if (e is NotSupportedException)
-                {
-                    LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NotSupportedException occurs");
-                    Assert.IsTrue(_isMachineLeanringTrainSupported == false, "Invalid NotSupportedException");
-                }
-
                 if (e is ArgumentException)
                 {
                     LogUtils.Write(LogUtils.DEBUG, TAG, "ArgumentException occurs");