EndProject\r
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.OAuth2.Tests", "Tizen.OAuth2.Tests\Tizen.OAuth2.Tests.csproj", "{0C5D3A30-65AD-4419-9584-67D3D596131A}"\r
EndProject\r
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Maps.Tests", "Tizen.Maps.Tests\Tizen.Maps.Tests.csproj", "{B0360617-24BA-4449-85A5-80420150C84F}"\r
-EndProject\r
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.MediaVision.Tests", "Tizen.MediaVision.Tests\Tizen.MediaVision.Tests.csproj", "{B4408568-4DBB-41F8-BB41-508A07614129}"\r
EndProject\r
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.MediaVision.Manual.Tests", "Tizen.MediaVision.Manual.Tests\Tizen.MediaVision.Manual.Tests.csproj", "{032CFAF5-0B1C-4828-AE57-7AB52544596D}"\r
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.Maps.Manual.Tests", "Tizen.Maps.Manual.Tests\Tizen.Maps.Manual.Tests.csproj", "{552E1436-AF4D-4DAA-BA0A-CA43A050DEB0}"\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.FidoClient.Tests", "Tizen.FidoClient.Tests\Tizen.FidoClient.Tests.csproj", "{6BA4E0F6-A125-4A12-AE89-30604126C90D}"\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 NUnit.Framework;
-using Xamarin.Forms;
-
-namespace XamarinApplication.Tizen
-{
- class Program : global::Xamarin.Forms.Platform.Tizen.FormsApplication
- {
- private Application _app;
- protected override void OnCreate()
- {
- Console.WriteLine("TCT : OnCreate()");
- base.OnCreate();
- if (ManualTest.IsWearable())
- {
- _app = new WearableTemplate.MainPage();
- }
- else
- {
- _app = new ManualTemplate.MainPage();
- }
- LoadApplication(_app);
- }
-
- static void Main(string[] args)
- {
- Console.WriteLine("TCT : Main()");
- var app = new Program();
- global::Xamarin.Forms.Forms.Init(app);
- app.Run(args);
- }
- }
-}
+++ /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>
-
- <!-- Include Nuget Package for Tizen Project building -->
- <ItemGroup>
- <ProjectReference Include="..\Template\ManualTemplate\ManualTemplate.csproj" />
- </ItemGroup>
-
-</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.Maps.Manual.Tests", "Tizen.Maps.Manual.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}") = "ManualTemplate", "..\Template\ManualTemplate\ManualTemplate.csproj", "{269F89A7-E648-4811-8421-844E00ACF5F0}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ManualTemplateForWearable", "..\Template\ManualTemplateForWearable\ManualTemplateForWearable.csproj", "{D36CED01-29BD-4EB3-8903-62E0BF2A822D}"
-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
- {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.NUI|Any CPU.ActiveCfg = Debug|Any CPU
- {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.NUI|Any CPU.Build.0 = Debug|Any CPU
- {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.Release|Any CPU.Build.0 = Release|Any CPU
- {269F89A7-E648-4811-8421-844E00ACF5F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {269F89A7-E648-4811-8421-844E00ACF5F0}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {269F89A7-E648-4811-8421-844E00ACF5F0}.NUI|Any CPU.ActiveCfg = Debug|Any CPU
- {269F89A7-E648-4811-8421-844E00ACF5F0}.NUI|Any CPU.Build.0 = Debug|Any CPU
- {269F89A7-E648-4811-8421-844E00ACF5F0}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {269F89A7-E648-4811-8421-844E00ACF5F0}.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
-/*
-* 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 System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-using NUnit.Framework;
-
-namespace Tizen.Maps.Tests
-{
- [TestFixture]
- [Description("Tizen.Maps.MapGestureEventArgs test class")]
- public class MapGestureEventArgsTests
- {
- private MapView s_mapview;
- private delegate void TestStep();
- private List<MapGestureEventArgs> s_eventArgsList = new List<MapGestureEventArgs>();
- private EventHandler<MapGestureEventArgs> s_handler;
-
- private async Task<MapGestureEventArgs> TestMapViewEvent(string eventName, TestStep addHandler, TestStep removeHandler)
- {
- // PRECONDITION
- s_mapview = MapViewHelper.GetMapViewTestPage($"<span color=#FFFFFF>1. Please do</span> <span color=#FFFF00>{eventName}</span> <span color=#FFFFFF>gesture on the Map.</span>");
- Assert.IsNotNull(s_mapview, "PRECONDITION: Failed to get map view object for testing");
-
- s_mapview.ZoomLevel = 10;
- s_mapview.Center = new Geocoordinates(37, 127);
- s_mapview.Show();
-
- // TEST CODE
- MapGestureEventArgs eventArg = null;
- s_handler = (s, e) => {
- eventArg = e;
- s_eventArgsList.Add(e);
- ManualTest.Confirm();
- };
-
- addHandler();
- await ManualTest.WaitForConfirm();
-
- // POSTCONDITION
- removeHandler();
- MapViewHelper.ClearMapViewTestPage();
-
- Console.WriteLine($"Event: GestureType = {eventArg.GestureType}, Position = {eventArg.Position}, TouchCount = {eventArg.TouchCount}, ZoomFactor = {eventArg.ZoomFactor}, RotationAngle = {eventArg.RotationAngle}, Geocoordinates = {eventArg.Geocoordinates}");
- return eventArg;
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets GestureType property and checks if it has valid value")]
- [Property("SPEC", "Tizen.Maps.MapGestureEventArgs.GestureType A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRE")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- [Precondition(1, "N/A")]
- [Step(1, "Click Run button. If feature is not supported, TC will automatically pass.")]
- [Step(2, "Perform Scroll gesture on the map.")]
- [Step(3, "If the gesture is not supported on the device, please test it with Scroll buttons instead, then report the result manually.")]
- [Postcondition(1, "N/A")]
- public async Task GestureType_PROPERTY_GET_ENUM_GESTURETYPE_SCROLL()
- {
- if (MapsCapabilities.Maps.IsSupported == false) return;
- MapGestureEventArgs eventArg = await TestMapViewEvent("Scroll", () => s_mapview.Scrolled += s_handler, () => s_mapview.Scrolled -= s_handler);
- Assert.IsNotNull(eventArg, $"Expected none null MapGestureEventArgs object");
- Assert.IsTrue(GestureType.Scroll == eventArg.GestureType, $"Expected: {GestureType.Scroll}, Actual: {eventArg.GestureType}");
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets GestureType property and checks if it has valid value")]
- [Property("SPEC", "Tizen.Maps.MapGestureEventArgs.GestureType A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRE")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- [Precondition(1, "N/A")]
- [Step(1, "Click Run button. If feature is not supported, TC will automatically pass.")]
- [Step(2, "Perform Two finger zoom gesture on the map.")]
- [Step(3, "If the gesture is not supported on the device, please test it with Zoom buttons instead, then report the result manually.")]
- [Postcondition(1, "N/A")]
- public async Task GestureType_PROPERTY_GET_ENUM_GESTURETYPE_ZOOM()
- {
- if (MapsCapabilities.Maps.IsSupported == false) return;
- MapGestureEventArgs eventArgs = await TestMapViewEvent("Zoom", () => s_mapview.TwoFingerZoomed += s_handler, () => s_mapview.TwoFingerZoomed -= s_handler);
- Assert.IsNotNull(eventArgs, $"Expected none null MapGestureEventArgs object");
- Assert.IsTrue(GestureType.Zoom == eventArgs.GestureType, $"Expected: {GestureType.Zoom}, Actual: {eventArgs.GestureType}");
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets GestureType property and checks if it has valid value")]
- [Property("SPEC", "Tizen.Maps.MapGestureEventArgs.GestureType A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRE")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- [Precondition(1, "N/A")]
- [Step(1, "Click Run button. If feature is not supported, TC will automatically pass.")]
- [Step(2, "Perform Click gesture on the map.")]
- [Step(3, "If the gesture is not supported on the device, please report it as 'N/A'.")]
- [Postcondition(1, "N/A")]
- public async Task GestureType_PROPERTY_GET_ENUM_GESTURETYPE_CLICK()
- {
- if (MapsCapabilities.Maps.IsSupported == false) return;
- MapGestureEventArgs eventArgs = await TestMapViewEvent("Click", () => s_mapview.Clicked += s_handler, () => s_mapview.Clicked -= s_handler);
- Assert.IsNotNull(eventArgs, $"Expected none null MapGestureEventArgs object");
- Assert.IsTrue(GestureType.Click == eventArgs.GestureType, $"Expected: {GestureType.Click}, Actual: {eventArgs.GestureType}");
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets GestureType property and checks if it has valid value")]
- [Property("SPEC", "Tizen.Maps.MapGestureEventArgs.GestureType A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRE")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- [Precondition(1, "N/A")]
- [Step(1, "Click Run button. If feature is not supported, TC will automatically pass.")]
- [Step(2, "Perform Double click gesture on the map.")]
- [Step(3, "If the gesture is not supported on the device, please test it with Zoom-in (+) button instead, then report the result manually.")]
- [Postcondition(1, "N/A")]
- public async Task GestureType_PROPERTY_GET_ENUM_GESTURETYPE_DOUBLECLICK()
- {
- if (MapsCapabilities.Maps.IsSupported == false) return;
- MapGestureEventArgs eventArgs = await TestMapViewEvent("DoubleClick", () => s_mapview.DoubleClicked += s_handler, () => s_mapview.DoubleClicked -= s_handler);
- Assert.IsNotNull(eventArgs, $"Expected none null MapGestureEventArgs object");
- Assert.IsTrue(GestureType.DoubleClick == eventArgs.GestureType, $"Expected: {GestureType.DoubleClick}, Actual: {eventArgs.GestureType}");
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets GestureType property and checks if it has valid value")]
- [Property("SPEC", "Tizen.Maps.MapGestureEventArgs.GestureType A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRE")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- [Precondition(1, "N/A")]
- [Step(1, "Click Run button. If feature is not supported, TC will automatically pass.")]
- [Step(2, "Perform Two finger click gesture on the map.")]
- [Step(3, "If the gesture is not supported on the device, please test it with Zoom-out (-) button instead, then report the result manually.")]
- [Step(4, "Time duration for two-finger click must be within 500ms.")]
- [Postcondition(1, "N/A")]
- public async Task GestureType_PROPERTY_GET_ENUM_GESTURETYPE_TWOFINGERCLICK()
- {
- if (MapsCapabilities.Maps.IsSupported == false) return;
- MapGestureEventArgs eventArgs = await TestMapViewEvent("TwoFingerClick", () => s_mapview.TwoFingerClicked += s_handler, () => s_mapview.TwoFingerClicked -= s_handler);
- Assert.IsNotNull(eventArgs, $"Expected none null MapGestureEventArgs object");
- Assert.IsTrue(GestureType.TwoFingerClick == eventArgs.GestureType, $"Expected: {GestureType.TwoFingerClick}, Actual: {eventArgs.GestureType}");
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets GestureType property and checks if it has valid value")]
- [Property("SPEC", "Tizen.Maps.MapGestureEventArgs.GestureType A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRE")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- [Precondition(1, "N/A")]
- [Step(1, "Click Run button. If feature is not supported, TC will automatically pass.")]
- [Step(2, "Perform Two finger rotation gesture on the map.")]
- [Step(3, "If the gesture is not supported on the device, please test it with Rotation buttons instead, then report the result manually.")]
- [Postcondition(1, "N/A")]
- public async Task GestureType_PROPERTY_GET_ENUM_GESTURETYPE_ROTATE()
- {
- if (MapsCapabilities.Maps.IsSupported == false) return;
- MapGestureEventArgs eventArgs = await TestMapViewEvent("Rotation", () => s_mapview.TwoFingerRotated += s_handler, () => s_mapview.TwoFingerRotated -= s_handler);
- Assert.IsNotNull(eventArgs, $"Expected none null MapGestureEventArgs object");
- Assert.IsTrue(GestureType.Rotation == eventArgs.GestureType, $"Expected: {GestureType.Rotation}, Actual: {eventArgs.GestureType}");
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets GestureType property and checks if it has valid value")]
- [Property("SPEC", "Tizen.Maps.MapGestureEventArgs.GestureType A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRE")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- [Precondition(1, "N/A")]
- [Step(1, "Click Run button. If feature is not supported, TC will automatically pass.")]
- [Step(2, "Perform Long press gesture on the map.")]
- [Step(3, "If the gesture is not supported on the device, please report it as 'N/A'.")]
- [Postcondition(1, "N/A")]
- public async Task GestureType_PROPERTY_GET_ENUM_GESTURETYPE_LONGPRESS()
- {
- if (MapsCapabilities.Maps.IsSupported == false) return;
- MapGestureEventArgs eventArgs = await TestMapViewEvent("LongPress", () => s_mapview.LongPressed += s_handler, () => s_mapview.LongPressed -= s_handler);
- Assert.IsNotNull(eventArgs, $"Expected none null MapGestureEventArgs object");
- Assert.IsTrue(GestureType.LongPress == eventArgs.GestureType, $"Expected: {GestureType.LongPress}, Actual: {eventArgs.GestureType}");
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Position property and checks if it has valid value")]
- [Property("SPEC", "Tizen.Maps.MapGestureEventArgs.Position A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- [Precondition(1, "N/A")]
- [Step(1, "Click Run button. If feature is not supported, TC will automatically pass.")]
- [Step(2, "Perform Click gesture on the map.")]
- [Step(3, "If the gesture is not supported on the device, please report it as 'N/A'.")]
- [Postcondition(1, "N/A")]
- public async Task Position_PROPERTY_READ_ONLY()
- {
- if (MapsCapabilities.Maps.IsSupported == false) return;
- MapGestureEventArgs eventArg = await TestMapViewEvent("Click", () => s_mapview.Clicked += s_handler, () => s_mapview.Clicked -= s_handler);
- Assert.IsNotNull(eventArg, $"Expected none null MapGestureEventArgs object");
- Assert.IsTrue(eventArg.Position.X > 0, $"Expected: X > 0, Actual: {eventArg.Position.X}");
- Assert.IsTrue(eventArg.Position.Y > 0, $"Expected: Y > 0, Actual: {eventArg.Position.Y}");
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets TouchCount property and checks if it has valid value")]
- [Property("SPEC", "Tizen.Maps.MapGestureEventArgs.TouchCount A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- [Precondition(1, "N/A")]
- [Step(1, "Click Run button. If feature is not supported, TC will automatically pass.")]
- [Step(2, "Perform Click gesture on the map.")]
- [Step(3, "If the gesture is not supported on the device, please report it as 'N/A'.")]
- [Postcondition(1, "N/A")]
- public async Task TouchCount_PROPERTY_READ_ONLY()
- {
- if (MapsCapabilities.Maps.IsSupported == false) return;
- MapGestureEventArgs eventArg = await TestMapViewEvent("Click", () => s_mapview.Clicked += s_handler, () => s_mapview.Clicked -= s_handler);
- Assert.IsNotNull(eventArg, $"Expected none null MapGestureEventArgs object");
- Assert.IsTrue(eventArg.TouchCount > 0, $"Expected: TouchCount > 0, Actual: {eventArg.TouchCount}");
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets ZoomFactor property and checks if it has valid value")]
- [Property("SPEC", "Tizen.Maps.MapGestureEventArgs.ZoomFactor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- [Precondition(1, "N/A")]
- [Step(1, "Click Run button. If feature is not supported, TC will automatically pass.")]
- [Step(2, "Perform Two finger zoom gesture on the map.")]
- [Step(3, "If the gesture is not supported on the device, please test it with Zoom buttons instead, then report the result manually.")]
- [Postcondition(1, "N/A")]
- public async Task ZoomFactor_PROPERTY_READ_ONLY()
- {
- if (MapsCapabilities.Maps.IsSupported == false) return;
- MapGestureEventArgs eventArg = await TestMapViewEvent("Zoom", () => s_mapview.TwoFingerZoomed += s_handler, () => s_mapview.TwoFingerZoomed -= s_handler);
- Assert.IsNotNull(eventArg, $"Expected none null MapGestureEventArgs object");
- Assert.IsTrue(eventArg.ZoomFactor > 0, $"Expected: ZoomFactor > 0, Actual: {eventArg.ZoomFactor}");
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets RotationAngle property and checks if it has valid value")]
- [Property("SPEC", "Tizen.Maps.MapGestureEventArgs.RotationAngle A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- [Precondition(1, "N/A")]
- [Step(1, "Click Run button. If feature is not supported, TC will automatically pass.")]
- [Step(2, "Perform Two finger rotation gesture on the map.")]
- [Step(3, "If the gesture is not supported on the device, please test it with Rotation buttons instead, then report the result manually.")]
- [Postcondition(1, "N/A")]
- public async Task RotationAngle_PROPERTY_READ_ONLY()
- {
- if (MapsCapabilities.Maps.IsSupported == false) return;
- MapGestureEventArgs eventArg = await TestMapViewEvent("Rotation", () => s_mapview.TwoFingerRotated += s_handler, () => s_mapview.TwoFingerRotated -= s_handler);
- Assert.IsNotNull(eventArg, $"Expected none null MapGestureEventArgs object");
- Assert.IsTrue(eventArg.RotationAngle != 0, $"Expected: RotationAngle != 0, Actual: {eventArg.RotationAngle}");
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Geocoordinates property and checks if it has valid value")]
- [Property("SPEC", "Tizen.Maps.MapGestureEventArgs.Geocoordinates A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- [Precondition(1, "N/A")]
- [Step(1, "Click Run button. If feature is not supported, TC will automatically pass.")]
- [Step(2, "Perform Click gesture on the map.")]
- [Step(3, "If the gesture is not supported on the device, please report it as 'N/A'.")]
- [Postcondition(1, "N/A")]
- public async Task Geocoordinates_PROPERTY_READ_ONLY()
- {
- if (MapsCapabilities.Maps.IsSupported == false) return;
- MapGestureEventArgs eventArg = await TestMapViewEvent("Click", () => s_mapview.Clicked += s_handler, () => s_mapview.Clicked -= s_handler);
- Assert.IsNotNull(eventArg, $"Expected none null MapGestureEventArgs object");
- Assert.IsTrue(eventArg.Geocoordinates.Latitude > 0, $"Expected: Latitude > 0, Actual: {eventArg.Geocoordinates.Latitude}");
- Assert.IsTrue(eventArg.Geocoordinates.Longitude > 0, $"Expected: Longitude > 0, Actual: {eventArg.Geocoordinates.Longitude}");
- }
- }
-}
+++ /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;
-using System;
-using ElmSharp;
-using System.Threading.Tasks;
-
-namespace Tizen.Maps.Tests
-{
- [TestFixture]
- [Description("Tizen.Maps.MapView test class")]
- public class MapViewTests
- {
- private MapView s_mapview;
-
- private async Task TestMapViewEvent(GestureType type)
- {
- // PRECONDITION
- s_mapview = MapViewHelper.GetMapViewTestPage($"<span color=#FFFFFF>1. Please do</span> <span color=#FFFF00>{type}</span> <span color=#FFFFFF>gesture on the Map.</span>");
- Assert.IsNotNull(s_mapview, "PRECONDITION: Failed to get map view object for testing");
-
- s_mapview.ZoomLevel = 1;
- s_mapview.Center = new Geocoordinates(0, 0);
- s_mapview.Show();
-
- // TEST CODE
- bool eventFlag = false;
- EventHandler<MapGestureEventArgs> handler = (s, e) =>
- {
- Console.WriteLine("Inside Gesture Event Handler");
- Console.WriteLine($"Event: GestureType = {e.GestureType}, Position = {e.Position}, TouchCount = {e.TouchCount}, ZoomFactor = {e.ZoomFactor}, RotationAngle = {e.RotationAngle}, Geocoordinates = {e.Geocoordinates}");
- eventFlag = true;
- ManualTest.Confirm();
- };
-
- switch (type)
- {
- case GestureType.Scroll: s_mapview.Scrolled += handler; break;
- case GestureType.Zoom: s_mapview.TwoFingerZoomed += handler; break;
- case GestureType.Click: s_mapview.Clicked += handler; break;
- case GestureType.DoubleClick: s_mapview.DoubleClicked += handler; break;
- case GestureType.TwoFingerClick: s_mapview.TwoFingerClicked += handler; break;
- case GestureType.Rotation: s_mapview.TwoFingerRotated += handler; break;
- case GestureType.LongPress: s_mapview.LongPressed += handler; break;
- }
-
- await ManualTest.WaitForConfirm();
- Assert.IsTrue(eventFlag, $"{type} event handler should get called");
-
- // POSTCONDITION
- switch (type)
- {
- case GestureType.Scroll: s_mapview.Scrolled -= handler; break;
- case GestureType.Zoom: s_mapview.TwoFingerZoomed -= handler; break;
- case GestureType.Click: s_mapview.Clicked -= handler; break;
- case GestureType.DoubleClick: s_mapview.DoubleClicked -= handler; break;
- case GestureType.TwoFingerClick: s_mapview.TwoFingerClicked -= handler; break;
- case GestureType.Rotation: s_mapview.TwoFingerRotated -= handler; break;
- case GestureType.LongPress: s_mapview.LongPressed -= handler; break;
- }
-
- MapViewHelper.ClearMapViewTestPage();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Event raised when MapView is clicked")]
- [Property("SPEC", "Tizen.Maps.MapView.Clicked E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- [Precondition(1, "N/A")]
- [Step(1, "Click Run button. If feature is not supported, TC will automatically pass.")]
- [Step(2, "Perform Click gesture on the map.")]
- [Step(3, "If the gesture is not supported on the device, please report it as 'N/A'.")]
- [Postcondition(1, "N/A")]
- public async Task Clicked_CHECK_EVENT()
- {
- if (MapsCapabilities.Maps.IsSupported == false) return;
- await TestMapViewEvent(GestureType.Click);
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Event raised when MapView is double clicked")]
- [Property("SPEC", "Tizen.Maps.MapView.DoubleClicked E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- [Precondition(1, "N/A")]
- [Step(1, "Click Run button. If feature is not supported, TC will automatically pass.")]
- [Step(2, "Perform Double click gesture on the map.")]
- [Step(3, "If the gesture is not supported on the device, please test it with Zoom-in (+) button instead, then report the result manually.")]
- [Postcondition(1, "N/A")]
- public async Task DoubleClicked_CHECK_EVENT()
- {
- if (MapsCapabilities.Maps.IsSupported == false) return;
- await TestMapViewEvent(GestureType.DoubleClick);
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Event raised when MapView is LongPressed")]
- [Property("SPEC", "Tizen.Maps.MapView.LongPressed E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- [Precondition(1, "N/A")]
- [Step(1, "Click Run button. If feature is not supported, TC will automatically pass.")]
- [Step(2, "Perform Long press gesture on the map.")]
- [Step(3, "If the gesture is not supported on the device, please report it as 'N/A'.")]
- [Postcondition(1, "N/A")]
- public async Task LongPressed_CHECK_EVENT()
- {
- if (MapsCapabilities.Maps.IsSupported == false) return;
- await TestMapViewEvent(GestureType.LongPress);
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Event raised when MapView is TwoFingerRotated")]
- [Property("SPEC", "Tizen.Maps.MapView.TwoFingerRotated E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- [Precondition(1, "N/A")]
- [Step(1, "Click Run button. If feature is not supported, TC will automatically pass.")]
- [Step(2, "Perform Two finger rotation gesture on the map.")]
- [Step(3, "If the gesture is not supported on the device, please test it with Rotation buttons instead, then report the result manually.")]
- [Postcondition(1, "N/A")]
- public async Task TwoFingerRotated_CHECK_EVENT()
- {
- if (MapsCapabilities.Maps.IsSupported == false) return;
- await TestMapViewEvent(GestureType.Rotation);
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Event raised when MapView is Scrolled")]
- [Property("SPEC", "Tizen.Maps.MapView.Scrolled E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- [Precondition(1, "N/A")]
- [Step(1, "Click Run button. If feature is not supported, TC will automatically pass.")]
- [Step(2, "Perform Scroll gesture on the map.")]
- [Step(3, "If the gesture is not supported on the device, please test it with Scroll buttons instead, then report the result manually.")]
- [Postcondition(1, "N/A")]
- public async Task Scrolled_CHECK_EVENT()
- {
- if (MapsCapabilities.Maps.IsSupported == false) return;
- await TestMapViewEvent(GestureType.Scroll);
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Event raised when MapView is TwoFingerClicked")]
- [Property("SPEC", "Tizen.Maps.MapView.TwoFingerClicked E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- [Precondition(1, "N/A")]
- [Step(1, "Click Run button. If feature is not supported, TC will automatically pass.")]
- [Step(2, "Perform Two finger click gesture on the map.")]
- [Step(3, "If the gesture is not supported on the device, please test it with Zoom-out (-) button instead, then report the result manually.")]
- [Step(4, "Time duration for two-finger click must be within 500ms.")]
- [Postcondition(1, "N/A")]
- public async Task TwoFingerClicked_CHECK_EVENT()
- {
- if (MapsCapabilities.Maps.IsSupported == false) return;
- await TestMapViewEvent(GestureType.TwoFingerClick);
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Event raised when MapView is TwoFingerZoomed")]
- [Property("SPEC", "Tizen.Maps.MapView.TwoFingerZoomed E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- [Precondition(1, "N/A")]
- [Step(1, "Click Run button. If feature is not supported, TC will automatically pass.")]
- [Step(2, "Perform Two finger zoom gesture on the map.")]
- [Step(3, "If the gesture is not supported on the device, please test it with Zoom buttons instead, then report the result manually.")]
- [Postcondition(1, "N/A")]
- public async Task TwoFingerZoomed_CHECK_EVENT()
- {
- if (MapsCapabilities.Maps.IsSupported == false) return;
- await TestMapViewEvent(GestureType.Zoom);
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Event raised when MapView is ViewReady")]
- [Property("SPEC", "Tizen.Maps.MapView.ViewReady E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- [Precondition(1, "N/A")]
- [Step(1, "Click Run button. If feature is not supported, TC will automatically pass.")]
- [Step(2, "If the event callback is invoked, TC will automatically pass.")]
- [Postcondition(1, "N/A")]
- public async Task ViewReady_CHECK_EVENT()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- s_mapview = MapViewHelper.GetMapViewTestPage($"<span color=#FFFFFF>1. Please</span> <span color=#FFFF00>DobuleClick</span> <span color=#FFFFFF>on Map.</span>");
- Assert.IsNotNull(s_mapview, "PRECONDITION: Failed to get map view object for testing");
-
- s_mapview.ZoomLevel = 1;
- s_mapview.Center = new Geocoordinates(0, 0);
- s_mapview.Show();
-
- // TEST CODE
- bool viewReadyeventFlag = false;
- EventHandler handler = (s, e) => { viewReadyeventFlag = true; ManualTest.Confirm(); };
- s_mapview.ViewReady += handler;
-
- await ManualTest.WaitForConfirm();
- Assert.IsTrue(viewReadyeventFlag, $"View Ready event handler should get called");
-
- // POSTCONDITION
- s_mapview.ViewReady -= handler;
- MapViewHelper.ClearMapViewTestPage();
- }
- }
-}
+++ /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 System.IO;
-using System.Threading.Tasks;
-using NUnit.Framework;
-using Tizen.Applications;
-
-namespace Tizen.Maps.Tests
-{
- [TestFixture]
- [Description("Tizen.Maps.MapObject test class")]
- public class MarkerTests
- {
- private MapView s_mapview;
- private bool s_eventFlag = false;
- private string s_imagePath = Path.Combine(Application.Current.DirectoryInfo.SharedResource, "picture.png");
-
- [Test]
- [Category("P1")]
- [Description("Test: Event raised when Marker is clicked")]
- [Property("SPEC", "Tizen.Maps.Marker.Clicked E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- [Precondition(1, "N/A")]
- [Step(1, "Click Run button. If feature is not supported, TC will automatically pass.")]
- [Step(2, "Perform Click gesture on Pin marker.")]
- [Step(3, "If the gesture is not supported on the device, please report it as 'N/A'.")]
- [Postcondition(1, "N/A")]
- public async Task Clicked_CHECK_EVENT()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- s_mapview = MapViewHelper.GetMapViewTestPage($"<span color=#FFFFFF>1. Please</span> <span color=#FFFF00>Click</span> <span color=#FFFFFF>on Pin.</span>");
- Assert.IsNotNull(s_mapview, "PRECONDITION: Failed to get map view object for testing");
-
- s_mapview.ZoomLevel = 10;
- s_mapview.Center = new Geocoordinates(37, 127);
- s_mapview.Show();
-
- Pin pin = new Pin(new Geocoordinates(37, 127), s_imagePath);
- EventHandler handler = (s, e) => {
- s_eventFlag = true;
- ManualTest.Confirm();
- };
-
- pin.Clicked += handler;
- s_mapview.Add(pin);
- s_mapview.Show();
-
- // TEST CODE
- s_eventFlag = false;
- await ManualTest.WaitForConfirm();
- Assert.IsTrue(s_eventFlag, $"Clicked event handler should get called");
-
- // POSTCONDITION
- s_mapview.Remove(pin);
- pin.Clicked -= handler;
- MapViewHelper.ClearMapViewTestPage();
- }
- }
-}
+++ /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 System.IO;
-using System.Threading.Tasks;
-using NUnit.Framework;
-using Tizen.Applications;
-using System.Collections.Generic;
-using ElmSharp;
-
-namespace Tizen.Maps.Tests
-{
- [TestFixture]
- [Description("Tizen.Maps.Polygon test class")]
- public class PolygonTests
- {
- private MapView s_mapview;
- private bool s_eventFlag = false;
-
- [Test]
- [Category("P1")]
- [Description("Test: Event raised when Polygon is clicked")]
- [Property("SPEC", "Tizen.Maps.Polygon.Clicked E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Seechan Kim, cbible.kim@samsung.com")]
- [Precondition(1, "N/A")]
- [Step(1, "Click Run button. If feature is not supported, TC will automatically pass.")]
- [Step(2, "Perform Click gesture on Polygon.")]
- [Step(3, "If the gesture is not supported on the device, please report it as 'N/A'.")]
- [Postcondition(1, "N/A")]
- public async Task Clicked_CHECK_EVENT()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- s_mapview = MapViewHelper.GetMapViewTestPage($"<span color=#FFFFFF>1. Please</span> <span color=#FFFF00>Click</span> <span color=#FFFFFF>on Polygon.</span>");
- Assert.IsNotNull(s_mapview, "PRECONDITION: Failed to get map view object for testing");
-
- s_mapview.ZoomLevel = 10;
- s_mapview.Center = new Geocoordinates(37, 127);
- s_mapview.Show();
-
- var coordinatesList = new List<Geocoordinates> { new Geocoordinates(37.15, 126.88), new Geocoordinates(37, 127.12),
- new Geocoordinates(36.85, 126.99), new Geocoordinates(37, 126.79) };
- var color = new Color(50, 200, 50, 128);
-
- Polygon polygon = new Polygon(coordinatesList, color);
- EventHandler handler = (s, e) => {
- s_eventFlag = true;
- ManualTest.Confirm();
- };
-
- polygon.Clicked += handler;
- s_mapview.Add(polygon);
- s_mapview.Show();
-
- // TEST CODE
- s_eventFlag = false;
- await ManualTest.WaitForConfirm();
- Assert.IsTrue(s_eventFlag, $"Clicked event handler should get called");
-
- // POSTCONDITION
- s_mapview.Remove(polygon);
- polygon.Clicked -= handler;
- MapViewHelper.ClearMapViewTestPage();
- }
- }
-}
+++ /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 System.IO;
-using System.Threading.Tasks;
-using NUnit.Framework;
-using Tizen.Applications;
-using System.Collections.Generic;
-using ElmSharp;
-
-namespace Tizen.Maps.Tests
-{
- [TestFixture]
- [Description("Tizen.Maps.Polyline test class")]
- public class PolylineTests
- {
- private MapView s_mapview;
- private bool s_eventFlag = false;
-
- [Test]
- [Category("P1")]
- [Description("Test: Event raised when Polyline is clicked")]
- [Property("SPEC", "Tizen.Maps.Polyline.Clicked E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Seechan Kim, cbible.kim@samsung.com")]
- [Precondition(1, "N/A")]
- [Step(1, "Click Run button. If feature is not supported, TC will automatically pass.")]
- [Step(2, "Perform Click gesture on Polyline.")]
- [Step(3, "If the gesture is not supported on the device, please report it as 'N/A'.")]
- [Postcondition(1, "N/A")]
- public async Task Clicked_CHECK_EVENT()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- s_mapview = MapViewHelper.GetMapViewTestPage($"<span color=#FFFFFF>1. Please</span> <span color=#FFFF00>Click</span> <span color=#FFFFFF>on Polyline.</span>");
- Assert.IsNotNull(s_mapview, "PRECONDITION: Failed to get map view object for testing");
-
- s_mapview.ZoomLevel = 10;
- s_mapview.Center = new Geocoordinates(37, 127);
- s_mapview.Show();
-
- var coordinatesList = new List<Geocoordinates> { new Geocoordinates(37.15, 126.88), new Geocoordinates(37, 127.12), new Geocoordinates(36.523, 127.20) };
- var color = new Color(255, 1, 1);
- var thick = 5;
-
- Polyline polyline = new Polyline(coordinatesList, color, thick);
- EventHandler handler = (s, e) => {
- s_eventFlag = true;
- ManualTest.Confirm();
- };
-
- polyline.Clicked += handler;
- s_mapview.Add(polyline);
- s_mapview.Show();
-
- // TEST CODE
- s_eventFlag = false;
- await ManualTest.WaitForConfirm();
- Assert.IsTrue(s_eventFlag, $"Clicked event handler should get called");
-
- // POSTCONDITION
- s_mapview.Remove(polyline);
- polyline.Clicked -= handler;
- MapViewHelper.ClearMapViewTestPage();
- }
- }
-}
+++ /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 System.Threading.Tasks;
-using System.Linq;
-using ElmSharp;
-
-namespace Tizen.Maps.Tests
-{
- public class MapViewHelper
- {
- private static Window s_window;
- private static MapService s_maps;
- private static Label s_label;
- private static MapView s_mapview;
-
- private static Geocoordinates s_mapCenter = new Geocoordinates(0, 0);
- private static int defalutZoomLevel = 3;
-
- public static MapView GetMapViewTestPage(string testStep)
- {
- if (s_mapview == null)
- GetMapViewTestPageImpl(testStep);
-
- ClearMapViewTestPage();
- s_label.Text = testStep;
- s_window.Show();
- s_mapview.Show();
- return s_mapview;
- }
-
- private static void zoomInClicked(object sender, EventArgs e)
- {
- if (s_mapview == null) return;
- s_mapview.ZoomLevel++;
- }
-
- private static void zoomOutClicked(object sender, EventArgs e)
- {
- if (s_mapview == null) return;
- s_mapview.ZoomLevel--;
- }
-
- private static void rotateLeftClicked(object sender, EventArgs e)
- {
- if (s_mapview == null) return;
- s_mapview.Orientation -= 30;
- }
-
- private static void rotateRightClicked(object sender, EventArgs e)
- {
- if (s_mapview == null) return;
- s_mapview.Orientation += 30;
- }
-
- private static void scrollUpClicked(object sender, EventArgs e)
- {
- if (s_mapview == null) return;
- s_mapview.Center = new Geocoordinates(s_mapview.Center.Latitude + (1.0 / s_mapview.ZoomLevel), s_mapview.Center.Longitude);
- }
-
- private static void scrollDownClicked(object sender, EventArgs e)
- {
- if (s_mapview == null) return;
- s_mapview.Center = new Geocoordinates(s_mapview.Center.Latitude - (1.0 / s_mapview.ZoomLevel), s_mapview.Center.Longitude);
- }
-
- private static void scrollLeftClicked(object sender, EventArgs e)
- {
- if (s_mapview == null) return;
- s_mapview.Center = new Geocoordinates(s_mapview.Center.Latitude, s_mapview.Center.Longitude - (1.0 / s_mapview.ZoomLevel));
- }
-
- private static void scrollRightClicked(object sender, EventArgs e)
- {
- if (s_mapview == null) return;
- s_mapview.Center = new Geocoordinates(s_mapview.Center.Latitude, s_mapview.Center.Longitude + (1.0 / s_mapview.ZoomLevel));
- }
-
- private static void addButtons()
- {
- int btnXPos = 20;
- int btnYPos = 150;
- int btnXSize = 60;
- int btnYSize = 45;
- int btnMargin = 10;
-
- Button zoomIn = new Button(s_window) { Text = "<span color=#FFFFFF font_size=17>+</span>" };
- zoomIn.BackgroundColor = Color.Black;
- zoomIn.Resize(btnXSize, btnYSize);
- zoomIn.Move(20, btnYPos);
- zoomIn.Clicked += zoomInClicked;
- zoomIn.Show();
-
- Button zoomOut = new Button(s_window) { Text = "<span color=#FFFFFF font_size=17>-</span>" };
- zoomOut.BackgroundColor = Color.Black;
- zoomOut.Resize(btnXSize, btnYSize);
- zoomOut.Move(btnXPos + btnXSize + btnMargin, btnYPos);
- zoomOut.Clicked += zoomOutClicked;
- zoomOut.Show();
-
- Button rotateLeft = new Button(s_window) { Text = "<span color=#FFFFFF font_size=17><R</span>" };
- rotateLeft.BackgroundColor = Color.Black;
- rotateLeft.Resize(btnXSize, btnYSize);
- rotateLeft.Move(btnXPos, btnYPos + (btnYSize + btnMargin) * 1);
- rotateLeft.Clicked += rotateLeftClicked;
- rotateLeft.Show();
-
- Button rotateRight = new Button(s_window) { Text = "<span color=#FFFFFF font_size=17>R></span>" };
- rotateRight.BackgroundColor = Color.Black;
- rotateRight.Resize(btnXSize, btnYSize);
- rotateRight.Move(btnXPos + btnXSize + btnMargin, btnYPos + (btnYSize + btnMargin) * 1);
- rotateRight.Clicked += rotateRightClicked;
- rotateRight.Show();
-
- Button scrollUp = new Button(s_window) { Text = "<span color=#FFFFFF font_size=17>â–²</span>" };
- scrollUp.BackgroundColor = Color.Black;
- scrollUp.Resize(btnXSize, btnYSize);
- scrollUp.Move(btnXPos + btnMargin * 4 + (btnXSize + btnMargin) * 5 / 2, btnYPos);
- scrollUp.Clicked += scrollUpClicked;
- scrollUp.Show();
-
- Button scrollLeft = new Button(s_window) { Text = "<span color=#FFFFFF font_size=17>â—€</span>" };
- scrollLeft.BackgroundColor = Color.Black;
- scrollLeft.Resize(btnXSize, btnYSize);
- scrollLeft.Move(btnXPos + btnMargin * 4 + (btnXSize + btnMargin) * 2, btnYPos + (btnYSize + btnMargin) * 1);
- scrollLeft.Clicked += scrollLeftClicked;
- scrollLeft.Show();
-
- Button scrollRight = new Button(s_window) { Text = "<span color=#FFFFFF font_size=17>â–¶</span>" };
- scrollRight.BackgroundColor = Color.Black;
- scrollRight.Resize(btnXSize, btnYSize);
- scrollRight.Move(btnXPos + btnMargin * 4 + (btnXSize + btnMargin) * 3, btnYPos + (btnYSize + btnMargin) * 1);
- scrollRight.Clicked += scrollRightClicked;
- scrollRight.Show();
-
- Button scrollDown = new Button(s_window) { Text = "<span color=#FFFFFF font_size=17>â–¼</span>" };
- scrollDown.BackgroundColor = Color.Black;
- scrollDown.Resize(btnXSize, btnYSize);
- scrollDown.Move(btnXPos + btnMargin * 4 + (btnXSize + btnMargin) * 5 / 2, btnYPos + (btnYSize + btnMargin) * 2);
- scrollDown.Clicked += scrollDownClicked;
- scrollDown.Show();
- }
-
- private static MapView GetMapViewTestPageImpl(string testStep)
- {
- Elementary.Initialize();
- EcoreSynchronizationContext.Initialize();
-
- s_window = new Window("Test");
- s_window.KeyGrab(EvasKeyEventArgs.PlatformBackButtonName, false);
- s_window.KeyUp += (s, e) =>
- {
- if (e.KeyName == EvasKeyEventArgs.PlatformBackButtonName)
- {
- ClearMapViewTestPage();
- }
- };
-
- int w, h;
- System.Information.TryGetValue("http://tizen.org/feature/screen.width", out w);
- System.Information.TryGetValue("http://tizen.org/feature/screen.height", out h);
-
- s_window.Resize(w, h);
- s_window.Move(0, 0);
- s_window.Show();
-
- Background bg = new Background(s_window);
- bg.BackgroundColor = Color.Black;
- bg.Resize(w, h);
- bg.Show();
-
- s_label = new Label(s_window) { Text = " " + testStep };
- s_label.TextStyle = "DEFAULT = 'color=#FFFFFF font_size=15 align=center valign=top wrap=word'";
- s_label.LineWrapType = WrapType.Word;
- s_label.SlideMode = LabelSlideMode.Auto;
- s_label.Resize(w - 100, 30);
- s_label.Move(20, 20);
- s_label.Show();
-
- Label label1 = new Label(s_window) { Text = "<span color=#FFFFFF> 2. If gesture is not supported, do the test with buttons instead.</span>" };
- label1.TextStyle = "DEFAULT = 'color=#FFFFFF font_size=15 align=center valign=middle wrap=word'";
- label1.LineWrapType = WrapType.Word;
- label1.SlideMode = LabelSlideMode.Auto;
- label1.Resize(w - 70, 30);
- label1.Move(20, 50);
- label1.Show();
-
- Label label2 = new Label(s_window) { Text = "<span color=#FFFFFF>3. Press Back key to go back to the test page</span>" };
- label2.TextStyle = "DEFAULT = 'color=#FFFFFF font_size=15 align=center valign=bottom wrap=word'";
- label2.LineWrapType = WrapType.Word;
- label2.SlideMode = LabelSlideMode.Auto;
- label2.Resize(w - 40, 30);
- label2.Move(20, 80);
- label2.Show();
-
- s_maps = GetMapService();
- s_mapview = new MapView(s_window, s_maps);
- s_mapview.MinimumZoomLevel = 3;
-
- s_mapview.Resize(w, h - (130 -1));
- s_mapview.Move(0, 130);
- s_mapview.Show();
-
- addButtons();
-
- return s_mapview;
- }
-
- public static void ClearMapViewTestPage()
- {
- s_mapview.Resize(s_window.ScreenSize.Width, s_window.ScreenSize.Height - 130);
- s_mapview.Move(0, 130);
- s_mapview.Center = s_mapCenter;
- s_mapview.ZoomLevel = defalutZoomLevel;
- s_mapview.RemoveAll();
- s_window.Hide();
- }
-
- public static MapService GetMapService()
- {
- if (s_maps == null)
- s_maps = ServiceHelper.GetMapServices().First().GetMapService();
- return s_maps;
- }
- }
-}
+++ /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;
-using Tizen.System;
-using System;
-
-namespace Tizen.Maps.Tests
-{
- internal static partial class MapsCapabilities
- {
- public static Capability Maps = new Capability("http://tizen.org/feature/maps");
- public static Capability Internet = new Capability("http://tizen.org/feature/network.internet");
-
- internal partial class Capability
- {
- private bool _isSupported = false;
- private bool _isInitialized = false;
- private string _feature;
-
- public Capability(string feature)
- {
- _feature = feature;
- }
-
- private bool CheckCapability()
- {
- bool ret = false;
- if (Information.TryGetValue<bool>(_feature, out ret))
- return ret;
- return false;
- }
-
- public bool IsSupported
- {
- get
- {
- if (_isInitialized == false)
- {
- _isSupported = CheckCapability();
- _isInitialized = true;
- }
- if (_isSupported == false)
- {
- TestPage.GetInstance().UnlockUIButton();
- }
- return _isSupported;
- }
- }
-
- public void Assert(Exception e)
- {
- if (_isSupported == false)
- {
- NUnit.Framework.Assert.IsTrue(e.GetType().Name.Equals("InvalidOperationException"),
- string.Format("Expecting: InvalidOperationException, Actual: {0}", e.GetType().Name));
- }
- }
- }
- }
-}
+++ /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 System;
-using System.IO;
-
-namespace Tizen.Maps.Tests
-{
- public class PreconditionUtils
- {
- public static string HERE_MAPS_PROVIDER_KEY = null;
- public static void SetPrecondition()
- {
- string result = ReadFile("/opt/usr/home/owner/share/tct/preconfigure.json");
- int index = 0;
- string[] resultArray = StringParser(result);
- foreach (string item in resultArray)
- {
- switch (item)
- {
- case "HERE_MAPS_PROVIDER_KEY":
- // Remove backslash
- resultArray[index + 1] = resultArray[index + 1].Replace("\\", "");
- HERE_MAPS_PROVIDER_KEY = resultArray[index + 1];
- break;
- default:
- break;
- }
- index++;
- }
- }
-
- private static string ReadFile(string path)
- {
- string result = null;
- string url = path;
-
- try
- {
- StreamReader reader = File.OpenText(path);
- result = reader.ReadToEnd();
- }
- catch (Exception e)
- {
- LogUtils.Write(LogUtils.ERROR, LogUtils.TAG, "File read error : " + e.Message);
- }
-
- 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
-/*
-* 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.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Threading.Tasks;
-
-namespace Tizen.Maps.Tests
-{
- public abstract class ServiceHelper
- {
- public ServiceHelper()
- {
- PreconditionUtils.SetPrecondition();
- }
-
- public abstract string ServiceProvider { get; }
- public abstract string ServiceProviderKey { get; }
- public MapService maps;
-
- public virtual MapService GetMapService()
- {
- if (maps == null)
- maps = new MapService(ServiceProvider, ServiceProviderKey);
- return maps;
- }
-
- public static List<ServiceHelper> GetMapServices()
- {
- var providerList = MapService.Providers;
- var here = providerList.Where(s => s == "HERE");
-
- List<ServiceHelper> service = new List<ServiceHelper>();
-
- if (here.Count() >= 1)
- service.Add(new HereMapService());
-
- return service;
- }
- }
-
- public class HereMapService : ServiceHelper
- {
- public override string ServiceProvider { get { return "HERE"; } }
-
- public override string ServiceProviderKey { get { return PreconditionUtils.HERE_MAPS_PROVIDER_KEY; } }
- }
-}
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<manifest xmlns="http://tizen.org/ns/packages" api-version="8.0" package="Tizen.Maps.Manual.Tests" version="1.0.0">\r
- <profile name="common" />\r
- <ui-application appid="Tizen.Maps.Manual.Tests"\r
- exec="Tizen.Maps.Manual.Tests.dll"\r
- type="dotnet"\r
- multiple="false"\r
- taskmanage="true"\r
- launch_mode="single">\r
- <icon>Tizen.Maps.Manual.Tests.png</icon>\r
- <label>Tizen.Maps.Manual.Tests</label>\r
- </ui-application>\r
- <privileges>\r
- <privilege>http://tizen.org/privilege/mapservice</privilege>\r
- <privilege>http://tizen.org/privilege/internet</privilege>\r
- <privilege>http://tizen.org/privilege/network.get</privilege>\r
- <privilege>http://tizen.org/privilege/appmanager.launch</privilege>\r
- </privileges>\r
-</manifest>\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 AutoTemplate;
-
-namespace XamarinForTizen.Tizen
-{
-
- class Program : global::Xamarin.Forms.Platform.Tizen.FormsApplication
- {
- private static App _app;
- protected override void OnCreate()
- {
- base.OnCreate();
-
- Console.WriteLine("TCT : OnCreate()");
- _app = new App();
- LoadApplication(_app);
-
- TRunner t = new TRunner();
- t.LoadTestsuite();
- t.Execute();
- }
-
- public static App getApp()
- {
- return _app;
- }
- static void Main(string[] args)
- {
- Console.WriteLine("TCT : Main()");
- var app = new Program();
- global::Xamarin.Forms.Forms.Init(app);
- app.Run(args);
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-
-To succussfull test execution, please ensure following before test execution
-1. Test need here map service provider key, please place it at "/home/owner/content/Documents/tct/here_maps_key.txt"
-2. When executing first time after flashing new binary, please wait for popup for user consent and press agree button. Then reexecute testcases.
+++ /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>
-
- <!-- Include Nuget Package for Tizen Project building -->
- <ItemGroup>
- <ProjectReference Include="..\Template\AutoTemplate\AutoTemplate.csproj" />
- </ItemGroup>
-
-</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.Maps.Tests", "Tizen.Maps.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
-/*
-* 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;
-using System;
-
-namespace Tizen.Maps.Tests
-{
- [TestFixture]
- [Description("Tizen.Maps.Area test class")]
- public class AreaTests
- {
- [Test]
- [Category("P1")]
- [Description("Test: Check if constructor returns valid Area object without any failure or exception")]
- [Property("SPEC", "Tizen.Maps.Area.Area C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- [Property("COVPARAM", "Geocoordinates, Geocoordinates")]
- public void Area_INIT_RECTANGULAR()
- {
- // TEST CODE
- try
- {
- var area = new Area(new Geocoordinates(1, 1), new Geocoordinates(10, 10));
- Assert.IsInstanceOf<Area>(area, "Expecting Area object");
- }
- catch (Exception e)
- {
- if (MapsCapabilities.Maps.IsSupported)
- Assert.IsTrue(false, string.Format("Exception Error : {0}", e.GetType().Name));
- else
- MapsCapabilities.Maps.Assert(e);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Check if constructor returns valid Area object without any failure or exception")]
- [Property("SPEC", "Tizen.Maps.Area.Area C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- [Property("COVPARAM", "Geocoordinates, Double")]
- public void Area_INIT_CIRCULAR()
- {
- // TEST CODE
- try
- {
- var area = new Area(new Geocoordinates(1, 1), 10);
- Assert.IsInstanceOf<Area>(area, "Expecting Area object");
- }
- catch (Exception e)
- {
- if (MapsCapabilities.Maps.IsSupported)
- Assert.IsTrue(false, string.Format("Exception Error : {0}", e.GetType().Name));
- else
- MapsCapabilities.Maps.Assert(e);
- }
- }
-
- [Test]
- [Category("P2")]
- [Description("Test: Tries to creates Area object using null coordinates")]
- [Property("SPEC", "Tizen.Maps.Area.Area C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTN")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- [Property("COVPARAM", "Geocoordinates, Geocoordinates")]
- public void Area_INIT_RECTANGULAR_CHECK_EXCEPTION()
- {
- // TEST CODE
- try
- {
- Area area = new Area(null, new Geocoordinates(10, 10));
- Assert.IsFalse(true, string.Format("Expecting Argument exception {0}", area));
- return;
- }
- catch (Exception e)
- {
- if (MapsCapabilities.Maps.IsSupported)
- Assert.IsTrue(e.GetType().Name.Equals("ArgumentException"), string.Format("Expecting: ArgumentException, Actual: {0}", e.GetType().Name));
- else
- MapsCapabilities.Maps.Assert(e);
- }
-
- try
- {
- Area area = new Area(new Geocoordinates(1, 1), null);
- Assert.IsFalse(true, string.Format("Expecting Argument exception {0}", area));
- return;
- }
- catch (Exception e)
- {
- if (MapsCapabilities.Maps.IsSupported)
- Assert.IsTrue(e.GetType().Name.Equals("ArgumentException"), string.Format("Expecting: ArgumentException, Actual: {0}", e.GetType().Name));
- else
- MapsCapabilities.Maps.Assert(e);
- }
- }
-
- [Test]
- [Category("P2")]
- [Description("Test: Tries to creates Area object using null coordinates")]
- [Property("SPEC", "Tizen.Maps.Area.Area C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTN")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- [Property("COVPARAM", "Geocoordinates, Double")]
- public void Area_INIT_CIRCULAR_CHECK_EXCEPTION()
- {
- // TEST CODE
- try
- {
- Area area = new Area(null, 10);
- Assert.IsFalse(true, string.Format("Expecting Argument exception {0}", area));
- }
- catch (Exception e)
- {
- if (MapsCapabilities.Maps.IsSupported)
- Assert.IsTrue(e.GetType().Name.Equals("ArgumentException"), string.Format("Expecting: ArgumentException, Actual: {0}", e.GetType().Name));
- else
- MapsCapabilities.Maps.Assert(e);
- }
- }
- }
-}
+++ /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 System.IO;
-using ElmSharp;
-using NUnit.Framework;
-using Tizen.Applications;
-
-namespace Tizen.Maps.Tests
-{
- [TestFixture]
- [Description("Tizen.Maps.BoxOverlay test class")]
- public class BoxOverlayTests
- {
- private EvasObject s_evasObj = new Window("MapView Test Window");
-
- [Test]
- [Category("P1")]
- [Description("Test: Check if constructor returns valid object without any failure or exception")]
- [Property("SPEC", "Tizen.Maps.BoxOverlay.BoxOverlay C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void BoxOverlay_INIT()
- {
- // TEST CODE
- try
- {
-
- CONSTR<BoxOverlay>.ForConstructorWithSignature(typeof(Geocoordinates), typeof(EvasObject))
- .WithArguments(new Geocoordinates(33, 57), s_evasObj)
- .VerifyInstanceOf(typeof(BoxOverlay))
- .VerifyProperty("Coordinates", new Geocoordinates(33, 57), MapsUtils.IsEquals)
- .Assert();
- }
- catch (Exception e)
- {
- MapsCapabilities.Maps.Assert(e);
- }
- }
-
- [Test]
- [Category("P2")]
- [Description("Test: Tries to create object with null parameter")]
- [Property("SPEC", "Tizen.Maps.BoxOverlay.BoxOverlay C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTRN")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void BoxOverlay_INIT_EXCEPTION()
- {
- // TEST CODE
- try
- {
- CONSTRN<BoxOverlay>.ForConstructorWithSignature(typeof(Geocoordinates), typeof(EvasObject))
- .WithArguments(null, s_evasObj).ExpectException(typeof(ArgumentException))
- .WithArguments(new Geocoordinates(33, 57), null).ExpectException(typeof(ArgumentException))
- .WithArguments(null, null).ExpectException(typeof(ArgumentException))
- .Assert();
- }
- catch (Exception e)
- {
- MapsCapabilities.Maps.Assert(e);
- }
- }
- }
-}
+++ /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 System.IO;
-using ElmSharp;
-using NUnit.Framework;
-using Tizen.Applications;
-
-namespace Tizen.Maps.Tests
-{
- [TestFixture]
- [Description("Tizen.Maps.BubbleOverlay test class")]
- public class BubbleOverlayTests
- {
- private EvasObject s_evasObj = new Window("MapView Test Window");
-
- [Test]
- [Category("P1")]
- [Description("Test: Check if constructor returns valid object without any failure or exception")]
- [Property("SPEC", "Tizen.Maps.BubbleOverlay.BubbleOverlay C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void BubbleOverlay_INIT()
- {
- // TEST CODE
- try
- {
- CONSTR<BubbleOverlay>.ForConstructorWithSignature(typeof(Geocoordinates), typeof(EvasObject))
- .WithArguments(new Geocoordinates(33, 57), s_evasObj)
- .VerifyInstanceOf(typeof(BubbleOverlay))
- .VerifyProperty("Coordinates", new Geocoordinates(33, 57), MapsUtils.IsEquals)
- .Assert();
- }
- catch (Exception e)
- {
- MapsCapabilities.Maps.Assert(e);
- }
- }
-
- [Test]
- [Category("P2")]
- [Description("Test: Tries to create object with null parameter")]
- [Property("SPEC", "Tizen.Maps.BubbleOverlay.BubbleOverlay C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTRN")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void BubbleOverlay_INIT_EXCEPTION()
- {
- // TEST CODE
- try
- {
- CONSTRN<BubbleOverlay>.ForConstructorWithSignature(typeof(Geocoordinates), typeof(EvasObject))
- .WithArguments(null, s_evasObj).ExpectException(typeof(ArgumentException))
- .WithArguments(new Geocoordinates(33, 57), null).ExpectException(typeof(ArgumentException))
- .WithArguments(null, null).ExpectException(typeof(ArgumentException))
- .Assert();
- }
- catch (Exception e)
- {
- MapsCapabilities.Maps.Assert(e);
- }
- }
- }
-}
+++ /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;
-using System;
-using System.Collections.Generic;
-
-namespace Tizen.Maps.Tests
-{
- [TestFixture]
- [Description("Tizen.Maps.Geocoordinates test class")]
- public class GeocoordinatesTests
- {
- private struct TestData
- {
- public double Latitude;
- public double Longitude;
- }
-
- private Dictionary<Geocoordinates, TestData> s_testdata;
-
- [SetUp]
- public void FixtureInit()
- {
- try
- {
- s_testdata = new Dictionary<Geocoordinates, TestData>
- {
- { new Geocoordinates(-90, 180), new TestData { Latitude = - 90, Longitude = 180 } },
- { new Geocoordinates(90, -180), new TestData { Latitude = 90, Longitude = -180 } },
- { new Geocoordinates(10, 50), new TestData { Latitude = 10, Longitude = 50 } },
- { new Geocoordinates(0, 0), new TestData { Latitude = 0, Longitude = 0 } },
- };
- }
- catch (Exception e)
- {
- MapsCapabilities.Maps.Assert(e);
- }
- }
-
- [TearDown]
- public void FixtureDestroy()
- {
- s_testdata?.Clear();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if constructor for the class returns correct object instance")]
- [Property("SPEC", "Tizen.Maps.Geocoordinates.Geocoordinates C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void Geocoordinates_INIT()
- {
- // TEST CODE
- try
- {
- var expectedLatitude = -90.0;
- var expectedLongitude = -180.0;
- Geocoordinates coordinates1 = new Geocoordinates(expectedLatitude, expectedLongitude);
- Assert.IsInstanceOf<Geocoordinates>(coordinates1, "Expecting Geocoordinates object");
-
- var actualLatitude = coordinates1.Latitude;
- Assert.IsTrue(expectedLatitude.IsEquals(actualLatitude), string.Format("Wrong Latitude value, Expected: {0}, Actual: {1}", expectedLatitude, actualLatitude));
-
- var actualLongitude = coordinates1.Longitude;
- Assert.IsTrue(expectedLongitude.IsEquals(actualLongitude), string.Format("Wrong Longitude value, Expected: {0}, Actual: {1}", expectedLongitude, actualLongitude));
-
- expectedLatitude = 90.0;
- expectedLongitude = 180.0;
- Geocoordinates coordinates2 = new Geocoordinates(expectedLatitude, expectedLongitude);
- Assert.IsInstanceOf<Geocoordinates>(coordinates2, "Expecting Geocoordinates object");
-
- actualLatitude = coordinates2.Latitude;
- Assert.IsTrue(expectedLatitude.IsEquals(actualLatitude), string.Format("Wrong Latitude value, Expected: {0}, Actual: {1}", expectedLatitude, actualLatitude));
-
- actualLongitude = coordinates2.Longitude;
- Assert.IsTrue(expectedLongitude.IsEquals(actualLongitude), string.Format("Wrong Longitude value, Expected: {0}, Actual: {1}", expectedLongitude, actualLongitude));
- }
- catch (Exception e)
- {
- MapsCapabilities.Maps.Assert(e);
- }
- }
-
- [Test]
- [Category("P2")]
- [Description("Test: Tries to create Geocoordinates object with out of range value for latitude and longitude")]
- [Property("SPEC", "Tizen.Maps.Geocoordinates.Geocoordinates C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTN")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void Geocoordinates_INIT_EXCEPTION()
- {
- // TEST CODE
- try
- {
- Geocoordinates coordinates = new Geocoordinates(-91, 10);
- Assert.IsFalse(true, string.Format("Expecting Argument exception {0}", coordinates));
- }
- catch (Exception e)
- {
- if (MapsCapabilities.Maps.IsSupported)
- Assert.IsTrue(e.GetType().Name.Equals("ArgumentException"), "Latitude value must be between (-90.0 ~ 90.0) degrees");
- else
- MapsCapabilities.Maps.Assert(e);
- }
-
- try
- {
- Geocoordinates coordinates = new Geocoordinates(91, 10);
- Assert.IsFalse(true, string.Format("Expecting Argument exception {0}", coordinates));
- }
- catch (Exception e)
- {
- if (MapsCapabilities.Maps.IsSupported)
- Assert.IsTrue(e.GetType().Name.Equals("ArgumentException"), "Latitude value must be between (-90.0 ~ 90.0) degrees");
- else
- MapsCapabilities.Maps.Assert(e);
- }
-
- try
- {
- Geocoordinates coordinates = new Geocoordinates(10, -181);
- Assert.IsFalse(true, string.Format("Expecting Argument exception {0}", coordinates));
- }
- catch (Exception e)
- {
- if (MapsCapabilities.Maps.IsSupported)
- Assert.IsTrue(e.GetType().Name.Equals("ArgumentException"), "Longitude value must be between (-180.0 ~ 180.0) degrees");
- else
- MapsCapabilities.Maps.Assert(e);
- }
-
- try
- {
- Geocoordinates coordinates = new Geocoordinates(10, 181);
- Assert.IsFalse(true, string.Format("Expecting Argument exception {0}", coordinates));
- }
- catch (Exception e)
- {
- if (MapsCapabilities.Maps.IsSupported)
- Assert.IsTrue(e.GetType().Name.Equals("ArgumentException"), "Longitude value must be between (-180.0 ~ 180.0) degrees");
- else
- MapsCapabilities.Maps.Assert(e);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Latitude property and compares it to value passed in constructor while creating object")]
- [Property("SPEC", "Tizen.Maps.Geocoordinates.Latitude A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void Latitude_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_testdata, "PRECONDITION: Failed to get Geocoordinates objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testdata)
- {
- var expected = item.Value.Latitude;
- var actual = item.Key.Latitude;
- Assert.IsTrue(expected.IsEquals(actual), string.Format("Wrong Latitude value, Expected: {0}, Actual: {1}", expected, actual));
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Longitude property and compares it to value passed in constructor while creating object")]
- [Property("SPEC", "Tizen.Maps.Geocoordinates.Longitude A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void Longitude_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_testdata, "PRECONDITION: Failed to get Geocoordinates objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testdata)
- {
- var expected = item.Value.Longitude;
- var actual = item.Key.Longitude;
- Assert.IsTrue(expected.IsEquals(actual), string.Format("Wrong Longitude value, Expected: {0}, Actual: {1}", expected, actual));
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Checks if ToString() returns correct formatted string")]
- [Property("SPEC", "Tizen.Maps.Geocoordinates.ToString M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void ToString_RETURN_TYPE()
- {
- // TEST CODE
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_testdata, "PRECONDITION: Failed to get Geocoordinates objects for testing.");
- var formatStr = "[{0}, {1}]";
-
- foreach(var item in s_testdata)
- {
- var expected = string.Format(formatStr, item.Value.Latitude, item.Value.Longitude);
- var actual = item.Key.ToString();
-
- Assert.IsTrue(expected.IsEquals(actual), string.Format("Wrong ToString value, Expected: {0}, Actual: {1}", expected, actual));
- }
- }
- }
-}
+++ /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;
-using System;
-using System.Linq;
-using System.Collections.Generic;
-
-namespace Tizen.Maps.Tests
-{
- [TestFixture]
- [Description("Tizen.Maps.IGeocodePreference test class")]
- public class IGeocodePreferenceTests
- {
- private IGeocodePreference s_preference;
-
- [SetUp]
- public void FixtureInit()
- {
- try
- {
- s_preference = new SearchPreference();
- }
- catch (Exception e)
- {
- MapsCapabilities.Maps.Assert(e);
- }
- }
-
- [TearDown]
- public void FixtureDestroy()
- {
- ((SearchPreference)s_preference)?.Dispose();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets Language property")]
- [Property("SPEC", "Tizen.Maps.IGeocodePreference.Language A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Seechan Kim, cbible.kim@samsung.com")]
- public void Language_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_preference, "PRECONDITION: Failed to get IGeocodePreference for testing.");
-
- // TEST CODE
- var expected = "ko-KR";
- s_preference.Language = expected;
- var actual = s_preference.Language;
- Assert.IsTrue(expected == actual, string.Format("Wrong Language value, Expected: {0}, Actual: {1}", expected, actual));
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets MaxResults property")]
- [Property("SPEC", "Tizen.Maps.IGeocodePreference.MaxResults A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Seechan Kim, cbible.kim@samsung.com")]
- public void MaxResults_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_preference, "PRECONDITION: Failed to get IGeocodePreference for testing.");
-
- // TEST CODE
- var expected = 25;
- s_preference.MaxResults = expected;
- var actual = s_preference.MaxResults;
- Assert.IsTrue(expected == actual, string.Format("Wrong MaxResults value, Expected: {0}, Actual: {1}", expected, actual));
- }
- }
-}
+++ /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;
-using System;
-using System.Linq;
-using System.Collections.Generic;
-
-namespace Tizen.Maps.Tests
-{
- [TestFixture]
- [Description("Tizen.Maps.IPlaceSearchPreference test class")]
- public class IPlaceSearchPreferenceTests
- {
- private IPlaceSearchPreference s_preference;
-
- [SetUp]
- public void FixtureInit()
- {
- try
- {
- s_preference = new SearchPreference();
- }
- catch (Exception e)
- {
- MapsCapabilities.Maps.Assert(e);
- }
- }
-
- [TearDown]
- public void FixtureDestroy()
- {
- ((SearchPreference)s_preference)?.Dispose();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets Unit property")]
- [Property("SPEC", "Tizen.Maps.IPlaceSearchPreference.Unit A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Seechan Kim, cbible.kim@samsung.com")]
- public void Unit_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_preference, "PRECONDITION: Failed to get IPlaceSearchPreference for testing.");
-
- // TEST CODE
- var expected = DistanceUnit.Kilometer;
- s_preference.Unit = expected;
- var actual = s_preference.Unit;
- Assert.IsTrue(expected == actual, string.Format("Wrong Unit value, Expected: {0}, Actual: {1}", expected, actual));
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets Language property")]
- [Property("SPEC", "Tizen.Maps.IPlaceSearchPreference.Language A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Seechan Kim, cbible.kim@samsung.com")]
- public void Language_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_preference, "PRECONDITION: Failed to get IPlaceSearchPreference for testing.");
-
- // TEST CODE
- var expected = "ko-KR";
- s_preference.Language = expected;
- var actual = s_preference.Language;
- Assert.IsTrue(expected == actual, string.Format("Wrong Language value, Expected: {0}, Actual: {1}", expected, actual));
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets MaxResults property")]
- [Property("SPEC", "Tizen.Maps.IPlaceSearchPreference.MaxResults A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Seechan Kim, cbible.kim@samsung.com")]
- public void MaxResults_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_preference, "PRECONDITION: Failed to get IPlaceSearchPreference for testing.");
-
- // TEST CODE
- var expected = 25;
- s_preference.MaxResults = expected;
- var actual = s_preference.MaxResults;
- Assert.IsTrue(expected == actual, string.Format("Wrong MaxResults value, Expected: {0}, Actual: {1}", expected, actual));
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets CountryCode property")]
- [Property("SPEC", "Tizen.Maps.IPlaceSearchPreference.CountryCode A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Seechan Kim, cbible.kim@samsung.com")]
- public void CountryCode_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_preference, "PRECONDITION: Failed to get IPlaceSearchPreference for testing.");
-
- // TEST CODE
- var expected = "KOR";
- s_preference.CountryCode = expected;
- var actual = s_preference.CountryCode;
- Assert.IsTrue(expected == actual, string.Format("Wrong MaxResults value, Expected: {0}, Actual: {1}", expected, actual));
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets Properties property")]
- [Property("SPEC", "Tizen.Maps.IPlaceSearchPreference.Properties A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Seechan Kim, cbible.kim@samsung.com")]
- public void Properties_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_preference, "PRECONDITION: Failed to get IPlaceSearchPreference for testing.");
-
- // TEST CODE
- var expected = new Dictionary<string, string>();
- expected.Add("remark", "test");
- s_preference.Properties = expected;
- var actual = s_preference.Properties;
- Assert.IsTrue(expected["remark"] == actual["remark"], string.Format("Wrong Properties value, Expected: {0}, Actual: {1}", expected["remark"], actual["remark"]));
- }
- }
-}
+++ /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;
-using System;
-using System.Linq;
-using System.Collections.Generic;
-
-namespace Tizen.Maps.Tests
-{
- [TestFixture]
- [Description("Tizen.Maps.IRouteSearchPreferenceTests test class")]
- public class IRouteSearchPreferenceTests
- {
- private IRouteSearchPreference s_preference;
-
- [SetUp]
- public void FixtureInit()
- {
- try
- {
- s_preference = new SearchPreference();
- }
- catch (Exception e)
- {
- MapsCapabilities.Maps.Assert(e);
- }
- }
-
- [TearDown]
- public void FixtureDestroy()
- {
- ((SearchPreference)s_preference)?.Dispose();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets Unit property")]
- [Property("SPEC", "Tizen.Maps.IRouteSearchPreference.Unit A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Seechan Kim, cbible.kim@samsung.com")]
- public void Unit_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_preference, "PRECONDITION: Failed to get IRouteSearchPreference for testing.");
-
- // TEST CODE
- var expected = DistanceUnit.Kilometer;
- s_preference.Unit = expected;
- var actual = s_preference.Unit;
- Assert.IsTrue(expected == actual, string.Format("Wrong Unit value, Expected: {0}, Actual: {1}", expected, actual));
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets Optimization property")]
- [Property("SPEC", "Tizen.Maps.IRouteSearchPreference.Optimization A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Seechan Kim, cbible.kim@samsung.com")]
- public void Optimization_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_preference, "PRECONDITION: Failed to get IRouteSearchPreference for testing.");
-
- // TEST CODE
- var expected = RouteOptimization.FastestNow;
- s_preference.Optimization = expected;
- var actual = s_preference.Optimization;
- Assert.IsTrue(expected == actual, string.Format("Wrong Optimization value, Expected: {0}, Actual: {1}", expected, actual));
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets Mode property")]
- [Property("SPEC", "Tizen.Maps.IRouteSearchPreference.Mode A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Seechan Kim, cbible.kim@samsung.com")]
- public void Mode_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_preference, "PRECONDITION: Failed to get IRouteSearchPreference for testing.");
-
- // TEST CODE
- var expected = TransportMode.Bicycle;
- s_preference.Mode = expected;
- var actual = s_preference.Mode;
- Assert.IsTrue(expected == actual, string.Format("Wrong Mode value, Expected: {0}, Actual: {1}", expected, actual));
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets RouteFeatureWeight property")]
- [Property("SPEC", "Tizen.Maps.IRouteSearchPreference.RouteFeatureWeight A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Seechan Kim, cbible.kim@samsung.com")]
- public void RouteFeatureWeight_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_preference, "PRECONDITION: Failed to get IRouteSearchPreference for testing.");
-
- // TEST CODE
- var expected = RouteFeatureWeight.Prefer;
- s_preference.RouteFeatureWeight = expected;
- var actual = s_preference.RouteFeatureWeight;
- Assert.IsTrue(expected == actual, string.Format("Wrong RouteFeatureWeight value, Expected: {0}, Actual: {1}", expected, actual));
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets RouteFeature property")]
- [Property("SPEC", "Tizen.Maps.IRouteSearchPreference.RouteFeature A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Seechan Kim, cbible.kim@samsung.com")]
- public void RouteFeature_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_preference, "PRECONDITION: Failed to get IRouteSearchPreference for testing.");
-
- // TEST CODE
- var expected = RouteFeature.DirtRoad;
- s_preference.RouteFeature = expected;
- var actual = s_preference.RouteFeature;
- Assert.IsTrue(expected == actual, string.Format("Wrong RouteFeature value, Expected: {0}, Actual: {1}", expected, actual));
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets SearchAlternativeRoutes property")]
- [Property("SPEC", "Tizen.Maps.IRouteSearchPreference.SearchAlternativeRoutes A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Seechan Kim, cbible.kim@samsung.com")]
- public void SearchAlternativeRoutes_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_preference, "PRECONDITION: Failed to get IRouteSearchPreference for testing.");
-
- // TEST CODE
- var expected = true;
- s_preference.SearchAlternativeRoutes = expected;
- var actual = s_preference.SearchAlternativeRoutes;
- Assert.IsTrue(expected == actual, string.Format("Wrong SearchAlternativeRoutes value, Expected: {0}, Actual: {1}", expected, actual));
- }
- }
-}
+++ /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 System.Collections.Generic;
-using System.IO;
-using ElmSharp;
-using NUnit.Framework;
-using Tizen.Applications;
-
-namespace Tizen.Maps.Tests
-{
- [TestFixture]
- [Description("Tizen.Maps.MapObject test class")]
- public class MapObjectTests
- {
- private List<MapObject> s_testData;
- private EvasObject s_evasObj = new Window("MapView Test Window");
- private string s_imagePath = Path.Combine(Application.Current.DirectoryInfo.SharedResource, "picture.png");
-
- [SetUp]
- public void FixtureInit()
- {
- try
- {
- s_testData = new List<MapObject> {
- new Pin(new Geocoordinates(10.0, 10.0), s_imagePath),
- new Sticker(new Geocoordinates(10.0, 10.0), s_imagePath),
- };
- }
- catch (Exception e)
- {
- MapsCapabilities.Maps.Assert(e);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets MapObject IsVisible property")]
- [Property("SPEC", "Tizen.Maps.MapObject.IsVisible A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void IsVisible_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_testData, "Precondition: need MapObject instances for testing");
-
- // TEST CODE
- s_testData.ForEach(mapObj =>
- {
- var isVisible = mapObj.IsVisible;
- PRW<MapObject>.For(mapObj)
- .TestGetterSetter("IsVisible", false)
- .TestGetterSetter("IsVisible", true)
- .TestGetterSetter("IsVisible", false)
- .Assert();
-
- // POSTCONDITION
- mapObj.IsVisible = isVisible;
- });
- }
- }
-}
+++ /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;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-
-namespace Tizen.Maps.Tests
-{
- [TestFixture]
- [Description("Tizen.Maps.MapService test class")]
- public class MapServiceTests
- {
- private string s_serviceProvider = "DEFAULT";
- private string s_serviceProviderKey = "Provider/Key";
- private List<ServiceHelper> s_testMapServices;
-
- [SetUp]
- public void FixtureInit()
- {
- try
- {
- s_testMapServices = ServiceHelper.GetMapServices();
- s_serviceProvider = s_testMapServices.First().ServiceProvider;
- s_serviceProviderKey = s_testMapServices.First().ServiceProviderKey;
- }
- catch (Exception e)
- {
- MapsCapabilities.Maps.Assert(e);
- }
- }
-
- [TearDown]
- public void FixtureDestroy()
- {
- s_testMapServices?.Clear();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Check if constructor for the class returns correct object instance")]
- [Property("SPEC", "Tizen.Maps.MapService.MapService C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void MapService_INIT()
- {
- // TEST CODE
- try
- {
- var maps = new MapService(s_serviceProvider, s_serviceProviderKey);
- Assert.IsInstanceOf<MapService>(maps, "Expecting MapService object");
-
- MapsUtils.AssertPropEqual(s_serviceProvider, maps.Provider, "Provider");
- MapsUtils.AssertPropEqual(s_serviceProviderKey, maps.ProviderKey, "ProviderKey");
- }
- catch (Exception e)
- {
- if (MapsCapabilities.Maps.IsSupported)
- Assert.True(false, string.Format("Unexpected Exception: {0}", e.GetType().Name));
- else
- MapsCapabilities.Maps.Assert(e);
- }
- }
-
- [Test]
- [Category("P2")]
- [Description("Test: Tries to create MapService object with null or invalid input parameter")]
- [Property("SPEC", "Tizen.Maps.MapService.MapService C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTRN")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void MapService_INIT_EXCEPTION()
- {
- // TEST CODE
- try
- {
- var maps = new MapService(null, s_serviceProviderKey);
- Assert.IsFalse(true, string.Format("Expecting Argument exception {0}", maps));
- }
- catch (Exception e)
- {
- if (MapsCapabilities.Maps.IsSupported)
- Assert.IsTrue(e.GetType().Name.Equals("ArgumentException"), "Service provider should not be null");
- else
- MapsCapabilities.Maps.Assert(e);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Check if getter of Providers property returns none empty list of providers and contains HERE provider")]
- [Property("SPEC", "Tizen.Maps.MapService.Providers A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void Providers_PROPERTY_READ_ONLY()
- {
- // TEST CODE
- try
- {
- var providerList = MapService.Providers;
- Assert.IsInstanceOf<IEnumerable<string>>(providerList, "Expecting list of strings");
- if (MapsCapabilities.Maps.IsSupported)
- {
- Assert.IsNotNull(providerList, "Expecting none null provider list");
- Assert.IsTrue(providerList.Count() > 0, "Expecting none empty provider list");
-
- var here = providerList.Where(s => s == s_serviceProvider);
- Assert.IsTrue(here.Count() == 1, "Provider list should have entry for HERE service provider");
- }
- }
- catch (Exception e)
- {
- Assert.True(false, string.Format("Unexpected Exception: {0}", e.GetType().Name));
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Check if the user consent is available or not")]
- [Property("SPEC", "Tizen.Maps.MapService.RequestUserConsent M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Jongmun Woo, jongmun.woo@samsung.com")]
- public async Task RequestUserConsent_CHANGE_STATUS()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_testMapServices, "PRECONDITION: Failed to get MapService for testing.");
-
- // TEST CODE
- try
- {
- foreach (var maps in s_testMapServices)
- {
- var mapService = maps.GetMapService();
- Assert.IsTrue(await mapService.RequestUserConsent(), "Need user consent to use map service");
- }
- }
- catch (Exception e)
- {
- Assert.IsTrue(false, "Failed to get user consent value : " + e.Message);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Check if IsSupported(ServiceRequestType) returns correct value for HERE provider")]
- [Property("SPEC", "Tizen.Maps.MapService.IsSupported M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MAE")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- [Property("COVPARAM", "ServiceRequestType")]
- public void IsSupported_ENUM_ALL_SERVICEREQUESTTYPE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_testMapServices, "PRECONDITION: Failed to get MapService for testing.");
-
- // TEST CODE
- try
- {
- foreach (var maps in s_testMapServices)
- {
- var mapService = maps.GetMapService();
- foreach (var requestType in Enum.GetValues(typeof(ServiceRequestType)).Cast<ServiceRequestType>())
- {
- mapService.IsSupported(requestType);
- }
- }
- }
- catch (Exception e)
- {
- Assert.IsTrue(false, "Failed to get IsSupported value : " + e.Message);
- }
-
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Check if IsSupported(ServiceData) returns correct value for HERE provider")]
- [Property("SPEC", "Tizen.Maps.MapService.IsSupported M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MAE")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- [Property("COVPARAM", "ServiceData")]
- public void IsSupported_ENUM_ALL_SERVICEDATA()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_testMapServices, "PRECONDITION: Failed to get MapService for testing.");
-
- // TEST CODE
- try
- {
- foreach (var maps in s_testMapServices)
- {
- var mapService = maps.GetMapService();
- foreach (var dataType in Enum.GetValues(typeof(ServiceData)).Cast<ServiceData>())
- {
- mapService.IsSupported(dataType);
- }
- }
- }
- catch (Exception e)
- {
- Assert.IsTrue(false, "Failed to get IsSupported value : " + e.Message);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Checks if CreateGeocodeRequest() returns valid request object")]
- [Property("SPEC", "Tizen.Maps.MapService.CreateGeocodeRequest M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- [Property("COVPARAM", "string")]
- public void CreateGeocodeRequest_RETURN_TYPE_WITH_FREEFORM_ADDRESS()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_testMapServices, "PRECONDITION: Failed to get MapService for testing.");
-
- // TEST CODE
- try
- {
- foreach (var maps in s_testMapServices)
- {
- var mapService = maps.GetMapService();
- var req = mapService.CreateGeocodeRequest("Area address");
- Assert.IsInstanceOf<GeocodeRequest>(req, "Expecting GeocodeRequest object");
- }
- }
- catch (Exception e)
- {
- Assert.True(false, string.Format("Unexpected Exception: {0}", e.GetType().Name));
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Checks if CreateGeocodeRequest() returns valid request object")]
- [Property("SPEC", "Tizen.Maps.MapService.CreateGeocodeRequest M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- [Property("COVPARAM", "string, Area")]
- public void CreateGeocodeRequest_RETURN_TYPE_WITH_BOUNDARY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_testMapServices, "PRECONDITION: Failed to get MapService for testing.");
-
- // TEST CODE
- try
- {
- foreach (var maps in s_testMapServices)
- {
- var mapService = maps.GetMapService();
- var req = mapService.CreateGeocodeRequest("Area address", new Area(new Geocoordinates(0, 0), 10));
- Assert.IsInstanceOf<GeocodeRequest>(req, "Expecting GeocodeRequest object");
- }
- }
- catch (Exception e)
- {
- Assert.True(false, string.Format("Unexpected Exception: {0}", e.GetType().Name));
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Checks if CreateGeocodeRequest() returns valid request object")]
- [Property("SPEC", "Tizen.Maps.MapService.CreateGeocodeRequest M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- [Property("COVPARAM", "PlaceAddress")]
- public void CreateGeocodeRequest_RETURN_TYPE_WITH_ADDRESS()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_testMapServices, "PRECONDITION: Failed to get MapService for testing.");
-
- // TEST CODE
- try
- {
- foreach (var maps in s_testMapServices)
- {
- var mapService = maps.GetMapService();
- var req = mapService.CreateGeocodeRequest(new PlaceAddress());
- Assert.IsInstanceOf<GeocodeRequest>(req, "Expecting GeocodeRequest object");
- }
- }
- catch (Exception e)
- {
- Assert.True(false, string.Format("Unexpected Exception: {0}", e.GetType().Name));
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Checks if CreateReverseGeocodeRequest() returns valid object")]
- [Property("SPEC", "Tizen.Maps.MapService.CreateReverseGeocodeRequest M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void CreateReverseGeocodeRequest_RETURN_TYPE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_testMapServices, "PRECONDITION: Failed to get MapService for testing.");
-
- // TEST CODE
- try
- {
- foreach (var maps in s_testMapServices)
- {
- var mapService = maps.GetMapService();
- var req = mapService.CreateReverseGeocodeRequest(10.0, 15.0);
- Assert.IsInstanceOf<ReverseGeocodeRequest>(req, "Expecting ReverseGeocodeRequest object");
- }
- }
- catch (Exception e)
- {
- Assert.True(false, string.Format("Unexpected Exception: {0}", e.GetType().Name));
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Checks if CreateMultiReverseGeocodeRequest() returns valid request object")]
- [Property("SPEC", "Tizen.Maps.MapService.CreateMultiReverseGeocodeRequest M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void CreateMultiReverseGeocodeRequest_RETURN_TYPE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_testMapServices, "PRECONDITION: Failed to get MapService for testing.");
-
- // TEST CODE
- try
- {
- foreach (var maps in s_testMapServices)
- {
- var mapService = maps.GetMapService();
- var req = mapService.CreateMultiReverseGeocodeRequest(new List<Geocoordinates> { new Geocoordinates(0, 0) });
- Assert.IsInstanceOf<MultiReverseGeocodeRequest>(req, "Expecting MultiReverseGeocodeRequest object");
- }
- }
- catch (Exception e)
- {
- Assert.True(false, string.Format("Unexpected Exception: {0}", e.GetType().Name));
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Checks if CreateRouteSearchRequest() returns valid request object")]
- [Property("SPEC", "Tizen.Maps.MapService.CreateRouteSearchRequest M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void CreateRouteSearchRequest_RETURN_TYPE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_testMapServices, "PRECONDITION: Failed to get MapService for testing.");
-
- // TEST CODE
- try
- {
- foreach (var maps in s_testMapServices)
- {
- var mapService = maps.GetMapService();
- var req = mapService.CreateRouteSearchRequest(new Geocoordinates(0, 0), new Geocoordinates(10, 0));
- Assert.IsInstanceOf<RouteSearchRequest>(req, "Expecting RouteSearchRequest object");
- }
- }
- catch (Exception e)
- {
- Assert.True(false, string.Format("Unexpected Exception: {0}", e.GetType().Name));
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Checks if CreatePlaceSearchRequest() returns valid request object")]
- [Property("SPEC", "Tizen.Maps.MapService.CreatePlaceSearchRequest M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- [Property("COVPARAM", "Geocoordinates, int")]
- public void CreatePlaceSearchRequest_RETURN_TYPE_WITH_GEOCOORDINATES_DISTANCE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_testMapServices, "PRECONDITION: Failed to get MapService for testing.");
-
- // TEST CODE
- try
- {
- foreach (var maps in s_testMapServices)
- {
- var mapService = maps.GetMapService();
- var req = mapService.CreatePlaceSearchRequest(new Geocoordinates(0, 0), 10);
- Assert.IsInstanceOf<PlaceSearchRequest>(req, "Expecting PlaceSearchRequest object");
- }
- }
- catch (Exception e)
- {
- Assert.True(false, string.Format("Unexpected Exception: {0}", e.GetType().Name));
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Checks if CreatePlaceSearchRequest() returns valid request object")]
- [Property("SPEC", "Tizen.Maps.MapService.CreatePlaceSearchRequest M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- [Property("COVPARAM", "Area")]
- public void CreatePlaceSearchRequest_RETURN_TYPE_WITH_AREA()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_testMapServices, "PRECONDITION: Failed to get MapService for testing.");
-
- // TEST CODE
- try
- {
- foreach (var maps in s_testMapServices)
- {
- var mapService = maps.GetMapService();
- var req = mapService.CreatePlaceSearchRequest(new Area(new Geocoordinates(0, 0), 10));
- Assert.IsInstanceOf<PlaceSearchRequest>(req, "Expecting PlaceSearchRequest object");
- }
- }
- catch (Exception e)
- {
- Assert.True(false, string.Format("Unexpected Exception: {0}", e.GetType().Name));
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Checks if CreatePlaceSearchRequest() returns valid request object")]
- [Property("SPEC", "Tizen.Maps.MapService.CreatePlaceSearchRequest M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- [Property("COVPARAM", "string, Area")]
- public void CreatePlaceSearchRequest_RETURN_TYPE_WITH_ADDRESS_AREA()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_testMapServices, "PRECONDITION: Failed to get MapService for testing.");
-
- // TEST CODE
- try
- {
- foreach (var maps in s_testMapServices)
- {
- var mapService = maps.GetMapService();
- var req = mapService.CreatePlaceSearchRequest("Place address", new Area(new Geocoordinates(0, 0), 10));
- Assert.IsInstanceOf<PlaceSearchRequest>(req, "Expecting PlaceSearchRequest object");
- }
- }
- catch (Exception e)
- {
- Assert.True(false, string.Format("Unexpected Exception: {0}", e.GetType().Name));
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Checks if Provider property returns same value as used in constructor")]
- [Property("SPEC", "Tizen.Maps.MapService.Provider A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void Provider_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_testMapServices, "PRECONDITION: Failed to get MapService for testing.");
-
- // TEST CODE
- try
- {
- foreach (var maps in s_testMapServices)
- {
- var actual = maps.GetMapService();
- MapsUtils.AssertPropEqual(maps.ServiceProvider, actual.Provider, "Provider");
- }
- }
- catch (Exception e)
- {
- Assert.True(false, string.Format("Unexpected Exception: {0}", e.GetType().Name));
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Checks if UserConsented property returns true")]
- [Property("SPEC", "Tizen.Maps.MapService.UserConsented A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Jongmun Woo, jongmun.woo@samsung.com")]
- public void UserConsented_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_testMapServices, "PRECONDITION: Failed to get MapService for testing.");
-
- // TEST CODE
- try
- {
- foreach (var maps in s_testMapServices)
- {
- var actual = maps.GetMapService();
- MapsUtils.AssertPropEqual(maps.ServiceUserConsented, actual.UserConsented, "UserConsented");
- }
- }
- catch (Exception e)
- {
- Assert.True(false, string.Format("Unexpected Exception: {0}", e.GetType().Name));
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets ProviderKey property")]
- [Property("SPEC", "Tizen.Maps.MapService.ProviderKey A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void ProviderKey_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_testMapServices, "PRECONDITION: Failed to get MapService for testing.");
-
- // TEST CODE
- try
- {
- foreach (var maps in s_testMapServices)
- {
- var mapService = maps.GetMapService();
- var original = mapService.ProviderKey;
-
- var expected = "NewProvider/Key";
- mapService.ProviderKey = expected;
- MapsUtils.AssertPropEqual(expected, mapService.ProviderKey, "ProviderKey");
-
- expected = "AnotherProvider/Key";
- mapService.ProviderKey = expected;
- MapsUtils.AssertPropEqual(expected, mapService.ProviderKey, "ProviderKey");
-
- mapService.ProviderKey = original;
- }
- }
- catch (Exception e)
- {
- Assert.True(false, string.Format("Unexpected Exception: {0}", e.GetType().Name));
- }
- }
-
- [Test]
- [Category("P2")]
- [Description("Test: Gets and sets ProviderKey property with wrong formatted key")]
- [Property("SPEC", "Tizen.Maps.MapService.ProviderKey A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void ProviderKey_PROPERTY_READ_WRITE_INVALIDKEY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_testMapServices, "PRECONDITION: Failed to get MapService for testing.");
-
- // TEST CODE
- try
- {
- foreach (var maps in s_testMapServices)
- {
- var mapService = maps.GetMapService();
- var expected = maps.ServiceProviderKey;
-
- mapService.ProviderKey = null;
- MapsUtils.AssertPropEqual(expected, mapService.ProviderKey, "ProviderKey");
- }
- }
- catch (Exception e)
- {
- Assert.True(false, string.Format("Unexpected Exception: {0}", e.GetType().Name));
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets PlaceSearchFilter property")]
- [Property("SPEC", "Tizen.Maps.MapService.PlaceSearchFilter A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void PlaceSearchFilter_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_testMapServices, "PRECONDITION: Failed to get MapService for testing.");
-
- // TEST CODE
- try
- {
- foreach (var maps in s_testMapServices)
- {
- var mapService = maps.GetMapService();
- var expected = new PlaceFilter { Address = "MyAddress" };
- mapService.PlaceSearchFilter = expected;
- var actual = mapService.PlaceSearchFilter;
- Assert.IsTrue(expected == actual, "Expecting same filter used while setting filter value");
- MapsUtils.AssertPropEqual(expected.Address, actual.Address, "PlaceSearchFilter.Address");
- }
- }
- catch (Exception e)
- {
- Assert.True(false, string.Format("Unexpected Exception: {0}", e.GetType().Name));
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets GeocodePreferences property")]
- [Property("SPEC", "Tizen.Maps.MapService.GeocodePreferences A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void GeocodePreferences_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_testMapServices, "PRECONDITION: Failed to get MapService for testing.");
-
- // TEST CODE
- try
- {
- foreach (var maps in s_testMapServices)
- {
- var mapService = maps.GetMapService();
- var expected = new SearchPreference { MaxResults = 100 };
- mapService.Preferences = expected;
- var actual = mapService.GeocodePreferences;
- Assert.IsTrue(expected == actual, "Expecting same preference value used while setting preference value");
- MapsUtils.AssertPropEqual(expected.MaxResults, actual.MaxResults, "GeocodePreferences.MaxResults");
- }
- }
- catch (Exception e)
- {
- Assert.True(false, string.Format("Unexpected Exception: {0}", e.GetType().Name));
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets PlaceSearchPreferences property")]
- [Property("SPEC", "Tizen.Maps.MapService.PlaceSearchPreferences A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void PlaceSearchPreferences_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_testMapServices, "PRECONDITION: Failed to get MapService for testing.");
-
- // TEST CODE
- try
- {
- foreach (var maps in s_testMapServices)
- {
- var mapService = maps.GetMapService();
- var expected = new SearchPreference { MaxResults = 100 };
- mapService.Preferences = expected;
- var actual = mapService.PlaceSearchPreferences;
- Assert.IsTrue(expected == actual, "Expecting same preference value used while setting preference value");
- MapsUtils.AssertPropEqual(expected.MaxResults, actual.MaxResults, "PlaceSearchPreferences.MaxResults");
- }
- }
- catch (Exception e)
- {
- Assert.True(false, string.Format("Unexpected Exception: {0}", e.GetType().Name));
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets RouteSearchPreferences property")]
- [Property("SPEC", "Tizen.Maps.MapService.RouteSearchPreferences A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void RouteSearchPreferences_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_testMapServices, "PRECONDITION: Failed to get MapService for testing.");
-
- // TEST CODE
- try
- {
- foreach (var maps in s_testMapServices)
- {
- var mapService = maps.GetMapService();
- var expected = new SearchPreference { Mode = TransportMode.Truck };
- mapService.Preferences = expected;
- var actual = mapService.RouteSearchPreferences;
- Assert.IsTrue(expected == actual, "Expecting same preference value used while setting preference value");
- MapsUtils.AssertPropEqual((int)expected.Mode, (int)actual.Mode, "RouteSearchPreferences.Mode");
- }
- }
- catch (Exception e)
- {
- Assert.True(false, string.Format("Unexpected Exception: {0}", e.GetType().Name));
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets Preferences property")]
- [Property("SPEC", "Tizen.Maps.MapService.Preferences A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void Preferences_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_testMapServices, "PRECONDITION: Failed to get MapService for testing.");
-
- // TEST CODE
- try
- {
- foreach (var maps in s_testMapServices)
- {
- var mapService = maps.GetMapService();
- var expected = new SearchPreference { MaxResults = 100 };
- mapService.Preferences = expected;
- var actual = mapService.Preferences;
- Assert.IsTrue(expected == actual, "Expecting same preference value used while setting preference value");
- MapsUtils.AssertPropEqual(expected.MaxResults, actual.MaxResults, "Preferences.MaxResults");
- }
- }
- catch (Exception e)
- {
- Assert.True(false, string.Format("Unexpected Exception: {0}", e.GetType().Name));
- }
- }
- }
-}
+++ /dev/null
-// Copyright 2016 by Samsung Electronics, Inc.,
-//
-// This software is the confidential and proprietary information
-// of Samsung Electronics, Inc. ("Confidential Information"). You
-// shall not disclose such Confidential Information and shall use
-// it only in accordance with the terms of the license agreement
-// you entered into with Samsung.
-
-using NUnit.Framework;
-using System;
-using System.Collections.Generic;
-using System.Threading;
-using System.Threading.Tasks;
-using Timeout = System.Threading.Timeout;
-using System.Linq;
-
-namespace Tizen.Maps.Tests
-{
- [TestFixture]
- [Description("Tizen.Maps.MapServiceRequest<T> test class")]
- public class MapServiceRequestTemplateTests
- {
- private List<ServiceHelper> s_testMapServices;
-
- [SetUp]
- public void FixtureInit()
- {
- try
- {
- ServiceHelper.ClearMapServices();
- s_testMapServices = ServiceHelper.GetMapServices();
- }
- catch (Exception e)
- {
- MapsCapabilities.Maps.Assert(e);
- MapsCapabilities.Internet.Assert(e);
- }
- }
-
- [TearDown]
- public void FixtureDestroy()
- {
- s_testMapServices?.Clear();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Triggers geocode search requests and checks response")]
- [Property("SPEC", "Tizen.Maps.MapServiceRequest<T>.GetResponseAsync M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task GetResponseAsync_RETURN_TYPE_GEOCODE_BY_FREEFORMED_ADDRESS()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false || MapsCapabilities.Internet.IsSupported == false) return;
- Assert.IsNotNull(s_testMapServices, "Precondition: Failed to get MapService for testing.");
-
- // TEST CODE
- try
- {
- foreach (var mapService in s_testMapServices)
- {
- var maps = mapService.GetMapService();
- Assert.IsNotNull(maps, "Expect not null map service.");
- if (maps.IsSupported(ServiceRequestType.Geocode) == false) continue;
-
- var request = maps.CreateGeocodeRequest("Berlin");
- var response = await request.GetResponseAsync();
- Assert.IsNotNull(response, "Expecting not null response");
- Assert.IsInstanceOf<IEnumerable<Geocoordinates>>(response, string.Format("Expecting: IEnumerable<Geocoordinates>, Actual: {0}", response.GetType().ToString()));
- Assert.IsNotEmpty(response, string.Format("Expecting response to be non-empty"));
- }
- }
- catch (Exception e)
- {
- Assert.IsTrue(false, string.Format("Failed to execute map service request: {0}", e.Message));
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Triggers geocode search requests and checks response")]
- [Property("SPEC", "Tizen.Maps.MapServiceRequest<T>.GetResponseAsync M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task GetResponseAsync_RETURN_TYPE_GEOCODE_BY_INSIDE_AREA()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false || MapsCapabilities.Internet.IsSupported == false) return;
- Assert.IsNotNull(s_testMapServices, "Precondition: Failed to get MapService for testing.");
-
- // TEST CODE
- try
- {
- foreach (var mapService in s_testMapServices)
- {
- var maps = mapService.GetMapService();
- Assert.IsNotNull(maps, "Expect not null map service.");
- if (maps.IsSupported(ServiceRequestType.GeocodeInsideArea) == false) continue;
-
- var request = maps.CreateGeocodeRequest("Bangalore", new Area(new Geocoordinates(12.990260, 77.59653), new Geocoordinates(12.90738, 77.707405)));
- var response = await request.GetResponseAsync();
- Assert.IsNotNull(response, "Expecting not null response");
- Assert.IsInstanceOf<IEnumerable<Geocoordinates>>(response, string.Format("Expecting: IEnumerable<Geocoordinates>, Actual: {0}", response.GetType().ToString()));
- Assert.IsNotEmpty(response, string.Format("Expecting response to be non-empty"));
- }
- }
- catch (Exception e)
- {
- Assert.IsTrue(false, string.Format("Failed to execute map service request: {0}", e.Message));
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Triggers geocode search requests and checks response")]
- [Property("SPEC", "Tizen.Maps.MapServiceRequest<T>.GetResponseAsync M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task GetResponseAsync_RETURN_TYPE_GEOCODE_BY_STRUCTURED_ADDRESS()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false || MapsCapabilities.Internet.IsSupported == false) return;
- Assert.IsNotNull(s_testMapServices, "Precondition: Failed to get MapService for testing.");
-
- // TEST CODE
- try
- {
- foreach (var mapService in s_testMapServices)
- {
- var maps = mapService.GetMapService();
- Assert.IsNotNull(maps, "Expect not null map service.");
- if (maps.IsSupported(ServiceRequestType.GeocodeByStructuredAddress) == false) continue;
-
- var request = maps.CreateGeocodeRequest(new PlaceAddress { Building = "Ub City", City = "Bengaluru", PostalCode = "560025", Country = "India" });
- var response = await request.GetResponseAsync();
- Assert.IsNotNull(response, "Expecting not null response");
- Assert.IsInstanceOf<IEnumerable<Geocoordinates>>(response, string.Format("Expecting: IEnumerable<Geocoordinates>, Actual: {0}", response.GetType().ToString()));
- Assert.IsNotEmpty(response, string.Format("Expecting response to be non-empty"));
- }
- }
- catch (Exception e)
- {
- Assert.IsTrue(false, string.Format("Failed to execute map service request: {0}", e.Message));
- }
- }
-
- [Test]
- [Category("P2")]
- [Description("Test: Triggers invalid geocode search requests and checks for exception")]
- [Property("SPEC", "Tizen.Maps.MapServiceRequest<T>.GetResponseAsync M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MEX")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task GetResponseAsync_RETURN_TYPE_GEOCODE_REQUEST_EXCEPTION()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false || MapsCapabilities.Internet.IsSupported == false) return;
- Assert.IsNotNull(s_testMapServices, "Precondition: Failed to get MapService for testing.");
-
- // TEST CODE
- try
- {
- foreach (var mapService in s_testMapServices)
- {
- var maps = mapService.GetMapService();
- Assert.IsNotNull(maps, "Expect not null map service.");
- if (maps.IsSupported(ServiceRequestType.Geocode) == false) continue;
-
- var request = maps.CreateGeocodeRequest("");
- try
- {
- await request.GetResponseAsync();
- Assert.IsTrue(false, "Expecting ArgumentException exception");
- }
- catch (Exception e)
- {
- Assert.IsTrue(e.GetType().Name.Equals("ArgumentException"), string.Format("Expecting: ArgumentException, Actual: {0}", e.GetType().Name));
- }
- }
- }
- catch (Exception e)
- {
- Assert.IsTrue(false, string.Format("Failed to execute map service request: {0}", e.Message));
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Triggers place search requests and checks response")]
- [Property("SPEC", "Tizen.Maps.MapServiceRequest<T>.GetResponseAsync M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task GetResponseAsync_RETURN_TYPE_PLACE_BY_COORDINATE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false || MapsCapabilities.Internet.IsSupported == false) return;
- Assert.IsNotNull(s_testMapServices, "Precondition: Failed to get MapService for testing.");
-
- // TEST CODE
- try
- {
- foreach (var mapService in s_testMapServices)
- {
- var maps = mapService.GetMapService();
- Assert.IsNotNull(maps, "Expect not null map service.");
- if (maps.IsSupported(ServiceRequestType.SearchPlace) == false) continue;
-
- var request = maps.CreatePlaceSearchRequest(new Geocoordinates(48.85784, 2.29516), 100);
- var response = await request.GetResponseAsync();
- Assert.IsNotNull(response, "Expecting not null response");
- Assert.IsInstanceOf<IEnumerable<Place>>(response, string.Format("Expecting: IEnumerable<Place>, Actual: {0}", response.GetType().ToString()));
- Assert.IsNotEmpty(response, string.Format("Expecting response to be non-empty"));
- }
- }
- catch (Exception e)
- {
- Assert.IsTrue(false, string.Format("Failed to execute map service request: {0}", e.Message));
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Triggers place search requests and checks response")]
- [Property("SPEC", "Tizen.Maps.MapServiceRequest<T>.GetResponseAsync M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task GetResponseAsync_RETURN_TYPE_PLACE_BY_AREA()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false || MapsCapabilities.Internet.IsSupported == false) return;
- Assert.IsNotNull(s_testMapServices, "Precondition: Failed to get MapService for testing.");
-
- // TEST CODE
- try
- {
- foreach (var mapService in s_testMapServices)
- {
- var maps = mapService.GetMapService();
- Assert.IsNotNull(maps, "Expect not null map service.");
- if (maps.IsSupported(ServiceRequestType.SearchPlaceByArea) == false) continue;
-
- var request = maps.CreatePlaceSearchRequest(new Area(new Geocoordinates(12.980260, 77.697405), 500));
- var response = await request.GetResponseAsync();
- Assert.IsNotNull(response, "Expecting not null response");
- Assert.IsInstanceOf<IEnumerable<Place>>(response, string.Format("Expecting: IEnumerable<Place>, Actual: {0}", response.GetType().ToString()));
- Assert.IsNotEmpty(response, string.Format("Expecting response to be non-empty"));
- }
- }
- catch (Exception e)
- {
- Assert.IsTrue(false, string.Format("Failed to execute map service request: {0}", e.Message));
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Triggers place search requests and checks response")]
- [Property("SPEC", "Tizen.Maps.MapServiceRequest<T>.GetResponseAsync M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task GetResponseAsync_RETURN_TYPE_PLACE_BY_ADDRESS()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false || MapsCapabilities.Internet.IsSupported == false) return;
- Assert.IsNotNull(s_testMapServices, "Precondition: Failed to get MapService for testing.");
-
- // TEST CODE
- try
- {
- foreach (var mapService in s_testMapServices)
- {
- var maps = mapService.GetMapService();
- Assert.IsNotNull(maps, "Expect not null map service.");
- if (maps.IsSupported(ServiceRequestType.SearchPlaceByAddress) == false) continue;
-
- var request = maps.CreatePlaceSearchRequest("The Taj Mahal Palace", new Area(new Geocoordinates(18.921729, 72.833031), 50));
- var response = await request.GetResponseAsync();
- Assert.IsNotNull(response, "Expecting not null response");
- Assert.IsInstanceOf<IEnumerable<Place>>(response, string.Format("Expecting: IEnumerable<Place>, Actual: {0}", response.GetType().ToString()));
- Assert.IsNotEmpty(response, string.Format("Expecting response to be non-empty"));
- }
- }
- catch (Exception e)
- {
- Assert.IsTrue(false, string.Format("Failed to execute map service request: {0}", e.Message));
- }
- }
-
- [Test]
- [Category("P2")]
- [Description("Test: Triggers invalid place search requests and checks for exception")]
- [Property("SPEC", "Tizen.Maps.MapServiceRequest<T>.GetResponseAsync M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MEX")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task GetResponseAsync_RETURN_TYPE_PLACE_REQUEST_EXCEPTION()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false || MapsCapabilities.Internet.IsSupported == false) return;
- Assert.IsNotNull(s_testMapServices, "Precondition: Failed to get MapService for testing.");
-
- // TEST CODE
- try
- {
- foreach (var mapService in s_testMapServices)
- {
- var maps = mapService.GetMapService();
- Assert.IsNotNull(maps, "Expect not null map service.");
- if (maps.IsSupported(ServiceRequestType.SearchPlace) == false) continue;
-
- var request = maps.CreatePlaceSearchRequest("CannotFindAnyPlace", new Area(new Geocoordinates(0, 0), 1));
- try
- {
- await request.GetResponseAsync();
- Assert.IsTrue(false, "Expecting InvalidOperationException exception");
- }
- catch (Exception e)
- {
- Assert.IsTrue(e.GetType().Name.Equals("InvalidOperationException"), string.Format("Expecting: InvalidOperationException, Actual: {0} -> {1}", e.GetType().Name, e.Message));
- }
- }
- }
- catch (Exception e)
- {
- Assert.IsTrue(false, string.Format("Failed to execute map service request: {0}", e.Message));
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Triggers reverse geocode requests and checks response")]
- [Property("SPEC", "Tizen.Maps.MapServiceRequest<T>.GetResponseAsync M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task GetResponseAsync_RETURN_TYPE_REVERSE_GEOCODE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false || MapsCapabilities.Internet.IsSupported == false) return;
- Assert.IsNotNull(s_testMapServices, "Precondition: Failed to get MapService for testing.");
-
- // TEST CODE
- try
- {
- foreach (var mapService in s_testMapServices)
- {
- var maps = mapService.GetMapService();
- Assert.IsNotNull(maps, "Expect not null map service.");
- if (maps.IsSupported(ServiceRequestType.ReverseGeocode) == false) continue;
-
- var request = maps.CreateReverseGeocodeRequest(12.975491, 77.697182);
- var response = await request.GetResponseAsync();
- Assert.IsNotNull(response, "Expecting not null response");
- Assert.IsInstanceOf<IEnumerable<PlaceAddress>>(response, string.Format("Expecting: IEnumerable<PlaceAddress>, Actual: {0}", response.GetType().ToString()));
- Assert.IsNotEmpty(response, string.Format("Expecting response to be non-empty"));
- }
- }
- catch (Exception e)
- {
- Assert.IsTrue(false, string.Format("Failed to execute map service request: {0}", e.Message));
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Triggers multi reverse geocode requests and checks response")]
- [Property("SPEC", "Tizen.Maps.MapServiceRequest<T>.GetResponseAsync M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task GetResponseAsync_RETURN_TYPE_MULTI_REVERSE_GEOCODE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false || MapsCapabilities.Internet.IsSupported == false) return;
- Assert.IsNotNull(s_testMapServices, "Precondition: Failed to get MapService for testing.");
-
- // TEST CODE
- try
- {
- foreach (var mapService in s_testMapServices)
- {
- var maps = mapService.GetMapService();
- Assert.IsNotNull(maps, "Expect not null map service.");
- if (maps.IsSupported(ServiceRequestType.MultiReverseGeocode) == false) continue;
-
- var request = maps.CreateMultiReverseGeocodeRequest(new List<Geocoordinates> {
- new Geocoordinates(12.975491, 77.697182),
- new Geocoordinates(48.85784, 2.29516),
- });
- var response = await request.GetResponseAsync();
- Assert.IsNotNull(response, "Expecting not null response");
- Assert.IsInstanceOf<IEnumerable<PlaceAddress>>(response, string.Format("Expecting: IEnumerable<PlaceAddress>, Actual: {0}", response.GetType().ToString()));
- Assert.IsNotEmpty(response, string.Format("Expecting response to be non-empty"));
- }
- }
- catch (Exception e)
- {
- Assert.IsTrue(false, string.Format("Failed to execute map service request: {0}", e.Message));
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Triggers route search requests and checks response")]
- [Property("SPEC", "Tizen.Maps.MapServiceRequest<T>.GetResponseAsync M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task GetResponseAsync_RETURN_TYPE_ROUTE_BY_ENDPOINTS()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false || MapsCapabilities.Internet.IsSupported == false) return;
- Assert.IsNotNull(s_testMapServices, "Precondition: Failed to get MapService for testing.");
-
- // TEST CODE
- try
- {
- foreach (var mapService in s_testMapServices)
- {
- var maps = mapService.GetMapService();
- Assert.IsNotNull(maps, "Expect not null map service.");
- if (maps.IsSupported(ServiceRequestType.SearchRoute) == false) continue;
-
- var request = maps.CreateRouteSearchRequest(new Geocoordinates(12.975491, 77.697182), new Geocoordinates(12.990647, 77.687907));
- var response = await request.GetResponseAsync();
- Assert.IsNotNull(response, "Expecting not null response");
- Assert.IsInstanceOf<IEnumerable<Route>>(response, string.Format("Expecting: IEnumerable<Route>, Actual: {0}", response.GetType().ToString()));
- Assert.IsNotEmpty(response, string.Format("Expecting response to be non-empty"));
- }
- }
- catch (Exception e)
- {
- Assert.IsTrue(false, string.Format("Failed to execute map service request: {0}", e.Message));
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Triggers route search requests and checks response")]
- [Property("SPEC", "Tizen.Maps.MapServiceRequest<T>.GetResponseAsync M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task GetResponseAsync_RETURN_TYPE_ROUTE_BY_WAYPOINT()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false || MapsCapabilities.Internet.IsSupported == false) return;
- Assert.IsNotNull(s_testMapServices, "Precondition: Failed to get MapService for testing.");
-
- // TEST CODE
- try
- {
- foreach (var mapService in s_testMapServices)
- {
- var maps = mapService.GetMapService();
- Assert.IsNotNull(maps, "Expect not null map service.");
- if (maps.IsSupported(ServiceRequestType.SearchRouteWithWaypoints) == false) continue;
-
- var request = maps.CreateRouteSearchRequest(new Geocoordinates(12.975491, 77.697182), new Geocoordinates(12.990647, 77.687907));
- request.Waypoints = new List<Geocoordinates>() { new Geocoordinates(12.985043, 77.691285) };
- var response = await request.GetResponseAsync();
- Assert.IsNotNull(response, "Expecting not null response");
- Assert.IsInstanceOf<IEnumerable<Route>>(response, string.Format("Expecting: IEnumerable<Route>, Actual: {0}", response.GetType().ToString()));
- Assert.IsNotEmpty(response, string.Format("Expecting response to be non-empty"));
- }
- }
- catch (Exception e)
- {
- Assert.IsTrue(false, string.Format("Failed to execute map service request: {0}", e.Message));
- }
- }
- }
-}
+++ /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 System.IO;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-using ElmSharp;
-using NUnit.Framework;
-using Tizen.Applications;
-
-namespace Tizen.Maps.Tests
-{
- [TestFixture]
- [Description("Tizen.Maps.MapView test class")]
- public class MapViewTests
- {
- private EvasObject s_evasObj;
- private MapService s_maps;
- private MapView s_mapview;
-
- private const string snapshotFilePath = "/tmp/Tizen.Maps.Tests.jpg";
- private string s_validImagePath = Path.Combine(Application.Current.DirectoryInfo.SharedResource, "picture.png");
- private List<MapObject> testObjects = new List<MapObject>();
-
- [SetUp]
- public void Init()
- {
- Elementary.Initialize();
- EcoreSynchronizationContext.Initialize();
-
- int w, h;
- System.Information.TryGetValue("http://tizen.org/feature/screen.width", out w);
- System.Information.TryGetValue("http://tizen.org/feature/screen.height", out h);
-
- s_evasObj = new Window("Test");
- s_evasObj.Resize(w, h);
- s_evasObj.Move(0, 0);
- s_evasObj.Show();
- try
- {
- s_maps = ServiceHelper.GetMapServices().First().GetMapService();
- s_mapview = new MapView(s_evasObj, s_maps);
- }
- catch (Exception e)
- {
- MapsCapabilities.Maps.Assert(e);
- }
- try
- {
- testObjects.Add(new Pin(new Geocoordinates(10.0, 10.0), s_validImagePath));
- testObjects.Add(new Sticker(new Geocoordinates(10.0, 10.0), s_validImagePath));
- }
- catch (Exception e)
- {
- MapsCapabilities.Maps.Assert(e);
- }
- }
- [TearDown]
- public void Destroy()
- {
- s_mapview?.Dispose();
- testObjects.Clear();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Check if constructor returns valid object without any failure or exception")]
- [Property("SPEC", "Tizen.Maps.MapView.MapView C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void MapView_INIT()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_mapview, "Precondition: need map view instance for testing");
-
- // TEST CODE
- var mapview = s_mapview;
- Assert.IsInstanceOf<MapView>(mapview, "Expecting MapView object");
- Assert.True(mapview != null, "The result is null");
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Check if GeolocationToScreen returns correct screen location value")]
- [Property("SPEC", "Tizen.Maps.MapView.GeolocationToScreen M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void GeolocationToScreen_RETURN_TYPE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_mapview, "Precondition: need map view instance for testing");
-
- // TEST CODE
- Point point = s_mapview.GeolocationToScreen(new Geocoordinates(0, 0));
- Assert.IsTrue(point.X >= 0 && point.Y >= 0, string.Format("Wrong return value, X: {0}, Y: {1}", point.X, point.Y));
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Check if ScreenToGeolocation returns correct coordinates")]
- [Property("SPEC", "Tizen.Maps.MapView.ScreenToGeolocation M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void ScreenToGeolocation_RETURN_TYPE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_mapview, "Precondition: need map view instance for testing");
-
- // TEST CODE
- Geocoordinates coordinates = s_mapview.ScreenToGeolocation(new Point { X = 0, Y = 0 });
- Assert.IsTrue(Math.Abs(coordinates.Latitude) <= 90 && Math.Abs(coordinates.Longitude) <= 180, string.Format("Wrong return value"));
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Add map object and check if Children count is increased")]
- [Property("SPEC", "Tizen.Maps.MapView.Add M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void Add_CHANGE_STATUS()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_mapview, "Precondition: need map view instance for testing");
-
- s_mapview.RemoveAll();
- var count = s_mapview.Children.ToList().Count;
- Assert.IsTrue(count == 0, "Precondition: need map view with no map objects added to it");
-
- // TEST CODE
- foreach (var obj in testObjects)
- {
- s_mapview.Add(obj);
- Assert.IsTrue(s_mapview.Children.ToList().Count == (count + 1), "Failed to add a map object to the map view");
-
- ++count;
- }
-
- // POSTCONDITION
- s_mapview.RemoveAll();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Remove map object and check if Children count decreases")]
- [Property("SPEC", "Tizen.Maps.MapView.Remove M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void Remove_CHANGE_STATUS()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_mapview, "Precondition: need map view instance for testing");
- testObjects.ForEach(o => s_mapview.Add(o));
-
- var count = s_mapview.Children.ToList().Count;
- Assert.IsTrue(count > 0, "Precondition: need map view with map objects added to it");
-
- // TEST CODE
- foreach (var obj in testObjects)
- {
- s_mapview.Remove(obj);
- Assert.IsTrue(s_mapview.Children.ToList().Count == (count - 1), "Failed to remove a map object from the map view");
-
- --count;
- }
-
- // POSTCONDITION
- s_mapview.RemoveAll();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Remove all map object and check if Children count becomes zero")]
- [Property("SPEC", "Tizen.Maps.MapView.RemoveAll M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void RemoveAll_CHANGE_STATUS()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_mapview, "Precondition: need map view instance for testing");
- testObjects.ForEach(o => s_mapview.Add(o));
- Assert.IsTrue(s_mapview.Children.ToList().Count > 0, "Precondition: need map view with map objects added to it");
-
- // TEST CODE
- s_mapview.RemoveAll();
- Assert.IsTrue(s_mapview.Children.ToList().Count == 0, "RemoveAll should remove all map objects");
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets MapView BuildingsEnabled property")]
- [Property("SPEC", "Tizen.Maps.MapView.BuildingsEnabled A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void BuildingsEnabled_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_mapview, "Precondition: need map view instance for testing");
-
- // TEST CODE
- var buildingEnabled = s_mapview.BuildingsEnabled;
- PRW<MapView>.For(s_mapview)
- .TestGetterSetter("BuildingsEnabled", false)
- .TestGetterSetter("BuildingsEnabled", s_maps.IsSupported(ServiceData.ViewBuilding))
- .TestGetterSetter("BuildingsEnabled", false)
- .Assert();
-
- // POSTCONDITION
- s_mapview.BuildingsEnabled = buildingEnabled;
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets MapView Center property")]
- [Property("SPEC", "Tizen.Maps.MapView.Center A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void Center_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_mapview, "Precondition: need map view instance for testing");
-
- // TEST CODE
- var center = s_mapview.Center;
- PRW<MapView>.For(s_mapview)
- .TestGetterSetter("Center", new Geocoordinates(0, 0), MapsUtils.IsEquals)
- .TestGetterSetter("Center", new Geocoordinates(-90, 180), MapsUtils.IsEquals)
- .TestGetterSetter("Center", new Geocoordinates(90, -180), MapsUtils.IsEquals)
- .Assert();
-
- // POSTCONDITION
- s_mapview.Center = center;
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets MapView Children property")]
- [Property("SPEC", "Tizen.Maps.MapView.Children A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void Children_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_mapview, "Precondition: need map view instance for testing");
-
- // TEST CODE
- Assert.IsNotNull(s_mapview.Children, "Expecting non-null list");
-
- var childrenList = s_mapview.Children.ToList();
- Assert.IsTrue(childrenList.Count == 0, "Expecting empty list");
-
- testObjects.ForEach(o => s_mapview.Add(o));
- Assert.IsTrue(s_mapview.Children.ToList().Count == testObjects.Count, "Expecting non-empty list");
-
- // POSTCONDITION
- s_mapview.RemoveAll();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets MapView Language property")]
- [Property("SPEC", "Tizen.Maps.MapView.Language A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void Language_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_mapview, "Precondition: need map view instance for testing");
-
- // TEST CODE
- var language = s_mapview.Language;
- PRW<MapView>.For(s_mapview)
- .TestGetterSetter("Language", "en-US")
- .TestGetterSetter("Language", "ko-KR")
- .Assert();
-
- // POSTCONDITION
- s_mapview.Language = language;
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets MapView MapType property")]
- [Property("SPEC", "Tizen.Maps.MapView.MapType A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRE")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void MapType_PROPERTY_GET_SET_ALL_ENUM()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_mapview, "Precondition: need map view instance for testing");
-
- // TEST CODE
- var maptype = s_mapview.MapType;
- foreach (var expected in Enum.GetValues(typeof(MapTypes)).Cast<MapTypes>())
- {
- s_mapview.MapType = expected;
- var actual = s_mapview.MapType;
- Assert.IsTrue(expected == actual, string.Format("Wrong MapType value, Expected: {0}, Actual: {1}", expected, actual));
- }
-
- // POSTCONDITION
- s_mapview.MapType = maptype;
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets MapView MaximumZoomLevel property")]
- [Property("SPEC", "Tizen.Maps.MapView.MaximumZoomLevel A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void MaximumZoomLevel_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_mapview, "Precondition: need map view instance for testing");
-
- // TEST CODE
- var maximumZoomLevel = s_mapview.MaximumZoomLevel;
- var minimumZoomLevel = s_mapview.MinimumZoomLevel;
-
- s_mapview.MinimumZoomLevel = 1;
- PRW<MapView>.For(s_mapview)
- .TestGetterSetter("MaximumZoomLevel", 2)
- .TestGetterSetter("MaximumZoomLevel", 10)
- .TestGetterSetter("MaximumZoomLevel", 20)
- .Assert();
-
- // POSTCONDITION
- s_mapview.MinimumZoomLevel = minimumZoomLevel;
- s_mapview.MaximumZoomLevel = maximumZoomLevel;
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets MapView MinimumZoomLevel property")]
- [Property("SPEC", "Tizen.Maps.MapView.MinimumZoomLevel A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void MinimumZoomLevel_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_mapview, "Precondition: need map view instance for testing");
-
- // TEST CODE
- var maximumZoomLevel = s_mapview.MaximumZoomLevel;
- var minimumZoomLevel = s_mapview.MinimumZoomLevel;
-
- s_mapview.MaximumZoomLevel = 20;
- PRW<MapView>.For(s_mapview)
- .TestGetterSetter("MinimumZoomLevel", 1)
- .TestGetterSetter("MinimumZoomLevel", 10)
- .TestGetterSetter("MinimumZoomLevel", 19)
- .Assert();
-
- // POSTCONDITION
- s_mapview.MinimumZoomLevel = minimumZoomLevel;
- s_mapview.MaximumZoomLevel = maximumZoomLevel;
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets MapView Orientation property")]
- [Property("SPEC", "Tizen.Maps.MapView.Orientation A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void Orientation_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_mapview, "Precondition: need map view instance for testing");
-
- // TEST CODE
- var orientation = s_mapview.Orientation;
- PRW<MapView>.For(s_mapview)
- .TestGetterSetter("Orientation", 0.1, MapsUtils.IsEquals)
- .TestGetterSetter("Orientation", 20.8, MapsUtils.IsEquals)
- .TestGetterSetter("Orientation", 359.99, MapsUtils.IsEquals)
- .Assert();
-
- // POSTCONDITION
- s_mapview.Orientation = orientation;
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets MapView PublicTransitEnabled property")]
- [Property("SPEC", "Tizen.Maps.MapView.PublicTransitEnabled A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void PublicTransitEnabled_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_mapview, "Precondition: need map view instance for testing");
-
- // TEST CODE
- var publicTransitEnabled = s_mapview.PublicTransitEnabled;
- PRW<MapView>.For(s_mapview)
- .TestGetterSetter("PublicTransitEnabled", false)
- .TestGetterSetter("PublicTransitEnabled", s_maps.IsSupported(ServiceData.ViewPublicTransit))
- .TestGetterSetter("PublicTransitEnabled", false)
- .Assert();
-
- // POSTCONDITION
- s_mapview.PublicTransitEnabled = publicTransitEnabled;
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets MapView ScalebarEnabled property")]
- [Property("SPEC", "Tizen.Maps.MapView.ScaleBarEnabled A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void ScaleBarEnabled_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_mapview, "Precondition: need map view instance for testing");
-
- // TEST CODE
- var scalebarEnabled = s_mapview.ScaleBarEnabled;
- PRW<MapView>.For(s_mapview)
- .TestGetterSetter("ScaleBarEnabled", false)
- .TestGetterSetter("ScaleBarEnabled", s_maps.IsSupported(ServiceData.ViewScaleBar))
- .TestGetterSetter("ScaleBarEnabled", false)
- .Assert();
-
- // POSTCONDITION
- s_mapview.ScaleBarEnabled = scalebarEnabled;
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets MapView TrafficEnabled property")]
- [Property("SPEC", "Tizen.Maps.MapView.TrafficEnabled A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void TrafficEnabled_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_mapview, "Precondition: need map view instance for testing");
-
- // TEST CODE
- var trafficEnabled = s_mapview.TrafficEnabled;
- PRW<MapView>.For(s_mapview)
- .TestGetterSetter("TrafficEnabled", false)
- .TestGetterSetter("TrafficEnabled", s_maps.IsSupported(ServiceData.ViewTraffic))
- .TestGetterSetter("TrafficEnabled", false)
- .Assert();
-
- // POSTCONDITION
- s_mapview.TrafficEnabled = trafficEnabled;
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets MapView ZoomLevel property")]
- [Property("SPEC", "Tizen.Maps.MapView.ZoomLevel A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void ZoomLevel_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_mapview, "Precondition: need map view instance for testing");
-
- // TEST CODE
- var maximumZoomLevel = s_mapview.MaximumZoomLevel;
- var minimumZoomLevel = s_mapview.MinimumZoomLevel;
- var zoomLevel = s_mapview.ZoomLevel;
-
- s_mapview.MinimumZoomLevel = 1;
- s_mapview.MaximumZoomLevel = 20;
-
- PRW<MapView>.For(s_mapview)
- .TestGetterSetter("ZoomLevel", 1)
- .TestGetterSetter("ZoomLevel", 10)
- .TestGetterSetter("ZoomLevel", 20)
- .Assert();
-
- // POSTCONDITION
- s_mapview.ZoomLevel = zoomLevel;
- s_mapview.MinimumZoomLevel = minimumZoomLevel;
- s_mapview.MaximumZoomLevel = maximumZoomLevel;
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Captures a snapshot of MapView")]
- [Property("SPEC", "Tizen.Maps.MapView.CaptureSnapshot M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Seechan Kim, cbible.kim@samsung.com")]
- public void CaptureSnapshot_CHANGE_STATUS()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_mapview, "Precondition: need map view instance for testing");
- File.Delete(snapshotFilePath);
-
- // TEST CODE
- try {
- s_mapview.CaptureSnapshot(SnapshotType.JPEG, 95, snapshotFilePath);
- Assert.IsTrue(File.Exists(snapshotFilePath), string.Format("Failed to find the snapshot image file"));
- }
- catch (Exception e)
- {
- Assert.IsTrue(false, string.Format("Exception : {0}", e.GetType().Name));
- }
-
- // POSTCONDITION
- File.Delete(snapshotFilePath);
- }
- }
-}
+++ /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 System.Collections.Generic;
-using System.IO;
-using ElmSharp;
-using NUnit.Framework;
-using Tizen.Applications;
-
-namespace Tizen.Maps.Tests
-{
- [TestFixture]
- [Description("Tizen.Maps.Marker test class")]
- public class MarkerTests
- {
- private List<Marker> s_testData;
- private string s_imagePath = Path.Combine(Application.Current.DirectoryInfo.SharedResource, "picture.png");
-
- [SetUp]
- public void FixtureInit()
- {
- try
- {
- s_testData = new List<Marker> {
- new Pin(new Geocoordinates(10.0, 10.0), s_imagePath),
- new Sticker(new Geocoordinates(10.0, 10.0), s_imagePath),
- };
- }
- catch (Exception e)
- {
- MapsCapabilities.Maps.Assert(e);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Check if Resize properly changes MarkerSize property")]
- [Property("SPEC", "Tizen.Maps.Marker.Resize M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void Resize_CHANGE_STATUS()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_testData, "PRECONDITION: Failed to get Markers for testing.");
-
- // TEST CODE
- s_testData.ForEach(m =>
- {
- new MarkerTester(m)
- .TestResize(new Size(10, 20))
- .TestResize(new Size(50, 10))
- .Assert();
- });
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Check if Move properly changes Position property")]
- [Property("SPEC", "Tizen.Maps.Marker.Move M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void Move_CHANGE_STATUS()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_testData, "PRECONDITION: Failed to get Markers for testing.");
-
- // TEST CODE
- s_testData.ForEach(m =>
- {
- new MarkerTester(m)
- .TestMove(new Geocoordinates(40, 15))
- .TestMove(new Geocoordinates(50, 10))
- .Assert();
- });
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets Marker Coordinates value")]
- [Property("SPEC", "Tizen.Maps.Marker.Coordinates A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void Coordinates_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_testData, "PRECONDITION: Failed to get Markers for testing.");
-
- // TEST CODE
- s_testData.ForEach(m =>
- {
- PRW<Marker>.For(m)
- .TestGetterSetter("Coordinates", new Geocoordinates(34, 56), MapsUtils.IsEquals)
- .TestGetterSetter("Coordinates", new Geocoordinates(89, 7), MapsUtils.IsEquals)
- .Assert();
- });
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets ImagePath value")]
- [Property("SPEC", "Tizen.Maps.Marker.ImagePath A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void ImagePath_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_testData, "PRECONDITION: Failed to get Markers for testing.");
-
- // TEST CODE
- s_testData.ForEach(m =>
- {
- PRW<Marker>.For(m)
- .TestGetterSetter("ImagePath", "New/Image/Path")
- .TestGetterSetter("ImagePath", "Latest/Image/Path")
- .Assert();
- });
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets MarkerSize value")]
- [Property("SPEC", "Tizen.Maps.Marker.MarkerSize A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void MarkerSize_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_testData, "PRECONDITION: Failed to get Markers for testing.");
-
- // TEST CODE
- s_testData.ForEach(m =>
- {
- PRW<Marker>.For(m)
- .TestGetterSetter("MarkerSize", new Size(10, 20))
- .TestGetterSetter("MarkerSize", new Size(100, 50))
- .Assert();
- });
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets ZOrder value")]
- [Property("SPEC", "Tizen.Maps.Marker.ZOrder A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void ZOrder_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_testData, "PRECONDITION: Failed to get Markers for testing.");
-
- // TEST CODE
- s_testData.ForEach(m =>
- {
- PRW<Marker>.For(m)
- .TestGetterSetter("ZOrder", 10)
- .TestGetterSetter("ZOrder", 5)
- .Assert();
- });
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Check if getter for IsVisible property returns previously set value")]
- [Property("SPEC", "Tizen.Maps.Marker.IsVisible A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Seechan Kim, cbible.kim@samsung.com")]
- public void IsVisible_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_testData, "PRECONDITION: Failed to get polyline for testing.");
-
- // TEST CODE
- s_testData.ForEach(m =>
- {
- var isVisible = m.IsVisible;
- PRW<Marker>.For(m)
- .TestGetterSetter("IsVisible", false)
- .TestGetterSetter("IsVisible", true)
- .TestGetterSetter("IsVisible", false)
- .Assert();
-
- // POSTCONDITION
- m.IsVisible = isVisible;
- });
- }
- }
-}
+++ /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 System.Collections.Generic;
-using System.IO;
-using ElmSharp;
-using NUnit.Framework;
-using Tizen.Applications;
-
-namespace Tizen.Maps.Tests
-{
- [TestFixture]
- [Description("Tizen.Maps.Overlay test class")]
- public class OverlayTests
- {
- private List<Overlay> s_testData;
- // private EvasObject s_evasObj = new Window("MapView Test Window");
- private EvasObject s_evasObj = null;
- [SetUp]
- public void FixtureInit()
- {
- try
- {
- s_evasObj = new Window("MapView Test Window");
- s_testData = new List<Overlay> {
- new Overlay(new Geocoordinates(10.0, 10.0), s_evasObj),
- new BoxOverlay(new Geocoordinates(11.0, 11.0), s_evasObj),
- new BubbleOverlay(new Geocoordinates(12.0, 12.0), s_evasObj),
- };
- }
- catch (Exception e)
- {
- MapsCapabilities.Maps.Assert(e);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Check if constructor returns valid object without any failure or exception")]
- [Property("SPEC", "Tizen.Maps.Overlay.Overlay C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void Overlay_INIT()
- {
- // TEST CODE
- try
- {
- CONSTR<Overlay>.ForConstructorWithSignature(typeof(Geocoordinates), typeof(EvasObject))
- .WithArguments(new Geocoordinates(33, 57), s_evasObj)
- .VerifyInstanceOf(typeof(Overlay))
- .VerifyProperty("Coordinates", new Geocoordinates(33, 57), MapsUtils.IsEquals)
- .Assert();
- }
- catch (Exception e)
- {
- MapsCapabilities.Maps.Assert(e);
- }
- }
-
- [Test]
- [Category("P2")]
- [Description("Test: Tries to create object with null parameter")]
- [Property("SPEC", "Tizen.Maps.Overlay.Overlay C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTRN")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void Overlay_INIT_EXCEPTION()
- {
- // TEST CODE
- try
- {
- CONSTRN<Overlay>.ForConstructorWithSignature(typeof(Geocoordinates), typeof(EvasObject))
- .WithArguments(null, s_evasObj).ExpectException(typeof(ArgumentException))
- .WithArguments(new Geocoordinates(33, 57), null).ExpectException(typeof(ArgumentException))
- .WithArguments(null, null).ExpectException(typeof(ArgumentException))
- .Assert();
- }
- catch (Exception e)
- {
- MapsCapabilities.Maps.Assert(e);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets Overlay Coordinates value")]
- [Property("SPEC", "Tizen.Maps.Overlay.Coordinates A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void Coordinates_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_testData, "Precondition: need overlay instances for testing");
-
- // TEST CODE
- s_testData.ForEach(overlay =>
- {
- PRW<Overlay>.For(overlay)
- .TestGetterSetter("Coordinates", new Geocoordinates(34, 56), MapsUtils.IsEquals)
- .TestGetterSetter("Coordinates", new Geocoordinates(89, 7), MapsUtils.IsEquals)
- .Assert();
- });
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets Overlay MaximumZoomLevel property")]
- [Property("SPEC", "Tizen.Maps.Overlay.MaximumZoomLevel A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void MaximumZoomLevel_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_testData, "Precondition: need overlay instances for testing");
-
- // TEST CODE
- s_testData.ForEach(overlay =>
- {
- var maximumZoomLevel = overlay.MaximumZoomLevel;
- var minimumZoomLevel = overlay.MinimumZoomLevel;
-
- overlay.MinimumZoomLevel = 1;
- PRW<Overlay>.For(overlay)
- .TestGetterSetter("MaximumZoomLevel", 2)
- .TestGetterSetter("MaximumZoomLevel", 10)
- .TestGetterSetter("MaximumZoomLevel", 20)
- .Assert();
-
- // POSTCONDITION
- overlay.MinimumZoomLevel = minimumZoomLevel;
- overlay.MaximumZoomLevel = maximumZoomLevel;
- });
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets Overlay MinimumZoomLevel property")]
- [Property("SPEC", "Tizen.Maps.Overlay.MinimumZoomLevel A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void MinimumZoomLevel_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_testData, "Precondition: need overlay instances for testing");
-
- // TEST CODE
- s_testData.ForEach(overlay =>
- {
- var maximumZoomLevel = overlay.MaximumZoomLevel;
- var minimumZoomLevel = overlay.MinimumZoomLevel;
-
- overlay.MaximumZoomLevel = 20;
- PRW<Overlay>.For(overlay)
- .TestGetterSetter("MinimumZoomLevel", 1)
- .TestGetterSetter("MinimumZoomLevel", 10)
- .TestGetterSetter("MinimumZoomLevel", 19)
- .Assert();
-
- // POSTCONDITION
- overlay.MinimumZoomLevel = minimumZoomLevel;
- overlay.MaximumZoomLevel = maximumZoomLevel;
- });
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Check if getter for IsVisible property returns previously set value")]
- [Property("SPEC", "Tizen.Maps.Overlay.IsVisible A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Seechan Kim, cbible.kim@samsung.com")]
- public void IsVisible_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_testData, "PRECONDITION: Failed to get polyline for testing.");
-
- // TEST CODE
- s_testData.ForEach(overlay =>
- {
- var isVisible = overlay.IsVisible;
- PRW<Overlay>.For(overlay)
- .TestGetterSetter("IsVisible", false)
- .TestGetterSetter("IsVisible", true)
- .TestGetterSetter("IsVisible", false)
- .Assert();
-
- // POSTCONDITION
- overlay.IsVisible = isVisible;
- });
- }
- }
-}
+++ /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 System.IO;
-using NUnit.Framework;
-using Tizen.Applications;
-
-namespace Tizen.Maps.Tests
-{
- [TestFixture]
- [Description("Tizen.Maps.Pin test class")]
- public class PinTests
- {
- private string s_validImagePath = Path.Combine(Application.Current.DirectoryInfo.SharedResource, "picture.png");
-
- [Test]
- [Category("P1")]
- [Description("Test: Check if constructor returns valid object without any failure or exception")]
- [Property("SPEC", "Tizen.Maps.Pin.Pin C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- [Property("COVPARAM", "Tizen.Maps.Geocoordinates, string")]
- public void Pin_INIT()
- {
- // TEST CODE
- try
- {
- CONSTR<Pin>.ForConstructorWithSignature(typeof(Geocoordinates), typeof(string))
-
- .WithArguments(new Geocoordinates(10.0, 10.0), "")
- .VerifyInstanceOf(typeof(Pin))
- .VerifyProperty("Coordinates", new Geocoordinates(10.0, 10.0), MapsUtils.IsEquals)
- .VerifyProperty("ImagePath", "")
- .Description("With empty image path")
-
- .WithArguments(new Geocoordinates(50.0, 90.0), s_validImagePath)
- .VerifyInstanceOf(typeof(Pin))
- .VerifyProperty("Coordinates", new Geocoordinates(50.0, 90.0), MapsUtils.IsEquals)
- .VerifyProperty("ImagePath", s_validImagePath)
- .Description("With existing image path")
-
- .Assert();
- }
- catch (Exception e)
- {
- MapsCapabilities.Maps.Assert(e);
- }
- }
-
- [Test]
- [Category("P2")]
- [Description("Test: Tries to create object with null parameter")]
- [Property("SPEC", "Tizen.Maps.Pin.Pin C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTRN")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- [Property("COVPARAM", "Tizen.Maps.Geocoordinates, string")]
- public void Pin_INIT_EXCEPTION()
- {
- // TEST CODE
- try
- {
- CONSTRN<Pin>.ForConstructorWithSignature(typeof(Geocoordinates), typeof(string))
- .WithArguments(null, "")
- .ExpectException(typeof(ArgumentException))
- .Description("With null coordinates")
-
- .WithArguments(new Geocoordinates(50.0, 90.0), null)
- .ExpectException(typeof(ArgumentException))
- .Description("With null image path")
-
- .WithArguments(null, null)
- .ExpectException(typeof(ArgumentException))
- .Description("With all null arguments")
-
- .Assert();
- }
- catch (Exception e)
- {
- MapsCapabilities.Maps.Assert(e);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Check if constructor returns valid object without any failure or exception")]
- [Property("SPEC", "Tizen.Maps.Pin.Pin C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Seechan Kim, cbible.kim@samsung.com")]
- [Property("COVPARAM", "Tizen.Maps.Geocoordinates")]
- public void Pin_INIT_WITH_DEFAULT_IMAGE()
- {
- // TEST CODE
- try
- {
- CONSTR<Pin>.ForConstructorWithSignature(typeof(Geocoordinates))
-
- .WithArguments(new Geocoordinates(50.0, 90.0))
- .VerifyInstanceOf(typeof(Pin))
- .VerifyProperty("Coordinates", new Geocoordinates(50.0, 90.0), MapsUtils.IsEquals)
- .Description("With default image path")
-
- .Assert();
- }
- catch (Exception e)
- {
- MapsCapabilities.Maps.Assert(e);
- }
- }
-
-
- [Test]
- [Category("P2")]
- [Description("Test: Tries to create object with null parameter")]
- [Property("SPEC", "Tizen.Maps.Pin.Pin C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTRN")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- [Property("COVPARAM", "Tizen.Maps.Geocoordinates")]
- public void Pin_INIT_EXCEPTION_WITH_DEFAULT_IMAGE()
- {
- // TEST CODE
- try
- {
- CONSTRN<Pin>.ForConstructorWithSignature(typeof(Geocoordinates))
- .WithArguments(new[] { (object)null })
- .ExpectException(typeof(ArgumentException))
- .Description("With null coordinates")
-
- .Assert();
- }
- catch (Exception e)
- {
- MapsCapabilities.Maps.Assert(e);
- }
- }
- }
-}
+++ /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;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-
-namespace Tizen.Maps.Tests
-{
- [TestFixture]
- [Description("Tizen.Maps.Place test class")]
- public class PlaceTests
- {
- private IDictionary<Place, PlaceData> s_testPlaces;
-
- [TearDown]
- public void FixtureDestroy()
- {
- s_testPlaces?.Clear();
- }
-
- public async Task<IDictionary<Place, PlaceData>> GetTestPlaces()
- {
- return s_testPlaces = await PlaceHelper.GetTestPlaces();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Id value and compares it with expected value")]
- [Property("SPEC", "Tizen.Maps.Place.Id A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Id_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestPlaces(), "PRECONDITION: Failed to get Place objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testPlaces)
- {
- MapsUtils.AssertIsReadable(item.Key.Id);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Name value and compares it with expected value")]
- [Property("SPEC", "Tizen.Maps.Place.Name A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Name_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestPlaces(), "PRECONDITION: Failed to get Place objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testPlaces)
- {
- MapsUtils.AssertIsReadable(item.Key.Name);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Uri value and compares it with expected value")]
- [Property("SPEC", "Tizen.Maps.Place.Uri A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Uri_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestPlaces(), "PRECONDITION: Failed to get Place objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testPlaces)
- {
- MapsUtils.AssertIsReadable(item.Key.Uri);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Coordinates value and compares it with expected value")]
- [Property("SPEC", "Tizen.Maps.Place.Coordinates A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Coordinates_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestPlaces(), "PRECONDITION: Failed to get Place objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testPlaces)
- {
- MapsUtils.AssertIsReadable(item.Key.Coordinates);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Distance value and compares it with expected value")]
- [Property("SPEC", "Tizen.Maps.Place.Distance A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Distance_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestPlaces(), "PRECONDITION: Failed to get Place objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testPlaces)
- {
- MapsUtils.AssertIsReadable(item.Key.Distance);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Address value and compares it with expected value")]
- [Property("SPEC", "Tizen.Maps.Place.Address A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Address_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestPlaces(), "PRECONDITION: Failed to get Place objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testPlaces)
- {
- MapsUtils.AssertIsReadable(item.Key.Address);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Rating value and compares it with expected value")]
- [Property("SPEC", "Tizen.Maps.Place.Rating A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Rating_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestPlaces(), "PRECONDITION: Failed to get Place objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testPlaces)
- {
- MapsUtils.AssertIsReadable(item.Key.Rating);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Property value and compares it with expected value")]
- [Property("SPEC", "Tizen.Maps.Place.Properties A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Properties_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestPlaces(), "PRECONDITION: Failed to get Place objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testPlaces)
- {
- MapsUtils.AssertIsReadable(item.Key.Properties);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Attributes value and compares it with expected value")]
- [Property("SPEC", "Tizen.Maps.Place.Attributes A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Seechan Kim, cbible.kim@samsung.com")]
- public async Task Attributes_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestPlaces(), "PRECONDITION: Failed to get Place objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testPlaces)
- {
- MapsUtils.AssertIsReadable(item.Key.Attributes);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Categories value and compares it with expected value")]
- [Property("SPEC", "Tizen.Maps.Place.Categories A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Seechan Kim, cbible.kim@samsung.com")]
- public async Task Categories_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestPlaces(), "PRECONDITION: Failed to get Place objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testPlaces)
- {
- MapsUtils.AssertIsReadable(item.Key.Categories);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Contacts value and compares it with expected value")]
- [Property("SPEC", "Tizen.Maps.Place.Contacts A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Seechan Kim, cbible.kim@samsung.com")]
- public async Task Contacts_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestPlaces(), "PRECONDITION: Failed to get Place objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testPlaces)
- {
- MapsUtils.AssertIsReadable(item.Key.Contacts);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Editorials value and compares it with expected value")]
- [Property("SPEC", "Tizen.Maps.Place.Editorials A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Seechan Kim, cbible.kim@samsung.com")]
- public async Task Editorials_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestPlaces(), "PRECONDITION: Failed to get Place objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testPlaces)
- {
- MapsUtils.AssertIsReadable(item.Key.Editorials);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Images value and compares it with expected value")]
- [Property("SPEC", "Tizen.Maps.Place.Images A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Seechan Kim, cbible.kim@samsung.com")]
- public async Task Images_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestPlaces(), "PRECONDITION: Failed to get Place objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testPlaces)
- {
- MapsUtils.AssertIsReadable(item.Key.Images);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Supplier property value and verifies with expected value")]
- [Property("SPEC", "Tizen.Maps.Place.Supplier A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Supplier_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestPlaces(), "PRECONDITION: Failed to get Place objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testPlaces)
- {
- MapsUtils.AssertIsReadable(item.Key.Supplier);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Reviews property value and verifies with expected value")]
- [Property("SPEC", "Tizen.Maps.Place.Reviews A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Reviews_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestPlaces(), "PRECONDITION: Failed to get Place objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testPlaces)
- {
- MapsUtils.AssertIsReadable(item.Key.Reviews);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Related property value and verifies with expected value")]
- [Property("SPEC", "Tizen.Maps.Place.Related A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Related_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestPlaces(), "PRECONDITION: Failed to get Place objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testPlaces)
- {
- MapsUtils.AssertIsReadable(item.Key.Related);
- }
- }
- }
-}
+++ /dev/null
-// Copyright 2016 by Samsung Electronics, Inc.,
-//
-// This software is the confidential and proprietary information
-// of Samsung Electronics, Inc. ("Confidential Information"). You
-// shall not disclose such Confidential Information and shall use
-// it only in accordance with the terms of the license agreement
-// you entered into with Samsung.
-
-using NUnit.Framework;
-using System;
-
-namespace Tizen.Maps.Tests
-{
- [TestFixture]
- [Description("Tizen.Maps.PlaceAddress test class")]
- public class PlaceAddressTests
- {
- private PlaceAddress s_address;
-
- [SetUp]
- public void FixtureInit()
- {
- try
- {
- s_address = new PlaceAddress();
- }
- catch (Exception e)
- {
- MapsCapabilities.Maps.Assert(e);
- }
- }
-
- [TearDown]
- public void FixtureDestroy()
- {
- s_address.Dispose();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Check if constructor for the class returns correct object instance")]
- [Property("SPEC", "Tizen.Maps.PlaceAddress.PlaceAddress C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void PlaceAddress_INIT()
- {
- // TEST CODE
- try
- {
- PlaceAddress address = new PlaceAddress();
- Assert.IsInstanceOf<PlaceAddress>(address, "Expecting PlaceAddress object");
- }
- catch (Exception e)
- {
- MapsCapabilities.Maps.Assert(e);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets Building property")]
- [Property("SPEC", "Tizen.Maps.PlaceAddress.Building A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void Building_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_address, "PRECONDITION: Failed to get PlaceAddress object for testing.");
-
- // TEST CODE
- var expected = "address.Building";
- s_address.Building = expected;
- var actual = s_address.Building;
- Assert.IsTrue(expected == actual, string.Format("Wrong Building value, Expected: {0}, Actual: {1}", expected, actual));
-
- expected = "address.Building.New";
- s_address.Building = expected;
- actual = s_address.Building;
- Assert.IsTrue(expected == actual, string.Format("Wrong Building value, Expected: {0}, Actual: {1}", expected, actual));
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets City property")]
- [Property("SPEC", "Tizen.Maps.PlaceAddress.City A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void City_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_address, "PRECONDITION: Failed to get PlaceAddress object for testing.");
-
- // TEST CODE
- var expected = "address.City";
- s_address.City = expected;
- var actual = s_address.City;
- Assert.IsTrue(expected == actual, string.Format("Wrong City value, Expected: {0}, Actual: {1}", expected, actual));
-
- expected = "address.City.New";
- s_address.City = expected;
- actual = s_address.City;
- Assert.IsTrue(expected == actual, string.Format("Wrong City value, Expected: {0}, Actual: {1}", expected, actual));
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets Country property")]
- [Property("SPEC", "Tizen.Maps.PlaceAddress.Country A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void Country_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_address, "PRECONDITION: Failed to get PlaceAddress object for testing.");
-
- // TEST CODE
- var expected = "address.Country";
- s_address.Country = expected;
- var actual = s_address.Country;
- Assert.IsTrue(expected == actual, string.Format("Wrong Country value, Expected: {0}, Actual: {1}", expected, actual));
-
- expected = "address.Country.New";
- s_address.Country = expected;
- actual = s_address.Country;
- Assert.IsTrue(expected == actual, string.Format("Wrong Country value, Expected: {0}, Actual: {1}", expected, actual));
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets CountryCode property")]
- [Property("SPEC", "Tizen.Maps.PlaceAddress.CountryCode A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void CountryCode_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_address, "PRECONDITION: Failed to get PlaceAddress object for testing.");
-
- // TEST CODE
- var expected = "address.CountryCode";
- s_address.CountryCode = expected;
- var actual = s_address.CountryCode;
- Assert.IsTrue(expected == actual, string.Format("Wrong CountryCode value, Expected: {0}, Actual: {1}", expected, actual));
-
- expected = "address.CountryCode.New";
- s_address.CountryCode = expected;
- actual = s_address.CountryCode;
- Assert.IsTrue(expected == actual, string.Format("Wrong CountryCode value, Expected: {0}, Actual: {1}", expected, actual));
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets County property")]
- [Property("SPEC", "Tizen.Maps.PlaceAddress.County A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void County_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_address, "PRECONDITION: Failed to get PlaceAddress object for testing.");
-
- // TEST CODE
- var expected = "address.County";
- s_address.County = expected;
- var actual = s_address.County;
- Assert.IsTrue(expected == actual, string.Format("Wrong County value, Expected: {0}, Actual: {1}", expected, actual));
-
- expected = "address.County.New";
- s_address.County = expected;
- actual = s_address.County;
- Assert.IsTrue(expected == actual, string.Format("Wrong County value, Expected: {0}, Actual: {1}", expected, actual));
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets District property")]
- [Property("SPEC", "Tizen.Maps.PlaceAddress.District A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void District_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_address, "PRECONDITION: Failed to get PlaceAddress object for testing.");
-
- // TEST CODE
- var expected = "address.District";
- s_address.District = expected;
- var actual = s_address.District;
- Assert.IsTrue(expected == actual, string.Format("Wrong District value, Expected: {0}, Actual: {1}", expected, actual));
-
- expected = "address.District.New";
- s_address.District = expected;
- actual = s_address.District;
- Assert.IsTrue(expected == actual, string.Format("Wrong District value, Expected: {0}, Actual: {1}", expected, actual));
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets free text property")]
- [Property("SPEC", "Tizen.Maps.PlaceAddress.FreeText A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void FreeText_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_address, "PRECONDITION: Failed to get PlaceAddress object for testing.");
-
- // TEST CODE
- var expected = "address.FreeText";
- s_address.FreeText = expected;
- var actual = s_address.FreeText;
- Assert.IsTrue(expected == actual, string.Format("Wrong free text value, Expected: {0}, Actual: {1}", expected, actual));
-
- expected = "address.FreeText.New";
- s_address.FreeText = expected;
- actual = s_address.FreeText;
- Assert.IsTrue(expected == actual, string.Format("Wrong free text value, Expected: {0}, Actual: {1}", expected, actual));
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets PostalCode property")]
- [Property("SPEC", "Tizen.Maps.PlaceAddress.PostalCode A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void PostalCode_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_address, "PRECONDITION: Failed to get PlaceAddress object for testing.");
-
- // TEST CODE
- var expected = "address.PostalCode";
- s_address.PostalCode = expected;
- var actual = s_address.PostalCode;
- Assert.IsTrue(expected == actual, string.Format("Wrong PostalCode value, Expected: {0}, Actual: {1}", expected, actual));
-
- expected = "address.PostalCode.New";
- s_address.PostalCode = expected;
- actual = s_address.PostalCode;
- Assert.IsTrue(expected == actual, string.Format("Wrong PostalCode value, Expected: {0}, Actual: {1}", expected, actual));
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets State property")]
- [Property("SPEC", "Tizen.Maps.PlaceAddress.State A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void State_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_address, "PRECONDITION: Failed to get PlaceAddress object for testing.");
-
- // TEST CODE
- var expected = "address.State";
- s_address.State = expected;
- var actual = s_address.State;
- Assert.IsTrue(expected == actual, string.Format("Wrong State value, Expected: {0}, Actual: {1}", expected, actual));
-
- expected = "address.State.New";
- s_address.State = expected;
- actual = s_address.State;
- Assert.IsTrue(expected == actual, string.Format("Wrong State value, Expected: {0}, Actual: {1}", expected, actual));
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets Street property")]
- [Property("SPEC", "Tizen.Maps.PlaceAddress.Street A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void Street_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_address, "PRECONDITION: Failed to get PlaceAddress object for testing.");
-
- // TEST CODE
- var expected = "address.Street";
- s_address.Street = expected;
- var actual = s_address.Street;
- Assert.IsTrue(expected == actual, string.Format("Wrong Street value, Expected: {0}, Actual: {1}", expected, actual));
-
- expected = "address.Street.New";
- s_address.Street = expected;
- actual = s_address.Street;
- Assert.IsTrue(expected == actual, string.Format("Wrong Street value, Expected: {0}, Actual: {1}", expected, actual));
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Checks if ToString() returns correct formatted string")]
- [Property("SPEC", "Tizen.Maps.PlaceAddress.ToString M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Seechan Kim, cbible.kim@samsung.com")]
- public void ToString_RETURN_TYPE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_address, "PRECONDITION: Failed to get PlaceAddress object for testing.");
-
- // TEST CODE
- var formatStr = "{0}";
-
- var expected = string.Format(formatStr, s_address.FreeText);
- var actual = s_address.ToString();
- Assert.IsTrue(expected.IsEquals(actual), string.Format("Wrong ToString value, Expected: {0}, Actual: {1}", expected, actual));
- }
- }
-}
+++ /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;
-using System;
-using System.Collections.Generic;
-using System.Threading.Tasks;
-
-namespace Tizen.Maps.Tests
-{
- [TestFixture]
- [Description("Tizen.Maps.PlaceAttribute test class")]
- public class PlaceAttributeTests
- {
- private Dictionary<PlaceAttribute, AttributeData> s_testdata;
-
- [TearDown]
- public void FixtureDestroy()
- {
- s_testdata?.Clear();
- }
-
- public async Task<Dictionary<PlaceAttribute, AttributeData>> GetTestAttributes()
- {
- return s_testdata = await PlaceHelper.GetTestAttributes();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Id property value and verifies with expected value")]
- [Property("SPEC", "Tizen.Maps.PlaceAttribute.Id A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Id_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestAttributes(), "PRECONDITION: Failed to get PlaceAttribute objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testdata)
- {
- MapsUtils.AssertIsReadable(item.Key.Id);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Label property value and verifies with expected value")]
- [Property("SPEC", "Tizen.Maps.PlaceAttribute.Label A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Label_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestAttributes(), "PRECONDITION: Failed to get PlaceAttribute objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testdata)
- {
- MapsUtils.AssertIsReadable(item.Key.Label);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Text property value and verifies with expected value")]
- [Property("SPEC", "Tizen.Maps.PlaceAttribute.Text A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Text_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestAttributes(), "PRECONDITION: Failed to get PlaceAttribute objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testdata)
- {
- MapsUtils.AssertIsReadable(item.Key.Text);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Checks if ToString() returns correct formatted string")]
- [Property("SPEC", "Tizen.Maps.PlaceAttribute.ToString M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Seechan Kim, cbible.kim@samsung.com")]
- public async Task ToString_RETURN_TYPE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestAttributes(), "PRECONDITION: Failed to get PlaceAttribute objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testdata)
- {
- MapsUtils.AssertIsReadable(item.Key.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;
-using System;
-
-namespace Tizen.Maps.Tests
-{
- [TestFixture]
- [Description("Tizen.Maps.PlaceCategory test class")]
- public class PlaceCategoryTests
- {
- private PlaceCategory s_category;
-
- [SetUp]
- public void FixtureInit()
- {
- try
- {
- s_category = new PlaceCategory();
- }
- catch (Exception e)
- {
- MapsCapabilities.Maps.Assert(e);
- }
- }
-
- [TearDown]
- public void FixtureDestroy()
- {
- s_category.Dispose();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if constructor for the class returns correct object instance")]
- [Property("SPEC", "Tizen.Maps.PlaceCategory.PlaceCategory C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void PlaceCategory_INIT()
- {
- // TEST CODE
- try
- {
- PlaceCategory category = new PlaceCategory();
- Assert.IsInstanceOf<PlaceCategory>(category, "Expecting PlaceCategory object");
- }
- catch (Exception e)
- {
- MapsCapabilities.Maps.Assert(e);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets Id value")]
- [Property("SPEC", "Tizen.Maps.PlaceCategory.Id A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void Id_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_category, "PRECONDITION: Failed to get PlaceCategory object for testing.");
-
- // TEST CODE
- var expected = "category.Id";
- s_category.Id = expected;
- var actual = s_category.Id;
- Assert.IsTrue(expected == actual, string.Format("Wrong Id value, Expected: {0}, Actual: {1}", expected, actual));
-
- expected = "category.Id.new";
- s_category.Id = expected;
- actual = s_category.Id;
- Assert.IsTrue(expected == actual, string.Format("Wrong Id value, Expected: {0}, Actual: {1}", expected, actual));
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets Name value")]
- [Property("SPEC", "Tizen.Maps.PlaceCategory.Name A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void Name_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_category, "PRECONDITION: Failed to get PlaceCategory object for testing.");
-
- // TEST CODE
- var expected = "category.Name";
- s_category.Name = expected;
- var actual = s_category.Name;
- Assert.IsTrue(expected == actual, string.Format("Wrong Name value, Expected: {0}, Actual: {1}", expected, actual));
-
- expected = "category.Name.new";
- s_category.Name = expected;
- actual = s_category.Name;
- Assert.IsTrue(expected == actual, string.Format("Wrong Name value, Expected: {0}, Actual: {1}", expected, actual));
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets URL value")]
- [Property("SPEC", "Tizen.Maps.PlaceCategory.Url A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void Url_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_category, "PRECONDITION: Failed to get PlaceCategory object for testing.");
-
- // TEST CODE
- var expected = "category.Url";
- s_category.Url = expected;
- var actual = s_category.Url;
- Assert.IsTrue(expected == actual, string.Format("Wrong URL value, Expected: {0}, Actual: {1}", expected, actual));
-
- expected = "category.Url.new";
- s_category.Url = expected;
- actual = s_category.Url;
- Assert.IsTrue(expected == actual, string.Format("Wrong URL value, Expected: {0}, Actual: {1}", expected, actual));
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Checks if ToString() returns correct formatted string")]
- [Property("SPEC", "Tizen.Maps.PlaceCategory.ToString M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Seechan Kim, cbible.kim@samsung.com")]
- public void ToString_RETURN_TYPE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_category, "PRECONDITION: Failed to get PlaceCategory objects for testing.");
-
- // TEST CODE
- var formatStr = "{0}";
-
- var expected = string.Format(formatStr, s_category.Name);
- var actual = s_category.ToString();
- Assert.IsTrue(expected.IsEquals(actual), string.Format("Wrong ToString value, Expected: {0}, Actual: {1}", expected, actual));
- }
- }
-}
+++ /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;
-using System;
-using System.Collections.Generic;
-using System.Threading.Tasks;
-
-namespace Tizen.Maps.Tests
-{
- [TestFixture]
- [Description("Tizen.Maps.PlaceContact test class")]
- public class PlaceContactTests
- {
- private Dictionary<PlaceContact, ContactData> s_testdata;
-
- [TearDown]
- public void FixtureDestroy()
- {
- s_testdata?.Clear();
- }
-
- public async Task<Dictionary<PlaceContact, ContactData>> GetTestContacts()
- {
- return s_testdata = await PlaceHelper.GetTestContacts();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Id property value and verifies with expected value")]
- [Property("SPEC", "Tizen.Maps.PlaceContact.Id A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Id_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestContacts(), "PRECONDITION: Failed to get PlaceContact objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testdata)
- {
- MapsUtils.AssertIsReadable(item.Key.Id);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Label property value and verifies with expected value")]
- [Property("SPEC", "Tizen.Maps.PlaceContact.Label A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Label_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestContacts(), "PRECONDITION: Failed to get PlaceContact objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testdata)
- {
- MapsUtils.AssertIsReadable(item.Key.Label);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Value property value and verifies with expected value")]
- [Property("SPEC", "Tizen.Maps.PlaceContact.Value A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Value_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestContacts(), "PRECONDITION: Failed to get PlaceContact objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testdata)
- {
- MapsUtils.AssertIsReadable(item.Key.Value);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Checks if ToString() returns correct formatted string")]
- [Property("SPEC", "Tizen.Maps.PlaceContact.ToString M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Seechan Kim, cbible.kim@samsung.com")]
- public async Task ToString_RETURN_TYPE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestContacts(), "PRECONDITION: Failed to get PlaceContact objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testdata)
- {
- MapsUtils.AssertIsReadable(item.Key.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;
-using System;
-using System.Collections.Generic;
-using System.Threading.Tasks;
-
-namespace Tizen.Maps.Tests
-{
- [TestFixture]
- [Description("Tizen.Maps.PlaceEditorial test class")]
- public class PlaceEditorialTests
- {
- private Dictionary<PlaceEditorial, EditorialData> s_testdata;
-
- [TearDown]
- public void FixtureDestroy()
- {
- s_testdata?.Clear();
- }
-
- public async Task<Dictionary<PlaceEditorial, EditorialData>> GetTestEditorials()
- {
- return s_testdata = await PlaceHelper.GetTestEditorials();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Description property value and verifies with expected value")]
- [Property("SPEC", "Tizen.Maps.PlaceEditorial.Description A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Description_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestEditorials(), "PRECONDITION: Failed to get PlaceEditorial objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testdata)
- {
- MapsUtils.AssertIsReadable(item.Key.Description);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Language property value and verifies with expected value")]
- [Property("SPEC", "Tizen.Maps.PlaceEditorial.Language A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Language_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestEditorials(), "PRECONDITION: Failed to get PlaceEditorial objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testdata)
- {
- MapsUtils.AssertIsReadable(item.Key.Language);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Media property value and verifies with expected value")]
- [Property("SPEC", "Tizen.Maps.PlaceEditorial.Media A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Media_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestEditorials(), "PRECONDITION: Failed to get PlaceEditorial objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testdata)
- {
- MapsUtils.AssertIsReadable(item.Key.Media);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Checks if ToString() returns correct formatted string")]
- [Property("SPEC", "Tizen.Maps.PlaceEditorial.ToString M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Seechan Kim, cbible.kim@samsung.com")]
- public void ToString_RETURN_TYPE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_testdata, "PRECONDITION: Failed to get PlaceEditorial objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testdata)
- {
- MapsUtils.AssertIsReadable(item.Key.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;
-using System;
-
-namespace Tizen.Maps.Tests
-{
- [TestFixture]
- [Description("Tizen.Maps.PlaceFilter test class")]
- public class PlaceFilterTests
- {
- private PlaceFilter s_filter;
-
- [SetUp]
- public void FixtureInit()
- {
- try
- {
- s_filter = new PlaceFilter();
- }
- catch (Exception e)
- {
- MapsCapabilities.Maps.Assert(e);
- }
- }
-
- [TearDown]
- public void FixtureDestroy()
- {
- s_filter?.Dispose();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if constructor for the class returns correct object instance")]
- [Property("SPEC", "Tizen.Maps.PlaceFilter.PlaceFilter C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void PlaceFilter_INIT()
- {
- // TEST CODE
- try
- {
- PlaceFilter filter = new PlaceFilter();
- Assert.IsInstanceOf<PlaceFilter>(filter, "Expecting PlaceFilter object");
- }
- catch (Exception e)
- {
- MapsCapabilities.Maps.Assert(e);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets Address value")]
- [Property("SPEC", "Tizen.Maps.PlaceFilter.Address A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void Address_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_filter, "PRECONDITION: Failed to get PlaceFilter object for testing.");
-
- // TEST CODE
- var expected = "filter.Address";
- s_filter.Address = expected;
- var actual = s_filter.Address;
- Assert.IsTrue(expected == actual, string.Format("Wrong Address value, Expected: {0}, Actual: {1}", expected, actual));
-
- expected = "filter.Address.new";
- s_filter.Address = expected;
- actual = s_filter.Address;
- Assert.IsTrue(expected == actual, string.Format("Wrong Address value, Expected: {0}, Actual: {1}", expected, actual));
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets Category value")]
- [Property("SPEC", "Tizen.Maps.PlaceFilter.Category A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void Category_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_filter, "PRECONDITION: Failed to get PlaceFilter object for testing.");
-
- // TEST CODE
- var expected = new PlaceCategory()
- {
- Id = "PlaceCategory.Id",
- Name = "PlaceCategory.Name",
- Url = "PlaceCategory.Url"
- };
-
- s_filter.Category = expected;
- var actual = s_filter.Category;
- Assert.IsTrue(expected.Id == actual.Id, string.Format("Wrong Category Id value, Expected: {0}, Actual: {1}", expected.Id, actual.Id));
- Assert.IsTrue(expected.Name == actual.Name, string.Format("Wrong Category Name value, Expected: {0}, Actual: {1}", expected.Name, actual.Name));
- Assert.IsTrue(expected.Url == actual.Url, string.Format("Wrong Category URL value, Expected: {0}, Actual: {1}", expected.Url, actual.Url));
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets Keyword value")]
- [Property("SPEC", "Tizen.Maps.PlaceFilter.Keyword A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void Keyword_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_filter, "PRECONDITION: Failed to get PlaceFilter object for testing.");
-
- // TEST CODE
- var expected = "filter.Keyword";
- s_filter.Keyword = expected;
- var actual = s_filter.Keyword;
- Assert.IsTrue(expected == actual, string.Format("Wrong Keyword value, Expected: {0}, Actual: {1}", expected, actual));
-
- expected = "filter.Keyword.new";
- s_filter.Keyword = expected;
- actual = s_filter.Keyword;
- Assert.IsTrue(expected == actual, string.Format("Wrong Keyword value, Expected: {0}, Actual: {1}", expected, actual));
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets Name value")]
- [Property("SPEC", "Tizen.Maps.PlaceFilter.Name A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void Name_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_filter, "PRECONDITION: Failed to get PlaceFilter object for testing.");
-
- // TEST CODE
- var expected = "filter.Name";
- s_filter.Name = expected;
- var actual = s_filter.Name;
- Assert.IsTrue(expected == actual, string.Format("Wrong Name value, Expected: {0}, Actual: {1}", expected, actual));
-
- expected = "filter.Name.new";
- s_filter.Name = expected;
- actual = s_filter.Name;
- Assert.IsTrue(expected == actual, string.Format("Wrong Name value, Expected: {0}, Actual: {1}", expected, actual));
- }
- }
-}
+++ /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;
-using System.Collections.Generic;
-using System.Threading.Tasks;
-
-namespace Tizen.Maps.Tests
-{
- [TestFixture]
- [Description("Tizen.Maps.PlaceImage test class")]
- public class PlaceImageTests
- {
- private Dictionary<PlaceImage, ImageData> s_testdata;
-
- public async Task<Dictionary<PlaceImage, ImageData>> GetTestImages()
- {
- return s_testdata = await PlaceHelper.GetTestImages();
- }
-
- [TearDown]
- public void FixtureDestroy()
- {
- s_testdata?.Clear();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Id property value and verifies with expected value")]
- [Property("SPEC", "Tizen.Maps.PlaceImage.Id A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Id_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestImages(), "PRECONDITION: Failed to get PlaceImages objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testdata)
- {
- MapsUtils.AssertIsReadable(item.Key.Id);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets URL property value and verifies with expected value")]
- [Property("SPEC", "Tizen.Maps.PlaceImage.Url A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Url_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestImages(), "PRECONDITION: Failed to get PlaceImages objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testdata)
- {
- MapsUtils.AssertIsReadable(item.Key.Url);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Width property value and verifies with expected value")]
- [Property("SPEC", "Tizen.Maps.PlaceImage.Width A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Width_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestImages(), "PRECONDITION: Failed to get PlaceImages objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testdata)
- {
- MapsUtils.AssertIsReadable(item.Key.Width);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Height property value and verifies with expected value")]
- [Property("SPEC", "Tizen.Maps.PlaceImage.Height A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Height_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestImages(), "PRECONDITION: Failed to get PlaceImages objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testdata)
- {
- MapsUtils.AssertIsReadable(item.Key.Height);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets UserLink property value and verifies with expected value")]
- [Property("SPEC", "Tizen.Maps.PlaceImage.UserLink A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task UserLink_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestImages(), "PRECONDITION: Failed to get PlaceImages objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testdata)
- {
- MapsUtils.AssertIsReadable(item.Key.UserLink);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets ImageMedia property value and verifies with expected value")]
- [Property("SPEC", "Tizen.Maps.PlaceImage.ImageMedia A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task ImageMedia_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestImages(), "PRECONDITION: Failed to get PlaceImages objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testdata)
- {
- MapsUtils.AssertIsReadable(item.Key.ImageMedia);
- }
- }
- }
-}
+++ /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;
-using System;
-using System.Collections.Generic;
-using System.Threading.Tasks;
-
-namespace Tizen.Maps.Tests
-{
- [TestFixture]
- [Description("Tizen.Maps.PlaceLink test class")]
- public class PlaceLinkTests
- {
- private Dictionary<PlaceLink, LinkData> s_testdata;
-
- [TearDown]
- public void FixtureDestroy()
- {
- s_testdata?.Clear();
- }
-
- public async Task<Dictionary<PlaceLink, LinkData>> GetTestLinks()
- {
- return s_testdata = await PlaceHelper.GetTestLinks();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Id property value and verifies with expected value")]
- [Property("SPEC", "Tizen.Maps.PlaceLink.Id A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Id_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestLinks(), "PRECONDITION: Failed to get PlaceLink objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testdata)
- {
- MapsUtils.AssertIsReadable(item.Key.Id);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Name property value and verifies with expected value")]
- [Property("SPEC", "Tizen.Maps.PlaceLink.Name A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Name_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestLinks(), "PRECONDITION: Failed to get PlaceLink objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testdata)
- {
- MapsUtils.AssertIsReadable(item.Key.Name);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Link property value and verifies with expected value")]
- [Property("SPEC", "Tizen.Maps.PlaceLink.Link A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Link_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestLinks(), "PRECONDITION: Failed to get PlaceLink objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testdata)
- {
- MapsUtils.AssertIsReadable(item.Key.Link);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Type property value and verifies with expected value")]
- [Property("SPEC", "Tizen.Maps.PlaceLink.Type A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Type_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestLinks(), "PRECONDITION: Failed to get PlaceLink objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testdata)
- {
- MapsUtils.AssertIsReadable(item.Key.Type);
- }
- }
- }
-}
+++ /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;
-using System;
-using System.Collections.Generic;
-using System.Threading.Tasks;
-
-namespace Tizen.Maps.Tests
-{
- [TestFixture]
- [Description("Tizen.Maps.PlaceMedia test class")]
- public class PlaceMediaTests
- {
- private Dictionary<PlaceMedia, MediaData> s_testdata;
-
- [TearDown]
- public void FixtureDestroy()
- {
- s_testdata?.Clear();
- }
-
- public async Task<Dictionary<PlaceMedia, MediaData>> GetTestMedia()
- {
- return s_testdata = await PlaceHelper.GetTestMedia();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Attribution property value and verifies with expected value")]
- [Property("SPEC", "Tizen.Maps.PlaceMedia.Attribution A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Attribution_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestMedia(), "PRECONDITION: Failed to get PlaceMedia objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testdata)
- {
- MapsUtils.AssertIsReadable(item.Key.Attribution);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Supplier property value and verifies with expected value")]
- [Property("SPEC", "Tizen.Maps.PlaceMedia.Supplier A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Supplier_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestMedia(), "PRECONDITION: Failed to get PlaceMedia objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testdata)
- {
- MapsUtils.AssertIsReadable(item.Key.Supplier);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Via property value and verifies with expected value")]
- [Property("SPEC", "Tizen.Maps.PlaceMedia.Via A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Via_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestMedia(), "PRECONDITION: Failed to get PlaceMedia objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testdata)
- {
- MapsUtils.AssertIsReadable(item.Key.Via);
- }
- }
- }
-}
+++ /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;
-using System;
-using System.Collections.Generic;
-using System.Threading.Tasks;
-
-namespace Tizen.Maps.Tests
-{
- [TestFixture]
- [Description("Tizen.Maps.PlaceRating test class")]
- public class PlaceRatingTests
- {
- private Dictionary<PlaceRating, RatingData> s_testdata;
-
- [TearDown]
- public void FixtureDestroy()
- {
- s_testdata?.Clear();
- }
-
- public async Task<Dictionary<PlaceRating, RatingData>> GetTestRatings()
- {
- return s_testdata = await PlaceHelper.GetTestRatings();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets UserCount property value and verifies with expected value")]
- [Property("SPEC", "Tizen.Maps.PlaceRating.UserCount A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task UserCount_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestRatings(), "PRECONDITION: Failed to get PlaceRating objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testdata)
- {
- MapsUtils.AssertIsReadable(item.Key.UserCount);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Average property value and verifies with expected value")]
- [Property("SPEC", "Tizen.Maps.PlaceRating.Average A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Average_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestRatings(), "PRECONDITION: Failed to get PlaceRating objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testdata)
- {
- MapsUtils.AssertIsReadable(item.Key.Average);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Checks if ToString() returns correct formatted string")]
- [Property("SPEC", "Tizen.Maps.PlaceRating.ToString M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Seechan Kim, cbible.kim@samsung.com")]
- public async Task ToString_RETURN_TYPE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestRatings(), "PRECONDITION: Failed to get PlaceRating objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testdata)
- {
- MapsUtils.AssertIsReadable(item.Key.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;
-using System;
-using System.Collections.Generic;
-using System.Threading.Tasks;
-
-namespace Tizen.Maps.Tests
-{
- [TestFixture]
- [Description("Tizen.Maps.PlaceReview test class")]
- public class PlaceReviewTests
- {
- private Dictionary<PlaceReview, ReviewData> s_testdata;
-
- [TearDown]
- public void FixtureDestroy()
- {
- s_testdata?.Clear();
- }
-
- public async Task<Dictionary<PlaceReview, ReviewData>> GetTestReviews()
- {
- return s_testdata = await PlaceHelper.GetTestReviews();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Date property value and verifies with expected value")]
- [Property("SPEC", "Tizen.Maps.PlaceReview.Date A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Date_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestReviews(), "PRECONDITION: Failed to get PlaceReview objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testdata)
- {
- MapsUtils.AssertIsReadable(item.Key.Date);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Title property value and verifies with expected value")]
- [Property("SPEC", "Tizen.Maps.PlaceReview.Title A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Title_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestReviews(), "PRECONDITION: Failed to get PlaceReview objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testdata)
- {
- MapsUtils.AssertIsReadable(item.Key.Title);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Rating property value and verifies with expected value")]
- [Property("SPEC", "Tizen.Maps.PlaceReview.Rating A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Rating_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestReviews(), "PRECONDITION: Failed to get PlaceReview objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testdata)
- {
- MapsUtils.AssertIsReadable(item.Key.Rating);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Description property value and verifies with expected value")]
- [Property("SPEC", "Tizen.Maps.PlaceReview.Description A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Description_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestReviews(), "PRECONDITION: Failed to get PlaceReview objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testdata)
- {
- MapsUtils.AssertIsReadable(item.Key.Description);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Language property value and verifies with expected value")]
- [Property("SPEC", "Tizen.Maps.PlaceReview.Language A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Language_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestReviews(), "PRECONDITION: Failed to get PlaceReview objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testdata)
- {
- MapsUtils.AssertIsReadable(item.Key.Language);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets ReviewMedia property value and verifies with expected value")]
- [Property("SPEC", "Tizen.Maps.PlaceReview.ReviewMedia A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task ReviewMedia_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestReviews(), "PRECONDITION: Failed to get PlaceReview objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testdata)
- {
- MapsUtils.AssertIsReadable(item.Key.ReviewMedia);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets UserLink property value and verifies with expected value")]
- [Property("SPEC", "Tizen.Maps.PlaceReview.UserLink A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task UserLink_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestReviews(), "PRECONDITION: Failed to get PlaceReview objects for testing.");
-
- // TEST CODE
- foreach (var item in s_testdata)
- {
- MapsUtils.AssertIsReadable(item.Key.UserLink);
- }
- }
- }
-}
+++ /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 ElmSharp;
-using System.Collections.Generic;
-using NUnit.Framework;
-using System;
-using System.Linq;
-
-namespace Tizen.Maps.Tests
-{
- [TestFixture]
- [Description("Tizen.Maps.Polygon test class")]
- public class PolygonTests
- {
- private Polygon s_polygon;
-
- [SetUp]
- public void FixtureInit()
- {
- try
- {
- var coordinatesList = new List<Geocoordinates> { new Geocoordinates(0, 0), new Geocoordinates(10, 0), new Geocoordinates(0, 10) };
- s_polygon = new Polygon(coordinatesList, new Color(1, 1, 1));
- }
- catch (Exception e)
- {
- MapsCapabilities.Maps.Assert(e);
- }
- }
-
- [TearDown]
- public void FixtureDestroy()
- {
- s_polygon?.Dispose();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Check if constructor returns valid Area object without any failure or exception")]
- [Property("SPEC", "Tizen.Maps.Polygon.Polygon C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void Polygon_INIT()
- {
- try
- {
- var coordinatesList = new List<Geocoordinates> { new Geocoordinates(0, 0), new Geocoordinates(50, 0), new Geocoordinates(0, 50) };
- var expectedColor = new Color(3, 3, 3);
-
- CONSTR<Polygon>.ForConstructorWithSignature(typeof(List<Geocoordinates>), typeof(Color))
- .WithArguments(coordinatesList, expectedColor)
- .VerifyInstanceOf(typeof(Polygon))
- .VerifyProperty("FillColor", expectedColor)
- .Description("With valid arguments")
- .Assert();
- }
- catch (Exception e)
- {
- MapsCapabilities.Maps.Assert(e);
- }
- }
-
- [Test]
- [Category("P2")]
- [Description("Test: Tries to construct Polygon object with less than 3 coordinates")]
- [Property("SPEC", "Tizen.Maps.Polygon.Polygon C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTRN")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void Polygon_INIT_EXCEPTION()
- {
- try
- {
- CONSTRN<Polygon>.ForConstructorWithSignature(typeof(List<Geocoordinates>), typeof(Color))
- .WithArguments(null, new Color(3, 3, 3))
- .ExpectException(typeof(ArgumentException))
- .Description("With null coordinates list")
- .WithArguments(new List<Geocoordinates>(), new Color(3, 3, 3))
- .ExpectException(typeof(ArgumentException))
- .Description("With empty coordinates list")
- .WithArguments(new List<Geocoordinates> { new Geocoordinates(0, 0) }, new Color(3, 3, 3))
- .ExpectException(typeof(ArgumentException))
- .Description("With list with one coordinates")
- .WithArguments(new List<Geocoordinates> { new Geocoordinates(0, 0), new Geocoordinates(50, 0) }, new Color(3, 3, 3))
- .ExpectException(typeof(ArgumentException))
- .Description("With list with two coordinates")
- .Assert();
- }
- catch (Exception e)
- {
- MapsCapabilities.Maps.Assert(e);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Check if getter for FillColor property returns previously set value")]
- [Property("SPEC", "Tizen.Maps.Polygon.FillColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void FillColor_PROPERTY_READ_WRITE()
- {
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_polygon, "PRECONDITION: Failed to get polygon for testing.");
-
- // TEST CODE
- PRW<Polygon>.For(s_polygon)
- .TestGetterSetter("FillColor", new Color(0, 1, 3))
- .TestGetterSetter("FillColor", new Color(255, 64, 128))
- .TestGetterSetter("FillColor", new Color(255, 255, 255))
- .Assert();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Check if getter for Coordinates property returns previously set value")]
- [Property("SPEC", "Tizen.Maps.Polygon.Coordinates A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Seechan Kim, cbible.kim@samsung.com")]
- public void Coordinates_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_polygon, "PRECONDITION: Failed to get polygon for testing.");
-
- // TEST CODE
- IEnumerable<Geocoordinates> coordinates = new List<Geocoordinates> { new Geocoordinates(0, 0), new Geocoordinates(10, 0), new Geocoordinates(0, 10) };
- PRW<Polygon>.For(s_polygon)
- .TestGetterSetter("Coordinates", coordinates, Enumerable.SequenceEqual)
- .Assert();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Check if getter for IsVisible property returns previously set value")]
- [Property("SPEC", "Tizen.Maps.Polygon.IsVisible A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Seechan Kim, cbible.kim@samsung.com")]
- public void IsVisible_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_polygon, "PRECONDITION: Failed to get polygon for testing.");
-
- // TEST CODE
- PRW<Polygon>.For(s_polygon)
- .TestGetterSetter("IsVisible", false)
- .TestGetterSetter("IsVisible", true)
- .TestGetterSetter("IsVisible", false)
- .Assert();
- }
- }
-}
+++ /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 ElmSharp;
-using System.Collections.Generic;
-using NUnit.Framework;
-using System;
-using System.Linq;
-
-namespace Tizen.Maps.Tests
-{
- [TestFixture]
- [Description("Tizen.Maps.Polyline test class")]
- public class PolylineTests
- {
- private Polyline s_polyline;
-
- [SetUp]
- public void FixtureInit()
- {
- try
- {
- var coordinatesList = new List<Geocoordinates> { new Geocoordinates(0, 0), new Geocoordinates(10, 0) };
- s_polyline = new Polyline(coordinatesList, new Color(1, 1, 1), 1);
- }
- catch (Exception e)
- {
- MapsCapabilities.Maps.Assert(e);
- }
- }
-
- [TearDown]
- public void FixtureDestroy()
- {
- s_polyline?.Dispose();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Check if constructor returns valid Area object without any failure or exception")]
- [Property("SPEC", "Tizen.Maps.Polyline.Polyline C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void Polyline_INIT()
- {
- // TEST CODE
- try
- {
- var coordinatesList = new List<Geocoordinates> { new Geocoordinates(0, 0), new Geocoordinates(50, 0) };
- var expectedColor = new Color(3, 3, 3);
- var expectedWidth = 2;
-
- CONSTR<Polyline>.ForConstructorWithSignature(typeof(List<Geocoordinates>), typeof(Color), typeof(int))
-
- .WithArguments(coordinatesList, expectedColor, expectedWidth)
- .VerifyInstanceOf(typeof(Polyline))
- .VerifyProperty("LineColor", expectedColor)
- .VerifyProperty("Width", expectedWidth)
-
- .Assert();
- }
- catch (Exception e)
- {
- MapsCapabilities.Maps.Assert(e);
- }
- }
-
- [Test]
- [Category("P2")]
- [Description("Test: Tries to construct Polyline object with less than 2 coordinates")]
- [Property("SPEC", "Tizen.Maps.Polyline.Polyline C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTRN")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void Polyline_INIT_EXCEPTION()
- {
- // TEST CODE
- try
- {
- CONSTRN<Polyline>.ForConstructorWithSignature(typeof(List<Geocoordinates>), typeof(Color), typeof(int))
-
- .WithArguments(null, new Color(3, 3, 3), 1)
- .ExpectException(typeof(ArgumentException))
- .Description("with null coordinates list")
-
- .WithArguments(new List<Geocoordinates>(), new Color(3, 3, 3), 1)
- .ExpectException(typeof(ArgumentException))
- .Description("with empty coordinates list")
-
- .WithArguments(new List<Geocoordinates> { new Geocoordinates(0, 0) }, new Color(3, 3, 3), 1)
- .ExpectException(typeof(ArgumentException))
- .Description("list with one coordinate")
-
- .Assert();
- }
- catch (Exception e)
- {
- MapsCapabilities.Maps.Assert(e);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Check if getter for LineColor property returns previously set value")]
- [Property("SPEC", "Tizen.Maps.Polyline.LineColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void LineColor_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_polyline, "PRECONDITION: Failed to get polyline for testing.");
-
- // TEST CODE
- PRW<Polyline>.For(s_polyline)
- .TestGetterSetter("LineColor", new Color(5, 5, 5))
- .TestGetterSetter("LineColor", new Color(0, 0, 0))
- .Assert();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Check if getter for Width property returns previously set value")]
- [Property("SPEC", "Tizen.Maps.Polyline.Width A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void Width_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_polyline, "PRECONDITION: Failed to get polyline for testing.");
-
- // TEST CODE
- PRW<Polyline>.For(s_polyline)
- .TestGetterSetter("Width", 5)
- .TestGetterSetter("Width", 1)
- .Assert();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Check if getter for Coordinates property returns previously set value")]
- [Property("SPEC", "Tizen.Maps.Polyline.Coordinates A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Seechan Kim, cbible.kim@samsung.com")]
- public void Coordinates_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_polyline, "PRECONDITION: Failed to get polyline for testing.");
-
- // TEST CODE
- IEnumerable<Geocoordinates> coordinates = new List<Geocoordinates> { new Geocoordinates(0, 0), new Geocoordinates(10, 0) };
- PRW<Polyline>.For(s_polyline)
- .TestGetterSetter("Coordinates", coordinates, Enumerable.SequenceEqual)
- .Assert();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Check if getter for IsVisible property returns previously set value")]
- [Property("SPEC", "Tizen.Maps.Polyline.IsVisible A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Seechan Kim, cbible.kim@samsung.com")]
- public void IsVisible_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_polyline, "PRECONDITION: Failed to get polyline for testing.");
-
- // TEST CODE
- var isVisible = s_polyline.IsVisible;
- PRW<Polyline>.For(s_polyline)
- .TestGetterSetter("IsVisible", false)
- .TestGetterSetter("IsVisible", true)
- .TestGetterSetter("IsVisible", false)
- .Assert();
-
- // POSTCONDITION
- s_polyline.IsVisible = isVisible;
- }
- }
-}
+++ /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;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-
-namespace Tizen.Maps.Tests
-{
- [TestFixture]
- [Description("Tizen.Maps.Route test class")]
- public class RouteTests
- {
- private IDictionary<Route, RouteData> s_testRoutes;
-
- [TearDown]
- public void FixtureDestroy()
- {
- s_testRoutes?.Clear();
- }
-
- public async Task<IDictionary<Route, RouteData>> GetTestRoutes()
- {
- return s_testRoutes = await RouteHelper.GetTestRoutes();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Id value and compares it with expected value")]
- [Property("SPEC", "Tizen.Maps.Route.Id A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Id_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestRoutes(), "PRECONDITION: Failed to get Routes for testing.");
-
- // TEST CODE
- foreach (var item in s_testRoutes)
- {
- MapsUtils.AssertIsReadable(item.Key.Id);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Destination value and compares it with expected value")]
- [Property("SPEC", "Tizen.Maps.Route.Destination A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Destination_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestRoutes(), "PRECONDITION: Failed to get Routes for testing.");
-
- // TEST CODE
- foreach (var item in s_testRoutes)
- {
- MapsUtils.AssertIsReadable(item.Key.Destination);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Distance value and compares it with expected value")]
- [Property("SPEC", "Tizen.Maps.Route.Distance A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Distance_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestRoutes(), "PRECONDITION: Failed to get Routes for testing.");
-
- // TEST CODE
- foreach (var item in s_testRoutes)
- {
- Assert.IsTrue(item.Key.Distance > 0, "Expecting none zero distance");
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Duration value and compares it with expected value")]
- [Property("SPEC", "Tizen.Maps.Route.Duration A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Duration_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestRoutes(), "PRECONDITION: Failed to get Routes for testing.");
-
- // TEST CODE
- foreach (var item in s_testRoutes)
- {
- Assert.IsTrue(item.Key.Duration > 0, "Expecting none zero duration");
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Mode value and compares it with expected value")]
- [Property("SPEC", "Tizen.Maps.Route.Mode A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRE")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Mode_PROPERTY_READ_ONLY_ENUM_ALL_TRANSPORTMODE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestRoutes(), "PRECONDITION: Failed to get Routes for testing.");
-
- // TEST CODE
- foreach (var item in s_testRoutes)
- {
- MapsUtils.AssertIsReadable(item.Key.Mode);
- Assert.IsTrue(item.Key.Mode >= TransportMode.Car && item.Key.Mode <= TransportMode.Truck);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Origin value and compares it with expected value")]
- [Property("SPEC", "Tizen.Maps.Route.Origin A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Origin_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestRoutes(), "PRECONDITION: Failed to get Routes for testing.");
-
- // TEST CODE
- foreach (var item in s_testRoutes)
- {
- MapsUtils.AssertIsReadable(item.Key.Origin);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Path value and compares it with expected value")]
- [Property("SPEC", "Tizen.Maps.Route.Path A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Path_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestRoutes(), "PRECONDITION: Failed to get Routes for testing.");
-
- // TEST CODE
- foreach (var item in s_testRoutes)
- {
- Assert.IsNotNull(item.Key.Path, "Expecting valid path list");
- Assert.IsTrue(item.Key.Path.Count() > 0, "Expecting none empty path list");
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Segments value and compares it with expected value")]
- [Property("SPEC", "Tizen.Maps.Route.Segments A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Segments_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestRoutes(), "PRECONDITION: Failed to get Routes for testing.");
-
- // TEST CODE
- foreach (var item in s_testRoutes)
- {
- Assert.IsNotNull(item.Key.Segments, "Expecting valid segment list");
- Assert.IsTrue(item.Key.Segments.Count() > 0, "Expecting none empty segment list");
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Unit value and compares it with expected value")]
- [Property("SPEC", "Tizen.Maps.Route.Unit A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRE")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Unit_PROPERTY_READ_ONLY_ENUM_ALL_DISTANCEUNIT()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestRoutes(), "PRECONDITION: Failed to get Routes for testing.");
-
- // TEST CODE
- foreach (var item in s_testRoutes)
- {
- MapsUtils.AssertIsReadable(item.Key.Unit);
- Assert.IsTrue(item.Key.Unit >= DistanceUnit.Meter && item.Key.Unit <= DistanceUnit.Yard);
- }
- }
- }
-}
+++ /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;
-using System;
-using System.Collections.Generic;
-using System.Threading.Tasks;
-
-namespace Tizen.Maps.Tests
-{
- [TestFixture]
- [Description("Tizen.Maps.RouteManeuver test class")]
- public class RouteManeuverTests
- {
- private IDictionary<RouteManeuver, RouteManeuverData> s_testManeuver;
-
- [TearDown]
- public void FixtureDestroy()
- {
- s_testManeuver?.Clear();
- }
-
- public async Task<IDictionary<RouteManeuver, RouteManeuverData>> GetTestManeuvers()
- {
- return s_testManeuver = await RouteHelper.GetTestManeuvers();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Direction value and compares it with expected value")]
- [Property("SPEC", "Tizen.Maps.RouteManeuver.Direction A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRE")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Direction_PROPERTY_ENUM_ALL_DIRECTIONTYPE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestManeuvers(), "PRECONDITION: Failed to get RouteManeuver for testing.");
-
- // TEST CODE
- foreach (var item in s_testManeuver)
- {
- MapsUtils.AssertIsReadable(item.Key.Direction);
- Assert.IsTrue(item.Key.Direction >= DirectionType.None && item.Key.Direction <= DirectionType.East);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Turn value and compares it with expected value")]
- [Property("SPEC", "Tizen.Maps.RouteManeuver.Turn A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRE")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Turn_PROPERTY_ENUM_ALL_TURNINSTRUCTION()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestManeuvers(), "PRECONDITION: Failed to get RouteManeuver for testing.");
-
- // TEST CODE
- foreach (var item in s_testManeuver)
- {
- MapsUtils.AssertIsReadable(item.Key.Turn);
- Assert.IsTrue(item.Key.Turn >= TurnInstruction.None && item.Key.Turn <= TurnInstruction.StraightFork);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Position value and compares it with expected value")]
- [Property("SPEC", "Tizen.Maps.RouteManeuver.Position A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Position_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestManeuvers(), "PRECONDITION: Failed to get RouteManeuver for testing.");
-
- // TEST CODE
- foreach (var item in s_testManeuver)
- {
- var value = item.Key.Position;
- Assert.IsInstanceOf<Geocoordinates>(value, "Expecting Geocoordinates object");
- Assert.IsTrue(value.Latitude >= -90 && value.Latitude <= 90);
- Assert.IsTrue(value.Longitude >= -180 && value.Latitude <= 180);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Road value and compares it with expected value")]
- [Property("SPEC", "Tizen.Maps.RouteManeuver.Road A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Road_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestManeuvers(), "PRECONDITION: Failed to get RouteManeuver for testing.");
-
- // TEST CODE
- foreach (var item in s_testManeuver)
- {
- MapsUtils.AssertIsReadable(item.Key.Road);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Instruction value and compares it with expected value")]
- [Property("SPEC", "Tizen.Maps.RouteManeuver.Instruction A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Instruction_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestManeuvers(), "PRECONDITION: Failed to get RouteManeuver for testing.");
-
- // TEST CODE
- foreach (var item in s_testManeuver)
- {
- MapsUtils.AssertIsReadable(item.Key.Instruction);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Locale value and compares it with expected value")]
- [Property("SPEC", "Tizen.Maps.RouteManeuver.Locale A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Locale_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestManeuvers(), "PRECONDITION: Failed to get RouteManeuver for testing.");
-
- // TEST CODE
- foreach (var item in s_testManeuver)
- {
- MapsUtils.AssertIsReadable(item.Key.Locale);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets TimeToNextInstruction value and compares it with expected value")]
- [Property("SPEC", "Tizen.Maps.RouteManeuver.TimeToNextInstruction A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task TimeToNextInstruction_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestManeuvers(), "PRECONDITION: Failed to get RouteManeuver for testing.");
-
- // TEST CODE
- foreach (var item in s_testManeuver)
- {
- Assert.IsTrue(item.Key.TimeToNextInstruction >= 0, "Expecting time equal or greater than 0");
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets DistanceToNextInstruction value and compares it with expected value")]
- [Property("SPEC", "Tizen.Maps.RouteManeuver.DistanceToNextInstruction A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task DistanceToNextInstruction_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestManeuvers(), "PRECONDITION: Failed to get RouteManeuver for testing.");
-
- // TEST CODE
- foreach (var item in s_testManeuver)
- {
- Assert.IsTrue(item.Key.DistanceToNextInstruction >= 0, "Expecting distance equal or greater than 0");
- }
- }
- }
-}
+++ /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 System.Collections.Generic;
-using System.IO;
-using System.Threading.Tasks;
-using System.Linq;
-using NUnit.Framework;
-using Tizen.Applications;
-
-namespace Tizen.Maps.Tests
-{
- [TestFixture]
- [Description("Tizen.Maps.RouteSearchRequest test class")]
- public class RouteSearchRequestTests
- {
- private MapService s_maps;
-
- [SetUp]
- public void FixtureInit()
- {
- try
- {
- s_maps = ServiceHelper.GetMapServices().First().GetMapService();
- }
- catch (Exception e)
- {
- MapsCapabilities.Maps.Assert(e);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Waypoints value and compares it with expected value")]
- [Property("SPEC", "Tizen.Maps.RouteSearchRequest.Waypoints A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Seechan Kim, cbible.kim@samsung.com")]
- public void Waypoints_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_maps, "PRECONDITION: Failed to get map service for testing.");
-
- // TEST CODE
- var request = s_maps.CreateRouteSearchRequest(new Geocoordinates(12.975491, 77.697182), new Geocoordinates(12.990647, 77.687907));
- IEnumerable<Geocoordinates> waypoints1 = new List<Geocoordinates> { new Geocoordinates(35, 56), new Geocoordinates(89, 7) };
- IEnumerable<Geocoordinates> waypoints2 = new List<Geocoordinates> { new Geocoordinates(27, 56), new Geocoordinates(33, 67) };
-
- PRW<RouteSearchRequest>.For(request)
- .TestGetterSetter("Waypoints", waypoints1, MapsUtils.IsEquals)
- .TestGetterSetter("Waypoints", waypoints2, MapsUtils.IsEquals)
- .Assert();
- }
- }
-}
+++ /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;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-
-namespace Tizen.Maps.Tests
-{
- [TestFixture]
- [Description("Tizen.Maps.RouteSegment test class")]
- public class RouteSegmentTests
- {
- private IDictionary<RouteSegment, RouteSegmentData> s_testSegments;
-
- [TearDown]
- public void FixtureDestroy()
- {
- s_testSegments?.Clear();
- }
-
- public async Task<IDictionary<RouteSegment, RouteSegmentData>> GetTestSegments()
- {
- return s_testSegments = await RouteHelper.GetTestSegments();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Origin value and compares it with expected value")]
- [Property("SPEC", "Tizen.Maps.RouteSegment.Origin A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Origin_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestSegments(), "PRECONDITION: Failed to get RouteSegments for testing.");
-
- // TEST CODE
- foreach (var item in s_testSegments)
- {
- MapsUtils.AssertIsReadable(item.Key.Origin);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Destination value and compares it with expected value")]
- [Property("SPEC", "Tizen.Maps.RouteSegment.Destination A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Destination_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestSegments(), "PRECONDITION: Failed to get RouteSegments for testing.");
-
- // TEST CODE
- foreach (var item in s_testSegments)
- {
- MapsUtils.AssertIsReadable(item.Key.Destination);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Distance value and compares it with expected value")]
- [Property("SPEC", "Tizen.Maps.RouteSegment.Distance A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Distance_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestSegments(), "PRECONDITION: Failed to get RouteSegments for testing.");
-
- // TEST CODE
- foreach (var item in s_testSegments)
- {
- Assert.IsTrue(item.Key.Distance >= 0, "Expecting distance equal or greater than 0");
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Duration value and compares it with expected value")]
- [Property("SPEC", "Tizen.Maps.RouteSegment.Duration A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Duration_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestSegments(), "PRECONDITION: Failed to get RouteSegments for testing.");
-
- // TEST CODE
- foreach (var item in s_testSegments)
- {
- Assert.IsTrue(item.Key.Duration >= 0, "Expecting duration equal or greater than 0");
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Maneuvers value and compares it with expected value")]
- [Property("SPEC", "Tizen.Maps.RouteSegment.Maneuvers A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Maneuvers_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestSegments(), "PRECONDITION: Failed to get Routes for testing.");
-
- // TEST CODE
- foreach (var item in s_testSegments)
- {
- Assert.IsNotNull(item.Key.Maneuvers, "Expecting valid maneuver list");
- Assert.IsTrue(item.Key.Maneuvers.Count() > 0, "Expecting none empty maneuver list");
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Path value and compares it with expected value")]
- [Property("SPEC", "Tizen.Maps.RouteSegment.Path A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public async Task Path_PROPERTY_READ_ONLY()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(await GetTestSegments(), "PRECONDITION: Failed to get Routes for testing.");
-
- // TEST CODE
- foreach (var item in s_testSegments)
- {
- Assert.IsNotNull(item.Key.Path, "Expecting valid path list");
- Assert.IsTrue(item.Key.Path.Count() > 0, "Expecting none empty path list");
- }
- }
- }
-}
+++ /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;
-using System;
-using System.Linq;
-using System.Collections.Generic;
-
-namespace Tizen.Maps.Tests
-{
- [TestFixture]
- [Description("Tizen.Maps.SearchPreference test class")]
- public class SearchPreferenceTests
- {
- private SearchPreference s_preference;
-
- [SetUp]
- public void FixtureInit()
- {
- try
- {
- s_preference = new SearchPreference();
- }
- catch (Exception e)
- {
- MapsCapabilities.Maps.Assert(e);
- }
- }
-
- [TearDown]
- public void FixtureDestroy()
- {
- s_preference?.Dispose();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if constructor for the class returns correct object instance")]
- [Property("SPEC", "Tizen.Maps.SearchPreference.SearchPreference C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void SearchPreference_INIT()
- {
- // TEST CODE
- try
- {
- var preference = new SearchPreference();
- Assert.IsInstanceOf<SearchPreference>(preference, "Expecting SearchPreference object");
- }
- catch (Exception e)
- {
- MapsCapabilities.Maps.Assert(e);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets Unit value to all possible value of DistanceUnit")]
- [Property("SPEC", "Tizen.Maps.SearchPreference.Unit A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRE")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void Unit_PROPERTY_ENUM_ALL_DISTANCEUNIT()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_preference, "PRECONDITION: Failed to get RouteSearchPreference for testing.");
-
- // TEST CODE
- foreach (var expected in Enum.GetValues(typeof(DistanceUnit)).Cast<DistanceUnit>())
- {
- s_preference.Unit = expected;
- var actual = s_preference.Unit;
- Assert.IsTrue(expected == actual, string.Format("Wrong Unit value, Expected: {0}, Actual: {1}", expected, actual));
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets Language value")]
- [Property("SPEC", "Tizen.Maps.SearchPreference.Language A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void Language_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_preference, "PRECONDITION: Failed to get RouteSearchPreference for testing.");
-
- //TEST CODE
- var expected = "hi_IN";
- s_preference.Language = expected;
- var actual = s_preference.Language;
- Assert.IsTrue(expected == actual, string.Format("Wrong Language value, Expected: {0}, Actual: {1}", expected, actual));
-
- expected = "en_US";
- s_preference.Language = expected;
- actual = s_preference.Language;
- Assert.IsTrue(expected == actual, string.Format("Wrong Language value, Expected: {0}, Actual: {1}", expected, actual));
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets MaxResults value in given range")]
- [Property("SPEC", "Tizen.Maps.SearchPreference.MaxResults A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void MaxResults_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_preference, "PRECONDITION: Failed to get RouteSearchPreference for testing.");
-
- //TEST CODE
- var expected = 5;
- s_preference.MaxResults = expected;
- var actual = s_preference.MaxResults;
- Assert.IsTrue(expected == actual, string.Format("Wrong MaxResults value, Expected: {0}, Actual: {1}", expected, actual));
-
- expected = 15;
- s_preference.MaxResults = expected;
- actual = s_preference.MaxResults;
- Assert.IsTrue(expected == actual, string.Format("Wrong MaxResults value, Expected: {0}, Actual: {1}", expected, actual));
- }
-
- [Test]
- [Category("P1")]
- [Description("est: Gets and sets MaxResults value to its limit 1 (min)")]
- [Property("SPEC", "Tizen.Maps.SearchPreference.MaxResults A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PMIN")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void MaxResults_PROPERTY_READ_WRITE_MINIMUM()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_preference, "PRECONDITION: Failed to get SearchPreference for testing.");
-
- //TEST CODE
- var expected = 1;
- s_preference.MaxResults = expected;
- var actual = s_preference.MaxResults;
- Assert.IsTrue(expected == actual, string.Format("Wrong MaxResults value, Expected: {0}, Actual: {1}", expected, actual));
- }
-
- [Test]
- [Category("P2")]
- [Description("Test: Gets and sets MaxResults value to out of bound value (below min)")]
- [Property("SPEC", "Tizen.Maps.SearchPreference.MaxResults A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PBM")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void MaxResults_PROPERTY_WRITE_NEGATIVE_VALUE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_preference, "PRECONDITION: Failed to get SearchPreference for testing.");
-
- //TEST CODE
- var expected = s_preference.MaxResults;
-
- s_preference.MaxResults = 0;
- var actual = s_preference.MaxResults;
- Assert.IsTrue(expected == actual, string.Format("Wrong MaxResults value, Expected: {0}, Actual: {1}", expected, actual));
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets and sets CountryCode value")]
- [Property("SPEC", "Tizen.Maps.SearchPreference.CountryCode A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void CountryCode_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_preference, "PRECONDITION: Failed to get RouteSearchPreference for testing.");
-
- //TEST CODE
- var expected = "IND";
- s_preference.CountryCode = expected;
- var actual = s_preference.CountryCode;
- Assert.IsTrue(expected == actual, string.Format("Wrong CountryCode value, Expected: {0}, Actual: {1}", expected, actual));
-
- expected = "KOR";
- s_preference.CountryCode = expected;
- actual = s_preference.CountryCode;
- Assert.IsTrue(expected == actual, string.Format("Wrong CountryCode value, Expected: {0}, Actual: {1}", expected, actual));
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Gets Properties value and checks if it is not null")]
- [Property("SPEC", "Tizen.Maps.SearchPreference.Properties A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void Properties_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_preference, "PRECONDITION: Failed to get RouteSearchPreference for testing.");
-
- // TEST CODE
- var actual = s_preference.Properties;
- Assert.IsInstanceOf<IReadOnlyDictionary<string, string>>(actual, "Expecting IReadOnlyDictionary<string, string> object");
- Assert.IsNotNull(actual, "Expecting not null dictionary of properties");
-
- var expected = new Dictionary<string, string> {
- { "Key1", "Value1" },
- { "Key2", "Value2" },
- };
-
- s_preference.Properties = expected;
- actual = s_preference.Properties;
- Assert.IsInstanceOf<IReadOnlyDictionary<string, string>>(actual, "Expecting IReadOnlyDictionary<string, string> object");
- Assert.IsNotNull(actual, "Expecting not null dictionary of properties");
- Assert.IsTrue(expected.SequenceEqual(actual), "Expecting same property value as pass in constructor");
- }
-
-
- [Test]
- [Category("P1")]
- [Description("Check if getter for Optimization property returns previously set value for all enum values")]
- [Property("SPEC", "Tizen.Maps.SearchPreference.Optimization A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRE")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void Optimization_PROPERTY_ENUM_ALL_ROUTEOPTIMIZATION()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_preference, "PRECONDITION: Failed to get SearchPreference for testing.");
-
- // TEST CODE
- foreach (var expected in Enum.GetValues(typeof(RouteOptimization)).Cast<RouteOptimization>())
- {
- s_preference.Optimization = expected;
- var actual = s_preference.Optimization;
- Assert.IsTrue(expected == actual, string.Format("Wrong Optimization value, Expected: {0}, Actual: {1}", expected, actual));
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if getter for Mode property returns previously set value for all enum values")]
- [Property("SPEC", "Tizen.Maps.SearchPreference.Mode A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRE")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void Mode_PROPERTY_ENUM_ALL_TRANSPORTMODE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_preference, "PRECONDITION: Failed to get SearchPreference for testing.");
-
- // TEST CODE
- foreach (var expected in Enum.GetValues(typeof(TransportMode)).Cast<TransportMode>())
- {
- s_preference.Mode = expected;
- var actual = s_preference.Mode;
- Assert.IsTrue(expected == actual, string.Format("Wrong Mode value, Expected: {0}, Actual: {1}", expected, actual));
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if getter for RouteFeatureWeight property returns previously set value for all enum values")]
- [Property("SPEC", "Tizen.Maps.SearchPreference.RouteFeatureWeight A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRE")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void RouteFeatureWeight_PROPERTY_ENUM_ALL_ROUTEFEATUREWEIGHT()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_preference, "PRECONDITION: Failed to get SearchPreference for testing.");
-
- // TEST CODE
- foreach (var expected in Enum.GetValues(typeof(RouteFeatureWeight)).Cast<RouteFeatureWeight>())
- {
- s_preference.RouteFeatureWeight = expected;
- var actual = s_preference.RouteFeatureWeight;
- Assert.IsTrue(expected == actual, string.Format("Wrong RouteFeatureWeight value, Expected: {0}, Actual: {1}", expected, actual));
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if getter for RouteFeature property returns previously set value for all enum values")]
- [Property("SPEC", "Tizen.Maps.SearchPreference.RouteFeature A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRE")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void RouteFeature_PROPERTY_ENUM_ALL_ROUTEFEATURE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_preference, "PRECONDITION: Failed to get SearchPreference for testing.");
-
- // TEST CODE
- foreach (var expected in Enum.GetValues(typeof(RouteFeature)).Cast<RouteFeature>())
- {
- s_preference.RouteFeature = expected;
- var actual = s_preference.RouteFeature;
- Assert.IsTrue(expected == actual, string.Format("Wrong RouteFeature value, Expected: {0}, Actual: {1}", expected, actual));
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if getter for SearchAlternativeRoutes property returns previously set value")]
- [Property("SPEC", "Tizen.Maps.SearchPreference.SearchAlternativeRoutes A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- public void SearchAlternativeRoutes_PROPERTY_READ_WRITE()
- {
- // PRECONDITION
- if (MapsCapabilities.Maps.IsSupported == false) return;
- Assert.IsNotNull(s_preference, "PRECONDITION: Failed to get SearchPreference object for testing.");
-
- // TEST CODE
- var expected = false;
- s_preference.SearchAlternativeRoutes = expected;
- var actual = s_preference.SearchAlternativeRoutes;
- Assert.IsTrue(expected == actual, string.Format("Wrong SearchAlternativeRoutes value, Expected: {0}, Actual: {1}", expected, actual));
-
- expected = true;
- s_preference.SearchAlternativeRoutes = expected;
- actual = s_preference.SearchAlternativeRoutes;
- Assert.IsTrue(expected == actual, string.Format("Wrong SearchAlternativeRoutes value, Expected: {0}, Actual: {1}", expected, actual));
- }
- }
-}
+++ /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 System.IO;
-using NUnit.Framework;
-using Tizen.Applications;
-
-namespace Tizen.Maps.Tests
-{
- [TestFixture]
- [Description("Tizen.Maps.Sticker test class")]
- public class StickerTests
- {
- private string s_validImagePath = Path.Combine(Application.Current.DirectoryInfo.SharedResource, "picture.png");
-
- [Test]
- [Category("P1")]
- [Description("Test: Check if constructor returns valid object without any failure or exception")]
- [Property("SPEC", "Tizen.Maps.Sticker.Sticker C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- [Property("COVPARAM", "Tizen.Maps.Geocoordinates, string")]
- public void Sticker_INIT()
- {
- // TEST CODE
- try
- {
- Func<Sticker, bool> validator = p => p != null && p.GetType() == typeof(Sticker);
-
- CONSTR<Sticker>.ForConstructorWithSignature(typeof(Geocoordinates), typeof(string))
-
- .WithArguments(new Geocoordinates(10.0, 10.0), "")
- .VerifyInstanceOf(typeof(Sticker))
- .VerifyProperty("Coordinates", new Geocoordinates(10.0, 10.0), MapsUtils.IsEquals)
- .VerifyProperty("ImagePath", "")
- .Description("With empty image path")
-
- .WithArguments(new Geocoordinates(50.0, 90.0), s_validImagePath)
- .VerifyInstanceOf(typeof(Sticker))
- .VerifyProperty("Coordinates", new Geocoordinates(50.0, 90.0), MapsUtils.IsEquals)
- .VerifyProperty("ImagePath", s_validImagePath)
- .Description("With existing image path")
-
- .Assert();
- }
- catch (Exception e)
- {
- MapsCapabilities.Maps.Assert(e);
- }
- }
-
- [Test]
- [Category("P2")]
- [Description("Test: Tries to create object with null parameter")]
- [Property("SPEC", "Tizen.Maps.Sticker.Sticker C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTRN")]
- [Property("AUTHOR", "Dinesh Dwivedi, dinesh.d@samsung.com")]
- [Property("COVPARAM", "Tizen.Maps.Geocoordinates, string")]
- public void Sticker_INIT_EXCEPTION()
- {
- // TEST CODE
- try
- {
- CONSTRN<Sticker>.ForConstructorWithSignature(typeof(Geocoordinates), typeof(string))
- .WithArguments(null, "")
- .ExpectException(typeof(ArgumentException))
- .Description("With null coordinates")
-
- .WithArguments(new Geocoordinates(50.0, 90.0), null)
- .ExpectException(typeof(ArgumentException))
- .Description("With null image path")
-
- .WithArguments(null, null)
- .ExpectException(typeof(ArgumentException))
- .Description("With all null arguments")
-
- .Assert();
- }
- catch (Exception e)
- {
- MapsCapabilities.Maps.Assert(e);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Check if constructor returns valid object without any failure or exception")]
- [Property("SPEC", "Tizen.Maps.Sticker.Sticker C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Seechan Kim, cbible.kim@samsung.com")]
- [Property("COVPARAM", "Tizen.Maps.Geocoordinates")]
- public void Sticker_INIT_WITH_DEFAULT_IMAGE()
- {
- // TEST CODE
- try
- {
- Func<Sticker, bool> validator = p => p != null && p.GetType() == typeof(Sticker);
-
- CONSTR<Sticker>.ForConstructorWithSignature(typeof(Geocoordinates))
-
- .WithArguments(new Geocoordinates(50.0, 90.0))
- .VerifyInstanceOf(typeof(Sticker))
- .VerifyProperty("Coordinates", new Geocoordinates(50.0, 90.0), MapsUtils.IsEquals)
- .Description("With default image path")
-
- .Assert();
- }
- catch (Exception e)
- {
- MapsCapabilities.Maps.Assert(e);
- }
- }
-
- [Test]
- [Category("P2")]
- [Description("Test: Tries to create object with null parameter")]
- [Property("SPEC", "Tizen.Maps.Sticker.Sticker C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTRN")]
- [Property("AUTHOR", "Seechan Kim, cbible.kim@samsung.com")]
- [Property("COVPARAM", "Tizen.Maps.Geocoordinates")]
- public void Sticker_INIT_EXCEPTION_WITH_DEFAULT_IMAGE()
- {
- // TEST CODE
- try
- {
- CONSTRN<Sticker>.ForConstructorWithSignature(typeof(Geocoordinates))
- .WithArguments(new[] { (object)null })
- .ExpectException(typeof(ArgumentException))
- .Description("With null coordinates")
-
- .Assert();
- }
- catch (Exception e)
- {
- MapsCapabilities.Maps.Assert(e);
- }
- }
-
- }
-}
+++ /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 System.IO;
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-namespace Tizen.Maps.Tests
-{
- public class CONSTR<T> : Tester<T>
- {
- private ConstructorInfo _ctor;
- private ConstructorTester<T> _testcase;
-
- public CONSTR(ConstructorInfo ctor)
- {
- _ctor = ctor;
- }
-
- public override void Assert()
- {
- if (_testcase != null)
- {
- testcases.Add(_testcase.AddTest());
- }
- base.Assert();
- }
-
-
- public static CONSTR<T> ForConstructorWithSignature(params Type[] argTypes)
- {
- ConstructorInfo ctor = typeof(T).GetConstructor(argTypes);
- return new CONSTR<T>(ctor);
- }
-
- public CONSTR<T> Description(string description)
- {
- _testcase.ID = description;
- return this;
- }
-
- public CONSTR<T> WithArguments(params object[] args)
- {
- if (_testcase?.Args != null)
- {
- testcases.Add(_testcase.AddTest());
- }
-
- _testcase = new ConstructorTester<T>(_ctor) { ID = "CONSTR", Args = args };
- return this;
- }
-
- public CONSTR<T> VerifyProperty<V>(string propName, V expected, Func<V, V, bool> comparator, [CallerFilePath] string file = "", [CallerLineNumber] int line = 0)
- {
- _testcase.verifiers.Add((T obj) =>
- {
- PropertyInfo property = obj.GetType().GetProperty(propName);
- V actual = (V)property.GetValue(obj);
-
- if (comparator != null)
- {
- if (comparator(expected, actual) == false)
- {
- return string.Format($"{Path.GetFileName(file)}:{line} -- {propName} getter returned {actual}, expecting {expected}");
- }
- }
- return string.Empty;
- });
- return this;
- }
-
- public CONSTR<T> VerifyProperty<V>(string propName, V expected, [CallerFilePath] string file = "", [CallerLineNumber] int line = 0)
- {
- _testcase.verifiers.Add((T obj) =>
- {
- PropertyInfo property = obj.GetType().GetProperty(propName);
- V actual = (V)property.GetValue(obj);
- if (!expected.Equals(actual))
- {
- return string.Format($"{Path.GetFileName(file)}:{line} -- {propName} getter returned {actual}, expecting {expected}");
- }
- return string.Empty;
- });
- return this;
- }
-
- public CONSTR<T> VerifyInstanceOf(Type objectType, [CallerFilePath] string file = "", [CallerLineNumber] int line = 0)
- {
- _testcase.verifiers.Add((T obj) =>
- {
- if (!objectType.IsAssignableFrom(obj.GetType()))
- {
- return string.Format($"{Path.GetFileName(file)}:{line} -- constructor returned {obj.GetType()} instance, expecting {objectType}");
- }
- return string.Empty;
- });
-
- return this;
- }
- }
-}
\ No newline at end of file
+++ /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 System.Collections.Generic;
-using System.IO;
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-namespace Tizen.Maps.Tests
-{
- public class CONSTRN<T> : Tester<T>
- {
- private ConstructorInfo _ctor;
- private ConstructorTester<T> _testcase;
-
- public CONSTRN(ConstructorInfo ctor)
- {
- _ctor = ctor;
- }
-
- public static CONSTRN<T> ForConstructorWithSignature(params Type[] argTypes)
- {
- ConstructorInfo ctor = typeof(T).GetConstructor(argTypes);
- return new CONSTRN<T>(ctor);
- }
-
- public CONSTRN<T> Description(string description)
- {
- _testcase.ID = description;
- return this;
- }
-
- public CONSTRN<T> WithArguments(params object[] args)
- {
- _testcase = new ConstructorTester<T>(_ctor) { ID = "CONSTRN", Args = args };
- return this;
- }
-
- private Testcase AddTest(ConstructorTester<T> testcase, Type exception, string file, int line)
- {
- return () =>
- {
- List<string> errors = new List<string>();
- try
- {
- testcase.InvokeConstructor(testcase.Args);
- errors.Add($"{Path.GetFileName(file)}:{line} -- {exception.Name} not thrown when expected.");
- }
- catch (Exception ex)
- {
- if (ex.GetType() != exception)
- {
- errors.Add($"{Path.GetFileName(file)}:{line} -- {ex.GetType().Name} thrown when {exception.Name} was expected.");
- errors.Add($"{ex.Message}");
- errors.Add($"{ex.StackTrace}");
- }
- }
- return testcase.FormatResult(errors);
- };
- }
-
- public CONSTRN<T> ExpectException(Type exception, [CallerFilePath] string file = "", [CallerLineNumber] int line = 0)
- {
- testcases.Add(AddTest(_testcase, exception, file, line));
- return this;
- }
- }
-}
\ No newline at end of file
+++ /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 System.Collections.Generic;
-using System.Reflection;
-
-namespace Tizen.Maps.Tests
-{
- internal class ConstructorTester<T> : Tester<T>
- {
- protected ConstructorInfo _ctor;
-
- public ConstructorTester(ConstructorInfo ctor)
- {
- _ctor = ctor;
- }
-
- public string ID { get; set; }
- public object[] Args { get; set; }
-
- public Type exception { get; set; }
-
- public List<Func<T, string>> verifiers = new List<Func<T, string>>();
-
- internal string FormatResult(List<string> errors)
- {
- string res = string.Empty;
- if (errors.Count > 0)
- {
- return $"[{ID}] failed with following errors:{Environment.NewLine} {string.Join($"{Environment.NewLine} ", errors)}";
- }
- return res;
- }
-
- private Testcase SuccessTest()
- {
- return () =>
- {
- List<string> errors = new List<string>();
- try
- {
- T obj = InvokeConstructor(Args);
- foreach (var testcase in verifiers)
- {
- string err = testcase(obj);
- if (string.IsNullOrEmpty(err) == false)
- {
- errors.Add(err);
- }
- }
- }
- catch (Exception ex)
- {
- errors.Add($"{ex.GetType().Name} thrown when success was expected.");
- errors.Add($"{ex.Message}");
- errors.AddRange(ex.StackTrace.Split('\n'));
- }
- return FormatResult(errors);
- };
- }
-
- private Testcase ExceptionTest()
- {
- return () =>
- {
- List<string> errors = new List<string>();
- try
- {
- InvokeConstructor(Args);
- errors.Add($"{exception.Name} not thrown when expected.");
- }
- catch (Exception ex)
- {
- if (ex.GetType() != exception)
- {
- errors.Add($"{ex.GetType().Name} thrown when {exception.Name} was expected.");
- errors.Add($"{ex.Message}");
- errors.AddRange(ex.StackTrace.Split('\n'));
- }
- }
- return FormatResult(errors);
- };
- }
-
- internal T InvokeConstructor(object[] args)
- {
- try
- {
- return (T)_ctor.Invoke(args);
- }
- catch (TargetInvocationException ex)
- {
- throw ex.InnerException;
- }
- }
-
- internal Testcase AddTest()
- {
- if (exception != null) return ExceptionTest();
- return SuccessTest();
- }
- }
-}
\ No newline at end of file
+++ /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 System.IO;
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-namespace Tizen.Maps.Tests
-{
- public class MCST<T> : Tester<T>
- {
- private MethodInfo _method;
- private MethodTester<T> _testcase;
-
- public MCST(MethodInfo method)
- {
- _method = method;
- }
-
- public override void Assert()
- {
- if (_testcase != null)
- {
- testcases.Add(_testcase.AddTest());
- }
- base.Assert();
- }
-
-
- public static MCST<T> ForMethodWithSignature(string name, params Type[] argTypes)
- {
- MethodInfo method = typeof(T).GetMethod(name, argTypes);
- return new MCST<T>(method);
- }
-
- public MCST<T> Test(T obj)
- {
- _testcase = new MethodTester<T>(obj, _method) { ID = "MCST" };
- return this;
- }
-
- public MCST<T> Description(string description)
- {
- _testcase.ID = description;
- return this;
- }
-
- public MCST<T> WithArguments(params object[] args)
- {
- if (_testcase?.Args != null)
- {
- testcases.Add(_testcase.AddTest());
- }
-
- _testcase.Args = args;
- return this;
- }
-
- public MCST<T> VerifyProperty<V>(string propName, V expected, Func<V, V, bool> comparator, [CallerFilePath] string file = "", [CallerLineNumber] int line = 0)
- {
- _testcase.verifiers.Add((T obj) =>
- {
- PropertyInfo property = obj.GetType().GetProperty(propName);
- V actual = (V)property.GetValue(obj);
-
- if (comparator != null)
- {
- if (comparator(expected, actual) == false)
- {
- return string.Format($"{Path.GetFileName(file)}:{line} -- {propName} getter returned {actual}, expecting {expected}");
- }
- }
- return string.Empty;
- });
- return this;
- }
-
- public MCST<T> VerifyProperty<V>(string propName, V expected, [CallerFilePath] string file = "", [CallerLineNumber] int line = 0)
- {
- _testcase.verifiers.Add((T obj) =>
- {
- PropertyInfo property = obj.GetType().GetProperty(propName);
- V actual = (V)property.GetValue(obj);
- if (!expected.Equals(actual))
- {
- return string.Format($"{Path.GetFileName(file)}:{line} -- {propName} getter returned {actual}, expecting {expected}");
- }
- return string.Empty;
- });
- return this;
- }
- }
-}
\ No newline at end of file
+++ /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 ElmSharp;
-
-namespace Tizen.Maps.Tests
-{
- public class MarkerTester : Tester<Marker>
- {
- private readonly Marker _marker = null;
-
- public MarkerTester(Marker marker)
- {
- _marker = marker;
- }
-
- public MarkerTester TestResize(Size expected)
- {
- testcases.Add(() =>
- {
- _marker.Resize(expected);
- if (expected.IsEquals(_marker.MarkerSize) == false)
- {
- return string.Format("Failed to resize, Expected Size: {0}, Actual Size: {1}", expected, _marker.MarkerSize);
- }
- return string.Empty;
- });
- return this;
- }
-
- public MarkerTester TestMove(Geocoordinates expected)
- {
- testcases.Add(() =>
- {
- _marker.Move(expected);
- var actual = _marker.Coordinates;
- if (expected.IsEquals(_marker.Coordinates) == false)
- {
- return string.Format("Failed to move, Expected Position: {0}, Actual Position: {1}", expected, _marker.Coordinates);
- }
- return string.Empty;
- });
- return this;
- }
- }
-}
\ No newline at end of file
+++ /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;
-using Tizen.System;
-using System;
-
-namespace Tizen.Maps.Tests
-{
- internal static partial class MapsCapabilities
- {
- public static Capability Maps = new Capability("http://tizen.org/feature/maps");
- public static Capability Internet = new Capability("http://tizen.org/feature/network.internet");
-
- internal partial class Capability
- {
- private bool _isSupported = false;
- private bool _isInitialized = false;
- private string _feature;
-
- public Capability(string feature)
- {
- _feature = feature;
- }
-
- private bool CheckCapability()
- {
- bool ret = false;
- if (Information.TryGetValue<bool>(_feature, out ret))
- return ret;
- return false;
- }
-
- public bool IsSupported
- {
- get
- {
- if (_isInitialized == false)
- {
- _isSupported = CheckCapability();
- _isInitialized = true;
- }
- return _isSupported;
- }
- }
-
- public void Assert(Exception e)
- {
- if (_isSupported == false)
- {
- NUnit.Framework.Assert.IsTrue(e.GetType().Name.Equals("InvalidOperationException"),
- string.Format("Expecting: InvalidOperationException, Actual: {0}", e.GetType().Name));
- }
- }
- }
- }
-}
+++ /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;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-
-namespace Tizen.Maps.Tests
-{
- internal static partial class MapsUtils
- {
- private const double ESP = 0.000001;
- public static bool IsEquals(this double first, double second)
- {
- return Math.Abs(first - second) < ESP;
- }
-
- public static bool IsEquals(this string first, string second)
- {
- return first == second;
- }
-
- public static bool IsEquals<T>(this T first, T second) where T : IEquatable<T>
- {
- return first.Equals(second);
- }
-
- public static bool IsEquals(this AddressData first, PlaceAddress second)
- {
- return first.Building.IsEquals(second.Building) && first.City.IsEquals(second.City) && first.Country.IsEquals(second.Country)
- && first.CountryCode.IsEquals(second.CountryCode) && first.County.IsEquals(second.County) && first.District.IsEquals(second.District)
- && first.FreeText.IsEquals(second.FreeText) && first.PostalCode.IsEquals(second.PostalCode) && first.State.IsEquals(second.State)
- && first.Street.IsEquals(second.Street);
- }
-
- public static bool IsEquals(this GeocoordinatesData first, Geocoordinates second)
- {
- return first.Latitude.IsEquals(second.Latitude) && first.Longitude.IsEquals(second.Longitude);
- }
-
- public static bool IsEquals(this LinkData first, PlaceLink second)
- {
- return first.Id.IsEquals(second.Id) && first.Name.IsEquals(second.Name) && first.Link.IsEquals(second.Link) && first.Type.IsEquals(second.Type);
- }
-
- public static bool IsEquals(this MediaData first, PlaceMedia second)
- {
- return first.Attribution.IsEquals(second.Attribution) && first.Supplier.IsEquals(second.Supplier) && first.Via.IsEquals(second.Via);
- }
-
- public static bool IsEquals(this RatingData first, PlaceRating second)
- {
- return first.Average.IsEquals(second.Average) && first.UserCount.IsEquals(second.UserCount);
- }
-
- public static bool IsEquals(this Geocoordinates first, Geocoordinates second)
- {
- return first.Latitude.IsEquals(second.Latitude) && first.Longitude.IsEquals(second.Longitude);
- }
-
- public static bool IsEquals(IEnumerable<Geocoordinates> first, IEnumerable<Geocoordinates> second)
- {
- return first.Zip(second, (f, s) => f.IsEquals(s)).All(p => p == true);
- }
-
- public static void AssertPropEqual<T1, T2>(T1 expected, T2 actual, string name) where T1 : IMapComparator<T1, T2>
- {
- if (expected != null && actual != null)
- {
- Assert.IsTrue(expected.IsEquals(actual), string.Format("Wrong {0} value, Expected: [{1}], Actual: [{2}]", name, expected, actual));
- }
- else
- {
- Assert.IsTrue(expected == null && actual == null, string.Format("Wrong {0} value, Expected: [{1}], Actual: [{2}]", name, expected, actual));
- }
- }
-
- public static void AssertPropEqual<T1, T2>(IEnumerable<T1> expected, IEnumerable<T2> actual, string name) where T1 : IMapComparator<T1, T2>
- {
- var result = expected.Zip(actual, (a, b) => a.IsEquals(b)).All(a => a == true);
- Assert.IsTrue(result, string.Format("Wrong {0} value, Expected: [{1}], Actual: [{2}]", name,
- string.Join(", ", expected.Select(e => e.ToString())),
- string.Join(", ", actual.Select(e => e.ToString()))));
- }
-
- public static void AssertPropEqual(bool expected, bool actual, string name)
- {
- Assert.IsTrue(expected.IsEquals(actual), string.Format("Wrong {0} value, Expected: [{1}], Actual: [{2}]", name, expected, actual));
- }
-
- public static void AssertPropEqual(int expected, int actual, string name)
- {
- Assert.IsTrue(expected.IsEquals(actual), string.Format("Wrong {0} value, Expected: [{1}], Actual: [{2}]", name, expected, actual));
- }
-
- public static void AssertPropEqual(double expected, double actual, string name)
- {
- Assert.IsTrue(expected.IsEquals(actual), string.Format("Wrong {0} value, Expected: [{1}], Actual: [{2}]", name, expected, actual));
- }
-
- public static void AssertPropEqual(string expected, string actual, string name)
- {
- Assert.IsTrue(expected.IsEquals(actual), string.Format("Wrong {0} value, Expected: [{1}], Actual: [{2}]", name, expected, actual));
- }
-
- public static void AssertIsReadable<T>(T value)
- {
- try
- {
- T t = value;
- Assert.IsTrue(t != null, string.Format("{0} is null", t));
- }
- catch (Exception e)
- {
- Assert.IsTrue(false, string.Format("Unexpected Exception: {0}", e.GetType().Name));
- }
- }
- }
-
- public interface IMapComparator<T1, T2>
- {
- bool IsEquals(T2 other);
- }
-}
+++ /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 System.Collections.Generic;
-using System.Reflection;
-
-namespace Tizen.Maps.Tests
-{
- public class MethodTester<T> : Tester<T>
- {
- private T _testObj;
- protected MethodInfo _method;
-
- public MethodTester(T obj, MethodInfo method)
- {
- _testObj = obj;
- _method = method;
- }
-
- public string ID { get; set; }
- public object[] Args { get; set; }
-
- public Type exception { get; set; }
-
- public List<Func<T, string>> verifiers = new List<Func<T, string>>();
-
- internal string FormatResult(List<string> errors)
- {
- string res = string.Empty;
- if (errors.Count > 0)
- {
- return $"[{ID}] failed with following errors:{Environment.NewLine} {string.Join($"{Environment.NewLine} ", errors)}";
- }
- return res;
- }
-
- private Testcase SuccessTest()
- {
- return () =>
- {
- List<string> errors = new List<string>();
- try
- {
- InvokeMethod(Args);
- foreach (var testcase in verifiers)
- {
- string err = testcase(_testObj);
- if (string.IsNullOrEmpty(err) == false)
- {
- errors.Add(err);
- }
- }
- }
- catch (Exception ex)
- {
- errors.Add($"{ex.GetType().Name} thrown when success was expected.");
- }
- return FormatResult(errors);
- };
- }
-
- private Testcase ExceptionTest()
- {
- return () =>
- {
- List<string> errors = new List<string>();
- try
- {
- InvokeMethod(Args);
- errors.Add($"{exception.Name} not thrown when expected.");
- }
- catch (Exception ex)
- {
- if (ex.GetType() != exception)
- {
- errors.Add($"{ex.GetType().Name} thrown when {exception.Name} was expected.");
- }
- }
- return FormatResult(errors);
- };
- }
-
- internal T InvokeMethod(object[] args)
- {
- try
- {
- return (T)_method.Invoke(_testObj, args);
- }
- catch (TargetInvocationException ex)
- {
- throw ex.InnerException;
- }
- }
-
- internal Testcase AddTest()
- {
- if (exception != null) return ExceptionTest();
- return SuccessTest();
- }
- }
-}
\ No newline at end of file
+++ /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 System.Collections.Generic;
-using System.IO;
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-namespace Tizen.Maps.Tests
-{
- public class PRW<T> : Tester<T>
- {
- private T _testObj;
-
- private PRW(T obj)
- {
- _testObj = obj;
- }
-
- public static PRW<T> For(T obj)
- {
- return new PRW<T>(obj);
- }
-
- public PRW<T> TestGetterSetter<V>(string propName, V value, V expected, Func<V, V, bool> comparator, [CallerFilePath] string file = "", [CallerLineNumber] int line = 0)
- {
- PropertyInfo property = _testObj.GetType().GetProperty(propName);
- testcases.Add(() =>
- {
- try
- {
- property.SetValue(_testObj, value);
- }
- catch (TargetInvocationException ex)
- {
- throw ex.InnerException;
- }
-
- V actual = (V)property.GetValue(_testObj);
- if (!comparator(expected, actual))
- {
- return string.Format($"{Path.GetFileName(file)}:{line} -- {propName} getter returned {actual}, expecting {expected}");
- }
-
- return string.Empty;
- });
-
- return this;
- }
-
- public PRW<T> TestGetterSetter<V>(string propName, V value, [CallerFilePath] string file = "", [CallerLineNumber] int line = 0)
- {
- return TestGetterSetter(propName, value, value, (a, b) => a.Equals(b), file, line);
- }
-
- public PRW<T> TestGetterSetter<V>(string propName, V value, Func<V, V, bool> comparator, [CallerFilePath] string file = "", [CallerLineNumber] int line = 0)
- {
- return TestGetterSetter(propName, value, value, comparator, file, line);
- }
- }
-}
\ No newline at end of file
+++ /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 System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-
-namespace Tizen.Maps.Tests
-{
- public static class PlaceHelper
- {
- private static MapService s_maps = null;
- private static Dictionary<Place, PlaceData> s_testPlaces = null;
-
- public static async Task<Place> GetPlace(Geocoordinates coordinate, int distance = 5)
- {
- if (s_maps == null)
- s_maps = ServiceHelper.GetMapServices().First().GetMapService();
- var req = s_maps.CreatePlaceSearchRequest(coordinate, distance);
- var places = await req.GetResponseAsync();
- return places.FirstOrDefault();
- }
-
- public static async Task<Dictionary<PlaceRating, RatingData>> GetTestRatings()
- {
- if (s_testPlaces == null) await GetTestPlaces();
- return s_testPlaces?.ToDictionary(p => p.Key.Rating, p => p.Value.Rating);
- }
-
- public static async Task<Dictionary<PlaceContact, ContactData>> GetTestContacts()
- {
- var data = new Dictionary<PlaceContact, ContactData>();
- if (s_testPlaces == null) await GetTestPlaces();
- if (s_testPlaces != null)
- {
- foreach (var item in s_testPlaces)
- {
- if (item.Key == null) continue;
- foreach (var testItem in item.Key.Contacts.Zip(item.Value.Contacts, (k, v) => new { Key = k, Value = v }))
- {
- if (testItem.Key == null) continue;
- data[testItem.Key] = testItem.Value;
- }
- }
- }
-
- return data;
- }
-
- public static async Task<Dictionary<PlaceAttribute, AttributeData>> GetTestAttributes()
- {
- var data = new Dictionary<PlaceAttribute, AttributeData>();
- if (s_testPlaces == null) await GetTestPlaces();
- if (s_testPlaces != null)
- {
- foreach (var item in s_testPlaces)
- {
- if (item.Key == null) continue;
- foreach (var testItem in item.Key.Attributes.Zip(item.Value.Attributes, (k, v) => new { Key = k, Value = v }))
- {
- if (testItem.Key == null) continue;
- data[testItem.Key] = testItem.Value;
- }
- }
- }
-
- return data;
- }
-
- public static async Task<Dictionary<PlaceEditorial, EditorialData>> GetTestEditorials()
- {
- var data = new Dictionary<PlaceEditorial, EditorialData>();
- if (s_testPlaces == null) await GetTestPlaces();
- if (s_testPlaces != null)
- {
- foreach (var item in s_testPlaces)
- {
- if (item.Key == null) continue;
- foreach (var testItem in item.Key.Editorials.Zip(item.Value.Editorials, (k, v) => new { Key = k, Value = v }))
- {
- if (testItem.Key == null) continue;
- data[testItem.Key] = testItem.Value;
- }
- }
- }
- return data;
- }
-
- public static async Task<Dictionary<PlaceImage, ImageData>> GetTestImages()
- {
- var data = new Dictionary<PlaceImage, ImageData>();
- if (s_testPlaces == null) await GetTestPlaces();
- if (s_testPlaces != null)
- {
- foreach (var item in s_testPlaces)
- {
- if (item.Key?.Images == null) continue;
- foreach (var testItem in item.Key.Images.Zip(item.Value.Images, (k, v) => new { Key = k, Value = v }))
- {
- if (testItem.Key == null) continue;
- data[testItem.Key] = testItem.Value;
- }
- }
- }
- return data;
- }
-
- public static async Task<Dictionary<PlaceLink, LinkData>> GetTestLinks()
- {
- var data = new Dictionary<PlaceLink, LinkData>();
- if (s_testPlaces == null) await GetTestPlaces();
- if (s_testPlaces != null)
- {
- foreach (var item in s_testPlaces)
- {
- if (item.Key?.Images == null) continue;
- foreach (var testItem in item.Key.Images.Zip(item.Value.Images, (k, v) => new { Key = k, Value = v }))
- {
- if (testItem.Key == null) continue;
- data[testItem.Key.UserLink] = testItem.Value.UserLink;
- }
-
- if (item.Key?.Reviews == null) continue;
- foreach (var testItem in item.Key.Reviews.Zip(item.Value.Reviews, (k, v) => new { Key = k, Value = v }))
- {
- if (testItem.Key == null) continue;
- data[testItem.Key.UserLink] = testItem.Value.UserLink;
- }
- }
- }
- return data;
- }
-
- public static async Task<Dictionary<PlaceMedia, MediaData>> GetTestMedia()
- {
- var data = new Dictionary<PlaceMedia, MediaData>();
- if (s_testPlaces == null) await GetTestPlaces();
- if (s_testPlaces != null)
- {
- foreach (var item in s_testPlaces)
- {
- if (item.Key?.Editorials == null) continue;
- foreach (var testItem in item.Key.Editorials.Zip(item.Value.Editorials, (k, v) => new { Key = k, Value = v }))
- {
- if (testItem.Key == null) continue;
- data[testItem.Key.Media] = testItem.Value.Media;
- }
-
- if (item.Key?.Images == null) continue;
- foreach (var testItem in item.Key.Images.Zip(item.Value.Images, (k, v) => new { Key = k, Value = v }))
- {
- if (testItem.Key == null) continue;
- data[testItem.Key.ImageMedia] = testItem.Value.ImageMedia;
- }
-
- if (item.Key?.Reviews == null) continue;
- foreach (var testItem in item.Key.Reviews.Zip(item.Value.Reviews, (k, v) => new { Key = k, Value = v }))
- {
- if (testItem.Key == null) continue;
- data[testItem.Key.ReviewMedia] = testItem.Value.ReviewMedia;
- }
- }
- }
- return data;
- }
-
- public static async Task<Dictionary<PlaceReview, ReviewData>> GetTestReviews()
- {
- var data = new Dictionary<PlaceReview, ReviewData>();
- if (s_testPlaces == null) await GetTestPlaces();
- if (s_testPlaces != null)
- {
- foreach (var item in s_testPlaces)
- {
- if (item.Key?.Reviews == null) continue;
- foreach (var testItem in item.Key.Reviews.Zip(item.Value.Reviews, (k, v) => new { Key = k, Value = v }))
- {
- if (testItem.Key == null) continue;
- data[testItem.Key] = testItem.Value;
- }
- }
- }
- return data;
- }
-
- public static async Task<IDictionary<Place, PlaceData>> GetTestPlaces()
- {
- if (s_testPlaces != null) return s_testPlaces;
- s_testPlaces = new Dictionary<Place, PlaceData> {
- {
- await GetPlace(new Geocoordinates(48.85784, 2.29516), 1000),
- new PlaceData() {
- Id="250u09tu-0e7c933fa5d54a1a935c74832a26a5dc",
- Name ="Le Jules Verne",
- Uri ="https://share.here.com/p/s-Yz1yZXN0YXVyYW50O2lkPTI1MHUwOXR1LTBlN2M5MzNmYTVkNTRhMWE5MzVjNzQ4MzJhMjZhNWRjO2xhdD00OC44NTc4NDtsb249Mi4yOTUxNjtuPUxlK0p1bGVzK1Zlcm5lO25sYXQ9NDguODU3ODQ7bmxvbj0yLjI5NTE2O3BoPSUyQjMzMTQ1NTU2MTQ0O2g9Mjc0OTZk",
- Coordinates = new GeocoordinatesData { Latitude=48.85784, Longitude=2.29516 },
- Distance=4,
- Address = new AddressData { Building="", City="Paris", Country="France", CountryCode="FRA", County="", District="7e Arrondissement", FreeText="Avenue Gustave Eiffel<br/>75007 Paris<br/>France", PostalCode="75007", State="\u00CEle-de-France", Street="Avenue Gustave Eiffel" },
- Attributes = new List<AttributeData> {
- new AttributeData { Id="openingHours", Label="Opening hours", Text="Mon-Sun: 12:00 - 13:30, 19:00 - 21:30" },
- },
- Contacts = new List<ContactData> {
- new ContactData { Id="phone", Label="Phone", Value="+33145556144" },
- new ContactData { Id="website", Label="Website", Value="http://www.lejulesverne-paris.com" },
- },
- Categories = new List<CategoryData> {
- new Tests.CategoryData { Id="restaurant", Name="Restaurant", Url="https://places.api.here.com/places/v1/categories/places/restaurant?app_id=" },
- },
- Editorials = new List<EditorialData>(),
- Images = new List<ImageData>(),
- Rating = new RatingData { UserCount=3, Average=4 },
- Reviews = new List<ReviewData>(),
- Properties = new Dictionary<string, string>(),
- Supplier = new LinkData { Id=string.Empty, Name=string.Empty, Link=string.Empty, Type=string.Empty },
- Related = new LinkData { Id="recommended", Name="Nearby", Link="https://places.api.here.com/places/v1/places/250u09tu-0e7c933fa5d54a1a935c74832a26a5dc/related/recommended;context=Zmxvdy1pZD1kYTQyMDJmMi0zYmVlLTU1ZDgtODZiZi03OWY3YWUxYzhjZTlfMTQ4ODUyMTc2NzMzNV8wXzI3MTU?app_id=57l3m35FktUN4sBpDTcJ&app_code=ckFerp2t5bCVjouh9v2HCw", Type="urn:nlp-types:search-results" },
- }
- },
- {
- await GetPlace(new Geocoordinates(48.85799, 2.29397), 1000),
- new PlaceData {
- Id="250u09tu-7a9d889df58c48019fb94a269aab479a",
- Name="58 Tour Eiffel",
- Uri="https://share.here.com/p/s-Yz1yZXN0YXVyYW50O2lkPTI1MHUwOXR1LTdhOWQ4ODlkZjU4YzQ4MDE5ZmI5NGEyNjlhYWI0NzlhO2xhdD00OC44NTgyOTtsb249Mi4yOTQ0NjtuPTU4K1RvdXIrRWlmZmVsO3BoPSUyQjMzKyUyODAlMjkrOCsyNSs1Nis2Nis2MjtoPTIzMDMwZQ",
- Coordinates = new GeocoordinatesData { Latitude=48.85799, Longitude=2.29397 },
- Distance=2,
- Address = new AddressData { Building="7e", City="Paris", Country="France", CountryCode="FRA", County="", District="", FreeText="7e Champ de Mars, 1st level, Eiffel Tower<br/>75007 Paris<br/>France", PostalCode="75007", State="", Street="Champ de Mars, 1st level, Eiffel Tower" },
- Attributes = new List<AttributeData> {
- new AttributeData { Id="openingHours", Label="Opening hours", Text="Mon-Sun: 11:30 - 23:00" },
- },
- Contacts = new List<ContactData> {
- new ContactData { Id="phone", Label="Phone", Value="+33 (0) 8 25 56 66 62" },
- new ContactData { Id="website", Label="Website", Value="http://www.restaurants-toureiffel.com" },
- },
- Categories = new List<CategoryData> {
- new Tests.CategoryData { Id="restaurant", Name="Restaurant", Url="https://places.api.here.com/places/v1/categories/places/restaurant?app_id=" },
- },
- Editorials = new List<EditorialData>(),
- Images = new List<ImageData>(),
- Rating = new RatingData { UserCount=2, Average=1 },
- Reviews = new List<ReviewData>(),
- Properties = new Dictionary<string, string>(),
- Supplier = new LinkData { Id=string.Empty, Name=string.Empty, Link=string.Empty, Type=string.Empty },
- Related = new LinkData { Id="recommended", Name="Nearby", Link="https://places.api.here.com/places/v1/places/250u09tu-7a9d889df58c48019fb94a269aab479a/related/recommended;context=Zmxvdy1pZD0yMzZiNzhiYi0xMzFkLTU0ZGEtYTE1MS1kNjNlMjJjYzhlMjZfMTQ4ODUyNTY0Mjk0OV8wXzIxNDk?app_id=57l3m35FktUN4sBpDTcJ&app_code=ckFerp2t5bCVjouh9v2HCw", Type="urn:nlp-types:search-results" },
- }
- },
- };
- return s_testPlaces;
- }
- }
-
- public class PlaceData
- {
- public string Id { get; set; }
- public string Name { get; set; }
- public string Uri { get; set; }
- public GeocoordinatesData Coordinates { get; set; }
- public int Distance { get; set; }
- public AddressData Address { get; set; }
- public IEnumerable<AttributeData> Attributes { get; set; }
- public IEnumerable<ContactData> Contacts { get; set; }
- public IEnumerable<CategoryData> Categories { get; set; }
- public IEnumerable<EditorialData> Editorials { get; set; }
- public IEnumerable<ImageData> Images { get; set; }
- public RatingData Rating { get; set; }
- public IEnumerable<ReviewData> Reviews { get; set; }
- public Dictionary<string, string> Properties { get; set; }
- public LinkData Supplier { get; set; }
- public LinkData Related { get; set; }
- }
-
- public class GeocoordinatesData : IMapComparator<GeocoordinatesData, Geocoordinates>
- {
- public double Latitude { get; set; }
- public double Longitude { get; set; }
-
- public bool IsEquals(Geocoordinates other)
- {
- return Latitude.IsEquals(other.Latitude) && Longitude.IsEquals(other.Longitude);
- }
-
- public override string ToString()
- {
- return string.Format("Lat: {0}, Lon: {1}", Latitude, Longitude);
- }
- }
-
- public struct AddressData : IMapComparator<AddressData, PlaceAddress>
- {
- public string Building { get; set; }
- public string City { get; set; }
- public string Country { get; set; }
- public string CountryCode { get; set; }
- public string County { get; set; }
- public string District { get; set; }
- public string FreeText { get; set; }
- public string PostalCode { get; set; }
- public string State { get; set; }
- public string Street { get; set; }
-
- public bool IsEquals(PlaceAddress second)
- {
- return Building.IsEquals(second.Building) && City.IsEquals(second.City) && Country.IsEquals(second.Country)
- && CountryCode.IsEquals(second.CountryCode) && County.IsEquals(second.County) && District.IsEquals(second.District)
- && FreeText.IsEquals(second.FreeText) && PostalCode.IsEquals(second.PostalCode) && State.IsEquals(second.State)
- && Street.IsEquals(second.Street);
- }
- }
-
- public class AttributeData : IMapComparator<AttributeData, PlaceAttribute>
- {
- public string Id { get; set; }
- public string Label { get; set; }
- public string Text { get; set; }
-
- public bool IsEquals(PlaceAttribute other)
- {
- return Id.IsEquals(other.Id) && Label.IsEquals(other.Label) && Text.IsEquals(other.Text);
- }
- }
-
- public class ContactData : IMapComparator<ContactData, PlaceContact>
- {
- public string Id { get; set; }
- public string Label { get; set; }
- public string Value { get; set; }
-
- public bool IsEquals(PlaceContact other)
- {
- return Id.IsEquals(other.Id) && Label.IsEquals(other.Label) && Value.IsEquals(other.Value);
- }
-
- public override string ToString()
- {
- return $"PlaceContact({Id}, {Label}, {Value})";
- }
- }
-
- public class CategoryData : IMapComparator<CategoryData, PlaceCategory>
- {
- public string Name { get; set; }
- public string Id { get; set; }
- public string Url { get; set; }
-
- public bool IsEquals(PlaceCategory other)
- {
- return Name.IsEquals(other.Name) && Id.IsEquals(other.Id) && other.Url.StartsWith(Url);
- }
-
- public override string ToString()
- {
- return $"PlaceCategory({Id}, {Name}, {Url})";
- }
- }
-
- public class LinkData : IMapComparator<LinkData, PlaceLink>
- {
- public string Id { get; set; }
- public string Name { get; set; }
- public string Link { get; set; }
- public string Type { get; set; }
-
- public bool IsEquals(PlaceLink other)
- {
- // ** NOTICE **
- // Because the context value of HERE maps looks a kind of hash code, and is changed whenever requested.
- // So, compare only meaningful data which is a part of link data.
- int length = Link.IndexOf(";context=");
- return Id.IsEquals(other.Id) && Name.IsEquals(other.Name) && Type.IsEquals(other.Type)
- && (Link.IsEquals(other.Link) ||
- (length > 0 && string.Compare(Link, 0, other.Link, 0, length) == 0));
- }
- }
-
- public class MediaData : IMapComparator<MediaData, PlaceMedia>
- {
- public string Attribution { get; set; }
- public LinkData Supplier { get; set; }
- public LinkData Via { get; set; }
-
- public bool IsEquals(PlaceMedia other)
- {
- return Attribution.IsEquals(other.Attribution) && Supplier.IsEquals(other.Supplier) && Via.IsEquals(other.Via);
- }
- }
-
- public class EditorialData : IMapComparator<EditorialData, PlaceEditorial>
- {
- public string Description { get; set; }
- public string Language { get; set; }
- public MediaData Media { get; set; }
-
- public bool IsEquals(PlaceEditorial other)
- {
- return Description.IsEquals(other.Description) && Language.IsEquals(other.Language) && Media.IsEquals(other.Media);
- }
- }
-
- public class ImageData : IMapComparator<ImageData, PlaceImage>
- {
- public string Id { get; set; }
- public string Url { get; set; }
- public int Width { get; set; }
- public int Height { get; set; }
- public LinkData UserLink { get; set; }
- public MediaData ImageMedia { get; set; }
-
- public bool IsEquals(PlaceImage other)
- {
- return Id.IsEquals(other.Id) && Url.IsEquals(other.Url) && Width.IsEquals(other.Width) && Height.IsEquals(other.Height)
- && UserLink.IsEquals(other.UserLink) && ImageMedia.IsEquals(other.ImageMedia);
- }
- }
-
- public class RatingData : IMapComparator<RatingData, PlaceRating>
- {
- public int UserCount { get; set; }
- public double Average { get; set; }
-
- public bool IsEquals(PlaceRating other)
- {
- return UserCount.IsEquals(other.UserCount) && Average.IsEquals(other.Average);
- }
- }
-
- public class ReviewData : IMapComparator<ReviewData, PlaceReview>
- {
- public DateTime Date { get; set; }
- public string Title { get; set; }
- public double Rating { get; set; }
- public string Description { get; set; }
- public string Language { get; set; }
- public MediaData ReviewMedia { get; set; }
- public LinkData UserLink { get; set; }
-
- public bool IsEquals(PlaceReview other)
- {
- return Date.IsEquals(other.Date) && Title.IsEquals(other.Title) && Rating.IsEquals(other.Rating) && Description.IsEquals(other.Description)
- && Language.IsEquals(other.Language) && ReviewMedia.IsEquals(other.ReviewMedia) && UserLink.IsEquals(other.UserLink);
- }
- }
-}
+++ /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 System;
-using System.IO;
-
-namespace Tizen.Maps.Tests
-{
- public class PreconditionUtils
- {
- public static string HERE_MAPS_PROVIDER_KEY = null;
- public static void SetPrecondition()
- {
- string result = ReadFile("/opt/usr/home/owner/share/tct/preconfigure.json");
- int index = 0;
- string[] resultArray = StringParser(result);
- foreach (string item in resultArray)
- {
- switch (item)
- {
- case "HERE_MAPS_PROVIDER_KEY":
- // Remove backslash
- resultArray[index + 1] = resultArray[index + 1].Replace("\\", "");
- HERE_MAPS_PROVIDER_KEY = resultArray[index + 1];
- break;
- default:
- break;
- }
- index++;
- }
- }
-
- private static string ReadFile(string path)
- {
- string result = null;
- string url = path;
-
- try
- {
- StreamReader reader = File.OpenText(path);
- result = reader.ReadToEnd();
- }
- catch (Exception e)
- {
- LogUtils.Write(LogUtils.ERROR, LogUtils.TAG, "File read error : " + e.Message);
- }
-
- 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
-/*
-* 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.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-
-namespace Tizen.Maps.Tests
-{
- public class RouteHelper
- {
- private static MapService s_maps = null;
- private static IDictionary<Route, RouteData> s_testRoutes = null;
-
- private static async Task<Route> GetRoute(Geocoordinates origin, Geocoordinates destination)
- {
- if (s_maps == null)
- s_maps = ServiceHelper.GetMapServices().First().GetMapService();
- var req = s_maps.CreateRouteSearchRequest(origin, destination);
- var routes = await req.GetResponseAsync();
- return routes.FirstOrDefault();
- }
-
- public static async Task<IDictionary<Route, RouteData>> GetTestRoutes()
- {
- if (s_testRoutes != null) return s_testRoutes;
- s_testRoutes = new Dictionary<Route, RouteData> {
- {
- await GetRoute(new Geocoordinates(12.975491, 77.697182), new Geocoordinates(12.990647, 77.687907)),
- new RouteData() {
- Origin = new GeocoordinatesData { Latitude = 12.975491, Longitude = 77.697182 },
- Destination = new GeocoordinatesData { Latitude = 12.990647, Longitude = 77.687907 },
- Distance = 1963,
- Duration = 172,
- Id = "",
- Mode = TransportMode.Car,
- Unit = DistanceUnit.Meter,
- Path = new List<GeocoordinatesData>() {
- new GeocoordinatesData { Latitude=12.9754589, Longitude=77.6971272 },
- new GeocoordinatesData { Latitude=12.9786301, Longitude=77.6952052 },
- new GeocoordinatesData { Latitude=12.9794455, Longitude=77.6947331 },
- new GeocoordinatesData { Latitude=12.9803467, Longitude=77.6941752 },
- new GeocoordinatesData { Latitude=12.9811835, Longitude=77.6936817 },
- new GeocoordinatesData { Latitude=12.9848206, Longitude=77.6913965 },
- new GeocoordinatesData { Latitude=12.9859364, Longitude=77.6907313 },
- new GeocoordinatesData { Latitude=12.9863441, Longitude=77.6904523 },
- new GeocoordinatesData { Latitude=12.9877067, Longitude=77.6896262 },
- new GeocoordinatesData { Latitude=12.9883611, Longitude=77.6892614 },
- new GeocoordinatesData { Latitude=12.9890049, Longitude=77.6888537 },
- new GeocoordinatesData { Latitude=12.9891443, Longitude=77.6888537 },
- new GeocoordinatesData { Latitude=12.9898846, Longitude=77.6884353 },
- new GeocoordinatesData { Latitude=12.9902065, Longitude=77.6882315 },
- new GeocoordinatesData { Latitude=12.990649, Longitude=77.6879099 },
- },
- Properties = new Dictionary<string, string>(),
- Segments = new List<RouteSegmentData>() {
- new RouteSegmentData {
- Origin = new GeocoordinatesData { Latitude = 12.9754589, Longitude = 77.6971272 },
- Destination = new GeocoordinatesData { Latitude = 12.990649, Longitude = 77.6879099 },
- Distance = 1963,
- Duration = 172,
- Maneuvers = new List<RouteManeuverData> {
- new RouteManeuverData {
- Direction = DirectionType.None,
- Turn = TurnInstruction.Straight,
- Position = new GeocoordinatesData { Latitude = 12.9754589, Longitude = 77.6971272 },
- Road = "",
- Locale = "",
- Instruction = "Head toward Gardachaya Palya Road on 100 Feet Ring Road (AH43/AH45). Go for 1.8 km.",
- TimeToNextInstruction = 136,
- DistanceToNextInstruction = 1752,
- },
- new RouteManeuverData {
- Direction = DirectionType.None,
- Turn = TurnInstruction.LightRight,
- Position = new GeocoordinatesData { Latitude = 12.9890049, Longitude = 77.6888537 },
- Road = "",
- Locale = "",
- Instruction = "Turn slightly right. Go for 211 m.",
- TimeToNextInstruction = 36,
- DistanceToNextInstruction = 211,
- },
- new RouteManeuverData {
- Direction = DirectionType.None,
- Turn = TurnInstruction.Straight,
- Position = new GeocoordinatesData { Latitude = 12.990649, Longitude = 77.6879099 },
- Road = "",
- Locale = "",
- Instruction = "Arrive at your destination.",
- TimeToNextInstruction = 0,
- DistanceToNextInstruction = 0,
- },
- },
- Path = new List<GeocoordinatesData>() {
- new GeocoordinatesData { Latitude=12.9754589, Longitude=77.6971272 },
- new GeocoordinatesData { Latitude=12.9890049, Longitude=77.68885 },
- }
- },
- },
- }
- },
- };
- return s_testRoutes;
- }
-
- public static async Task<IDictionary<RouteSegment, RouteSegmentData>> GetTestSegments()
- {
- var testSegments = new Dictionary<RouteSegment, RouteSegmentData>();
- if (s_testRoutes == null) await GetTestRoutes();
- if (s_testRoutes != null)
- {
- testSegments = new Dictionary<RouteSegment, RouteSegmentData>();
- foreach (var item in s_testRoutes)
- {
- if (item.Key?.Segments == null) continue;
- foreach (var testItem in item.Key.Segments.Zip(item.Value.Segments, (k, v) => new { Key = k, Value = v }))
- {
- if (testItem.Key == null) continue;
- testSegments[testItem.Key] = testItem.Value;
- }
- }
- }
-
- return testSegments;
- }
-
- public static async Task<IDictionary<RouteManeuver, RouteManeuverData>> GetTestManeuvers()
- {
- var testManeuvers = new Dictionary<RouteManeuver, RouteManeuverData>();
- var testSegments = await GetTestSegments();
- if (testSegments != null)
- {
- foreach (var item in testSegments)
- {
- if (item.Key?.Maneuvers == null) continue;
- foreach (var testItem in item.Key.Maneuvers.Zip(item.Value.Maneuvers, (k, v) => new { Key = k, Value = v }))
- {
- if (testItem.Key == null) continue;
- testManeuvers[testItem.Key] = testItem.Value;
- }
- }
- }
- return testManeuvers;
- }
- }
-
- public class RouteData
- {
- public GeocoordinatesData Origin { get; set; }
- public GeocoordinatesData Destination { get; set; }
- public double Distance { get; set; }
- public double Duration { get; set; }
- public string Id { get; set; }
- public TransportMode Mode { get; set; }
- public IEnumerable<GeocoordinatesData> Path { get; set; }
- public IDictionary<string, string> Properties { get; set; }
- public IEnumerable<RouteSegmentData> Segments { get; set; }
- public DistanceUnit Unit { get; set; }
- }
-
- public class RouteSegmentData
- {
- public GeocoordinatesData Origin { get; set; }
- public GeocoordinatesData Destination { get; set; }
- public double Distance { get; set; }
- public double Duration { get; set; }
- public IEnumerable<RouteManeuverData> Maneuvers { get; set; }
- public IEnumerable<GeocoordinatesData> Path { get; set; }
- }
-
- public class RouteManeuverData
- {
- public DirectionType Direction { get; set; }
- public TurnInstruction Turn { get; set; }
- public GeocoordinatesData Position { get; set; }
- public string Road { get; set; }
- public string Instruction { get; set; }
- public string Locale { get; set; }
- public int TimeToNextInstruction { get; set; }
- public double DistanceToNextInstruction { get; set; }
- }
-}
+++ /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.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Threading.Tasks;
-
-namespace Tizen.Maps.Tests
-{
- public abstract class ServiceHelper
- {
- static List<ServiceHelper> services = new List<ServiceHelper>();
-
- public ServiceHelper()
- {
- PreconditionUtils.SetPrecondition();
- }
-
- public abstract string ServiceProvider { get; }
-
- public abstract bool ServiceUserConsented { get; }
- public abstract string ServiceProviderKey { get; }
- public MapService maps;
-
- public virtual MapService GetMapService()
- {
- if (maps == null)
- maps = new MapService(ServiceProvider, ServiceProviderKey);
- return maps;
- }
-
- public static List<ServiceHelper> GetMapServices()
- {
- if (services.Count == 0)
- {
- var providerList = MapService.Providers;
- var here = providerList.Where(s => s == "HERE");
-
- if (here.Count() >= 1)
- services.Add(new HereMapService());
- }
- return services;
- }
-
- public static void ClearMapServices()
- {
- services.Clear();
- }
- }
-
- public class HereMapService : ServiceHelper
- {
- public override string ServiceProvider { get { return "HERE"; } }
-
- public override bool ServiceUserConsented { get { return true; } }
-
- public override string ServiceProviderKey { get { return PreconditionUtils.HERE_MAPS_PROVIDER_KEY; } }
- }
-}
+++ /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 System.Collections.Generic;
-
-namespace Tizen.Maps.Tests
-{
- public class Tester<T>
- {
- internal delegate string Testcase();
- internal readonly List<Testcase> testcases = new List<Testcase>();
-
- public virtual void Assert()
- {
- List<string> errors = new List<string>();
- foreach (var test in testcases)
- {
- string error = test?.Invoke();
- if (!string.IsNullOrEmpty(error))
- {
- errors.Add(error);
- }
- }
- if (errors.Count != 0)
- {
- NUnit.Framework.Assert.IsTrue(errors.Count == 0, string.Join(Environment.NewLine, errors));
- }
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<manifest xmlns="http://tizen.org/ns/packages" api-version="8.0" package="Tizen.Maps.Tests" version="1.0.0">\r
- <profile name="common" />\r
- <ui-application appid="Tizen.Maps.Tests"\r
- exec="Tizen.Maps.Tests.dll"\r
- type="dotnet"\r
- multiple="false"\r
- taskmanage="true"\r
- launch_mode="single">\r
- <icon>Tizen.Maps.Tests.png</icon>\r
- <label>Tizen.Maps.Tests</label>\r
- </ui-application>\r
- <privileges>\r
- <privilege>http://tizen.org/privilege/mapservice</privilege>\r
- <privilege>http://tizen.org/privilege/internet</privilege>\r
- <privilege>http://tizen.org/privilege/network.get</privilege>\r
- <privilege>http://tizen.org/privilege/appmanager.launch</privilege>\r
- </privileges>\r
-</manifest>\r