EndProject\r
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Stt.Manual.Tests", "Tizen.Stt.Manual.Tests\Tizen.Stt.Manual.Tests.csproj", "{D09A0ACE-E070-4694-9E3C-F81F54C27A69}"\r
EndProject\r
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Messages.Tests", "Tizen.Messages.Tests\Tizen.Messages.Tests.csproj", "{22673A2C-2B03-4114-ADF3-B6B952F758C9}"\r
-EndProject\r
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.RemoteView.Tests", "Tizen.RemoteView.Tests\Tizen.RemoteView.Tests.csproj", "{D23C0C2B-2361-42CA-8BC6-F2F9325A8158}"\r
EndProject\r
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.WidgetApplication.Manual.Tests", "Tizen.WidgetApplication.Manual.Tests\Tizen.WidgetApplication.Manual.Tests.csproj", "{2464E62B-ABF3-4F66-94D3-F75F4A6B015B}"\r
+++ /dev/null
-/*
- * 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
+++ /dev/null
-<Project Sdk="Microsoft.NET.Sdk">
-
- <!-- Property Group for .NET Core Project -->
- <PropertyGroup>
- <OutputType>Exe</OutputType>
- <TargetFramework>net6.0-tizen8.0</TargetFramework>
- <DisableImplicitTizenReferences>True</DisableImplicitTizenReferences>
- <TargetFrameworkIdentifier>Tizen</TargetFrameworkIdentifier>
- </PropertyGroup>
-
- <!-- Property Group for Tizen Project -->
- <PropertyGroup>
- <TizenCreateTpkOnBuild>true</TizenCreateTpkOnBuild>
- </PropertyGroup>
-
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugType>portable</DebugType>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>None</DebugType>
- </PropertyGroup>
-
- <ItemGroup>
- <Folder Include="lib\" />
- </ItemGroup>
-
- <Import Project="..\Common\dependencies.props" />
-
- <ItemGroup>
- <PackageReference Include="Tizen.NET" Version="$(TizenNETVersion)">
- <ExcludeAssets>Runtime</ExcludeAssets>
- </PackageReference>
- </ItemGroup>
-
- <ItemGroup>
- <ProjectReference Include="..\nunit.framework\nunit.framework.csproj" />
- <ProjectReference Include="..\nunitlite\nunitlite.csproj" />
- </ItemGroup>
-
- <!-- Include Nuget Package for Tizen Project building -->
-
-</Project>
+++ /dev/null
-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
+++ /dev/null
-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
+++ /dev/null
-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<Message>(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<Message>(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<Message>(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<Message>(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<Message>(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<Message>(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<Message>(msg, "Should return message instance");
-
- /* TEST CODE */
- var from = msg.From;
- Assert.IsInstanceOf<IReadOnlyCollection<MessagesAddress>>(from, "Should return IReadOnlyCollection<MessagesAddress> instance");
- }
- catch (NotSupportedException)
- {
- Assert.IsTrue(isSmsSupported == false, "Invalid NotSupportedException");
- }
- catch (Exception ex)
- {
- Assert.Fail("Exception occurs. Msg : " + ex.ToString());
- }
- }
- }
-}
+++ /dev/null
-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<SlotHandle> simList = Manager.Init();
- Assert.IsNotNull(simList, "simList is Null");
- Assert.IsInstanceOf<IEnumerable<SlotHandle>>(simList, "simList is Not of IEnumerable<SlotHandle> 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<MessageReceivedEventArgs> handler = null;
- handler = (object sender, MessageReceivedEventArgs args) =>
- {
- _flag = true;
- var message = args.ReceivedMessage;
- Assert.NotNull(message, "Should be readable");
- Assert.IsInstanceOf<Message>(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<SentResult>(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());
- }
- }
- }
-}
+++ /dev/null
-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<MessagesAddress>(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<MessagesAddress>(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());
- }
- }
- }
-}
+++ /dev/null
-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<MessagesAttachment>(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<MessagesAttachment>(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<MessagesAttachment>(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());
- }
- }
- }
-}
+++ /dev/null
-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<SlotHandle> simList = Manager.Init();
- Assert.IsNotNull(simList, "simList is Null");
- Assert.IsInstanceOf<IEnumerable<SlotHandle>>(simList, "simList is Not of IEnumerable<SlotHandle> 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<SmsMessage>(msg, "Should return sms message instance");
-
- var address = new MessagesAddress(destinationNumber);
- Assert.IsInstanceOf<MessagesAddress>(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<SentResult>(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<MmsMessage>(msg, "Should return mms message instance");
-
- var address = new MessagesAddress(destinationNumber);
- Assert.IsInstanceOf<MessagesAddress>(address, "Should return address instance");
- msg.To.Add(address);
-
- var attachement = new MessagesAttachment(MediaType.Image, imagePath);
- Assert.IsInstanceOf<MessagesAttachment>(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<SentResult>(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<SmsMessage>(msg, "Should return sms message instance");
-
- var address = new MessagesAddress(destinationNumber);
- Assert.IsInstanceOf<MessagesAddress>(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<SentResult>(result, "Should return SentResult instance");
- Assert.IsTrue(result == SentResult.Success, "SendMessageAsync failed");
-
- var filter = new MessagesSearchFilter();
- Assert.IsInstanceOf<MessagesSearchFilter>(filter, "Should return filter instance");
-
- filter.TextKeyword = "checking";
- filter.AddressKeyword = destinationNumber;
-
- var resultMessages = await MessagesManager.SearchMessageAsync(filter);
- Assert.IsInstanceOf<IEnumerable<Message>>(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<SmsMessage>(msg, "Should return sms message instance");
-
- var address = new MessagesAddress(destinationNumber);
- Assert.IsInstanceOf<MessagesAddress>(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<SentResult>(result, "Should return SentResult instance");
- Assert.IsTrue(result == SentResult.Success, "SendMessageAsync failed");
-
- var filter = new MessagesSearchFilter();
- Assert.IsInstanceOf<MessagesSearchFilter>(filter, "Should return filter instance");
-
- filter.TextKeyword = "Tizen";
-
- /* TEST CODE*/
- var resultMessages = await MessagesManager.SearchMessageAsync(filter);
- Assert.IsInstanceOf<IEnumerable<Message>>(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<SentResult>(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;
- }
- }
-}
+++ /dev/null
-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<MessagesSearchFilter>(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<MessagesSearchFilter>(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<MessagesSearchFilter>(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<MessagesSearchFilter>(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<MessagesSearchFilter>(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());
- }
- }
- }
-}
+++ /dev/null
-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<MmsMessage>(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<MmsMessage>(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<MmsMessage>(msg, "Should return mms message instance");
-
- /* TEST CODE */
- var to = msg.To;
- Assert.IsInstanceOf<ICollection<MessagesAddress>>(to, "Should return ICollection<MessagesAddress> 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<MmsMessage>(msg, "Should return mms message instance");
-
- /* TEST CODE */
- var cc = msg.Cc;
- Assert.IsInstanceOf<ICollection<MessagesAddress>>(cc, "Should return ICollection<MessagesAddress> 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<MmsMessage>(msg, "Should return mms message instance");
-
- /* TEST CODE */
- var bcc = msg.Bcc;
- Assert.IsInstanceOf<ICollection<MessagesAddress>>(bcc, "Should return ICollection<MessagesAddress> 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<MmsMessage>(msg, "Should return mms message instance");
-
- /* TEST CODE */
- var attachments = msg.Attachments;
- Assert.IsInstanceOf<IList<MessagesAttachment>>(attachments, "Should return ICollection<MessagesAttachment> instance");
- }
- catch (NotSupportedException)
- {
- Assert.IsTrue(isSmsSupported == false || isMmsSupported == false, "Invalid NotSupportedException");
- }
- catch (Exception ex)
- {
- Assert.Fail("Exception occurs. Msg : " + ex.ToString());
- }
- }
- }
-}
+++ /dev/null
-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<SmsMessage>(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<SmsMessage>(msg, "Should return sms message instance");
-
- /* TEST CODE */
- var to = msg.To;
- Assert.IsInstanceOf<ICollection<MessagesAddress>>(to, "Should return ICollection<MessagesAddress> instance");
- }
- catch (NotSupportedException)
- {
- Assert.IsTrue(isSmsSupported == false, "Invalid NotSupportedException");
- }
- catch (Exception ex)
- {
- Assert.Fail("Exception occurs. Msg : " + ex.ToString());
- }
- }
- }
-}
+++ /dev/null
-/*
-* 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;
- }
- }
-}
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<manifest xmlns="http://tizen.org/ns/packages" api-version="8.0" package="Tizen.Messages.Tests" version="1.0.0">\r
- <profile name="common" />\r
- <service-application appid="Tizen.Messages.Tests" exec="Tizen.Messages.Tests.dll" type="dotnet">\r
- <icon>Tizen.Messages.Tests.png</icon>\r
- <label>Tizen.Messages.Tests</label>\r
- <background-category value="background-network" />\r
- </service-application>\r
- <privileges>\r
- <privilege>http://tizen.org/privilege/message.read</privilege>\r
- <privilege>http://tizen.org/privilege/message.write</privilege>\r
- <privilege>http://tizen.org/privilege/mediastorage</privilege>\r
- <privilege>http://tizen.org/privilege/telephony</privilege>\r
- <privilege>http://tizen.org/privilege/appmanager.launch</privilege>\r
- </privileges>\r
-</manifest>\r