using Tizen.Nlp;\r
using Tizen.Applications;\r
using Tizen.Applications.Messages;\r
+using Tizen.System;\r
\r
namespace Tizen.Nlp.Tests {\r
\r
[Description("Tizen.Nlp.LanguageDetectedResult test")]\r
public class LanguageDetectedResultTests\r
{\r
+ bool isNlpSupported = false;\r
\r
[SetUp]\r
- public static void Init()\r
+ public void Init()\r
{\r
LogUtils.Write(LogUtils.DEBUG , LogUtils.TAG , "Preconditions for each TEST");\r
+ Information.TryGetValue("http://tizen.org/feature/nlp", out isNlpSupported);\r
}\r
\r
[TearDown]\r
- public static void Destroy()\r
+ public void Destroy()\r
{\r
LogUtils.Write(LogUtils.DEBUG , LogUtils.TAG , "Postconditions for each TEST");\r
}\r
var res = new LanguageDetectedResult();\r
Assert.IsInstanceOf<LanguageDetectedResult>(res, "Expecting LanguageDetectedResult object");\r
}\r
+ catch (NotSupportedException)\r
+ {\r
+ Assert.IsTrue(isNlpSupported == false, "Invalid NotSupportedException");\r
+ }\r
catch (Exception e)\r
{\r
Assert.Fail("Got Exception" + e.ToString());\r
res = await nlp.LanguageDetectAsync(msg);\r
Assert.IsTrue(res.Language.Equals("en"), "The return value of Language is correct");\r
}\r
+ catch (NotSupportedException)\r
+ {\r
+ Assert.IsTrue(isNlpSupported == false, "Invalid NotSupportedException");\r
+ }\r
catch (Exception e)\r
{\r
Assert.Fail("Got Exception" + e.ToString());\r
using Tizen.Nlp;\r
using Tizen.Applications;\r
using Tizen.Applications.Messages;\r
+using Tizen.System;\r
\r
namespace Tizen.Nlp.Tests {\r
\r
[Description("Tizen.Nlp.NamedEntityRecognitionResult test")]\r
public class NamedEntityRecognitionResultTests\r
{\r
- static NaturalLanguageProcess nlp = null;\r
+ NaturalLanguageProcess nlp = null;\r
+ bool isNlpSupported = false;\r
+\r
[SetUp]\r
- public static void Init()\r
+ public void Init()\r
{\r
nlp = new NaturalLanguageProcess();\r
LogUtils.Write(LogUtils.DEBUG , LogUtils.TAG , "Preconditions for each TEST");\r
+ Information.TryGetValue("http://tizen.org/feature/nlp", out isNlpSupported);\r
}\r
\r
[TearDown]\r
- public static void Destroy()\r
+ public void Destroy()\r
{\r
LogUtils.Write(LogUtils.DEBUG , LogUtils.TAG , "Postconditions for each TEST");\r
}\r
var res = new NamedEntityRecognitionResult();\r
Assert.IsInstanceOf<NamedEntityRecognitionResult>(res, "Expecting NamedEntityRecognitionResult object");\r
}\r
+ catch (NotSupportedException)\r
+ {\r
+ Assert.IsTrue(isNlpSupported == false, "Invalid NotSupportedException");\r
+ }\r
catch (Exception e)\r
{\r
Assert.Fail("Got Exception" + e.ToString());\r
for (int i = 0; i < res.Tags.Count; i++)\r
Assert.IsTrue(res.Tags[i].Equals(rs_tag[i]), "The return value of tag is correct");\r
}\r
+ catch (NotSupportedException)\r
+ {\r
+ Assert.IsTrue(isNlpSupported == false, "Invalid NotSupportedException");\r
+ }\r
catch (Exception e)\r
{\r
Assert.Fail("Got Exception" + e.ToString());\r
for (int i = 0; i < res.Tokens.Count; i++)\r
Assert.IsTrue(res.Tokens[1].Equals(rs_token[1]), "The return token value of token is correct");\r
}\r
+ catch (NotSupportedException)\r
+ {\r
+ Assert.IsTrue(isNlpSupported == false, "Invalid NotSupportedException");\r
+ }\r
catch (Exception e)\r
{\r
Assert.Fail("Got Exception" + e.ToString());\r
using Tizen.Nlp;\r
using Tizen.Applications;\r
using Tizen.Applications.Messages;\r
+using Tizen.System;\r
\r
namespace Tizen.Nlp.Tests {\r
\r
[Description("Tizen.Nlp.NaturalLanguageProcess test")]\r
public class NaturalLanguageProcessTests\r
{\r
- static NaturalLanguageProcess nlp = null;\r
+ NaturalLanguageProcess nlp = null;\r
+ bool isNlpSupported = false;\r
+\r
[SetUp]\r
- public static void Init()\r
+ public void Init()\r
{\r
nlp = new NaturalLanguageProcess();\r
LogUtils.Write(LogUtils.DEBUG , LogUtils.TAG , "Preconditions for each TEST");\r
+ Information.TryGetValue("http://tizen.org/feature/nlp", out isNlpSupported);\r
}\r
\r
[TearDown]\r
- public static void Destroy()\r
+ public void Destroy()\r
{\r
LogUtils.Write(LogUtils.DEBUG , LogUtils.TAG , "Postconditions for each TEST");\r
}\r
var res = new NaturalLanguageProcess();\r
Assert.IsInstanceOf<NaturalLanguageProcess>(res, "Expecting NaturalLanguageProcess object");\r
}\r
+ catch (NotSupportedException)\r
+ {\r
+ Assert.IsTrue(isNlpSupported == false, "Invalid NotSupportedException");\r
+ }\r
catch (Exception e)\r
{\r
Assert.Fail("Got Exception" + e.ToString());\r
}\r
nlp.Disconnected += Disconnected;\r
}\r
+ catch (NotSupportedException)\r
+ {\r
+ Assert.IsTrue(isNlpSupported == false, "Invalid NotSupportedException");\r
+ }\r
catch (Exception e)\r
{\r
Assert.Fail("Got Exception" + e.ToString());\r
}\r
;\r
}\r
+ catch (NotSupportedException)\r
+ {\r
+ Assert.IsTrue(isNlpSupported == false, "Invalid NotSupportedException");\r
+ }\r
catch (Exception e)\r
{\r
Assert.Fail("Got Exception" + e.ToString());\r
for (int i = 0; i < res.Tokens.Count; i++)\r
Assert.IsTrue(rs_token[i].Equals(res.Tokens[i]), "The return value of WordTokenizeAsyncTask is correct");\r
}\r
+ catch (NotSupportedException)\r
+ {\r
+ Assert.IsTrue(isNlpSupported == false, "Invalid NotSupportedException");\r
+ }\r
catch (Exception e)\r
{\r
Assert.Fail("Got Exception" + e.ToString());\r
Assert.IsTrue(rs_tag[i].Equals(res.Tags[i]), "The return tag value of PosTagAsyncTask is correct");\r
}\r
}\r
+ catch (NotSupportedException)\r
+ {\r
+ Assert.IsTrue(isNlpSupported == false, "Invalid NotSupportedException");\r
+ }\r
catch (Exception e)\r
{\r
Assert.Fail("Got Exception" + e.ToString());\r
Assert.IsTrue(rs_tag[i].Equals(res.Tags[i]), "The return tag value of NamedEntityRecognitionAsyncTask is correct");\r
}\r
}\r
+ catch (NotSupportedException)\r
+ {\r
+ Assert.IsTrue(isNlpSupported == false, "Invalid NotSupportedException");\r
+ }\r
catch (Exception e)\r
{\r
Assert.Fail("Got Exception" + e.ToString());\r
res = await nlp.LanguageDetectAsync(msg);\r
Assert.IsTrue(res.Language.Equals("en"), "The return tag value of LanguageDetectAsyncTask is correct");\r
}\r
+ catch (NotSupportedException)\r
+ {\r
+ Assert.IsTrue(isNlpSupported == false, "Invalid NotSupportedException");\r
+ }\r
catch (Exception e)\r
{\r
Assert.Fail("Got Exception" + e.ToString());\r
nlp = new NaturalLanguageProcess();\r
nlp.Close();\r
}\r
+ catch (NotSupportedException)\r
+ {\r
+ Assert.IsTrue(isNlpSupported == false, "Invalid NotSupportedException");\r
+ }\r
catch (Exception e)\r
{\r
Assert.Fail("Got Exception" + e.ToString());\r
nlp.Dispose();\r
nlp = null;\r
}\r
+ catch (NotSupportedException)\r
+ {\r
+ Assert.IsTrue(isNlpSupported == false, "Invalid NotSupportedException");\r
+ }\r
catch (Exception e)\r
{\r
Assert.Fail("Got Exception" + e.ToString());\r
using Tizen.Nlp;\r
using Tizen.Applications;\r
using Tizen.Applications.Messages;\r
+using Tizen.System;\r
\r
namespace Tizen.Nlp.Tests {\r
\r
[Description("Tizen.Nlp.PosTagResult test")]\r
public class PosTagResultTests\r
{\r
- static NaturalLanguageProcess nlp = null;\r
+ NaturalLanguageProcess nlp = null;\r
+ bool isNlpSupported = false;\r
\r
[SetUp]\r
- public static void Init()\r
+ public void Init()\r
{\r
nlp = new NaturalLanguageProcess();\r
LogUtils.Write(LogUtils.DEBUG , LogUtils.TAG , "Preconditions for each TEST");\r
+ Information.TryGetValue("http://tizen.org/feature/nlp", out isNlpSupported);\r
}\r
\r
[TearDown]\r
- public static void Destroy()\r
+ public void Destroy()\r
{\r
LogUtils.Write(LogUtils.DEBUG , LogUtils.TAG , "Postconditions for each TEST");\r
}\r
var res = new PosTagResult();\r
Assert.IsInstanceOf<PosTagResult>(res, "Expecting PosTagResult object");\r
}\r
+ catch (NotSupportedException)\r
+ {\r
+ Assert.IsTrue(isNlpSupported == false, "Invalid NotSupportedException");\r
+ }\r
catch (Exception e)\r
{\r
Assert.Fail("Got Exception" + e.ToString());\r
for (int i = 0; i < res.Tags.Count; i++)\r
Assert.IsTrue(res.Tags[i].Equals(rs_tag[i]), "The return value of tag is correct");\r
}\r
+ catch (NotSupportedException)\r
+ {\r
+ Assert.IsTrue(isNlpSupported == false, "Invalid NotSupportedException");\r
+ }\r
catch (Exception e)\r
{\r
Assert.Fail("Got Exception" + e.ToString());\r
for (int i = 0; i < res.Tokens.Count; i++)\r
Assert.IsTrue(res.Tokens[i].Equals(rs_token[i]), "The return token value of token is correct");\r
}\r
+ catch (NotSupportedException)\r
+ {\r
+ Assert.IsTrue(isNlpSupported == false, "Invalid NotSupportedException");\r
+ }\r
catch (Exception e)\r
{\r
Assert.Fail("Got Exception" + e.ToString());\r
using Tizen.Nlp;\r
using Tizen.Applications;\r
using Tizen.Applications.Messages;\r
+using Tizen.System;\r
\r
namespace Tizen.Nlp.Tests {\r
\r
[Description("Tizen.Nlp.WordTokenizeResult test")]\r
public class WordTokenizeResultTests\r
{\r
+ bool isNlpSupported = false;\r
\r
[SetUp]\r
- public static void Init()\r
+ public void Init()\r
{\r
LogUtils.Write(LogUtils.DEBUG , LogUtils.TAG , "Preconditions for each TEST");\r
+ Information.TryGetValue("http://tizen.org/feature/nlp", out isNlpSupported);\r
}\r
\r
[TearDown]\r
- public static void Destroy()\r
+ public void Destroy()\r
{\r
LogUtils.Write(LogUtils.DEBUG , LogUtils.TAG , "Postconditions for each TEST");\r
}\r
var res = new WordTokenizeResult();\r
Assert.IsInstanceOf<WordTokenizeResult>(res, "Expecting WordTokenizeResult object");\r
}\r
+ catch (NotSupportedException)\r
+ {\r
+ Assert.IsTrue(isNlpSupported == false, "Invalid NotSupportedException");\r
+ }\r
catch (Exception e)\r
{\r
Assert.Fail("Got Exception" + e.ToString());\r
for (int i = 0; i < res.Tokens.Count; i++)\r
Assert.IsTrue(res.Tokens[i].Equals(rs_token[i]), "The return token value of token is correct");\r
}\r
+ catch (NotSupportedException)\r
+ {\r
+ Assert.IsTrue(isNlpSupported == false, "Invalid NotSupportedException");\r
+ }\r
catch (Exception e)\r
{\r
Assert.Fail("Got Exception" + e.ToString());\r