[Common][Non-ACR] Add missing TCs for Tizen.Common 61/199561/5
authorWonyoung Choi <wy80.choi@samsung.com>
Wed, 13 Feb 2019 05:01:13 +0000 (14:01 +0900)
committerWonyoung Choi <wy80.choi@samsung.com>
Thu, 14 Feb 2019 03:36:03 +0000 (12:36 +0900)
Change-Id: I17a52bd41f597e8d229e0ce41979137098425621

tct-suite-vs/Tizen.Common.Tests/Program.cs [new file with mode: 0755]
tct-suite-vs/Tizen.Common.Tests/Tizen.Common.Tests.csproj [new file with mode: 0644]
tct-suite-vs/Tizen.Common.Tests/Tizen.Common.Tests.sln [new file with mode: 0644]
tct-suite-vs/Tizen.Common.Tests/shared/res/Tizen.Common.Tests.png [new file with mode: 0755]
tct-suite-vs/Tizen.Common.Tests/testcase/TSColor.cs [new file with mode: 0644]
tct-suite-vs/Tizen.Common.Tests/testcase/TSErrorFacts.cs [new file with mode: 0644]
tct-suite-vs/Tizen.Common.Tests/tizen-manifest.xml [new file with mode: 0644]

diff --git a/tct-suite-vs/Tizen.Common.Tests/Program.cs b/tct-suite-vs/Tizen.Common.Tests/Program.cs
new file mode 100755 (executable)
index 0000000..ed0e06c
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ *  Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License
+ */
+
+using System;
+using NUnitLite.TUnit;
+using AutoTemplate;
+
+namespace XamarinForTizen.Tizen
+{
+
+    class Program : global::Xamarin.Forms.Platform.Tizen.FormsApplication
+    {
+        private static App _app;
+        protected override void OnCreate()
+        {
+            base.OnCreate();
+
+            Console.WriteLine("TCT : OnCreate()");
+            _app = new App();
+            LoadApplication(_app);
+
+            TRunner t = new TRunner();
+            t.LoadTestsuite();
+            t.Execute();
+        }
+
+        public static App getApp()
+        {
+            return _app;
+        }
+        static void Main(string[] args)
+        {
+            Console.WriteLine("TCT : Main()");
+            var app = new Program();
+            global::Xamarin.Forms.Platform.Tizen.Forms.Init(app);
+            app.Run(args);
+        }
+    }
+}
\ No newline at end of file
diff --git a/tct-suite-vs/Tizen.Common.Tests/Tizen.Common.Tests.csproj b/tct-suite-vs/Tizen.Common.Tests/Tizen.Common.Tests.csproj
new file mode 100644 (file)
index 0000000..6f861d8
--- /dev/null
@@ -0,0 +1,39 @@
+<Project Sdk="Microsoft.NET.Sdk">\r
+\r
+  <!-- Property Group for .NET Core Project -->\r
+  <PropertyGroup>\r
+    <OutputType>Exe</OutputType>\r
+    <TargetFramework>tizen60</TargetFramework>\r
+  </PropertyGroup>\r
+\r
+  <!-- Property Group for Tizen Project -->\r
+  <PropertyGroup>\r
+    <TizenCreateTpkOnBuild>true</TizenCreateTpkOnBuild>\r
+  </PropertyGroup>\r
+\r
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
+    <DebugType>portable</DebugType>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
+    <DebugType>None</DebugType>\r
+  </PropertyGroup>\r
+\r
+  <ItemGroup>\r
+       <Folder Include="lib\" />\r
+  </ItemGroup>\r
+\r
+  <Import Project="..\Common\dependencies.props" />\r
+\r
+  <ItemGroup>\r
+    <PackageReference Include="Tizen.NET" Version="$(TizenNETVersion)">\r
+      <ExcludeAssets>Runtime</ExcludeAssets>\r
+    </PackageReference>\r
+    <PackageReference Include="Tizen.NET.Sdk" Version="$(TizenNETSdkVersion)" />\r
+  </ItemGroup>\r
+\r
+  <!-- Include Nuget Package for Tizen Project building -->\r
+  <ItemGroup>\r
+    <ProjectReference Include="..\Template\AutoTemplate\AutoTemplate.csproj" />\r
+  </ItemGroup>\r
+\r
+</Project>\r
diff --git a/tct-suite-vs/Tizen.Common.Tests/Tizen.Common.Tests.sln b/tct-suite-vs/Tizen.Common.Tests/Tizen.Common.Tests.sln
new file mode 100644 (file)
index 0000000..468e70e
--- /dev/null
@@ -0,0 +1,76 @@
+\r
+Microsoft Visual Studio Solution File, Format Version 12.00\r
+# Visual Studio 15\r
+VisualStudioVersion = 15.0.26124.0\r
+MinimumVisualStudioVersion = 15.0.26124.0\r
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tizen.Common.Tests", "Tizen.Common.Tests.csproj", "{E554013F-EC14-4C24-91B6-BB430B612289}"\r
+EndProject\r
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunit.framework", "..\nunit.framework\nunit.framework.csproj", "{95033104-6789-433A-AFCA-7131DD0670B6}"\r
+EndProject\r
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunitlite", "..\nunitlite\nunitlite.csproj", "{0777CAF5-21FC-49B6-9F04-2CE8B6802697}"\r
+EndProject\r
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoTemplate", "..\Template\AutoTemplate\AutoTemplate.csproj", "{58B361F2-7E80-49BD-9D86-00D7A243FA2E}"\r
+EndProject\r
+Global\r
+       GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
+               Debug|Any CPU = Debug|Any CPU\r
+               Debug|x64 = Debug|x64\r
+               Debug|x86 = Debug|x86\r
+               Release|Any CPU = Release|Any CPU\r
+               Release|x64 = Release|x64\r
+               Release|x86 = Release|x86\r
+       EndGlobalSection\r
+       GlobalSection(SolutionProperties) = preSolution\r
+               HideSolutionNode = FALSE\r
+       EndGlobalSection\r
+       GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
+               {E554013F-EC14-4C24-91B6-BB430B612289}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
+               {E554013F-EC14-4C24-91B6-BB430B612289}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
+               {E554013F-EC14-4C24-91B6-BB430B612289}.Debug|x64.ActiveCfg = Debug|Any CPU\r
+               {E554013F-EC14-4C24-91B6-BB430B612289}.Debug|x64.Build.0 = Debug|Any CPU\r
+               {E554013F-EC14-4C24-91B6-BB430B612289}.Debug|x86.ActiveCfg = Debug|Any CPU\r
+               {E554013F-EC14-4C24-91B6-BB430B612289}.Debug|x86.Build.0 = Debug|Any CPU\r
+               {E554013F-EC14-4C24-91B6-BB430B612289}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
+               {E554013F-EC14-4C24-91B6-BB430B612289}.Release|Any CPU.Build.0 = Release|Any CPU\r
+               {E554013F-EC14-4C24-91B6-BB430B612289}.Release|x64.ActiveCfg = Release|Any CPU\r
+               {E554013F-EC14-4C24-91B6-BB430B612289}.Release|x64.Build.0 = Release|Any CPU\r
+               {E554013F-EC14-4C24-91B6-BB430B612289}.Release|x86.ActiveCfg = Release|Any CPU\r
+               {E554013F-EC14-4C24-91B6-BB430B612289}.Release|x86.Build.0 = Release|Any CPU\r
+               {95033104-6789-433A-AFCA-7131DD0670B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
+               {95033104-6789-433A-AFCA-7131DD0670B6}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
+               {95033104-6789-433A-AFCA-7131DD0670B6}.Debug|x64.ActiveCfg = Debug|Any CPU\r
+               {95033104-6789-433A-AFCA-7131DD0670B6}.Debug|x64.Build.0 = Debug|Any CPU\r
+               {95033104-6789-433A-AFCA-7131DD0670B6}.Debug|x86.ActiveCfg = Debug|Any CPU\r
+               {95033104-6789-433A-AFCA-7131DD0670B6}.Debug|x86.Build.0 = Debug|Any CPU\r
+               {95033104-6789-433A-AFCA-7131DD0670B6}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
+               {95033104-6789-433A-AFCA-7131DD0670B6}.Release|Any CPU.Build.0 = Release|Any CPU\r
+               {95033104-6789-433A-AFCA-7131DD0670B6}.Release|x64.ActiveCfg = Release|Any CPU\r
+               {95033104-6789-433A-AFCA-7131DD0670B6}.Release|x64.Build.0 = Release|Any CPU\r
+               {95033104-6789-433A-AFCA-7131DD0670B6}.Release|x86.ActiveCfg = Release|Any CPU\r
+               {95033104-6789-433A-AFCA-7131DD0670B6}.Release|x86.Build.0 = Release|Any CPU\r
+               {0777CAF5-21FC-49B6-9F04-2CE8B6802697}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
+               {0777CAF5-21FC-49B6-9F04-2CE8B6802697}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
+               {0777CAF5-21FC-49B6-9F04-2CE8B6802697}.Debug|x64.ActiveCfg = Debug|Any CPU\r
+               {0777CAF5-21FC-49B6-9F04-2CE8B6802697}.Debug|x64.Build.0 = Debug|Any CPU\r
+               {0777CAF5-21FC-49B6-9F04-2CE8B6802697}.Debug|x86.ActiveCfg = Debug|Any CPU\r
+               {0777CAF5-21FC-49B6-9F04-2CE8B6802697}.Debug|x86.Build.0 = Debug|Any CPU\r
+               {0777CAF5-21FC-49B6-9F04-2CE8B6802697}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
+               {0777CAF5-21FC-49B6-9F04-2CE8B6802697}.Release|Any CPU.Build.0 = Release|Any CPU\r
+               {0777CAF5-21FC-49B6-9F04-2CE8B6802697}.Release|x64.ActiveCfg = Release|Any CPU\r
+               {0777CAF5-21FC-49B6-9F04-2CE8B6802697}.Release|x64.Build.0 = Release|Any CPU\r
+               {0777CAF5-21FC-49B6-9F04-2CE8B6802697}.Release|x86.ActiveCfg = Release|Any CPU\r
+               {0777CAF5-21FC-49B6-9F04-2CE8B6802697}.Release|x86.Build.0 = Release|Any CPU\r
+               {58B361F2-7E80-49BD-9D86-00D7A243FA2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
+               {58B361F2-7E80-49BD-9D86-00D7A243FA2E}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
+               {58B361F2-7E80-49BD-9D86-00D7A243FA2E}.Debug|x64.ActiveCfg = Debug|Any CPU\r
+               {58B361F2-7E80-49BD-9D86-00D7A243FA2E}.Debug|x64.Build.0 = Debug|Any CPU\r
+               {58B361F2-7E80-49BD-9D86-00D7A243FA2E}.Debug|x86.ActiveCfg = Debug|Any CPU\r
+               {58B361F2-7E80-49BD-9D86-00D7A243FA2E}.Debug|x86.Build.0 = Debug|Any CPU\r
+               {58B361F2-7E80-49BD-9D86-00D7A243FA2E}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
+               {58B361F2-7E80-49BD-9D86-00D7A243FA2E}.Release|Any CPU.Build.0 = Release|Any CPU\r
+               {58B361F2-7E80-49BD-9D86-00D7A243FA2E}.Release|x64.ActiveCfg = Release|Any CPU\r
+               {58B361F2-7E80-49BD-9D86-00D7A243FA2E}.Release|x64.Build.0 = Release|Any CPU\r
+               {58B361F2-7E80-49BD-9D86-00D7A243FA2E}.Release|x86.ActiveCfg = Release|Any CPU\r
+               {58B361F2-7E80-49BD-9D86-00D7A243FA2E}.Release|x86.Build.0 = Release|Any CPU\r
+       EndGlobalSection\r
+EndGlobal\r
diff --git a/tct-suite-vs/Tizen.Common.Tests/shared/res/Tizen.Common.Tests.png b/tct-suite-vs/Tizen.Common.Tests/shared/res/Tizen.Common.Tests.png
new file mode 100755 (executable)
index 0000000..9f3cb98
Binary files /dev/null and b/tct-suite-vs/Tizen.Common.Tests/shared/res/Tizen.Common.Tests.png differ
diff --git a/tct-suite-vs/Tizen.Common.Tests/testcase/TSColor.cs b/tct-suite-vs/Tizen.Common.Tests/testcase/TSColor.cs
new file mode 100644 (file)
index 0000000..5adc9d0
--- /dev/null
@@ -0,0 +1,583 @@
+/*\r
+ *  Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved\r
+ *\r
+ *  Licensed under the Apache License, Version 2.0 (the "License");\r
+ *  you may not use this file except in compliance with the License.\r
+ *  You may obtain a copy of the License at\r
+ *\r
+ *      http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ *  Unless required by applicable law or agreed to in writing, software\r
+ *  distributed under the License is distributed on an "AS IS" BASIS,\r
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ *  See the License for the specific language governing permissions and\r
+ *  limitations under the License\r
+ */\r
+\r
+using NUnit.Framework;\r
+using NUnit.Framework.TUnit;\r
+\r
+namespace Tizen.Common.Tests\r
+{\r
+\r
+    [TestFixture]\r
+    [Description("Tizen.Common.Color Tests")]\r
+    public class ColorTests\r
+    {\r
+\r
+        public const int IntR = 255, IntG = 0, IntB = 0, IntA = 255;\r
+\r
+        [SetUp]\r
+        public void Init()\r
+        {\r
+            LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST");\r
+        }\r
+\r
+        [TearDown]\r
+        public void Destroy()\r
+        {\r
+            LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Postconditions for each TEST");\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Create a Color with four values are r, g, b, a.")]\r
+        [Property("SPEC", "Tizen.Common.Color.Color C")]\r
+        [Property("COVPARAM", "int, int, int, int")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "CONSTR")]\r
+        [Property("AUTHOR", "WonYoung Choi, wy80.choi@samsung.com")]\r
+        public void Color_CONST_WITH_RGBA()\r
+        {\r
+            var color = new Color(0, 128, 0, 255);\r
+            Assert.AreEqual(0, color.R, "Cannot successfully create Color object");\r
+            Assert.AreEqual(128, color.G, "Cannot successfully create Color object");\r
+            Assert.AreEqual(0, color.B, "Cannot successfully create Color object");\r
+            Assert.AreEqual(255, color.A, "Cannot successfully create Color object");\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Create a Color with three values are r, g, b.")]\r
+        [Property("SPEC", "Tizen.Common.Color.Color C")]\r
+        [Property("COVPARAM", "int, int, int")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "CONSTR")]\r
+        [Property("AUTHOR", "WonYoung Choi, wy80.choi@samsung.com")]\r
+        public void Color_CONST_WITH_RGB()\r
+        {\r
+            var color = new Color(0, 128, 0);\r
+            Assert.AreEqual(0, color.R, "Cannot successfully create Color object");\r
+            Assert.AreEqual(128, color.G, "Cannot successfully create Color object");\r
+            Assert.AreEqual(0, color.B, "Cannot successfully create Color object");\r
+            Assert.AreEqual(255, color.A, "Cannot successfully create Color object");\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Check whether R returns expected value or not.")]\r
+        [Property("SPEC", "Tizen.Common.Color.R A")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "PRO")]\r
+        [Property("AUTHOR", "WonYoung Choi, wy80.choi@samsung.com")]\r
+        public void R_PROPERTY_GET()\r
+        {\r
+            var color = Color.White;\r
+            Assert.AreEqual(255, color.R, "Value of R should be 255");\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Check whether G returns expected value or not.")]\r
+        [Property("SPEC", "Tizen.Common.Color.G A")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "PRO")]\r
+        [Property("AUTHOR", "WonYoung Choi, wy80.choi@samsung.com")]\r
+        public void G_PROPERTY_GET()\r
+        {\r
+            var color = Color.White;\r
+            Assert.AreEqual(255, color.G, "Value of G should be 255");\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Check whether B returns expected value or not.")]\r
+        [Property("SPEC", "Tizen.Common.Color.B A")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "PRO")]\r
+        [Property("AUTHOR", "WonYoung Choi, wy80.choi@samsung.com")]\r
+        public void B_PROPERTY_GET()\r
+        {\r
+            var color = Color.White;\r
+            Assert.AreEqual(255, color.B, "Value of B should be 255");\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Check whether A returns expected value or not.")]\r
+        [Property("SPEC", "Tizen.Common.Color.A A")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "PRO")]\r
+        [Property("AUTHOR", "WonYoung Choi, wy80.choi@samsung.com")]\r
+        public void A_PROPERTY_GET()\r
+        {\r
+            var color = Color.White;\r
+            Assert.AreEqual(255, color.A, "Value of A should be 255");\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Check the return type of the Equality method.")]\r
+        [Property("SPEC", "Tizen.Common.Color.== M")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "MR")]\r
+        [Property("AUTHOR", "WonYoung Choi, wy80.choi@samsung.com")]\r
+        public void Equality_COMPARE()\r
+        {\r
+            var color1 = Color.FromRgb(IntR, IntG, IntB);\r
+            var color2 = Color.FromRgb(IntR, IntG, IntB);\r
+            var color3 = Color.FromRgb(IntR - 1, IntG, IntB);\r
+            Assert.IsTrue(color1 == color2, "Equals doens't get True after comparing 2 same colors");\r
+            Assert.IsFalse(color1 == color3, "Equals doens't get False after comparing 2 different colors");\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Check the return type of the Inequality method.")]\r
+        [Property("SPEC", "Tizen.Common.Color.!= M")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "MR")]\r
+        [Property("AUTHOR", "WonYoung Choi, wy80.choi@samsung.com")]\r
+        public void Inequality_COMPARE()\r
+        {\r
+            var color1 = Color.FromRgb(IntR, IntG, IntB);\r
+            var color2 = Color.FromRgb(IntR, IntG, IntB);\r
+            var color3 = Color.FromRgb(IntR - 1, IntG, IntB);\r
+            Assert.IsFalse(color1 != color2, "Equals doens't get False after comparing 2 same colors");\r
+            Assert.IsTrue(color1 != color3, "Equals doens't get True after comparing 2 different colors");\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Check value returned by FromRgb.")]\r
+        [Property("SPEC", "Tizen.Common.Color.FromRgb M")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "MR")]\r
+        [Property("AUTHOR", "WonYoung Choi, wy80.choi@samsung.com")]\r
+        public void FromRgb_RETURN()\r
+        {\r
+            var color = Color.FromRgb(IntR, IntG, IntB);\r
+            Assert.IsNotNull(color, "Instance Color is null");\r
+            Assert.AreEqual(Color.Red, color, "Value of color returned by FromRgb should be red.");\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Check value returned by FromRgba.")]\r
+        [Property("SPEC", "Tizen.Common.Color.FromRgba M")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "MR")]\r
+        [Property("AUTHOR", "WonYoung Choi, wy80.choi@samsung.com")]\r
+        public void FromRgba_RETURN()\r
+        {\r
+            var color = Color.FromRgba(IntR, IntG, IntB, IntA);\r
+            Assert.IsNotNull(color, "Instance Color is null");\r
+            Assert.AreEqual(Color.Red, color, "Value of color returned by FromRgba should be red.");\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Check value returned by FromHex.")]\r
+        [Property("SPEC", "Tizen.Common.Color.FromHex M")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "MR")]\r
+        [Property("AUTHOR", "WonYoung Choi, wy80.choi@samsung.com")]\r
+        public void FromHex_RETURN()\r
+        {\r
+            string hex = "#000000";\r
+\r
+            var color = Color.FromHex(hex);\r
+            Assert.IsNotNull(color, "Instance Color is null");\r
+            Assert.AreEqual(Color.Black, color, "Value of color returned by FromHex should be black.");\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Check value returned by GetRgba.")]\r
+        [Property("SPEC", "Tizen.Common.Color.GetRgba M")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "MR")]\r
+        [Property("AUTHOR", "WonYoung Choi, wy80.choi@samsung.com")]\r
+        public void GetRgba_RETURN()\r
+        {\r
+            uint value = (uint)Color.Red.GetRgba();\r
+            Assert.AreEqual(value, 4278190335, "Value of Color.Red returned by GetRgba should be 4278190335.");\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Check value returned by GetArgb.")]\r
+        [Property("SPEC", "Tizen.Common.Color.GetArgb M")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "MR")]\r
+        [Property("AUTHOR", "WonYoung Choi, wy80.choi@samsung.com")]\r
+        public void GetArgb_RETURN()\r
+        {\r
+            uint value = (uint)Color.Red.GetArgb();\r
+            Assert.AreEqual(value, 4294901760, "Value of Color.Red returned by GetArgb should be 4294901760.");\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Check value returned by ToHex.")]\r
+        [Property("SPEC", "Tizen.Common.Color.ToHex M")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "MR")]\r
+        [Property("AUTHOR", "WonYoung Choi, wy80.choi@samsung.com")]\r
+        public void ToHex_RETURN()\r
+        {\r
+            string value = Color.Red.ToHex();\r
+            Assert.AreEqual(value, "#FF0000FF", "Value of Color.Red returned by GetArgb should be #FF0000FF.");\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Return a boolean indicating whether the given Color is equal to this Color instance.")]\r
+        [Property("SPEC", "Tizen.Common.Color.Equals M")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "MR")]\r
+        [Property("AUTHOR", "WonYoung Choi, wy80.choi@samsung.com")]\r
+        public void Equals_COMPARE()\r
+        {\r
+            var color1 = Color.FromRgb(IntR, IntG, IntB);\r
+            var color2 = Color.FromRgb(IntR, IntG, IntB);\r
+            var color3 = Color.FromRgb(IntR - 1, IntG, IntB);\r
+            Assert.IsTrue(color1.Equals(color2), "Equals doens't get True after comparing 2 same colors");\r
+            Assert.IsFalse(color1.Equals(color3), "Equals doens't get False after comparing 2 different colors");\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Check value returned by ToString.")]\r
+        [Property("SPEC", "Tizen.Common.Color.ToString M")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "MR")]\r
+        [Property("AUTHOR", "WonYoung Choi, wy80.choi@samsung.com")]\r
+        public void ToString_RETURN()\r
+        {\r
+            var color = Color.FromRgb(IntR, IntG, IntB);\r
+            Assert.IsNotNull(color, "Instance Color is null");\r
+            Assert.IsInstanceOf<Color>(color);\r
+            Assert.AreEqual(Color.Red, color, "Value of color returned by FromRgb should be red.");\r
+\r
+            var str = "Color [R=255, G=0, B=0, A=255]";\r
+            Assert.AreEqual(str, color.ToString(), "ToString doesn't return properly");\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Check the return value of the GetHashCode method.")]\r
+        [Property("SPEC", "Tizen.Common.Color.GetHashCode M")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "MR")]\r
+        [Property("AUTHOR", "WonYoung Choi, wy80.choi@samsung.com")]\r
+        public void GetHashCode_RETURN()\r
+        {\r
+            var color1 = Color.FromRgba(IntR, IntG, IntB, IntA);\r
+            var color2 = Color.FromRgba(IntR, IntG, IntB, IntA);\r
+            var color3 = Color.FromRgba(IntR, IntG, 16, 0);\r
+\r
+            var hashCode1 = color1.GetHashCode();\r
+            var hashCode2 = color2.GetHashCode();\r
+            var hashCode3 = color3.GetHashCode();\r
+            Assert.AreEqual(hashCode1, hashCode2, "GetHashCode of two colors same should be same.");\r
+            Assert.AreNotEqual(hashCode1, hashCode3, "GetHashCode of two colors not same should be not equal.");\r
+        }\r
+\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Check property Empty.")]\r
+        [Property("SPEC", "Tizen.Common.Color.Empty A")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "PRO")]\r
+        [Property("AUTHOR", "WonYoung Choi, wy80.choi@samsung.com")]\r
+        public void Empty_READ_ONLY()\r
+        {\r
+            var color = Color.FromRgba(0, 0, 0, 0);\r
+            Assert.IsNotNull(color, "Instance color is null");\r
+            Assert.IsInstanceOf<Color>(color, "Should be instance of Color");\r
+            Assert.AreEqual(color, Color.Empty, "Property Empty should same color create via FromRgba(0, 0, 0, 0)");\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Check property Transparent.")]\r
+        [Property("SPEC", "Tizen.Common.Color.Transparent A")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "PRO")]\r
+        [Property("AUTHOR", "WonYoung Choi, wy80.choi@samsung.com")]\r
+        public void Transparent_READ_ONLY()\r
+        {\r
+            var color = Color.FromRgba(0, 0, 0, 0);\r
+            Assert.IsNotNull(color, "Instance color is null");\r
+            Assert.IsInstanceOf<Color>(color, "Should be instance of Color");\r
+            Assert.AreEqual(color, Color.Empty, "Property Transparent should same color create via FromRgba(0, 0, 0, 0)");\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Check property Aqua.")]\r
+        [Property("SPEC", "Tizen.Common.Color.Aqua A")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "PRO")]\r
+        [Property("AUTHOR", "WonYoung Choi, wy80.choi@samsung.com")]\r
+        public void Aqua_READ_ONLY()\r
+        {\r
+            var color = Color.FromHex("#00ffff");\r
+            Assert.IsNotNull(color, "Instance color is null");\r
+            Assert.IsInstanceOf<Color>(color, "Should be instance of Color");\r
+            Assert.AreEqual(color, Color.Aqua, "Property Aqua should same color create via hex string refer w3c.");\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Check property Black.")]\r
+        [Property("SPEC", "Tizen.Common.Color.Black A")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "PRO")]\r
+        [Property("AUTHOR", "WonYoung Choi, wy80.choi@samsung.com")]\r
+        public void Black_READ_ONLY()\r
+        {\r
+            var color = Color.FromHex("#000000");\r
+            Assert.IsNotNull(color, "Instance color is null");\r
+            Assert.IsInstanceOf<Color>(color, "Should be instance of Color");\r
+            Assert.AreEqual(color, Color.Black, "Property Black should same color create via hex string refer w3c.");\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Check property Blue.")]\r
+        [Property("SPEC", "Tizen.Common.Color.Blue A")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "PRO")]\r
+        [Property("AUTHOR", "WonYoung Choi, wy80.choi@samsung.com")]\r
+        public void Blue_READ_ONLY()\r
+        {\r
+            var color = Color.FromHex("#0000ff");\r
+            Assert.IsNotNull(color, "Instance color is null");\r
+            Assert.IsInstanceOf<Color>(color, "Should be instance of Color");\r
+            Assert.AreEqual(color, Color.Blue, "Property Blue should same color create via hex string refer w3c.");\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Check property Fuchsia.")]\r
+        [Property("SPEC", "Tizen.Common.Color.Fuchsia A")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "PRO")]\r
+        [Property("AUTHOR", "WonYoung Choi, wy80.choi@samsung.com")]\r
+        public void Fuchsia_READ_ONLY()\r
+        {\r
+            var color = Color.FromHex("#ff00ff");\r
+            Assert.IsNotNull(color, "Instance color is null");\r
+            Assert.IsInstanceOf<Color>(color, "Should be instance of Color");\r
+            Assert.AreEqual(color, Color.Fuchsia, "Property Fuchsia should same color create via hex string refer w3c.");\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Check property Gray.")]\r
+        [Property("SPEC", "Tizen.Common.Color.Gray A")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "PRO")]\r
+        [Property("AUTHOR", "WonYoung Choi, wy80.choi@samsung.com")]\r
+        public void Gray_READ_ONLY()\r
+        {\r
+            var color = Color.FromHex("#808080");\r
+            Assert.IsNotNull(color, "Instance color is null");\r
+            Assert.IsInstanceOf<Color>(color, "Should be instance of Color");\r
+            Assert.AreEqual(color, Color.Gray, "Property Gray should same color create via hex string refer w3c.");\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Check property Green.")]\r
+        [Property("SPEC", "Tizen.Common.Color.Green A")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "PRO")]\r
+        [Property("AUTHOR", "WonYoung Choi, wy80.choi@samsung.com")]\r
+        public void Green_READ_ONLY()\r
+        {\r
+            var color = Color.FromHex("#008000");\r
+            Assert.IsNotNull(color, "Instance color is null");\r
+            Assert.IsInstanceOf<Color>(color, "Should be instance of Color");\r
+            Assert.AreEqual(color, Color.Green, "Property Green should same color create via hex string refer w3c.");\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Check property Lime.")]\r
+        [Property("SPEC", "Tizen.Common.Color.Lime A")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "PRO")]\r
+        [Property("AUTHOR", "WonYoung Choi, wy80.choi@samsung.com")]\r
+        public void Lime_READ_ONLY()\r
+        {\r
+            var color = Color.FromHex("#00ff00");\r
+            Assert.IsNotNull(color, "Instance color is null");\r
+            Assert.IsInstanceOf<Color>(color, "Should be instance of Color");\r
+            Assert.AreEqual(color, Color.Lime, "Property Lime should same color create via hex string refer w3c.");\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Check property Maroon.")]\r
+        [Property("SPEC", "Tizen.Common.Color.Maroon A")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "PRO")]\r
+        [Property("AUTHOR", "WonYoung Choi, wy80.choi@samsung.com")]\r
+        public void Maroon_READ_ONLY()\r
+        {\r
+            var color = Color.FromHex("#800000");\r
+            Assert.IsNotNull(color, "Instance color is null");\r
+            Assert.IsInstanceOf<Color>(color, "Should be instance of Color");\r
+            Assert.AreEqual(color, Color.Maroon, "Property Maroon should same color create via hex string refer w3c.");\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Check property Navy.")]\r
+        [Property("SPEC", "Tizen.Common.Color.Navy A")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "PRO")]\r
+        [Property("AUTHOR", "WonYoung Choi, wy80.choi@samsung.com")]\r
+        public void Navy_READ_ONLY()\r
+        {\r
+            var color = Color.FromHex("#000080");\r
+            Assert.IsNotNull(color, "Instance color is null");\r
+            Assert.IsInstanceOf<Color>(color, "Should be instance of Color");\r
+            Assert.AreEqual(color, Color.Navy, "Property Navy should same color create via hex string refer w3c.");\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Check property Olive.")]\r
+        [Property("SPEC", "Tizen.Common.Color.Olive A")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "PRO")]\r
+        [Property("AUTHOR", "WonYoung Choi, wy80.choi@samsung.com")]\r
+        public void Olive_READ_ONLY()\r
+        {\r
+            var color = Color.FromHex("#808000");\r
+            Assert.IsNotNull(color, "Instance color is null");\r
+            Assert.IsInstanceOf<Color>(color, "Should be instance of Color");\r
+            Assert.AreEqual(color, Color.Olive, "Property Olive should same color create via hex string refer w3c.");\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Check property Purple.")]\r
+        [Property("SPEC", "Tizen.Common.Color.Purple A")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "PRO")]\r
+        [Property("AUTHOR", "WonYoung Choi, wy80.choi@samsung.com")]\r
+        public void Purple_READ_ONLY()\r
+        {\r
+            var color = Color.FromHex("#800080");\r
+            Assert.IsNotNull(color, "Instance color is null");\r
+            Assert.IsInstanceOf<Color>(color, "Should be instance of Color");\r
+            Assert.AreEqual(color, Color.Purple, "Property Purple should same color create via hex string refer w3c.");\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Check property Pink.")]\r
+        [Property("SPEC", "Tizen.Common.Color.Pink A")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "PRO")]\r
+        [Property("AUTHOR", "WonYoung Choi, wy80.choi@samsung.com")]\r
+        public void Pink_READ_ONLY()\r
+        {\r
+            var color = Color.FromHex("#ff66ff");\r
+            Assert.IsNotNull(color, "Instance color is null");\r
+            Assert.IsInstanceOf<Color>(color, "Should be instance of Color");\r
+            Assert.AreEqual(color, Color.Pink, "Property Pink should same color create via hex string refer Xamarin.");\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Check property Red.")]\r
+        [Property("SPEC", "Tizen.Common.Color.Red A")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "PRO")]\r
+        [Property("AUTHOR", "WonYoung Choi, wy80.choi@samsung.com")]\r
+        public void Red_READ_ONLY()\r
+        {\r
+            var color = Color.FromHex("#ff0000");\r
+            Assert.IsNotNull(color, "Instance color is null");\r
+            Assert.IsInstanceOf<Color>(color, "Should be instance of Color");\r
+            Assert.AreEqual(color, Color.Red, "Property Red should same color create via hex string refer w3c.");\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Check property Silver.")]\r
+        [Property("SPEC", "Tizen.Common.Color.Silver A")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "PRO")]\r
+        [Property("AUTHOR", "WonYoung Choi, wy80.choi@samsung.com")]\r
+        public void Silver_READ_ONLY()\r
+        {\r
+            var color = Color.FromHex("#c0c0c0");\r
+            Assert.IsNotNull(color, "Instance color is null");\r
+            Assert.IsInstanceOf<Color>(color, "Should be instance of Color");\r
+            Assert.AreEqual(color, Color.Silver, "Property Silver should same color create via hex string refer w3c.");\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Check property Teal.")]\r
+        [Property("SPEC", "Tizen.Common.Color.Teal A")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "PRO")]\r
+        [Property("AUTHOR", "WonYoung Choi, wy80.choi@samsung.com")]\r
+        public void Teal_READ_ONLY()\r
+        {\r
+            var color = Color.FromHex("#008080");\r
+            Assert.IsNotNull(color, "Instance color is null");\r
+            Assert.IsInstanceOf<Color>(color, "Should be instance of Color");\r
+            Assert.AreEqual(color, Color.Teal, "Property Teal should same color create via hex string refer w3c.");\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Check property White.")]\r
+        [Property("SPEC", "Tizen.Common.Color.White A")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "PRO")]\r
+        [Property("AUTHOR", "WonYoung Choi, wy80.choi@samsung.com")]\r
+        public void White_READ_ONLY()\r
+        {\r
+            var color = Color.FromHex("#ffffff");\r
+            Assert.IsNotNull(color, "Instance color is null");\r
+            Assert.IsInstanceOf<Color>(color, "Should be instance of Color");\r
+            Assert.AreEqual(color, Color.White, "Property White should same color create via hex string refer w3c.");\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Check property Yellow.")]\r
+        [Property("SPEC", "Tizen.Common.Color.Yellow A")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "PRO")]\r
+        [Property("AUTHOR", "WonYoung Choi, wy80.choi@samsung.com")]\r
+        public void Yellow_READ_ONLY()\r
+        {\r
+            var color = Color.FromHex("#ffff00");\r
+            Assert.IsNotNull(color, "Instance color is null");\r
+            Assert.IsInstanceOf<Color>(color, "Should be instance of Color");\r
+            Assert.AreEqual(color, Color.Yellow, "Property Yellow should same color create via hex string refer w3c.");\r
+        }\r
+    }\r
+}\r
diff --git a/tct-suite-vs/Tizen.Common.Tests/testcase/TSErrorFacts.cs b/tct-suite-vs/Tizen.Common.Tests/testcase/TSErrorFacts.cs
new file mode 100644 (file)
index 0000000..3f22ec3
--- /dev/null
@@ -0,0 +1,68 @@
+/*\r
+ *  Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved\r
+ *\r
+ *  Licensed under the Apache License, Version 2.0 (the "License");\r
+ *  you may not use this file except in compliance with the License.\r
+ *  You may obtain a copy of the License at\r
+ *\r
+ *      http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ *  Unless required by applicable law or agreed to in writing, software\r
+ *  distributed under the License is distributed on an "AS IS" BASIS,\r
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ *  See the License for the specific language governing permissions and\r
+ *  limitations under the License\r
+ */\r
+\r
+using NUnit.Framework;\r
+using NUnit.Framework.TUnit;\r
+\r
+using Tizen.Internals.Errors;\r
+\r
+namespace Tizen.Common.Tests\r
+{\r
+    [TestFixture]\r
+    [Description("Tizen.Common.ErrorFacts Tests")]\r
+    public class ErrorFactsTests\r
+    {\r
+\r
+        [SetUp]\r
+        public void Init()\r
+        {\r
+            LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST");\r
+        }\r
+\r
+        [TearDown]\r
+        public void Destroy()\r
+        {\r
+            LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Postconditions for each TEST");\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Check value returned by GetLastResult.")]\r
+        [Property("SPEC", "Tizen.Internals.Errors.ErrorFacts.GetLastResult M")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "MR")]\r
+        [Property("AUTHOR", "WonYoung Choi, wy80.choi@samsung.com")]\r
+        public void GetLastResult_RETURN()\r
+        {\r
+            var ret = ErrorFacts.GetLastResult();\r
+            Assert.IsInstanceOf<int>(ret, "Should be value of int");\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Check value returned by GetErrorMessage.")]\r
+        [Property("SPEC", "Tizen.Internals.Errors.ErrorFacts.GetErrorMessage M")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "MR")]\r
+        [Property("AUTHOR", "WonYoung Choi, wy80.choi@samsung.com")]\r
+        public void GetErrorMessage_RETURN()\r
+        {\r
+            string msg = ErrorFacts.GetErrorMessage(0);\r
+            Assert.AreEqual(msg, "Successful", "Return value of Error.None by GetErrorMessage should be 'Successful'");\r
+        }\r
+\r
+    }\r
+}\r
diff --git a/tct-suite-vs/Tizen.Common.Tests/tizen-manifest.xml b/tct-suite-vs/Tizen.Common.Tests/tizen-manifest.xml
new file mode 100644 (file)
index 0000000..f2fa9b5
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<manifest package="Tizen.Common.Tests" version="1.0.0" api-version="6" xmlns="http://tizen.org/ns/packages">\r
+    <profile name="common" />\r
+    <ui-application appid="Tizen.Common.Tests" exec="Tizen.Common.Tests.dll" multiple="false" taskmanage="true" splash-screen-display="true" type="dotnet" launch_mode="single">\r
+        <label>Tizen.Common.Tests</label>\r
+        <icon>Tizen.Common.Tests.png</icon>\r
+    </ui-application>\r
+         <privileges>\r
+      <privilege>http://tizen.org/privilege/appmanager.launch</privilege>\r
+    </privileges>\r
+</manifest>\r