From: Krishna Kant Jaju Date: Tue, 17 Oct 2023 06:37:16 +0000 (+0530) Subject: [Tizen.Messages.Tests][TCSACR-557] Remove TCs for Messages deprecated APIs X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0ee72e05e3acb38d5cb692a6f68e37e37981d728;p=test%2Ftct%2Fcsharp%2Fapi.git [Tizen.Messages.Tests][TCSACR-557] Remove TCs for Messages deprecated APIs Change-Id: I143b710946a7b6acd9d963defa8d64900a1b06d5 Signed-off-by: Krishna Kant Jaju (cherry picked from commit 2538bf78995d1ebba1fde847c5804b7463384e88) --- diff --git a/tct-suite-vs/CSharpTCT.sln b/tct-suite-vs/CSharpTCT.sln index 8584319..f1e0e9d 100644 --- a/tct-suite-vs/CSharpTCT.sln +++ b/tct-suite-vs/CSharpTCT.sln @@ -98,8 +98,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Stt.Tests", "Tizen.St EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Stt.Manual.Tests", "Tizen.Stt.Manual.Tests\Tizen.Stt.Manual.Tests.csproj", "{D09A0ACE-E070-4694-9E3C-F81F54C27A69}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Messages.Tests", "Tizen.Messages.Tests\Tizen.Messages.Tests.csproj", "{22673A2C-2B03-4114-ADF3-B6B952F758C9}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.RemoteView.Tests", "Tizen.RemoteView.Tests\Tizen.RemoteView.Tests.csproj", "{D23C0C2B-2361-42CA-8BC6-F2F9325A8158}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.WidgetApplication.Manual.Tests", "Tizen.WidgetApplication.Manual.Tests\Tizen.WidgetApplication.Manual.Tests.csproj", "{2464E62B-ABF3-4F66-94D3-F75F4A6B015B}" diff --git a/tct-suite-vs/Tizen.Messages.Tests/Program.cs b/tct-suite-vs/Tizen.Messages.Tests/Program.cs deleted file mode 100755 index 9f05a00..0000000 --- a/tct-suite-vs/Tizen.Messages.Tests/Program.cs +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2016 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 Tizen.Applications; - -namespace TCT.Tizen -{ - - class Program : ServiceApplication - { - protected override void OnCreate() - { - base.OnCreate(); - - Console.WriteLine("TCT : OnCreate()"); - - TRunner t = new TRunner(); - t.LoadTestsuite(); - t.Execute(); - } - - static void Main(string[] args) - { - Console.WriteLine("TCT : Main()"); - var app = new Program(); - app.Run(args); - } - } -} \ No newline at end of file diff --git a/tct-suite-vs/Tizen.Messages.Tests/Tizen.Messages.Tests.csproj b/tct-suite-vs/Tizen.Messages.Tests/Tizen.Messages.Tests.csproj deleted file mode 100755 index 839d3cb..0000000 --- a/tct-suite-vs/Tizen.Messages.Tests/Tizen.Messages.Tests.csproj +++ /dev/null @@ -1,42 +0,0 @@ - - - - - Exe - net6.0-tizen8.0 - True - Tizen - - - - - true - - - - portable - - - None - - - - - - - - - - - Runtime - - - - - - - - - - - diff --git a/tct-suite-vs/Tizen.Messages.Tests/Tizen.Messages.Tests.sln b/tct-suite-vs/Tizen.Messages.Tests/Tizen.Messages.Tests.sln deleted file mode 100755 index 4d7baf1..0000000 --- a/tct-suite-vs/Tizen.Messages.Tests/Tizen.Messages.Tests.sln +++ /dev/null @@ -1,72 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26730.15 -MinimumVisualStudioVersion = 15.0.26124.0 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Messages.Tests", "Tizen.Messages.Tests.csproj", "{D92BEEAC-3B2A-45F8-8C53-53B92550404A}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "nunit.framework", "..\nunit.framework\nunit.framework.csproj", "{B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "nunitlite", "..\nunitlite\nunitlite.csproj", "{FDB8025A-C029-461F-895E-287B4C65939B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoTemplate", "..\Template\AutoTemplate\AutoTemplate.csproj", "{B11ABB0C-C3C1-4B5C-8251-A15628A775F3}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|x64.ActiveCfg = Debug|Any CPU - {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|x64.Build.0 = Debug|Any CPU - {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|x86.ActiveCfg = Debug|Any CPU - {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|x86.Build.0 = Debug|Any CPU - {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|Any CPU.Build.0 = Release|Any CPU - {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|x64.ActiveCfg = Release|Any CPU - {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|x64.Build.0 = Release|Any CPU - {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|x86.ActiveCfg = Release|Any CPU - {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|x86.Build.0 = Release|Any CPU - {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|x64.ActiveCfg = Debug|Any CPU - {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|x64.Build.0 = Debug|Any CPU - {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|x86.ActiveCfg = Debug|Any CPU - {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|x86.Build.0 = Debug|Any CPU - {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|Any CPU.Build.0 = Release|Any CPU - {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|x64.ActiveCfg = Release|Any CPU - {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|x64.Build.0 = Release|Any CPU - {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|x86.ActiveCfg = Release|Any CPU - {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|x86.Build.0 = Release|Any CPU - {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|x64.ActiveCfg = Debug|Any CPU - {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|x64.Build.0 = Debug|Any CPU - {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|x86.ActiveCfg = Debug|Any CPU - {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|x86.Build.0 = Debug|Any CPU - {FDB8025A-C029-461F-895E-287B4C65939B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FDB8025A-C029-461F-895E-287B4C65939B}.Release|Any CPU.Build.0 = Release|Any CPU - {FDB8025A-C029-461F-895E-287B4C65939B}.Release|x64.ActiveCfg = Release|Any CPU - {FDB8025A-C029-461F-895E-287B4C65939B}.Release|x64.Build.0 = Release|Any CPU - {FDB8025A-C029-461F-895E-287B4C65939B}.Release|x86.ActiveCfg = Release|Any CPU - {FDB8025A-C029-461F-895E-287B4C65939B}.Release|x86.Build.0 = Release|Any CPU - {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.NUI|Any CPU.ActiveCfg = Debug|Any CPU - {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.NUI|Any CPU.Build.0 = Debug|Any CPU - {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {ED382B91-9930-40B6-B3D7-362304C78680} - EndGlobalSection -EndGlobal diff --git a/tct-suite-vs/Tizen.Messages.Tests/res/Default.jpg b/tct-suite-vs/Tizen.Messages.Tests/res/Default.jpg deleted file mode 100755 index c090428..0000000 Binary files a/tct-suite-vs/Tizen.Messages.Tests/res/Default.jpg and /dev/null differ diff --git a/tct-suite-vs/Tizen.Messages.Tests/res/V091120_104905.3gp b/tct-suite-vs/Tizen.Messages.Tests/res/V091120_104905.3gp deleted file mode 100755 index c41d536..0000000 Binary files a/tct-suite-vs/Tizen.Messages.Tests/res/V091120_104905.3gp and /dev/null differ diff --git a/tct-suite-vs/Tizen.Messages.Tests/res/audio.amr b/tct-suite-vs/Tizen.Messages.Tests/res/audio.amr deleted file mode 100755 index c41d536..0000000 Binary files a/tct-suite-vs/Tizen.Messages.Tests/res/audio.amr and /dev/null differ diff --git a/tct-suite-vs/Tizen.Messages.Tests/res/copy_res.sh b/tct-suite-vs/Tizen.Messages.Tests/res/copy_res.sh deleted file mode 100755 index 90eeb3f..0000000 --- a/tct-suite-vs/Tizen.Messages.Tests/res/copy_res.sh +++ /dev/null @@ -1,40 +0,0 @@ -LOCATION='/home/owner/share' -# Change the destination of the resource folder(absolute path). -DESTINATION_MOBILE='/home/owner/media' -DESTINATION_TV='/home/owner/content' - -if [ -d "$DESTINATION_MOBILE" ]; then - DESTINATION=$DESTINATION_MOBILE -else - DESTINATION=$DESTINATION_TV -fi - -# Change the list of the files in the resource folder. -FILE_LIST=( -) - -# Change the list of the directories in the resource folder. -DIR_LIST=( - 'res' -) - -if [ "$1" == "-i" ] -then - for value in "${FILE_LIST[@]}";do - cp $LOCATION/$value $DESTINATION - done - for value in "${DIR_LIST[@]}";do - cp -R $LOCATION/$value $DESTINATION - done -elif [ "$1" == "-u" ] -then - for value in "${FILE_LIST[@]}";do - rm $DESTINATION/$value - done - for value in "${DIR_LIST[@]}";do - rm -rf $DESTINATION/$value - done -else - echo "===> Please enter -i for install or -u for uninstall!" - exit -fi diff --git a/tct-suite-vs/Tizen.Messages.Tests/shared/res/Tizen.Messages.Tests.png b/tct-suite-vs/Tizen.Messages.Tests/shared/res/Tizen.Messages.Tests.png deleted file mode 100755 index 9765b1b..0000000 Binary files a/tct-suite-vs/Tizen.Messages.Tests/shared/res/Tizen.Messages.Tests.png and /dev/null differ diff --git a/tct-suite-vs/Tizen.Messages.Tests/testcase/TSMessage.cs b/tct-suite-vs/Tizen.Messages.Tests/testcase/TSMessage.cs deleted file mode 100755 index fa263f2..0000000 --- a/tct-suite-vs/Tizen.Messages.Tests/testcase/TSMessage.cs +++ /dev/null @@ -1,238 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using System.Collections.Generic; -using Tizen.System; - -namespace Tizen.Messaging.Messages.Tests -{ - - [TestFixture] - [Description("Tizen.Messaging.Messages.Message Tests")] - public class MessageTests - { - bool isSmsSupported = false; - - [OneTimeSetUp] - public void GetFeature() - { - Information.TryGetValue("http://tizen.org/feature/network.telephony.sms", out isSmsSupported); - } - - [SetUp] - public void Init() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST"); - } - - [TearDown] - public void Destroy() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Postconditions for each TEST"); - } - - [Test] - [Category("P1")] - [Description("Test Id property of Message : Check the default value of the Id property")] - [Property("SPEC", "Tizen.Messaging.Messages.Message.Id A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PDV")] - [Property("AUTHOR", "Kyeonghun Lee, kh9090.lee@samsung.com")] - public void Id_PROPERTY_READ_ONLY() - { - try - { - /* PRECONDITION */ - int defaultMsgId = 0; - var msg = new SmsMessage(); - Assert.IsInstanceOf(msg, "Should return message instance"); - - /* TEST CODE */ - Assert.IsTrue(msg.Id == defaultMsgId, "Get Message.Id failed"); - } - catch (NotSupportedException) - { - Assert.IsTrue(isSmsSupported == false, "Invalid NotSupportedException"); - } - catch (Exception ex) - { - Assert.Fail("Exception occurs. Msg : " + ex.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test Port property of Message")] - [Property("SPEC", "Tizen.Messaging.Messages.Message.Port A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Kyeonghun Lee, kh9090.lee@samsung.com")] - public void Port_PROPERTY_READ_ONLY() - { - try - { - /* PRECONDITION */ - var msg = new SmsMessage(); - Assert.IsInstanceOf(msg, "Should return message instance"); - - /* TEST CODE */ - Assert.IsTrue(msg.Port >= 0, "Get Message.Port failed"); - } - catch (NotSupportedException) - { - Assert.IsTrue(isSmsSupported == false, "Invalid NotSupportedException"); - } - catch (Exception ex) - { - Assert.Fail("Exception occurs. Msg : " + ex.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test BoxType property of Message")] - [Property("SPEC", "Tizen.Messaging.Messages.Message.BoxType A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Kyeonghun Lee, kh9090.lee@samsung.com")] - public void BoxType_PROPERTY() - { - try - { - /* PRECONDITION */ - var msg = new SmsMessage(); - Assert.IsInstanceOf(msg, "Should return message instance"); - - /* TEST CODE */ - msg.BoxType = MessageBoxType.Inbox; - Assert.IsTrue(msg.BoxType == MessageBoxType.Inbox, "Set/Get Message.BoxType failed"); - } - catch (NotSupportedException) - { - Assert.IsTrue(isSmsSupported == false, "Invalid NotSupportedException"); - } - catch (Exception ex) - { - Assert.Fail("Exception occurs. Msg : " + ex.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test Text property of Message")] - [Property("SPEC", "Tizen.Messaging.Messages.Message.Text A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Kyeonghun Lee, kh9090.lee@samsung.com")] - public void Text_PROPERTY() - { - try - { - /* PRECONDITION */ - string testText = "test"; - var msg = new SmsMessage(); - Assert.IsInstanceOf(msg, "Should return message instance"); - - /* TEST CODE */ - msg.Text = testText; - Assert.IsTrue(msg.Text == testText, "Set/Get Message.Text failed"); - } - catch (NotSupportedException) - { - Assert.IsTrue(isSmsSupported == false, "Invalid NotSupportedException"); - } - catch (Exception ex) - { - Assert.Fail("Exception occurs. Msg : " + ex.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test Time property of Message")] - [Property("SPEC", "Tizen.Messaging.Messages.Message.Time A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Kyeonghun Lee, kh9090.lee@samsung.com")] - public void Time_PROPERTY() - { - try - { - /* PRECONDITION */ - DateTime testTime = DateTime.Now; - var msg = new SmsMessage(); - Assert.IsInstanceOf(msg, "Should return message instance"); - - /* TEST CODE */ - msg.Time = testTime; - Assert.IsTrue(msg.Time.ToString("yyyyMMddHHmmss") == testTime.ToString("yyyyMMddHHmmss"), "Set/Get Message.Time failed"); - } - catch (NotSupportedException) - { - Assert.IsTrue(isSmsSupported == false, "Invalid NotSupportedException"); - } - catch (Exception ex) - { - Assert.Fail("Exception occurs. Msg : " + ex.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test SimId property of Message")] - [Property("SPEC", "Tizen.Messaging.Messages.Message.SimId A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Kyeonghun Lee, kh9090.lee@samsung.com")] - public void SimId_PROPERTY() - { - try - { - /* PRECONDITION */ - var msg = new SmsMessage(); - Assert.IsInstanceOf(msg, "Should return message instance"); - - /* TEST CODE */ - msg.SimId = SimSlotId.Sim1; - Assert.IsTrue(msg.SimId == SimSlotId.Sim1, "Set/Get Message.SimId failed"); - } - catch (NotSupportedException) - { - Assert.IsTrue(isSmsSupported == false, "Invalid NotSupportedException"); - } - catch (Exception ex) - { - Assert.Fail("Exception occurs. Msg : " + ex.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test From property of Message")] - [Property("SPEC", "Tizen.Messaging.Messages.Message.From A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Kyeonghun Lee, kh9090.lee@samsung.com")] - public void From_PROPERTY_READ_ONLY() - { - try - { - /* PRECONDITION */ - var msg = new SmsMessage(); - Assert.IsInstanceOf(msg, "Should return message instance"); - - /* TEST CODE */ - var from = msg.From; - Assert.IsInstanceOf>(from, "Should return IReadOnlyCollection instance"); - } - catch (NotSupportedException) - { - Assert.IsTrue(isSmsSupported == false, "Invalid NotSupportedException"); - } - catch (Exception ex) - { - Assert.Fail("Exception occurs. Msg : " + ex.ToString()); - } - } - } -} diff --git a/tct-suite-vs/Tizen.Messages.Tests/testcase/TSMessageReceivedEventArgs.cs b/tct-suite-vs/Tizen.Messages.Tests/testcase/TSMessageReceivedEventArgs.cs deleted file mode 100755 index 81c7700..0000000 --- a/tct-suite-vs/Tizen.Messages.Tests/testcase/TSMessageReceivedEventArgs.cs +++ /dev/null @@ -1,112 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.System; -using Tizen.Telephony; -using System.Collections.Generic; -using System.Threading.Tasks; -using System.Linq; - -namespace Tizen.Messaging.Messages.Tests -{ - - [TestFixture] - [Description("Tizen.Messaging.Messages.MessageReceivedEventArgs Tests")] - public class MessageReceivedEventArgsTests - { - bool isSmsSupported = false; - bool isEmulator = false; - private string myNumber = ""; - - [OneTimeSetUp] - public void OneTimeInit() - { - Information.TryGetValue("http://tizen.org/feature/network.telephony.sms", out isSmsSupported); - - if (isSmsSupported == true) - { - IEnumerable simList = Manager.Init(); - Assert.IsNotNull(simList, "simList is Null"); - Assert.IsInstanceOf>(simList, "simList is Not of IEnumerable type"); - var sim = new Sim(simList.ElementAt(0)); - Assert.IsNotNull(sim, "Sim object is Null"); - Assert.IsTrue(sim.CurrentState == Sim.State.Available, "Sim state is not available"); - - myNumber = sim.SubscriberNumber; - isEmulator = myNumber.Length > 0 ? false : true; - - Manager.Deinit(); - } - } - - [SetUp] - public void Init() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST"); - } - - [TearDown] - public void Destroy() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Postconditions for each TEST"); - } - - [Test] - [Category("P1")] - [Description("Test for MessageReceivedEventArgs with ReceivedMessage property in case of receiving messages")] - [Property("SPEC", "Tizen.Messaging.Messages.MessageReceivedEventArgs.ReceivedMessage A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Kyeonghun Lee, kh9090.lee@samsung.com")] - public async Task ReceivedMessage_READ_ONLY() - { - try - { - /** PRECONDITION - * 1. Insert a SIM into SIM slot 1 - */ - if (isEmulator == true) - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "This test cannot be tested on emulator"); - return; - } - - /* TEST CODE */ - bool _flag = false; - EventHandler handler = null; - handler = (object sender, MessageReceivedEventArgs args) => - { - _flag = true; - var message = args.ReceivedMessage; - Assert.NotNull(message, "Should be readable"); - Assert.IsInstanceOf(message, "Should return Message instance"); - }; - - MessagesManager.MessageReceived += handler; - - var msg = new SmsMessage(); - var address = new MessagesAddress(myNumber); - msg.To.Add(address); - msg.Text = "Tizen C# test sms message"; - msg.SimId = SimSlotId.Sim1; - - var result = await MessagesManager.SendMessageAsync(msg, false); - Assert.IsInstanceOf(result, "Should return SentResult instance"); - Assert.IsTrue(result == SentResult.Success, "SendMessageAsync failed"); - - await Task.Delay(10000); - MessagesManager.MessageReceived -= handler; - - Assert.True(_flag, "Event for receiving message is fail"); - } - catch (NotSupportedException) - { - Assert.IsTrue(isSmsSupported == false, "Invalid NotSupportedException"); - } - catch (Exception ex) - { - Assert.Fail("Exception occurs. Msg : " + ex.ToString()); - } - } - } -} diff --git a/tct-suite-vs/Tizen.Messages.Tests/testcase/TSMessagesAddress.cs b/tct-suite-vs/Tizen.Messages.Tests/testcase/TSMessagesAddress.cs deleted file mode 100755 index 7b52ff5..0000000 --- a/tct-suite-vs/Tizen.Messages.Tests/testcase/TSMessagesAddress.cs +++ /dev/null @@ -1,91 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using Tizen.System; -using System; - -namespace Tizen.Messaging.Messages.Tests -{ - - [TestFixture] - [Description("Tizen.Messaging.Messages.MessagesAddress Tests")] - public class MessagesAddressTests - { - bool isSmsSupported = false; - - [OneTimeSetUp] - public void OneTimeInit() - { - Information.TryGetValue("http://tizen.org/feature/network.telephony.sms", out isSmsSupported); - } - - [SetUp] - public void Init() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST"); - } - - [TearDown] - public void Destroy() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Postconditions for each TEST"); - } - - [Test] - [Category("P0")] - [Description("Create an address")] - [Property("SPEC", "Tizen.Messaging.Messages.MessagesAddress.MessagesAddress C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Kyeonghun Lee, kh9090.lee@samsung.com")] - public void MessagesAddress_INIT() - { - try - { - /* PRECONDTION */ - string number = "1234567890"; - - /* TEST CODE */ - var address = new MessagesAddress(number); - Assert.IsInstanceOf(address, "Should return MessagesAddress instance"); - Assert.AreEqual(number, address.Number, "MessagesAddress init do not successfully"); - } - catch (NotSupportedException) - { - Assert.IsTrue(isSmsSupported == false, "Invalid NotSupportedException"); - } - catch (Exception ex) - { - Assert.Fail("Exception occurs. Msg : " + ex.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test Number property of Address")] - [Property("SPEC", "Tizen.Messaging.Messages.MessagesAddress.Number A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Kyeonghun Lee, kh9090.lee@samsung.com")] - public void Number_PROPERTY_READ_ONLY() - { - try - { - /* PRECONDTION */ - string number = "0123456789"; - var address = new MessagesAddress(number); - Assert.IsInstanceOf(address, "Should return MessagesAddress instance"); - - /* TEST CODE */ - Assert.IsTrue(address.Number == number, "Get MessagesAddress.Number failed"); - } - catch (NotSupportedException) - { - Assert.IsTrue(isSmsSupported == false, "Invalid NotSupportedException"); - } - catch (Exception ex) - { - Assert.Fail("Exception occurs. Msg : " + ex.ToString()); - } - } - } -} diff --git a/tct-suite-vs/Tizen.Messages.Tests/testcase/TSMessagesAttachment.cs b/tct-suite-vs/Tizen.Messages.Tests/testcase/TSMessagesAttachment.cs deleted file mode 100755 index 9b3fb73..0000000 --- a/tct-suite-vs/Tizen.Messages.Tests/testcase/TSMessagesAttachment.cs +++ /dev/null @@ -1,120 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using Tizen.System; -using System; - -namespace Tizen.Messaging.Messages.Tests -{ - - [TestFixture] - [Description("Tizen.Messaging.Messages.MessagesAttachment Tests")] - public class MessagesAttachmentTests - { - private string imagePath = "/opt/usr/home/owner/share/res/Default.jpg"; - private string audioPath = "/opt/usr/home/owner/share/res/audio.amr"; - private string videoPath = "/opt/usr/home/owner/share/res/V091120_104905.3gp"; - - bool isSmsSupported = false; - - [OneTimeSetUp] - public void OneTimeInit() - { - Information.TryGetValue("http://tizen.org/feature/network.telephony.sms", out isSmsSupported); - } - - [SetUp] - public void Init() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST"); - } - - [TearDown] - public void Destroy() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Postconditions for each TEST"); - } - - [Test] - [Category("P0")] - [Description("Create an attachment")] - [Property("SPEC", "Tizen.Messaging.Messages.MessagesAttachment.MessagesAttachment C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Kyeonghun Lee, kh9090.lee@samsung.com")] - public void MessagesAttachment_INIT() - { - try - { - /* TEST CODE */ - var attachment = new MessagesAttachment(MediaType.Image, imagePath); - Assert.IsInstanceOf(attachment, "Should return MessagesAttachment instance"); - Assert.AreEqual(MediaType.Image, attachment.Type, "MessagesAttachment init do not successfully"); - Assert.AreEqual(imagePath, attachment.FilePath, "MessagesAttachment init do not successfully"); - } - catch (NotSupportedException) - { - Assert.IsTrue(isSmsSupported == false, "Invalid NotSupportedException"); - } - catch (Exception ex) - { - Assert.Fail("Exception occurs. Msg : " + ex.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test Type property of MessagesAttachment")] - [Property("SPEC", "Tizen.Messaging.Messages.MessagesAttachment.Type A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Kyeonghun Lee, kh9090.lee@samsung.com")] - public void Type_PROPERTY_READ_ONLY() - { - try - { - /* PRECONDTION */ - var attachment = new MessagesAttachment(MediaType.Audio, audioPath); - Assert.IsInstanceOf(attachment, "Should return MessagesAttachment instance"); - - /* TEST CODE */ - Assert.IsTrue(attachment.Type == MediaType.Audio, "Get MessagesAttachment.Type failed"); - } - catch (NotSupportedException) - { - Assert.IsTrue(isSmsSupported == false, "Invalid NotSupportedException"); - } - catch (Exception ex) - { - Assert.Fail("Exception occurs. Msg : " + ex.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test FilePath property of Attachment")] - [Property("SPEC", "Tizen.Messaging.Messages.MessagesAttachment.FilePath A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Kyeonghun Lee, kh9090.lee@samsung.com")] - public void FilePath_PROPERTY_READ_ONLY() - { - try - { - /* PRECONDTION */ - var attachment = new MessagesAttachment(MediaType.Video, videoPath); - Assert.IsInstanceOf(attachment, "Should return MessagesAttachment instance"); - - /* TEST CODE */ - Assert.IsTrue(attachment.FilePath == videoPath, "Get MessagesAttachment.FilePath failed"); - } - catch (NotSupportedException) - { - Assert.IsTrue(isSmsSupported == false, "Invalid NotSupportedException"); - } - catch (Exception ex) - { - Assert.Fail("Exception occurs. Msg : " + ex.ToString()); - } - } - } -} diff --git a/tct-suite-vs/Tizen.Messages.Tests/testcase/TSMessagesManager.cs b/tct-suite-vs/Tizen.Messages.Tests/testcase/TSMessagesManager.cs deleted file mode 100755 index 7245e53..0000000 --- a/tct-suite-vs/Tizen.Messages.Tests/testcase/TSMessagesManager.cs +++ /dev/null @@ -1,351 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.System; -using Tizen.Telephony; -using System.Collections.Generic; -using System.Threading.Tasks; -using System.Linq; - -namespace Tizen.Messaging.Messages.Tests -{ - - [TestFixture] - [Description("Tizen.Messaging.Messages.MessagesManager Tests")] - public class MessagesManagerTests - { - bool isSmsSupported = false; - bool isMmsSupported = false; - bool isEmulator = false; - - bool _flag = false; - private string myNumber = ""; - private string destinationNumber = ""; - private string imagePath = "/opt/usr/home/owner/share/res/Default.jpg"; - - [OneTimeSetUp] - public void OneTimeInit() - { - Information.TryGetValue("http://tizen.org/feature/network.telephony.sms", out isSmsSupported); - Information.TryGetValue("http://tizen.org/feature/network.telephony.mms", out isMmsSupported); - - if (isSmsSupported == true) - { - IEnumerable simList = Manager.Init(); - Assert.IsNotNull(simList, "simList is Null"); - Assert.IsInstanceOf>(simList, "simList is Not of IEnumerable type"); - var sim = new Sim(simList.ElementAt(0)); - Assert.IsNotNull(sim, "Sim object is Null"); - Assert.IsTrue(sim.CurrentState == Sim.State.Available, "Sim state is not available"); - - myNumber = sim.SubscriberNumber; - isEmulator = myNumber.Length > 0 ? false : true; - - Manager.Deinit(); - - PreconditionUtils.SetPrecondition(); - destinationNumber = PreconditionUtils.MESSAGES_MOBILE_NUMBER; - } - } - - [SetUp] - public void Init() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST"); - } - - [TearDown] - public void Destroy() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Postconditions for each TEST"); - } - - [Test] - [Category("P1")] - [Description("Send a sms message")] - [Property("SPEC", "Tizen.Messaging.Messages.MessagesManager.SendMessageAsync M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Kyeonghun Lee, kh9090.lee@samsung.com")] - public async Task SendMessageAsync_SMS() - { - try - { - /** PRECONDITION - * 1. Insert a SIM into SIM slot 1 - */ - var msg = new SmsMessage(); - Assert.IsInstanceOf(msg, "Should return sms message instance"); - - var address = new MessagesAddress(destinationNumber); - Assert.IsInstanceOf(address, "Should return address instance"); - msg.To.Add(address); - - msg.Text = "Tizen C# test sms message"; - msg.SimId = SimSlotId.Sim1; - - /* TEST CODE*/ - var result = await MessagesManager.SendMessageAsync(msg, false); - Assert.IsInstanceOf(result, "Should return SentResult instance"); - Assert.IsTrue(result == SentResult.Success, "SendMessageAsync failed"); - } - catch (NotSupportedException) - { - Assert.IsTrue(isSmsSupported == false, "Invalid NotSupportedException"); - } - catch (Exception ex) - { - Assert.Fail("Exception occurs. Msg : " + ex.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Send a mms message")] - [Property("SPEC", "Tizen.Messaging.Messages.MessagesManager.SendMessageAsync M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Kyeonghun Lee, kh9090.lee@samsung.com")] - public async Task SendMessageAsync_MMS() - { - try - { - /** PRECONDITION - * 1. Insert a SIM into SIM slot 1 - */ - var msg = new MmsMessage(); - Assert.IsInstanceOf(msg, "Should return mms message instance"); - - var address = new MessagesAddress(destinationNumber); - Assert.IsInstanceOf(address, "Should return address instance"); - msg.To.Add(address); - - var attachement = new MessagesAttachment(MediaType.Image, imagePath); - Assert.IsInstanceOf(attachement, "Should return attachment instance"); - - msg.Attachments.Add(attachement); - msg.Subject = "Tizen C# test subject"; - msg.Text = "Tizen C# test mms message"; - msg.SimId = SimSlotId.Sim1; - - /* TEST CODE*/ - var result = await MessagesManager.SendMessageAsync(msg, false); - Assert.IsInstanceOf(result, "Sholud return SentResult instance"); - Assert.IsTrue(result == SentResult.Success, "SendMessageAsync failed"); - } - catch (NotSupportedException) - { - Assert.IsTrue(isMmsSupported == false, "Invalid NotSupportedException"); - } - catch (Exception ex) - { - Assert.Fail("Exception occurs. Msg : " + ex.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Check whether sent message is saved in sentbox or not")] - [Property("SPEC", "Tizen.Messaging.Messages.MessagesManager.SendMessageAsync M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Kyeonghun Lee, kh9090.lee@samsung.com")] - public async Task SendMessageAsync_CHECK_SAVE() - { - try - { - /** PRECONDITION - * 1. Insert a SIM into SIM slot 1 - */ - var msg = new SmsMessage(); - Assert.IsInstanceOf(msg, "Should return sms message instance"); - - var address = new MessagesAddress(destinationNumber); - Assert.IsInstanceOf(address, "Should return address instance"); - msg.To.Add(address); - - msg.Text = "Tizen C# test sms message for checking status"; - msg.SimId = SimSlotId.Sim1; - - /* TEST CODE*/ - var result = await MessagesManager.SendMessageAsync(msg, true); - Assert.IsInstanceOf(result, "Should return SentResult instance"); - Assert.IsTrue(result == SentResult.Success, "SendMessageAsync failed"); - - var filter = new MessagesSearchFilter(); - Assert.IsInstanceOf(filter, "Should return filter instance"); - - filter.TextKeyword = "checking"; - filter.AddressKeyword = destinationNumber; - - var resultMessages = await MessagesManager.SearchMessageAsync(filter); - Assert.IsInstanceOf>(resultMessages, "Should return IEnumerable of messages instance"); - - var item = resultMessages.First(); - Assert.IsTrue(item.BoxType == MessageBoxType.Sentbox, "Sent message should be saved in sentbox"); - } - catch (NotSupportedException) - { - Assert.IsTrue(isSmsSupported == false, "Invalid NotSupportedException"); - } - catch (Exception ex) - { - Assert.Fail("Exception occurs. Msg : " + ex.ToString()); - } - } - - [Test] - [Category("P2")] - [Description("Send a message with null argument")] - [Property("SPEC", "Tizen.Messaging.Messages.MessagesManager.SendMessageAsync M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("AUTHOR", "Kyeonghun Lee, kh9090.lee@samsung.com")] - public async Task SendMessageAsync_NULL_ARGUMENT() - { - try - { - /* TEST CODE*/ - var result = await MessagesManager.SendMessageAsync(null, false); - } - catch (NotSupportedException) - { - Assert.IsTrue(isSmsSupported == false, "Invalid NotSupportedException"); - } - catch (Exception ex) - { - Assert.True(ex.GetType().Equals(typeof(NullReferenceException)), "SendMessageAsync method should throw NullReferenceException"); - } - } - - [Test] - [Category("P1")] - [Description("Search messages with filter, and check the return value")] - [Property("SPEC", "Tizen.Messaging.Messages.MessagesManager.SearchMessageAsync M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Kyeonghun Lee, kh9090.lee@samsung.com")] - public async Task SearchMessageAsync_NORMAL() - { - try - { - /** PRECONDITION - * 1. Insert a SIM into SIM slot 1 - */ - var msg = new SmsMessage(); - Assert.IsInstanceOf(msg, "Should return sms message instance"); - - var address = new MessagesAddress(destinationNumber); - Assert.IsInstanceOf(address, "Should return address instance"); - msg.To.Add(address); - - msg.Text = "Tizen C# test sms message"; - msg.SimId = SimSlotId.Sim1; - - var result = await MessagesManager.SendMessageAsync(msg, true); - Assert.IsInstanceOf(result, "Should return SentResult instance"); - Assert.IsTrue(result == SentResult.Success, "SendMessageAsync failed"); - - var filter = new MessagesSearchFilter(); - Assert.IsInstanceOf(filter, "Should return filter instance"); - - filter.TextKeyword = "Tizen"; - - /* TEST CODE*/ - var resultMessages = await MessagesManager.SearchMessageAsync(filter); - Assert.IsInstanceOf>(resultMessages, "Should return IEnumerable of messages instance"); - - foreach (var item in resultMessages) - { - Assert.IsTrue(item.Text.Contains(filter.TextKeyword), "Searched messages must fit as filter properties"); - } - } - catch (NotSupportedException) - { - Assert.IsTrue(isSmsSupported == false, "Invalid NotSupportedException"); - } - catch (Exception ex) - { - Assert.Fail("Exception occurs. Msg : " + ex.ToString()); - } - } - - [Test] - [Category("P2")] - [Description("Search messages with null argument")] - [Property("SPEC", "Tizen.Messaging.Messages.MessagesManager.SearchMessageAsync M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("AUTHOR", "Kyeonghun Lee, kh9090.lee@samsung.com")] - public async Task SearchMessageAsync_NULL_ARGUMENT() - { - try - { - /* TEST CODE*/ - var resultMessages = await MessagesManager.SearchMessageAsync(null); - } - catch (NotSupportedException) - { - Assert.IsTrue(isSmsSupported == false, "Invalid NotSupportedException"); - } - catch (Exception ex) - { - Assert.True(ex.GetType().Equals(typeof(NullReferenceException)), "SearchMessageAsync method should throw NullReferenceException"); - } - } - - [Test] - [Category("P1")] - [Description("MessageReceived event called when receiving messages")] - [Property("SPEC", "Tizen.Messaging.Messages.MessagesManager.MessageReceived E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Kyeonghun Lee, kh9090.lee@samsung.com")] - public async Task MessageReceived_CHECK_EVENT() - { - try - { - /** PRECONDITION - * 1. Insert a SIM into SIM slot 1 - */ - if (isEmulator == true) - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "This test cannot be tested on emulator"); - return; - } - - _flag = false; - MessagesManager.MessageReceived += EventHandlerMessageReceived; - - var msg = new SmsMessage(); - var address = new MessagesAddress(myNumber); - msg.To.Add(address); - msg.Text = "Tizen C# test sms message"; - msg.SimId = SimSlotId.Sim1; - - /* TEST CODE */ - var result = await MessagesManager.SendMessageAsync(msg, false); - Assert.IsInstanceOf(result, "Should return SentResult instance"); - Assert.IsTrue(result == SentResult.Success, "SendMessageAsync failed"); - - await Task.Delay(10000); - MessagesManager.MessageReceived -= EventHandlerMessageReceived; - - Assert.True(_flag, "Event for receiving message is fail"); - } - catch (NotSupportedException) - { - Assert.IsTrue(isSmsSupported == false, "Invalid NotSupportedException"); - } - catch (Exception ex) - { - Assert.Fail("Exception occurs. Msg : " + ex.ToString()); - } - } - - public void EventHandlerMessageReceived(object sender, EventArgs e) - { - _flag = true; - } - } -} diff --git a/tct-suite-vs/Tizen.Messages.Tests/testcase/TSMessagesSearchFilter.cs b/tct-suite-vs/Tizen.Messages.Tests/testcase/TSMessagesSearchFilter.cs deleted file mode 100755 index c32a2f1..0000000 --- a/tct-suite-vs/Tizen.Messages.Tests/testcase/TSMessagesSearchFilter.cs +++ /dev/null @@ -1,176 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using Tizen.System; -using System; - -namespace Tizen.Messaging.Messages.Tests -{ - - [TestFixture] - [Description("Tizen.Messaging.Messages.MessagesSearchFilter Tests")] - public class MessagesSearchFilterTests - { - bool isSmsSupported = false; - - [OneTimeSetUp] - public void OneTimeInit() - { - Information.TryGetValue("http://tizen.org/feature/network.telephony.sms", out isSmsSupported); - } - - [SetUp] - public void Init() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST"); - } - - [TearDown] - public void Destroy() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Postconditions for each TEST"); - } - - [Test] - [Category("P0")] - [Description("Create a search filter")] - [Property("SPEC", "Tizen.Messaging.Messages.MessagesSearchFilter.MessagesSearchFilter C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Kyeonghun Lee, kh9090.lee@samsung.com")] - public void MessagesSearchFilter_INIT() - { - try - { - /* TEST CODE */ - var filter = new MessagesSearchFilter(); - Assert.IsInstanceOf(filter, "Should return MessagesSearchFilter instance"); - } - catch (NotSupportedException) - { - Assert.IsTrue(isSmsSupported == false, "Invalid NotSupportedException"); - } - catch (Exception ex) - { - Assert.Fail("Exception occurs. Msg : " + ex.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test MessageBoxType property of MessagesSearchFilter")] - [Property("SPEC", "Tizen.Messaging.Messages.MessagesSearchFilter.MessageBoxType A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Kyeonghun Lee, kh9090.lee@samsung.com")] - public void MessageBoxType_PROPERTY() - { - try - { - /* PRECONDTION */ - var filter = new MessagesSearchFilter(); - Assert.IsInstanceOf(filter, "Should return MessagesSearchFilter instance"); - - /* TEST CODE */ - filter.MessageBoxType = MessageBoxType.Draft; - Assert.IsTrue(filter.MessageBoxType == MessageBoxType.Draft, "Set/Get MessagesSearchFilter.MessageBoxType failed"); - } - catch (NotSupportedException) - { - Assert.IsTrue(isSmsSupported == false, "Invalid NotSupportedException"); - } - catch (Exception ex) - { - Assert.Fail("Exception occurs. Msg : " + ex.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test MessageType property of MessagesSearchFilter")] - [Property("SPEC", "Tizen.Messaging.Messages.MessagesSearchFilter.MessageType A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Kyeonghun Lee, kh9090.lee@samsung.com")] - public void MessageType_PROPERTY() - { - try - { - /* PRECONDTION */ - var filter = new MessagesSearchFilter(); - Assert.IsInstanceOf(filter, "Should return MessagesSearchFilter instance"); - - /* TEST CODE */ - filter.MessageType = MessageType.Sms; - Assert.IsTrue(filter.MessageType == MessageType.Sms, "Set/Get MessagesSearchFilter.MessageType failed"); - } - catch (NotSupportedException) - { - Assert.IsTrue(isSmsSupported == false, "Invalid NotSupportedException"); - } - catch (Exception ex) - { - Assert.Fail("Exception occurs. Msg : " + ex.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test TextKeyword property of MessagesSearchFilter")] - [Property("SPEC", "Tizen.Messaging.Messages.MessagesSearchFilter.TextKeyword A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Kyeonghun Lee, kh9090.lee@samsung.com")] - public void TextKeyword_PROPERTY() - { - try - { - /* PRECONDTION */ - string keyword = "test"; - var filter = new MessagesSearchFilter(); - Assert.IsInstanceOf(filter, "Should return MessagesSearchFilter instance"); - - /* TEST CODE */ - filter.TextKeyword = keyword; - Assert.IsTrue(filter.TextKeyword == keyword, "Set/Get MessagesSearchFilter.TextKeyword failed"); - } - catch (NotSupportedException) - { - Assert.IsTrue(isSmsSupported == false, "Invalid NotSupportedException"); - } - catch (Exception ex) - { - Assert.Fail("Exception occurs. Msg : " + ex.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test AddressKeyword property of MessagesSearchFilter")] - [Property("SPEC", "Tizen.Messaging.Messages.MessagesSearchFilter.AddressKeyword A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Kyeonghun Lee, kh9090.lee@samsung.com")] - public void AddressKeyword_PROPERTY() - { - try - { - /* PRECONDTION */ - string keyword = "test"; - var filter = new MessagesSearchFilter(); - Assert.IsInstanceOf(filter, "Should return MessagesSearchFilter instance"); - - /* TEST CODE */ - filter.AddressKeyword = keyword; - Assert.IsTrue(filter.AddressKeyword == keyword, "Set/Get MessagesSearchFilter.AddressKeyword failed"); - } - catch (NotSupportedException) - { - Assert.IsTrue(isSmsSupported == false, "Invalid NotSupportedException"); - } - catch (Exception ex) - { - Assert.Fail("Exception occurs. Msg : " + ex.ToString()); - } - } - } -} diff --git a/tct-suite-vs/Tizen.Messages.Tests/testcase/TSMmsMessage.cs b/tct-suite-vs/Tizen.Messages.Tests/testcase/TSMmsMessage.cs deleted file mode 100755 index 8e47da6..0000000 --- a/tct-suite-vs/Tizen.Messages.Tests/testcase/TSMmsMessage.cs +++ /dev/null @@ -1,208 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.System; -using System.Collections.Generic; - -namespace Tizen.Messaging.Messages.Tests -{ - - [TestFixture] - [Description("Tizen.Messaging.Messages.MmsMessage Tests")] - - public class MmsMessageTests - { - bool isSmsSupported = false; - bool isMmsSupported = false; - - [OneTimeSetUp] - public void GetFeature() - { - Information.TryGetValue("http://tizen.org/feature/network.telephony.sms", out isSmsSupported); - Information.TryGetValue("http://tizen.org/feature/network.telephony.mms", out isMmsSupported); - } - - [SetUp] - public void Init() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST"); - } - - [TearDown] - public void Destroy() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Postconditions for each TEST"); - } - - [Test] - [Category("P0")] - [Description("Create a mms message")] - [Property("SPEC", "Tizen.Messaging.Messages.MmsMessage.MmsMessage C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Kyeonghun Lee, kh9090.lee@samsung.com")] - public void MmsMessage_INIT() - { - try - { - /* TEST CODE */ - var msg = new MmsMessage(); - Assert.IsInstanceOf(msg, "Should return MmsMessage instance"); - } - catch (NotSupportedException) - { - Assert.IsTrue(isSmsSupported == false || isMmsSupported == false, "Invalid NotSupportedException"); - } - catch (Exception ex) - { - Assert.Fail("Exception occurs. Msg : " + ex.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test Subject property of MmsMessage")] - [Property("SPEC", "Tizen.Messaging.Messages.MmsMessage.Subject A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Kyeonghun Lee, kh9090.lee@samsung.com")] - public void Subject_PROPERTY() - { - try - { - /* PRECONDTION */ - string testSubject = "test"; - var msg = new MmsMessage(); - Assert.IsInstanceOf(msg, "Should return mms message instance"); - - /* TEST CODE */ - msg.Subject = testSubject; - Assert.IsTrue(msg.Subject == testSubject, "Set/Get Message.Subject failed"); - } - catch (NotSupportedException) - { - Assert.IsTrue(isSmsSupported == false || isMmsSupported == false, "Invalid NotSupportedException"); - } - catch (Exception ex) - { - Assert.Fail("Exception occurs. Msg : " + ex.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test To property of MmsMessage")] - [Property("SPEC", "Tizen.Messaging.Messages.MmsMessage.To A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Kyeonghun Lee, kh9090.lee@samsung.com")] - public void To_PROPERTY_READ_ONLY() - { - try - { - /* PRECONDTION */ - var msg = new MmsMessage(); - Assert.IsInstanceOf(msg, "Should return mms message instance"); - - /* TEST CODE */ - var to = msg.To; - Assert.IsInstanceOf>(to, "Should return ICollection instance"); - } - catch (NotSupportedException) - { - Assert.IsTrue(isSmsSupported == false || isMmsSupported == false, "Invalid NotSupportedException"); - } - catch (Exception ex) - { - Assert.Fail("Exception occurs. Msg : " + ex.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test Cc property of MmsMessage")] - [Property("SPEC", "Tizen.Messaging.Messages.MmsMessage.Cc A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Kyeonghun Lee, kh9090.lee@samsung.com")] - public void Cc_PROPERTY_READ_ONLY() - { - try - { - /* PRECONDTION */ - var msg = new MmsMessage(); - Assert.IsInstanceOf(msg, "Should return mms message instance"); - - /* TEST CODE */ - var cc = msg.Cc; - Assert.IsInstanceOf>(cc, "Should return ICollection instance"); - } - catch (NotSupportedException) - { - Assert.IsTrue(isSmsSupported == false || isMmsSupported == false, "Invalid NotSupportedException"); - } - catch (Exception ex) - { - Assert.Fail("Exception occurs. Msg : " + ex.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test Bcc property of MmsMessage")] - [Property("SPEC", "Tizen.Messaging.Messages.MmsMessage.Bcc A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Kyeonghun Lee, kh9090.lee@samsung.com")] - public void Bcc_PROPERTY_READ_ONLY() - { - try - { - /* PRECONDTION */ - var msg = new MmsMessage(); - Assert.IsInstanceOf(msg, "Should return mms message instance"); - - /* TEST CODE */ - var bcc = msg.Bcc; - Assert.IsInstanceOf>(bcc, "Should return ICollection instance"); - } - catch (NotSupportedException) - { - Assert.IsTrue(isSmsSupported == false || isMmsSupported == false, "Invalid NotSupportedException"); - } - catch (Exception ex) - { - Assert.Fail("Exception occurs. Msg : " + ex.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test Attachments property of MmsMessage")] - [Property("SPEC", "Tizen.Messaging.Messages.MmsMessage.Attachments A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Kyeonghun Lee, kh9090.lee@samsung.com")] - public void Attachments_PROPERTY_READ_ONLY() - { - try - { - /* PRECONDTION */ - var msg = new MmsMessage(); - Assert.IsInstanceOf(msg, "Should return mms message instance"); - - /* TEST CODE */ - var attachments = msg.Attachments; - Assert.IsInstanceOf>(attachments, "Should return ICollection instance"); - } - catch (NotSupportedException) - { - Assert.IsTrue(isSmsSupported == false || isMmsSupported == false, "Invalid NotSupportedException"); - } - catch (Exception ex) - { - Assert.Fail("Exception occurs. Msg : " + ex.ToString()); - } - } - } -} diff --git a/tct-suite-vs/Tizen.Messages.Tests/testcase/TSSmsMessage.cs b/tct-suite-vs/Tizen.Messages.Tests/testcase/TSSmsMessage.cs deleted file mode 100755 index 7a84eb6..0000000 --- a/tct-suite-vs/Tizen.Messages.Tests/testcase/TSSmsMessage.cs +++ /dev/null @@ -1,88 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.System; -using System.Collections.Generic; - -namespace Tizen.Messaging.Messages.Tests -{ - - [TestFixture] - [Description("Tizen.Messaging.Messages.SmsMessage Tests")] - public class SmsMessageTests - { - bool isSmsSupported = false; - - [OneTimeSetUp] - public void GetFeature() - { - Information.TryGetValue("http://tizen.org/feature/network.telephony.sms", out isSmsSupported); - } - - [SetUp] - public void Init() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST"); - } - - [TearDown] - public void Destroy() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Postconditions for each TEST"); - } - - [Test] - [Category("P0")] - [Description("Create a sms message")] - [Property("SPEC", "Tizen.Messaging.Messages.SmsMessage.SmsMessage C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Kyeonghun Lee, kh9090.lee@samsung.com")] - public void SmsMessage_INIT() - { - try - { - /* TEST CODE */ - var msg = new SmsMessage(); - Assert.IsInstanceOf(msg, "Should return SmsMessage instance"); - } - catch (NotSupportedException) - { - Assert.IsTrue(isSmsSupported == false, "Invalid NotSupportedException"); - } - catch (Exception ex) - { - Assert.Fail("Exception occurs. Msg : " + ex.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test To property of SmsMessage")] - [Property("SPEC", "Tizen.Messaging.Messages.SmsMessage.To A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Kyeonghun Lee, kh9090.lee@samsung.com")] - public void To_PROPERTY_READ_ONLY() - { - try - { - /* PRECONDTION */ - var msg = new SmsMessage(); - Assert.IsInstanceOf(msg, "Should return sms message instance"); - - /* TEST CODE */ - var to = msg.To; - Assert.IsInstanceOf>(to, "Should return ICollection instance"); - } - catch (NotSupportedException) - { - Assert.IsTrue(isSmsSupported == false, "Invalid NotSupportedException"); - } - catch (Exception ex) - { - Assert.Fail("Exception occurs. Msg : " + ex.ToString()); - } - } - } -} diff --git a/tct-suite-vs/Tizen.Messages.Tests/testcase/support/PreconditionUtils.cs b/tct-suite-vs/Tizen.Messages.Tests/testcase/support/PreconditionUtils.cs deleted file mode 100755 index 76b249f..0000000 --- a/tct-suite-vs/Tizen.Messages.Tests/testcase/support/PreconditionUtils.cs +++ /dev/null @@ -1,100 +0,0 @@ -/* -* Copyright (c) 2016 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 NUnit.Framework.TUnit; -using NUnit.Framework; -using System; -using System.IO; - -namespace Tizen.Messaging.Messages.Tests -{ - public class PreconditionUtils - { - public static string MESSAGES_MOBILE_NUMBER = null; - - public static void SetPrecondition() - { - string result = ReadFile("/opt/usr/home/owner/share/tct/preconfigure.json"); - int index = 0; - string[] resultArray = StringParser(result); - - if (resultArray == null) - { - LogUtils.Write(LogUtils.ERROR, LogUtils.TAG, "StringParser failed " + result); - return; - } - - Assert.Greater(resultArray?.Length, 0, "resultArray can not be null"); - - foreach (string item in resultArray) - { - switch (item) - { - case "MESSAGES_MOBILE_NUMBER": - // Remove backslash - resultArray[index + 1] = resultArray[index + 1].Replace("\\", ""); - MESSAGES_MOBILE_NUMBER = resultArray[index + 1]; - break; - - default: - break; - } - index++; - } - } - - private static string ReadFile(string path) - { - string result = null; - string url = path; - - StreamReader reader = null; - try - { - reader = File.OpenText(path); - result = reader.ReadToEnd(); - } - catch (Exception e) - { - LogUtils.Write(LogUtils.ERROR, LogUtils.TAG, "File read error : " + e.Message); - } - - reader?.Dispose(); - return result; - } - private static string[] StringParser(string TCID) - { - TCID = TCID.Replace(": \"", ":\""); - TCID = TCID.Replace(" ", ""); - TCID = TCID.Replace("\n", ""); - TCID = TCID.Replace("\n", ""); - - string[] delimiter = { "[{\"", "\":\"", "\",\"", "\":", ",\"", "\"}]", "}" }; - string[] stringPieces = null; - - try - { - stringPieces = TCID.Split(delimiter, StringSplitOptions.None); - } - catch (Exception e) - { - LogUtils.Write(LogUtils.ERROR, LogUtils.TAG, "ResultParser : " + e.Message); - } - - return stringPieces; - } - } -} diff --git a/tct-suite-vs/Tizen.Messages.Tests/tizen-manifest.xml b/tct-suite-vs/Tizen.Messages.Tests/tizen-manifest.xml deleted file mode 100755 index 93809e2..0000000 --- a/tct-suite-vs/Tizen.Messages.Tests/tizen-manifest.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - Tizen.Messages.Tests.png - - - - - http://tizen.org/privilege/message.read - http://tizen.org/privilege/message.write - http://tizen.org/privilege/mediastorage - http://tizen.org/privilege/telephony - http://tizen.org/privilege/appmanager.launch - -