+++ /dev/null
-/*\r
- * Copyright (c) 2018 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
-using System;\r
-using System.Threading;\r
-using System.Threading.Tasks;\r
-using System.Collections.Generic;\r
-using Tizen;\r
-using Tizen.Nlp;\r
-using Tizen.Applications;\r
-using Tizen.Applications.Messages;\r
-\r
-namespace Tizen.Nlp.Tests {\r
-\r
- [TestFixture]\r
- [Description("Tizen.Nlp.LemmatizeResult test")]\r
- public class LemmatizeResultTests\r
- {\r
- static NaturalLanguageProcess nlp = null;\r
-\r
- [SetUp]\r
- public static void Init()\r
- {\r
- nlp = new NaturalLanguageProcess();\r
- LogUtils.Write(LogUtils.DEBUG , LogUtils.TAG , "Preconditions for each TEST");\r
- }\r
-\r
- [TearDown]\r
- public static void Destroy()\r
- {\r
- LogUtils.Write(LogUtils.DEBUG , LogUtils.TAG , "Postconditions for each TEST");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test: Check if constructor for the class returns correct object instance")]\r
- [Property("SPEC", "Tizen.Nlp.LemmatizeResult.LemmatizeResult C")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "CONSTR")]\r
- [Property("AUTHOR", "Xiaochun wang, xiaochn.wang@samsung.com")]\r
- public static void LemmatizeResult_INIT()\r
- {\r
- /* TEST CODE */\r
- try\r
- {\r
- LemmatizeResult res = new LemmatizeResult();\r
- Assert.IsInstanceOf<LemmatizeResult>(res, "Expecting LemmatizeResult object");\r
- }\r
- catch (Exception e)\r
- {\r
- Assert.Fail("Got Exception" + e.ToString());\r
- }\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Check the return value of LemmatizeResult Tags is correct or not")]\r
- [Property("SPEC", "Tizen.Nlp.LemmatizeResult.Tags A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRO")]\r
- [Property("AUTHOR", "Xiaochun wang, xiaochn.wang@samsung.com")]\r
- public static async Task Tags_RETURN_VALUE()\r
- {\r
- try\r
- {\r
- /* TEST CODE */\r
- if (nlp == null)\r
- nlp = new NaturalLanguageProcess();\r
- try\r
- {\r
- Task task = nlp.Connect();\r
- await task;\r
- await Task.Delay(100);\r
- }\r
- catch\r
- {\r
- LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "nlp has connected");\r
- }\r
- LemmatizeResult res;\r
- string msg = "raining";\r
- res = await nlp.LemmatizeaAsync(msg);\r
- Assert.IsTrue(res.ActualWord.Equals("rain"), "The return value of tag is correct");\r
- }\r
- catch (Exception e)\r
- {\r
- Assert.Fail("Got Exception" + e.ToString());\r
- }\r
- }\r
- }\r
-}\r
\r
[Test]\r
[Category("P1")]\r
- [Description("Check the working of NLP LemmatizeaAsync method for No Exception")]\r
- [Property("SPEC", "Tizen.Nlp.NaturalLanguageProcess.LemmatizeaAsync M")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "MR")]\r
- [Property("AUTHOR", "Xiaochun wang, xiaochn.wang@samsung.com")]\r
- public static async Task LemmatizeaAsync_RETURN_VALUE()\r
- {\r
- /* TEST CODE */\r
- try\r
- {\r
- if (nlp == null)\r
- nlp = new NaturalLanguageProcess();\r
- try\r
- {\r
- var task = nlp.Connect();\r
- await task;\r
- await Task.Delay(100);\r
- }\r
- catch\r
- {\r
- LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "nlp has connected");\r
- }\r
- LemmatizeResult res;\r
- string msg = "raining";\r
- res = await nlp.LemmatizeaAsync(msg);\r
- IList<string> rs_token = new List<string>();\r
- Assert.IsTrue(res.ActualWord.Equals("rain"), "The return value of tag is correct");\r
- nlp.Close();\r
- }\r
- catch (Exception e)\r
- {\r
- Assert.Fail("Got Exception" + e.ToString());\r
- }\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
[Description("Check the working of NLP Close method for No Exception")]\r
[Property("SPEC", "Tizen.Nlp.NaturalLanguageProcess.Close M")]\r
[Property("SPEC_URL", "-")]\r