EndProject\r
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.MediaController.Tests", "Tizen.MediaController.Tests\Tizen.MediaController.Tests.csproj", "{C03750D8-7A7B-4126-9555-BEC39FB26D58}"\r
EndProject\r
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.XamarinForms.Manual.Tests", "Tizen.XamarinForms.Manual.Tests\Tizen.XamarinForms.Manual.Tests.csproj", "{4E36D272-9642-46EA-8D8A-BF5B7330FD97}"\r
-EndProject\r
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Tts.Tests", "Tizen.Tts.Tests\Tizen.Tts.Tests.csproj", "{35BE8024-E369-41B0-BE2B-6C20385563FD}"\r
EndProject\r
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Tts.Manual.Tests", "Tizen.Tts.Manual.Tests\Tizen.Tts.Manual.Tests.csproj", "{D852B2C9-0D40-40B2-9D70-552BDAC83E97}"\r
EndProject\r
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Inputmethodmanager.Tests", "Tizen.Inputmethodmanager.Tests\Tizen.Inputmethodmanager.Tests.csproj", "{0FCFB092-54E6-4A21-9595-1B6BAD69ED58}"\r
EndProject\r
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.XamarinFormsMaps.Tests", "Tizen.XamarinFormsMaps.Tests\Tizen.XamarinFormsMaps.Tests.csproj", "{53ACEB7B-41DD-4A7D-8C0D-B48C2283878B}"\r
-EndProject\r
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.DataControl.Tests", "Tizen.DataControl.Tests\Tizen.DataControl.Tests.csproj", "{10FE62D3-50D1-458E-ABB4-9C13E946A935}"\r
EndProject\r
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.XamarinFormsMaps.Manual.Tests", "Tizen.XamarinFormsMaps.Manual.Tests\Tizen.XamarinFormsMaps.Manual.Tests.csproj", "{4EBF4294-2FD8-451C-B7DD-37D837E9E271}"\r
-EndProject\r
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.NUI.Tests", "Tizen.NUI.Tests\Tizen.NUI.Tests.csproj", "{FC4BDD19-5A2E-4FB7-B058-6EC7663723DF}"\r
EndProject\r
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Alarm.Tests", "Tizen.Alarm.Tests\Tizen.Alarm.Tests.csproj", "{8BCA1FEB-7175-461F-A1A8-7FE324F1E034}"\r
EndProject\r
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.AttachPanel.Manual.Tests", "Tizen.AttachPanel.Manual.Tests\Tizen.AttachPanel.Manual.Tests.csproj", "{3372CC3A-51F4-42EB-8D9A-1657C1A9131B}"\r
EndProject\r
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.XamarinForms1.Tests", "Tizen.XamarinForms1.Tests\Tizen.XamarinForms1.Tests.csproj", "{922CC89D-1881-4536-AD0F-89B28F46B4B3}"\r
-EndProject\r
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.XamarinForms2.Tests", "Tizen.XamarinForms2.Tests\Tizen.XamarinForms2.Tests.csproj", "{1B6A1265-DDD9-4791-8A5C-5EDD2D2B76AF}"\r
-EndProject\r
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.XamarinForms3.Tests", "Tizen.XamarinForms3.Tests\Tizen.XamarinForms3.Tests.csproj", "{FD233943-681C-4583-87C1-3AE8D213A6AF}"\r
-EndProject\r
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.XamarinForms4.Tests", "Tizen.XamarinForms4.Tests\Tizen.XamarinForms4.Tests.csproj", "{9CE23374-4BBE-4F07-B293-994485809AE6}"\r
-EndProject\r
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.XamarinForms5.Tests", "Tizen.XamarinForms5.Tests\Tizen.XamarinForms5.Tests.csproj", "{1464181A-4AFF-48F5-9C21-6302E1582A15}"\r
-EndProject\r
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.ElmSharpWearable.Manual.Tests", "Tizen.ElmSharpWearable.Manual.Tests\Tizen.ElmSharpWearable.Manual.Tests.csproj", "{57B0DF9F-3B6F-4327-A2FF-4C6265AB395F}"\r
EndProject\r
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.ElmSharpWearable.Tests", "Tizen.ElmSharpWearable.Tests\Tizen.ElmSharpWearable.Tests.csproj", "{B0284A28-42EE-4A08-B493-6547E5C38862}"\r
{C03750D8-7A7B-4126-9555-BEC39FB26D58}.NUI|Any CPU.ActiveCfg = Release|Any CPU\r
{C03750D8-7A7B-4126-9555-BEC39FB26D58}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
{C03750D8-7A7B-4126-9555-BEC39FB26D58}.Release|Any CPU.Build.0 = Release|Any CPU\r
- {4E36D272-9642-46EA-8D8A-BF5B7330FD97}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
- {4E36D272-9642-46EA-8D8A-BF5B7330FD97}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
- {4E36D272-9642-46EA-8D8A-BF5B7330FD97}.NUI|Any CPU.ActiveCfg = Release|Any CPU\r
- {4E36D272-9642-46EA-8D8A-BF5B7330FD97}.NUI|Any CPU.Build.0 = Release|Any CPU\r
- {4E36D272-9642-46EA-8D8A-BF5B7330FD97}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
- {4E36D272-9642-46EA-8D8A-BF5B7330FD97}.Release|Any CPU.Build.0 = Release|Any CPU\r
{35BE8024-E369-41B0-BE2B-6C20385563FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
{35BE8024-E369-41B0-BE2B-6C20385563FD}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
{35BE8024-E369-41B0-BE2B-6C20385563FD}.NUI|Any CPU.ActiveCfg = Release|Any CPU\r
{0FCFB092-54E6-4A21-9595-1B6BAD69ED58}.NUI|Any CPU.ActiveCfg = Release|Any CPU\r
{0FCFB092-54E6-4A21-9595-1B6BAD69ED58}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
{0FCFB092-54E6-4A21-9595-1B6BAD69ED58}.Release|Any CPU.Build.0 = Release|Any CPU\r
- {53ACEB7B-41DD-4A7D-8C0D-B48C2283878B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
- {53ACEB7B-41DD-4A7D-8C0D-B48C2283878B}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
- {53ACEB7B-41DD-4A7D-8C0D-B48C2283878B}.NUI|Any CPU.ActiveCfg = Release|Any CPU\r
- {53ACEB7B-41DD-4A7D-8C0D-B48C2283878B}.NUI|Any CPU.Build.0 = Release|Any CPU\r
- {53ACEB7B-41DD-4A7D-8C0D-B48C2283878B}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
- {53ACEB7B-41DD-4A7D-8C0D-B48C2283878B}.Release|Any CPU.Build.0 = Release|Any CPU\r
{10FE62D3-50D1-458E-ABB4-9C13E946A935}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
{10FE62D3-50D1-458E-ABB4-9C13E946A935}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
{10FE62D3-50D1-458E-ABB4-9C13E946A935}.NUI|Any CPU.ActiveCfg = Release|Any CPU\r
{10FE62D3-50D1-458E-ABB4-9C13E946A935}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
{10FE62D3-50D1-458E-ABB4-9C13E946A935}.Release|Any CPU.Build.0 = Release|Any CPU\r
- {4EBF4294-2FD8-451C-B7DD-37D837E9E271}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
- {4EBF4294-2FD8-451C-B7DD-37D837E9E271}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
- {4EBF4294-2FD8-451C-B7DD-37D837E9E271}.NUI|Any CPU.ActiveCfg = Release|Any CPU\r
- {4EBF4294-2FD8-451C-B7DD-37D837E9E271}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
- {4EBF4294-2FD8-451C-B7DD-37D837E9E271}.Release|Any CPU.Build.0 = Release|Any CPU\r
{FC4BDD19-5A2E-4FB7-B058-6EC7663723DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
{FC4BDD19-5A2E-4FB7-B058-6EC7663723DF}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
{FC4BDD19-5A2E-4FB7-B058-6EC7663723DF}.NUI|Any CPU.ActiveCfg = Release|Any CPU\r
{3372CC3A-51F4-42EB-8D9A-1657C1A9131B}.NUI|Any CPU.Build.0 = Debug|Any CPU\r
{3372CC3A-51F4-42EB-8D9A-1657C1A9131B}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
{3372CC3A-51F4-42EB-8D9A-1657C1A9131B}.Release|Any CPU.Build.0 = Release|Any CPU\r
- {922CC89D-1881-4536-AD0F-89B28F46B4B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
- {922CC89D-1881-4536-AD0F-89B28F46B4B3}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
- {922CC89D-1881-4536-AD0F-89B28F46B4B3}.NUI|Any CPU.ActiveCfg = Debug|Any CPU\r
- {922CC89D-1881-4536-AD0F-89B28F46B4B3}.NUI|Any CPU.Build.0 = Debug|Any CPU\r
- {922CC89D-1881-4536-AD0F-89B28F46B4B3}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
- {922CC89D-1881-4536-AD0F-89B28F46B4B3}.Release|Any CPU.Build.0 = Release|Any CPU\r
- {1B6A1265-DDD9-4791-8A5C-5EDD2D2B76AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
- {1B6A1265-DDD9-4791-8A5C-5EDD2D2B76AF}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
- {1B6A1265-DDD9-4791-8A5C-5EDD2D2B76AF}.NUI|Any CPU.ActiveCfg = Debug|Any CPU\r
- {1B6A1265-DDD9-4791-8A5C-5EDD2D2B76AF}.NUI|Any CPU.Build.0 = Debug|Any CPU\r
- {1B6A1265-DDD9-4791-8A5C-5EDD2D2B76AF}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
- {1B6A1265-DDD9-4791-8A5C-5EDD2D2B76AF}.Release|Any CPU.Build.0 = Release|Any CPU\r
- {FD233943-681C-4583-87C1-3AE8D213A6AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
- {FD233943-681C-4583-87C1-3AE8D213A6AF}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
- {FD233943-681C-4583-87C1-3AE8D213A6AF}.NUI|Any CPU.ActiveCfg = Debug|Any CPU\r
- {FD233943-681C-4583-87C1-3AE8D213A6AF}.NUI|Any CPU.Build.0 = Debug|Any CPU\r
- {FD233943-681C-4583-87C1-3AE8D213A6AF}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
- {FD233943-681C-4583-87C1-3AE8D213A6AF}.Release|Any CPU.Build.0 = Release|Any CPU\r
- {9CE23374-4BBE-4F07-B293-994485809AE6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
- {9CE23374-4BBE-4F07-B293-994485809AE6}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
- {9CE23374-4BBE-4F07-B293-994485809AE6}.NUI|Any CPU.ActiveCfg = Debug|Any CPU\r
- {9CE23374-4BBE-4F07-B293-994485809AE6}.NUI|Any CPU.Build.0 = Debug|Any CPU\r
- {9CE23374-4BBE-4F07-B293-994485809AE6}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
- {9CE23374-4BBE-4F07-B293-994485809AE6}.Release|Any CPU.Build.0 = Release|Any CPU\r
- {1464181A-4AFF-48F5-9C21-6302E1582A15}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
- {1464181A-4AFF-48F5-9C21-6302E1582A15}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
- {1464181A-4AFF-48F5-9C21-6302E1582A15}.NUI|Any CPU.ActiveCfg = Debug|Any CPU\r
- {1464181A-4AFF-48F5-9C21-6302E1582A15}.NUI|Any CPU.Build.0 = Debug|Any CPU\r
- {1464181A-4AFF-48F5-9C21-6302E1582A15}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
- {1464181A-4AFF-48F5-9C21-6302E1582A15}.Release|Any CPU.Build.0 = Release|Any CPU\r
{57B0DF9F-3B6F-4327-A2FF-4C6265AB395F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
{57B0DF9F-3B6F-4327-A2FF-4C6265AB395F}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
{57B0DF9F-3B6F-4327-A2FF-4C6265AB395F}.NUI|Any CPU.ActiveCfg = Debug|Any CPU\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 static 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);
- }
-
- public static Application GetApp()
- {
- return _app;
- }
-
- static void Main(string[] args)
- {
- Console.WriteLine("TCT : Main()");
- var app = new Program();
- global::Xamarin.Forms.Platform.Tizen.Forms.Init(app);
- app.Run(args);
- }
- }
-}
+++ /dev/null
-<Project Sdk="Microsoft.NET.Sdk">
-
- <!-- Property Group for .NET Core Project -->
- <PropertyGroup>
- <OutputType>Exe</OutputType>
- <TargetFramework>tizen60</TargetFramework>
- </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>
- <PackageReference Include="Tizen.NET.Sdk" Version="$(TizenNETSdkVersion)" />
- </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.XamarinForms.Manual.Tests", "Tizen.XamarinForms.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 NUnit.Framework;
-using NUnit.Framework.TUnit;
-using System.Threading.Tasks;
-using XamarinApplication.Tizen;
-using System.Collections.Generic;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class AbsoluteLayoutTests
- {
- private AbsoluteLayout _mAbsoluteLayout;
- private static TestPage _testPage = TestPage.GetInstance();
- private string _appResourcePath = Program.Current.DirectoryInfo.Resource;
-
- class ControlTest
- {
- public ControlTest(string name)
- {
- this.Name = name;
- }
-
- public string Name { private set; get; }
- };
-
- [SetUp]
- public void SetUp()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "AbsoluteLayout CLASS: Setup---------------------------------");
- _mAbsoluteLayout = new AbsoluteLayout();
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "AbsoluteLayout CLASS: Teardown---------------------------------");
- _mAbsoluteLayout = null;
- }
-
- [Test]
- [Category("P1")]
- [Description("check whether AbsoluteLayout's able to auto size or not")]
- [Property("SPEC", "Xamarin.Forms.AbsoluteLayout.AutoSize A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click Default button or AutoSize button")]
- [Step(3, "Observe change of square")]
- [Step(4, "Testcase PASS if square size changed otherwise FAIL")]
- [Postcondition(1, "Click Back button.")]
- public async Task AutoSize_PROPERTY_GET()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
- AbsoluteLayout simpleLayout = new AbsoluteLayout
- {
- BackgroundColor = Color.Blue.WithLuminosity(0.9),
- VerticalOptions = LayoutOptions.FillAndExpand
- };
-
- var mBoxviewcenter = new BoxView
- {
- Color = Color.Red
- };
- AbsoluteLayout.SetLayoutFlags(mBoxviewcenter,
- AbsoluteLayoutFlags.PositionProportional);
- AbsoluteLayout.SetLayoutBounds(mBoxviewcenter,
- new Rectangle(0.5f,
- 0.5f, 10, 10));
-
- simpleLayout.Children.Add(mBoxviewcenter);
-
- var mBtnDefalut = new Button
- {
- HorizontalOptions = LayoutOptions.Fill,
- Text = "Default",
- Margin = new Thickness()
- {
- Right = 10,
- Left = 10
- }
- };
-
- var BtnAutoResize = new Button
- {
- HorizontalOptions = LayoutOptions.Fill,
- Text = "AutoSize",
- Margin = new Thickness()
- {
- Right = 10,
- Left = 10
- }
- };
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- simpleLayout,
- mBtnDefalut,
- BtnAutoResize
- },
- },
- Title = "Test: AutoSize",
- };
-
- BtnAutoResize.Clicked += (e, o) =>
- {
- AbsoluteLayout.SetLayoutBounds(mBoxviewcenter,
- new Rectangle(0.5f,
- 0.5f, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));
- };
-
- mBtnDefalut.Clicked += (e, o) =>
- {
- AbsoluteLayout.SetLayoutBounds(mBoxviewcenter,
- new Rectangle(0.5f,
- 0.5f, 10, 10));
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- BtnAutoResize.Clicked -= (e, o) =>
- {
- AbsoluteLayout.SetLayoutBounds(mBoxviewcenter,
- new Rectangle(0.5f,
- 0.5f, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));
- };
-
- mBtnDefalut.Clicked -= (e, o) =>
- {
- AbsoluteLayout.SetLayoutBounds(mBoxviewcenter,
- new Rectangle(0.5f,
- 0.5f, 500, 500));
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether SetLayoutBounds able to sets the layout bounds")]
- [Property("SPEC", "Xamarin.Forms.AbsoluteLayout.SetLayoutBounds M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click Change button")]
- [Step(3, "Observe change of square")]
- [Step(4, "Testcase PASS if click Change button -> square changed,otherwise FAIL")]
- [Postcondition(1, "Click Back button.")]
- public async Task SetLayoutBounds_UIBH()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
- AbsoluteLayout simpleLayout = new AbsoluteLayout
- {
- BackgroundColor = Color.Blue.WithLuminosity(0.9),
- VerticalOptions = LayoutOptions.FillAndExpand
- };
-
- var mBoxviewcenter = new BoxView
- {
- Color = Color.Red,
- HeightRequest = 200,
- WidthRequest = 200
- };
-
- simpleLayout.Children.Add(mBoxviewcenter);
-
- var mBtnChangeBound = new Button
- {
- HorizontalOptions = LayoutOptions.Fill,
- Text = "Change",
- Margin = new Thickness()
- {
- Right = 10,
- Left = 10
- }
- };
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- simpleLayout,
- mBtnChangeBound,
- },
- },
- Title = "SetLayoutBounds Test",
- };
-
- mBtnChangeBound.Clicked += (e, o) =>
- {
- AbsoluteLayout.SetLayoutBounds(mBoxviewcenter,
- new Rectangle(0.5f,
- 0.5f, 500, 500));
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- mBtnChangeBound.Clicked -= (e, o) =>
- {
- AbsoluteLayout.SetLayoutBounds(mBoxviewcenter,
- new Rectangle(0.5f,
- 0.5f, 500, 500));
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("check whether SetLayoutFlags able to sets the layout flags")]
- [Property("SPEC", "Xamarin.Forms.AbsoluteLayout.SetLayoutFlags M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click all buttons")]
- [Step(3, "Observe change of square")]
- [Step(4, "Testcase PASS if square apparence has been changed after clicked each button otherwise FAIL")]
- [Postcondition(1, "Click Back button.")]
- public async Task SetLayoutFlags_UIBH()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
- AbsoluteLayout simpleLayout = new AbsoluteLayout
- {
- BackgroundColor = Color.Blue.WithLuminosity(0.9),
- VerticalOptions = LayoutOptions.FillAndExpand,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
-
- var mBoxviewcenter = new BoxView
- {
- Color = Color.Red
- };
- AbsoluteLayout.SetLayoutFlags(mBoxviewcenter,
- AbsoluteLayoutFlags.PositionProportional);
- AbsoluteLayout.SetLayoutBounds(mBoxviewcenter,
- new Rectangle(0.5f,
- 0.5f, 200, 200));
-
- simpleLayout.Children.Add(mBoxviewcenter);
-
- var mBtnAll = new Button
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- Text = "All",
- Margin = new Thickness()
- {
- Right = 10,
- Left = 10
- }
- };
-
- var mBtnHeightProportional = new Button
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- Text = "HeightProportional",
- Margin = new Thickness()
- {
- Right = 10,
- Left = 10
- }
- };
- var mBtnNone = new Button
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- Text = "None",
- Margin = new Thickness()
- {
- Right = 10,
- Left = 10
- }
- };
-
- var mBtnSizeProportional = new Button
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- Text = "SizeProportional",
- Margin = new Thickness()
- {
- Right = 10,
- Left = 10
- }
- };
-
- var mBtnWidthProportional = new Button
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- Text = "WidthProportional",
- Margin = new Thickness()
- {
- Right = 10,
- Left = 10
- }
- };
-
- var mBtnXProportional = new Button
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- Text = "XProportional",
- Margin = new Thickness()
- {
- Right = 10,
- Left = 10
- }
- };
-
- var mBtnYProportional = new Button
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- Text = "YProportional",
- Margin = new Thickness()
- {
- Right = 10,
- Left = 10
- }
- };
-
- var layout = new StackLayout
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- simpleLayout,
- mBtnAll,
- mBtnHeightProportional,
- mBtnNone,
- mBtnSizeProportional,
- mBtnWidthProportional,
- mBtnXProportional,
- mBtnYProportional
- },
- };
-
- var view = new ScrollView
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- Content = layout
- };
-
- ContentPage page = new ContentPage
- {
- Content = view,
- Title = "SetLayoutFlags Test",
- };
-
- mBtnAll.Clicked += (e, o) =>
- {
- AbsoluteLayout.SetLayoutFlags(mBoxviewcenter,
- AbsoluteLayoutFlags.All);
- };
-
- mBtnHeightProportional.Clicked += (e, o) =>
- {
- AbsoluteLayout.SetLayoutFlags(mBoxviewcenter,
- AbsoluteLayoutFlags.HeightProportional);
- };
-
- mBtnNone.Clicked += (e, o) =>
- {
- AbsoluteLayout.SetLayoutFlags(mBoxviewcenter,
- AbsoluteLayoutFlags.None);
- };
-
- mBtnSizeProportional.Clicked += (e, o) =>
- {
- AbsoluteLayout.SetLayoutFlags(mBoxviewcenter,
- AbsoluteLayoutFlags.SizeProportional);
- };
-
- mBtnWidthProportional.Clicked += (e, o) =>
- {
- AbsoluteLayout.SetLayoutFlags(mBoxviewcenter,
- AbsoluteLayoutFlags.WidthProportional);
- };
-
- mBtnXProportional.Clicked += (e, o) =>
- {
- AbsoluteLayout.SetLayoutFlags(mBoxviewcenter,
- AbsoluteLayoutFlags.XProportional);
- };
-
- mBtnYProportional.Clicked += (e, o) =>
- {
- AbsoluteLayout.SetLayoutFlags(mBoxviewcenter,
- AbsoluteLayoutFlags.YProportional);
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- mBtnAll.Clicked -= (e, o) =>
- {
- AbsoluteLayout.SetLayoutFlags(mBoxviewcenter,
- AbsoluteLayoutFlags.All);
- };
-
- mBtnHeightProportional.Clicked -= (e, o) =>
- {
- AbsoluteLayout.SetLayoutFlags(mBoxviewcenter,
- AbsoluteLayoutFlags.HeightProportional);
- };
-
- mBtnNone.Clicked -= (e, o) =>
- {
- AbsoluteLayout.SetLayoutFlags(mBoxviewcenter,
- AbsoluteLayoutFlags.None);
- };
-
- mBtnSizeProportional.Clicked -= (e, o) =>
- {
- AbsoluteLayout.SetLayoutFlags(mBoxviewcenter,
- AbsoluteLayoutFlags.SizeProportional);
- };
-
- mBtnWidthProportional.Clicked -= (e, o) =>
- {
- AbsoluteLayout.SetLayoutFlags(mBoxviewcenter,
- AbsoluteLayoutFlags.WidthProportional);
- };
-
- mBtnXProportional.Clicked -= (e, o) =>
- {
- AbsoluteLayout.SetLayoutFlags(mBoxviewcenter,
- AbsoluteLayoutFlags.XProportional);
- };
-
- mBtnYProportional.Clicked -= (e, o) =>
- {
- AbsoluteLayout.SetLayoutFlags(mBoxviewcenter,
- AbsoluteLayoutFlags.YProportional);
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the IsVisible property")]
- [Property("SPEC", "Xamarin.Forms.AbsoluteLayout.IsVisible P")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click Change button")]
- [Step(3, "Observe change of the layout")]
- [Step(4, "Testcase PASS if click Visible button -> Show the layout and click Hide button-> Hide the layout, otherwise FAIL")]
- [Postcondition(1, "Click Back button.")]
- public async Task AbsoluteLayout_IsVisible_UIBH()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
- AbsoluteLayout simpleLayout = new AbsoluteLayout
- {
- BackgroundColor = Color.Blue.WithLuminosity(0.9),
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 100,
- WidthRequest = 200
- };
-
- var mBtnVisible = new Button
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.End,
- Text = "Visible",
- Margin = new Thickness()
- {
- Right = 10,
- Left = 10
- }
- };
-
- var mBtnHide = new Button
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.End,
- Text = "Hide",
- Margin = new Thickness()
- {
- Right = 10,
- Left = 10
- }
- };
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- simpleLayout,
- mBtnVisible,
- mBtnHide
- },
- },
- Title = "IsVisible Test",
- };
-
- mBtnVisible.Clicked += (e, o) =>
- {
- simpleLayout.IsVisible = true;
- };
-
- mBtnHide.Clicked += (e, o) =>
- {
- simpleLayout.IsVisible = false;
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- mBtnVisible.Clicked -= (e, o) =>
- {
- simpleLayout.IsVisible = true;
- };
-
- mBtnHide.Clicked -= (e, o) =>
- {
- simpleLayout.IsVisible = false;
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the BackgroundColor property")]
- [Property("SPEC", "Xamarin.Forms.AbsoluteLayout.BackgroundColor P")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Select a Color after observe BackgroundColor of layout is changed")]
- [Step(3, "Testcase PASS If BackgroundColor of Layout changed otherwise false")]
- [Postcondition(1, "Click Back button.")]
- public async Task AbsoluteLayout_BackgroundColor_Change_UILK()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
- AbsoluteLayout simpleLayout = new AbsoluteLayout
- {
- BackgroundColor = Color.Blue.WithLuminosity(0.9),
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 100,
- WidthRequest = 200
- };
-
- var mBtnRed = new Button
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.End,
- BackgroundColor = Color.Red,
- Text = "Red",
- Margin = new Thickness()
- {
- Right = 10,
- Left = 10
- }
- };
-
- var mBtnGreen = new Button
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.End,
- BackgroundColor = Color.Green,
- Text = "Green",
- Margin = new Thickness()
- {
- Right = 10,
- Left = 10
- }
- };
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- simpleLayout,
- mBtnRed,
- mBtnGreen
- },
- },
- Title = "BackgoundColor Test",
- };
-
- mBtnRed.Clicked += (e, o) =>
- {
- simpleLayout.BackgroundColor = Color.Red;
- };
-
- mBtnGreen.Clicked += (e, o) =>
- {
- simpleLayout.BackgroundColor = Color.Green;
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- mBtnRed.Clicked -= (e, o) =>
- {
- simpleLayout.BackgroundColor = Color.Red;
- };
-
- mBtnGreen.Clicked -= (e, o) =>
- {
- simpleLayout.BackgroundColor = Color.Green;
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the HeightRequest & WidthRequest property")]
- [Property("SPEC", "Xamarin.Forms.AbsoluteLayout P")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Seek Silder for Width and Height after observe")]
- [Step(3, "Pass If Height and Width of the layout changed otherwise false")]
- [Postcondition(1, "Click Back button.")]
- public async Task AbsoluteLayout_WidthAndHeight_CHANGE_SIZE_UILK()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
- AbsoluteLayout simpleLayout = new AbsoluteLayout
- {
- BackgroundColor = Color.Blue.WithLuminosity(0.9),
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 100,
- WidthRequest = 200
- };
-
- var sliderHorizontal = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- BackgroundColor = Color.Pink,
- Maximum = 500,
- Minimum = 120
- };
-
- var sliderVertical = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- BackgroundColor = Color.Pink,
- Maximum = 500,
- Minimum = 80
- };
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- simpleLayout,
- sliderHorizontal,
- sliderVertical
- },
- },
- Title = "Size Layout Test",
- };
-
- sliderHorizontal.ValueChanged += (o, e) =>
- {
- simpleLayout.WidthRequest = sliderHorizontal.Value;
- };
-
- sliderVertical.ValueChanged += (o, e) =>
- {
- simpleLayout.HeightRequest = sliderVertical.Value;
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- sliderHorizontal.ValueChanged -= (o, e) =>
- {
- simpleLayout.WidthRequest = sliderHorizontal.Value;
- };
-
- sliderVertical.ValueChanged -= (o, e) =>
- {
- simpleLayout.HeightRequest = sliderVertical.Value;
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the Opacity property")]
- [Property("SPEC", "Xamarin.Forms.AbsoluteLayout P")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Seek Opacity Slider after observe")]
- [Step(3, "Pass If Opacity of layout changed otherwise false")]
- [Postcondition(1, "Click Back button.")]
- public async Task AbsoluteLayout_Opacity_UILK()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
- AbsoluteLayout simpleLayout = new AbsoluteLayout
- {
- BackgroundColor = Color.Blue.WithLuminosity(0.9),
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 100,
- WidthRequest = 200
- };
-
- var sliderOpacity = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.Blue,
- Maximum = 1,
- Minimum = 0,
- Value = 1
- };
-
- simpleLayout.BindingContext = sliderOpacity;
- simpleLayout.SetBinding(Button.OpacityProperty, "Value");
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- simpleLayout,
- sliderOpacity,
- },
- },
- Title = "OpacityTest",
- };
-
- if (ManualTest.IsWearable())
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Not supported on this profile");
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
- else
- {
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the Margin property")]
- [Property("SPEC", "Xamarin.Forms.AbsoluteLayout P")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(4, "Pass If Margin of layout changed otherwise False")]
- [Postcondition(1, "Click Back button.")]
- public async Task AbsoluteLayout_Margin_UILK()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
- AbsoluteLayout simpleLayout = new AbsoluteLayout
- {
- BackgroundColor = Color.Blue.WithLuminosity(0.9),
- VerticalOptions = LayoutOptions.Fill,
- HorizontalOptions = LayoutOptions.Fill,
- HeightRequest = 100,
- WidthRequest = 200
- };
-
- String[] dataTest = { "", "", "" };
- dataTest[0] = "MarginTop: 50";
- dataTest[1] = "MarginTop: 100";
- dataTest[2] = "MarginTop: 150";
- var text = "Select a Margin test";
- var title = "Margin Test";
-
- //CreatePageTestToButton(text, title, dataTest);
- List<ControlTest> controlTest = new List<ControlTest>
- {
- new ControlTest(dataTest[0]),
- new ControlTest(dataTest[1]),
- new ControlTest(dataTest[2])
- };
- var _listview = new ListView
- {
- RowHeight = 100,
- ItemsSource = controlTest,
- ItemTemplate = new DataTemplate(() =>
- {
- Label nameLabel = new Label()
- {
- TextColor = Color.Black,
- BackgroundColor = Color.White,
- HorizontalOptions = LayoutOptions.Center,
- };
- nameLabel.SetBinding(Label.TextProperty, "Name");
- return new ViewCell
- {
- View = new StackLayout
- {
- Padding = new Thickness(0, 5),
- Children =
- {
- new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Spacing = 0,
- Children =
- {
- nameLabel,
- }
- }
- }
- }
- };
- })
- };
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest ctlTest = (ControlTest)e.Item;
- if (ctlTest.Name.Equals(dataTest[0]))
- {
- simpleLayout.Margin = new Thickness(0, 50, 0, 0);
- }
- else if (ctlTest.Name.Equals(dataTest[1]))
- {
- simpleLayout.Margin = new Thickness(0, 100, 0, 0);
- }
- else
- {
- simpleLayout.Margin = new Thickness(0, 150, 0, 0);
- }
- };
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- simpleLayout,
- _listview,
- },
- BackgroundColor = Color.Navy
- },
- Title = title,
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the Rotation property")]
- [Property("SPEC", "Xamarin.Forms.AbsoluteLayout P")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(3, "Pass If Rotation of layout changed otherwise False")]
- [Postcondition(1, "Click Back button.")]
- public async Task AbsoluteLayout_Rotation_UILK()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
- AbsoluteLayout simpleLayout = new AbsoluteLayout
- {
- BackgroundColor = Color.Blue.WithLuminosity(0.9),
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 100,
- WidthRequest = 200
- };
-
- String[] dataTest = { "", "", "" };
- dataTest[0] = "50";
- dataTest[1] = "90";
- dataTest[2] = "180";
- var text = "Select a Rotation test";
- var title = "Rotation Test";
- //CreatePageTestToButton(text, title, dataTest);
- List<ControlTest> controlTest = new List<ControlTest>
- {
- new ControlTest(dataTest[0]),
- new ControlTest(dataTest[1]),
- new ControlTest(dataTest[2])
- };
- var _listview = new ListView
- {
- RowHeight = 100,
- ItemsSource = controlTest,
- ItemTemplate = new DataTemplate(() =>
- {
- Label nameLabel = new Label()
- {
- TextColor = Color.Black,
- BackgroundColor = Color.White,
- HorizontalOptions = LayoutOptions.Center,
- };
- nameLabel.SetBinding(Label.TextProperty, "Name");
- return new ViewCell
- {
- View = new StackLayout
- {
- Padding = new Thickness(0, 5),
- Children =
- {
- new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Spacing = 0,
- Children =
- {
- nameLabel,
- }
- }
- }
- }
- };
- })
- };
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest ctlTest = (ControlTest)e.Item;
- if (ctlTest.Name.Equals(dataTest[0]))
- {
- simpleLayout.Rotation = 50;
- }
- else if (ctlTest.Name.Equals(dataTest[1]))
- {
- simpleLayout.Rotation = 90;
- }
- else
- {
- simpleLayout.Rotation = 180;
- }
- };
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- simpleLayout,
- _listview,
- },
- BackgroundColor = Color.Navy
- },
- Title = title,
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the Scale property")]
- [Property("SPEC", "Xamarin.Forms.AbsoluteLayout P")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(3, "Pass If Scale of layout changed otherwise False")]
- [Postcondition(1, "Click Back button.")]
- public async Task AbsoluteLayout_Scale_UILK()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
- AbsoluteLayout simpleLayout = new AbsoluteLayout
- {
- BackgroundColor = Color.Blue.WithLuminosity(0.9),
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 100,
- WidthRequest = 200
- };
-
- String[] dataTest = { "", "", "" };
- dataTest[0] = "0.5";
- dataTest[1] = "1.0";
- dataTest[2] = "2.0";
- var text = "Select a Scale test";
- var title = "Scale Test";
- //CreatePageTestToButton(text, title, dataTest);
- List<ControlTest> controlTest = new List<ControlTest>
- {
- new ControlTest(dataTest[0]),
- new ControlTest(dataTest[1]),
- new ControlTest(dataTest[2])
- };
- var _listview = new ListView
- {
- RowHeight = 100,
- ItemsSource = controlTest,
- ItemTemplate = new DataTemplate(() =>
- {
- Label nameLabel = new Label()
- {
- TextColor = Color.Black,
- BackgroundColor = Color.White,
- HorizontalOptions = LayoutOptions.Center,
- };
- nameLabel.SetBinding(Label.TextProperty, "Name");
- return new ViewCell
- {
- View = new StackLayout
- {
- Padding = new Thickness(0, 5),
- Children =
- {
- new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Spacing = 0,
- Children =
- {
- nameLabel,
- }
- }
- }
- }
- };
- })
- };
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest ctlTest = (ControlTest)e.Item;
- if (ctlTest.Name.Equals(dataTest[0]))
- {
- simpleLayout.Scale = 0.5;
- }
- else if (ctlTest.Name.Equals(dataTest[1]))
- {
- simpleLayout.Scale = 1.0;
- }
- else
- {
- simpleLayout.Scale = 2.0;
- }
- };
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- simpleLayout,
- _listview,
- },
- BackgroundColor = Color.Navy
- },
- Title = title,
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the IsEnabled property")]
- [Property("SPEC", "Xamarin.Forms.AbsoluteLayout P")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(3, "Pass If Click me button can not be clicked after select the Disable from Listview, otherwaise False")]
- [Postcondition(1, "Click Back button.")]
- public async Task AbsoluteLayout_IsEnabled_UIBH()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
- AbsoluteLayout simpleLayout = new AbsoluteLayout
- {
- BackgroundColor = Color.Blue.WithLuminosity(0.9),
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 100,
- WidthRequest = 200,
- Children =
- {
- new StackLayout
- {
- HorizontalOptions=LayoutOptions.FillAndExpand,
- VerticalOptions=LayoutOptions.FillAndExpand,
- Children =
- {
- new Button
- {
- Text="Click me",
- HorizontalOptions=LayoutOptions.CenterAndExpand,
- VerticalOptions=LayoutOptions.Center
- }
- }
- }
- }
- };
-
- String[] dataTest = { "", "", "" };
- dataTest[0] = "Enable";
- dataTest[1] = "Disable";
- dataTest[2] = "Enable";
- var text = "Select a IsEnabled test";
- var title = "IsEnabled Test";
- //CreatePageTestToButton(text, title, dataTest);
- List<ControlTest> controlTest = new List<ControlTest>
- {
- new ControlTest(dataTest[0]),
- new ControlTest(dataTest[1]),
- new ControlTest(dataTest[2])
- };
- var _listview = new ListView
- {
- RowHeight = 100,
- ItemsSource = controlTest,
- ItemTemplate = new DataTemplate(() =>
- {
- Label nameLabel = new Label()
- {
- TextColor = Color.Black,
- BackgroundColor = Color.White,
- HorizontalOptions = LayoutOptions.Center,
- };
- nameLabel.SetBinding(Label.TextProperty, "Name");
- return new ViewCell
- {
- View = new StackLayout
- {
- Padding = new Thickness(0, 5),
- Children =
- {
- new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Spacing = 0,
- Children =
- {
- nameLabel,
- }
- }
- }
- }
- };
- })
- };
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest ctlTest = (ControlTest)e.Item;
- if (ctlTest.Name.Equals(dataTest[1]))
- {
- simpleLayout.IsEnabled = false;
- }
- else
- {
- simpleLayout.IsEnabled = true;
- }
- };
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- simpleLayout,
- _listview,
- },
- BackgroundColor = Color.Navy
- },
- Title = title,
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, 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 NUnit.Framework;
-using NUnit.Framework.TUnit;
-using System.Threading.Tasks;
-using System.Collections.Generic;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.ActivityIndicator ManualTests")]
- public class ActivityIndicatorTest
- {
- private ActivityIndicator _mActivityIndicator;
- private static TestPage _testPage = TestPage.GetInstance();
-
- class ControlTest
- {
- public ControlTest(string name)
- {
- this.Name = name;
- }
-
- public string Name { private set; get; }
- };
-
- [SetUp]
- public void SetUp()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "ActivityIndicator CLASS: Setup---------------------------------");
- _mActivityIndicator = new ActivityIndicator();
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "ActivityIndicator CLASS: Teardown---------------------------------");
- _mActivityIndicator = null;
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ActivityIndicator IsRunning can be changed")]
- [Property("SPEC", "Xamarin.Forms.ActivityIndicator.IsRunning A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click start button")]
- [Step(3, "Observe ActivityIndicator is running")]
- [Step(4, "Testcase PASS if the ActivityIndicator is running,otherwise FAIL")]
- [Postcondition(1, "Click Back button.")]
- public async Task IsRunning_UIBH()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
- _mActivityIndicator = new ActivityIndicator()
- {
- WidthRequest = 100,
- HeightRequest = 100
- };
- _mActivityIndicator.Color = Color.Yellow;
- _mActivityIndicator.IsVisible = true;
- _mActivityIndicator.IsRunning = true;
-
- var btnStop = new Button
- {
- Text = "Stop"
- };
-
- var btnRun = new Button
- {
- Text = "Run"
- };
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- _mActivityIndicator,
- btnRun,
- btnStop
- }
- },
- Title = "ActivityIndicator IsRunning test",
- };
-
- btnRun.Clicked += (e, o) =>
- {
- _mActivityIndicator.IsRunning = true;
- };
-
- btnStop.Clicked += (e, o) =>
- {
- _mActivityIndicator.IsRunning = false;
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- btnRun.Clicked += (e, o) =>
- {
- _mActivityIndicator.IsRunning = true;
- };
-
- btnStop.Clicked += (e, o) =>
- {
- _mActivityIndicator.IsRunning = false;
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the IsVisible property")]
- [Property("SPEC", "Xamarin.Forms.ActivityIndicator.IsVisible P")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click Change button")]
- [Step(3, "Observe change of the layout")]
- [Step(4, "Testcase PASS if click Visible button -> Show the ActivityIndicator and click Hide button-> Hide the ActivityIndicator, otherwise FAIL")]
- [Postcondition(1, "Click Back button.")]
- public async Task ActivityIndicator_IsVisible_UIBH()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
-
- _mActivityIndicator = new ActivityIndicator()
- {
- IsRunning = true,
- IsVisible = true,
- WidthRequest = 100,
- HeightRequest = 100
- };
-
- var mBtnVisible = new Button
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.End,
- Text = "Visible",
- Margin = new Thickness()
- {
- Right = 10,
- Left = 10
- }
- };
-
- var mBtnHide = new Button
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.End,
- Text = "Hide",
- Margin = new Thickness()
- {
- Right = 10,
- Left = 10
- }
- };
-
- var mainUi = new StackLayout
- {
- Children =
- {
- }
- };
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- _mActivityIndicator,
- mBtnVisible,
- mBtnHide
- },
- },
- Title = "IsVisible Test",
- };
-
- mBtnVisible.Clicked += (e, o) =>
- {
- _mActivityIndicator.IsVisible = true;
- _mActivityIndicator.IsRunning = true;
- };
-
- mBtnHide.Clicked += (e, o) =>
- {
- _mActivityIndicator.IsVisible = false;
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- mBtnVisible.Clicked -= (e, o) =>
- {
- _mActivityIndicator.IsVisible = true;
- };
-
- mBtnHide.Clicked -= (e, o) =>
- {
- _mActivityIndicator.IsVisible = false;
- };
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check the Color property")]
- [Property("SPEC", "Xamarin.Forms.ActivityIndicator.BackgroundColor P")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "Can not test on TV and TV Emulator. Please mark NA on TV.(Due to Limitation on TV)")]
- [Step(2, "Select a Color after observe BackgroundColor of ActivityIndicator is changed")]
- [Step(3, "Testcase PASS If BackgroundColor of ActivityIndicator changed otherwise false")]
- [Postcondition(1, "Click Back button.")]
- public async Task ActivityIndicator_Color_Change_UILK()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
- _mActivityIndicator = new ActivityIndicator()
- {
- IsRunning = true,
- IsVisible = true,
- WidthRequest = 100,
- HeightRequest = 100
- };
-
- var mBtnYellow = new Button
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.End,
- BackgroundColor = Color.Yellow,
- Text = "Yellow",
- Margin = new Thickness()
- {
- Right = 10,
- Left = 10
- }
- };
-
- var mBtnGreen = new Button
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.End,
- BackgroundColor = Color.Green,
- Text = "Green",
- Margin = new Thickness()
- {
- Right = 10,
- Left = 10
- }
- };
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- _mActivityIndicator,
- mBtnYellow,
- mBtnGreen
- },
- },
- Title = "BackgoundColor Test",
- };
-
- mBtnYellow.Clicked += (e, o) =>
- {
- _mActivityIndicator.Color = Color.Yellow;
- };
-
- mBtnGreen.Clicked += (e, o) =>
- {
- _mActivityIndicator.Color = Color.Green;
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- mBtnYellow.Clicked -= (e, o) =>
- {
- _mActivityIndicator.BackgroundColor = Color.Yellow;
- };
-
- mBtnGreen.Clicked -= (e, o) =>
- {
- _mActivityIndicator.BackgroundColor = Color.Green;
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the Opacity property")]
- [Property("SPEC", "Xamarin.Forms.ActivityIndicator P")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Seek Opacity Slider after observe")]
- [Step(3, "Pass If Opacity of ActivityIndicator changed otherwise false")]
- [Postcondition(1, "Click Back button.")]
- public async Task ActivityIndicator_Opacity_UILK()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
- _mActivityIndicator = new ActivityIndicator()
- {
- IsRunning = true,
- IsVisible = true,
- WidthRequest = 100,
- HeightRequest = 100
- };
-
- var sliderOpacity = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.Blue,
- Maximum = 1,
- Minimum = 0,
- Value = 1
- };
-
- _mActivityIndicator.BindingContext = sliderOpacity;
- _mActivityIndicator.SetBinding(Button.OpacityProperty, "Value");
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- _mActivityIndicator,
- sliderOpacity,
- },
- },
- Title = "OpacityTest",
- };
-
- if (ManualTest.IsWearable())
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Not supported on this profile");
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
- else
- {
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the Margin property")]
- [Property("SPEC", "Xamarin.Forms.ActivityIndicator P")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(4, "Pass If Margin of ActivityIndicator changed otherwise False")]
- [Postcondition(1, "Click Back button.")]
- public async Task ActivityIndicator_Margin_UILK()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
- _mActivityIndicator = new ActivityIndicator()
- {
- IsRunning = true,
- IsVisible = true,
- WidthRequest = 100,
- HeightRequest = 100
- };
-
- String[] dataTest = { "", "", "" };
- dataTest[0] = "MarginTop: 50";
- dataTest[1] = "MarginTop: 100";
- dataTest[2] = "MarginTop: 150";
- var text = "Select a Margin test";
- var title = "Margin Test";
- //CreatePageTestToButton(text, title, dataTest);
- List<ControlTest> controlTest = new List<ControlTest>
- {
- new ControlTest(dataTest[0]),
- new ControlTest(dataTest[1]),
- new ControlTest(dataTest[2])
- };
- var _listview = new ListView
- {
- RowHeight = 100,
- ItemsSource = controlTest,
- ItemTemplate = new DataTemplate(() =>
- {
- Label nameLabel = new Label()
- {
- TextColor = Color.Black,
- BackgroundColor = Color.White,
- HorizontalOptions = LayoutOptions.Center,
- };
- nameLabel.SetBinding(Label.TextProperty, "Name");
- return new ViewCell
- {
- View = new StackLayout
- {
- Padding = new Thickness(0, 5),
- Children =
- {
- new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Spacing = 0,
- Children =
- {
- nameLabel,
- }
- }
- }
- }
- };
- })
- };
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest ctlTest = (ControlTest)e.Item;
- if (ctlTest.Name.Equals(dataTest[0]))
- {
- _mActivityIndicator.Margin = new Thickness(0, 50, 0, 0);
- }
- else if (ctlTest.Name.Equals(dataTest[1]))
- {
- _mActivityIndicator.Margin = new Thickness(0, 100, 0, 0);
- }
- else
- {
- _mActivityIndicator.Margin = new Thickness(0, 150, 0, 0);
- }
- };
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- _mActivityIndicator,
- _listview,
- },
- BackgroundColor = Color.Blue.WithLuminosity(0.9),
- },
- Title = title,
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the Rotation property")]
- [Property("SPEC", "Xamarin.Forms.ActivityIndicator P")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "This test will be passed on Wearable")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(3, "Pass If Rotation of ActivityIndicator changed otherwise False")]
- [Postcondition(1, "Click Back button.")]
- public async Task ActivityIndicator_Rotation_UILK()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
- _mActivityIndicator = new ActivityIndicator()
- {
- IsRunning = true,
- IsVisible = true,
- WidthRequest = 100,
- HeightRequest = 100
- };
-
- String[] dataTest = { "", "", "" };
- dataTest[0] = "50";
- dataTest[1] = "90";
- dataTest[2] = "180";
- var text = "Select a Rotation test";
- var title = "Rotation Test";
- //CreatePageTestToButton(text, title, dataTest);
- List<ControlTest> controlTest = new List<ControlTest>
- {
- new ControlTest(dataTest[0]),
- new ControlTest(dataTest[1]),
- new ControlTest(dataTest[2])
- };
- var _listview = new ListView
- {
- RowHeight = 100,
- ItemsSource = controlTest,
- ItemTemplate = new DataTemplate(() =>
- {
- Label nameLabel = new Label()
- {
- TextColor = Color.Black,
- BackgroundColor = Color.White,
- HorizontalOptions = LayoutOptions.Center,
- };
- nameLabel.SetBinding(Label.TextProperty, "Name");
- return new ViewCell
- {
- View = new StackLayout
- {
- Padding = new Thickness(0, 5),
- Children =
- {
- new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Spacing = 0,
- Children =
- {
- nameLabel,
- }
- }
- }
- }
- };
- })
- };
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest ctlTest = (ControlTest)e.Item;
- if (ctlTest.Name.Equals(dataTest[0]))
- {
- _mActivityIndicator.Rotation = 50;
- _mActivityIndicator.IsRunning = true;
- }
- else if (ctlTest.Name.Equals(dataTest[1]))
- {
- _mActivityIndicator.Rotation = 90;
- _mActivityIndicator.IsRunning = true;
- }
- else
- {
- _mActivityIndicator.Rotation = 180;
- _mActivityIndicator.IsRunning = true;
- }
- };
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- _mActivityIndicator,
- _listview,
- },
- BackgroundColor = Color.Blue.WithLuminosity(0.9),
- },
- Title = title,
- };
-
- if (Device.Idiom == TargetIdiom.Phone || Device.Idiom == TargetIdiom.TV)
- {
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
- else
- {
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the Scale property")]
- [Property("SPEC", "Xamarin.Forms.ActivityIndicator P")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(3, "Pass If Scale of ActivityIndicator changed otherwise False")]
- [Postcondition(1, "Click Back button.")]
- public async Task ActivityIndicator_Scale_UILK()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
- _mActivityIndicator = new ActivityIndicator()
- {
- IsRunning = true,
- IsVisible = true,
- WidthRequest = 100,
- HeightRequest = 100
- };
-
- String[] dataTest = { "", "", "" };
- dataTest[0] = "0.5";
- dataTest[1] = "1.0";
- dataTest[2] = "2.0";
- var text = "Select a Scale test";
- var title = "Scale Test";
- //CreatePageTestToButton(text, title, dataTest);
- List<ControlTest> controlTest = new List<ControlTest>
- {
- new ControlTest(dataTest[0]),
- new ControlTest(dataTest[1]),
- new ControlTest(dataTest[2])
- };
- var _listview = new ListView
- {
- RowHeight = 100,
- ItemsSource = controlTest,
- ItemTemplate = new DataTemplate(() =>
- {
- Label nameLabel = new Label()
- {
- TextColor = Color.Black,
- BackgroundColor = Color.White,
- HorizontalOptions = LayoutOptions.Center,
- };
- nameLabel.SetBinding(Label.TextProperty, "Name");
- return new ViewCell
- {
- View = new StackLayout
- {
- Padding = new Thickness(0, 5),
- Children =
- {
- new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Spacing = 0,
- Children =
- {
- nameLabel,
- }
- }
- }
- }
- };
- })
- };
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest ctlTest = (ControlTest)e.Item;
- if (ctlTest.Name.Equals(dataTest[0]))
- {
- _mActivityIndicator.Scale = 0.5;
- }
- else if (ctlTest.Name.Equals(dataTest[1]))
- {
- _mActivityIndicator.Scale = 1.0;
- _mActivityIndicator.IsRunning = true;
- }
- else
- {
- _mActivityIndicator.Scale = 2.0;
- _mActivityIndicator.IsRunning = true;
- }
- };
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- _mActivityIndicator,
- _listview,
- },
- BackgroundColor = Color.Blue.WithLuminosity(0.9),
- },
- Title = title,
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
- }
-}
+++ /dev/null
-using System.Threading.Tasks;
-using System.Diagnostics;
-using NUnit.Framework;
-using NUnit.Framework.TUnit;
-using Tizen.Applications;
-
-namespace Xamarin.Forms.Core.UnitTests {
-
- [TestFixture]
- [Description("Application init test")]
- public class ApplicationTests {
-
- private static TestPage _testPage = TestPage.GetInstance();
-
- public static void AppLaunchReq()
- {
- AppControl myAppControl = new AppControl();
- myAppControl.Operation = AppControlOperations.Default;
- myAppControl.ApplicationId = "ApplicationTests.Tizen";
- AppControl.SendLaunchRequest(myAppControl);
- }
-
- [SetUp]
- public void Init() {
- LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST");
-
-
- }
-
- [TearDown]
- public void Destroy() {
- LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Postconditions for each TEST");
- }
-
- [Test]
- [Category("P1")]
- [Description("MANUAL TEST : OnResume() should be called after launch app")]
- [Property("SPEC", "Xamarin.Forms.Application.OnResume M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Ngo Van Hai, hai.nv3@samsung.com")]
- [Precondition(1, "If ApplicationTests.Tizen is launched, please kill this application.")]
- [Precondition(2, "Open terminal to view logs.")]
- [Precondition(3, "Enter command \"sdb dlog -c \"")]
- [Precondition(4, "Enter command \"sdb dlog | grep TestCase\" to terminal")]
- [Step(1, "Click run TC")]
- [Step(2, "Check if log show \"[TestCase][OnResume][Application] Pass\".")]
- [Postcondition(1, "Close the terminal")]
- public async Task OnResume_MANUAL_TEST()
- {
- /* TEST CODE */
- ApplicationTests.AppLaunchReq();
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("MANUAL TEST : OnStart() should be called after launch app")]
- [Property("SPEC", "Xamarin.Forms.Application.OnStart M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Ngo Van Hai, hai.nv3@samsung.com")]
- [Precondition(1, "If ApplicationTests.Tizen is launched, please kill this application.")]
- [Precondition(2, "Open terminal to view logs.")]
- [Precondition(3, "Enter command \"sdb dlog -c\"")]
- [Precondition(4, "Enter command \"sdb dlog | grep TestCase\" to terminal")]
- [Step(1, "Click run TC")]
- [Step(2, "Check if log show \"[TestCase][OnStart][Application] Pass\".")]
- [Postcondition(1, "Close the terminal")]
- public async Task OnStart_MANUAL_TEST()
- {
- /* TEST CODE */
- ApplicationTests.AppLaunchReq();
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("MANUAL TEST : OnSleep() should be called after launch app")]
- [Property("SPEC", "Xamarin.Forms.Application.OnSleep M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Ngo Van Hai, hai.nv3@samsung.com")]
- [Precondition(1, "If ApplicationTests.Tizen is launched, please kill this application.")]
- [Precondition(2, "Open terminal to view logs.")]
- [Precondition(3, "Enter command \"sdb dlog -c \"")]
- [Precondition(4, "Enter command \"sdb dlog | grep TestCase\" to terminal")]
- [Step(1, "Click run TC")]
- [Step(2, "Check if log show \"[TestCase][OnSleep][Application] Pass\".")]
- [Postcondition(1, "Close the terminal")]
- public async Task OnSleep_MANUAL_TEST()
- {
- /* TEST CODE */
- ApplicationTests.AppLaunchReq();
- await ManualTest.WaitForConfirm();
- }
-
- //[Test]
- [Category("P1")]
- [Description("MANUAL TEST : OnSleep() should be called after launch app")]
- [Property("SPEC", "Xamarin.Forms.Application.OnSleep M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Ngo Van Hai, hai.nv3@samsung.com")]
- [Precondition(1, "If ApplicationTests.Tizen is launched, please kill this application.")]
- [Precondition(2, "Open terminal to view logs.")]
- [Precondition(3, "Enter command \"sdb dlog -c \"")]
- [Precondition(4, "Enter command \"sdb dlog | grep TestCase\" to terminal")]
- [Step(1, "Click run TC")]
- [Step(2, "Check if log show \"[TestCase][OnSleep][Application] Pass\".")]
- [Postcondition(1, "Close the terminal")]
- public async Task OnAppLinkRequestReceived_MANUAL_TEST()
- {
- /* TEST CODE */
- ApplicationTests.AppLaunchReq();
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("MANUAL TEST : ModalPopped event is raised after a view has been popped modally.")]
- [Property("SPEC", "Xamarin.Forms.Application.ModalPopped E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "N/A")]
- [Step(1, "Click run TC")]
- [Step(2, "Click the button click me.")]
- [Step(3, "Check new page with button 'Click for Popped' appears.")]
- [Step(4, "Click the button for Popped.")]
- [Step(5, "Check the lebel below clicked button is 'ModalPopped Event raised'.")]
- [Step(6, "TC will Pass automatically if ModalPopped event raised otherwise Fail")]
- [Postcondition(1, "N/A")]
- public async Task ModalPopped_EVENT_CHECK_MANUAL_TEST()
- {
- /* TEST CODE */
- var _button1 = new Button
- {
- Text = "Click me",
- };
-
- Label poppedText = new Label
- {
- Text = "Not Popped."
- };
-
- var _buttonPopped = new Button
- {
- Text = "Click for Popped",
- };
-
- ContentPage page1 = new ContentPage
- {
- Title = "Hello World",
- Content = new StackLayout
- {
- IsVisible = true,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _buttonPopped
- }
- }
-
- };
-
- ContentPage contentpage = new ContentPage()
- {
- Content = new StackLayout
- {
- IsVisible = true,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _button1,
- poppedText
- }
- }
-
- };
-
- _button1.Clicked += (sender, e) =>
- {
- _button1.Text = "Clicked";
- contentpage.Navigation.PushModalAsync(page1);
- };
-
- _buttonPopped.Clicked += (sender, e) =>
- {
- _button1.Text = "Clicked";
- contentpage.Navigation.PopModalAsync();
- };
-
- Application.Current.ModalPopped += (sender, e) => {
- _buttonPopped.Text = "popped";
- poppedText.Text = "ModalPopped Evenet Raised.";
- Assert.IsTrue(true, "Unknown exception occured.");
- ManualTest.Confirm();
- };
-
- _testPage.ExecuteTC(contentpage);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("MANUAL TEST : ModalPopping event is raised when a view is modally popped.")]
- [Property("SPEC", "Xamarin.Forms.Application.ModalPopping E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "N/A")]
- [Step(1, "Click run TC")]
- [Step(2, "Click the button click me.")]
- [Step(3, "Check new page with button 'click for popping' appears.")]
- [Step(4, "Click the button for popping.")]
- [Step(5, "Check the lebel below click me button is 'ModalPopping Event raised'.")]
- [Step(6, "TC will Pass automatically if ModalPopping event raised otherwise Fail")]
- [Postcondition(1, "N/A")]
- public async Task ModalPopping_EVENT_CHECK_MANUAL_TEST()
- {
- /* TEST CODE */
- var _button1 = new Button
- {
- Text = "Click me",
- };
-
- var _buttonPopping = new Button
- {
- Text = "Click for Popping",
- };
-
- Label poppingText = new Label
- {
- Text = "Not Popped."
- };
-
- ContentPage page1 = new ContentPage
- {
- Title = "Hello World",
- Content = new StackLayout
- {
- IsVisible = true,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _buttonPopping,
-
- }
- }
-
- };
-
- ContentPage contentpage = new ContentPage()
- {
- Content = new StackLayout
- {
- IsVisible = true,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _button1,
- poppingText
- }
- }
-
- };
-
- _button1.Clicked += (sender, e) =>
- {
- _button1.Text = "Clicked";
- contentpage.Navigation.PushModalAsync(page1);
- };
-
- _buttonPopping.Clicked += (sender, e) =>
- {
- contentpage.Navigation.PopModalAsync();
- };
-
- Application.Current.ModalPopping += (sender, e) => {
- _buttonPopping.Text = "popping";
- poppingText.Text = "ModalPopping Event raised.";
- Assert.IsTrue(true, "Unknown exception occured.");
- ManualTest.Confirm();
- };
-
- _testPage.ExecuteTC(contentpage);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("MANUAL TEST : ModalPushed event is raised after a view has been pushed modally.")]
- [Property("SPEC", "Xamarin.Forms.Application.ModalPushed E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "N/A")]
- [Step(1, "Click run TC")]
- [Step(2, "Click the button click me.")]
- [Step(3, "Check new page with button 'Pushed' appears.")]
- [Step(4, "Click the button for Pushed.")]
- [Step(5, "Check the lebel below click me button is 'ModalPushed Event raised'.")]
- [Step(6, "TC will Pass automatically if ModalPushed event raised otherwise Fail")]
- [Postcondition(1, "N/A")]
- public async Task ModalPushed_EVENT_CHECK_MANUAL_TEST()
- {
- /* TEST CODE */
- var _button1 = new Button
- {
- Text = "Click me",
- };
-
- var _buttonPushed = new Button
- {
- Text = "Pushed"
- };
-
- Label pushedText = new Label
- {
- Text = "Not Pushed."
- };
-
- ContentPage page1 = new ContentPage
- {
- Title = "Hello World",
- Content = new StackLayout
- {
- IsVisible = true,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _buttonPushed
-
- }
- }
-
- };
-
- ContentPage contentpage = new ContentPage()
- {
- Content = new StackLayout
- {
- IsVisible = true,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _button1,
- pushedText
- }
- }
-
- };
-
- _button1.Clicked += (sender, e) =>
- {
- _button1.Text = "Clicked";
- contentpage.Navigation.PushModalAsync(page1);
- };
-
- _buttonPushed.Clicked += (sender, e) =>
- {
- contentpage.Navigation.PopModalAsync();
- };
-
- Application.Current.ModalPushed += (sender, e) => {
- _buttonPushed.Text = "Pushed";
- pushedText.Text = "ModalPushed Event raised.";
- Assert.IsTrue(true, "Unknown exception occured.");
- ManualTest.Confirm();
- };
-
- _testPage.ExecuteTC(contentpage);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("MANUAL TEST : ModalPushing event is raised when a view is modally pushed.")]
- [Property("SPEC", "Xamarin.Forms.Application.ModalPushing E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "N/A")]
- [Step(1, "Click run TC")]
- [Step(2, "Click the button click me.")]
- [Step(3, "Check new page with button 'Pushing' appears.")]
- [Step(4, "Click the button for Pushing.")]
- [Step(5, "Check the lebel below click me button is 'ModalPushing Event raised'.")]
- [Step(6, "TC will Pass automatically if ModalPushing event raised otherwise Fail")]
- [Postcondition(1, "N/A")]
- public async Task ModalPushing_EVENT_CHECK_MANUAL_TEST()
- {
- /* TEST CODE */
- var _button1 = new Button
- {
- Text = "Click me",
- };
-
- var _buttonPushing = new Button
- {
- Text = "Pushing"
- };
-
- Label pushingText = new Label
- {
- Text = "Not Pushed."
- };
-
- ContentPage page1 = new ContentPage
- {
- Title = "Hello World",
- Content = new StackLayout
- {
- IsVisible = true,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _buttonPushing
-
- }
- }
-
- };
-
- ContentPage contentpage = new ContentPage()
- {
- Content = new StackLayout
- {
- IsVisible = true,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _button1,
- pushingText
- }
- }
-
- };
-
- _button1.Clicked += (sender, e) =>
- {
- _button1.Text = "Clicked";
- contentpage.Navigation.PushModalAsync(page1);
- };
-
- _buttonPushing.Clicked += (sender, e) =>
- {
- contentpage.Navigation.PopModalAsync();
- };
-
- Application.Current.ModalPushing += (sender, e) => {
- _buttonPushing.Text = "Pushing";
- pushingText.Text = "ModalPushing Event raised.";
- Assert.IsTrue(true, "Unknown exception occured.");
- ManualTest.Confirm();
- };
-
- _testPage.ExecuteTC(contentpage);
- await ManualTest.WaitForConfirm();
- }
-
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System.Threading.Tasks;
-using System.Collections.Generic;
-using Xamarin.Forms;
-using XamarinApplication.Tizen;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.BoxView ManualTests")]
- class BoxViewTest
- {
- private BoxView _mBoxView;
- private static TestPage _testPage = TestPage.GetInstance();
- private string _appResourcePath = Program.Current.DirectoryInfo.Resource;
-
- class ControlTest
- {
- public ControlTest(string name)
- {
- this.Name = name;
- }
-
- public string Name { private set; get; }
- };
-
- [SetUp]
- public void SetUp()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "BoxView CLASS: Setup---------------------------------");
- _mBoxView = new BoxView();
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "BoxView CLASS: Teardown---------------------------------");
- _mBoxView = null;
- }
-
- //support function
-
- [Test]
- [Category("P1")]
- [Description("BoxView look")]
- [Property("SPEC", "Xamarin.Forms.BoxView A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(4, "Testcase PASS if the BoxView is shown,otherwise FAIL")]
- [Postcondition(1, "Click Back button.")]
- public async Task BoxView_UILK()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
-
- _mBoxView = new BoxView
- {
- BackgroundColor = Color.Blue.WithLuminosity(0.9),
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 100,
- WidthRequest = 200
- };
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- _mBoxView
- }
- },
- Title = "BoxView UILK Test",
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the IsVisible property")]
- [Property("SPEC", "Xamarin.Forms.BoxView.IsVisible P")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click Change button")]
- [Step(3, "Observe change of the BoxView")]
- [Step(4, "Testcase PASS if click Visible button -> Show the BoxView and click Hide button-> Hide the BoxView, otherwise FAIL")]
- [Postcondition(1, "Click Back button.")]
- public async Task BoxView_IsVisible_UIBH()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
- _mBoxView = new BoxView
- {
- BackgroundColor = Color.Blue.WithLuminosity(0.9),
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 100,
- WidthRequest = 200,
- };
-
- var mBtnVisible = new Button
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.End,
- Text = "Visible",
- Margin = new Thickness()
- {
- Right = 10,
- Left = 10
- }
- };
-
- var mBtnHide = new Button
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.End,
- Text = "Hide",
- Margin = new Thickness()
- {
- Right = 10,
- Left = 10
- }
- };
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- _mBoxView,
- mBtnVisible,
- mBtnHide
- },
- },
- Title = "IsVisible Test",
- };
-
- mBtnVisible.Clicked += (e, o) =>
- {
- _mBoxView.IsVisible = true;
- };
-
- mBtnHide.Clicked += (e, o) =>
- {
- _mBoxView.IsVisible = false;
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- mBtnVisible.Clicked -= (e, o) =>
- {
- _mBoxView.IsVisible = true;
- };
-
- mBtnHide.Clicked -= (e, o) =>
- {
- _mBoxView.IsVisible = false;
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the BackgroundColor property")]
- [Property("SPEC", "Xamarin.Forms.BoxView.BackgroundColor P")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Select a Color after observe BackgroundColor of BoxView is changed")]
- [Step(3, "Testcase PASS If BackgroundColor of BoxView changed otherwise false")]
- [Postcondition(1, "Click Back button.")]
- public async Task BoxView_BackgroundColor_Change_UILK()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
- _mBoxView = new BoxView
- {
- BackgroundColor = Color.Blue.WithLuminosity(0.9),
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 100,
- WidthRequest = 200
- };
-
- var mBtnRed = new Button
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.End,
- BackgroundColor = Color.Red,
- Text = "Red",
- Margin = new Thickness()
- {
- Right = 10,
- Left = 10
- }
- };
-
- var mBtnGreen = new Button
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.End,
- BackgroundColor = Color.Green,
- Text = "Green",
- Margin = new Thickness()
- {
- Right = 10,
- Left = 10
- }
- };
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- _mBoxView,
- mBtnRed,
- mBtnGreen
- },
- },
- Title = "BackgoundColor Test",
- };
-
- mBtnRed.Clicked += (e, o) =>
- {
- _mBoxView.BackgroundColor = Color.Red;
- };
-
- mBtnGreen.Clicked += (e, o) =>
- {
- _mBoxView.BackgroundColor = Color.Green;
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- mBtnRed.Clicked -= (e, o) =>
- {
- _mBoxView.BackgroundColor = Color.Red;
- };
-
- mBtnGreen.Clicked -= (e, o) =>
- {
- _mBoxView.BackgroundColor = Color.Green;
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the HeightRequest & WidthRequest property")]
- [Property("SPEC", "Xamarin.Forms.BoxView P")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Seek Silder for Width and Height after observe")]
- [Step(3, "Pass If Height and Width of the BoxView changed otherwise false")]
- [Postcondition(1, "Click Back button.")]
- public async Task BoxView_WidthAndHeight_CHANGE_SIZE_UILK()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
- _mBoxView = new BoxView
- {
- BackgroundColor = Color.Blue.WithLuminosity(0.9),
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 100,
- WidthRequest = 200
- };
-
- var sliderHorizontal = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- BackgroundColor = Color.Pink,
- Maximum = 500,
- Minimum = 120
- };
-
- var sliderVertical = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- BackgroundColor = Color.Pink,
- Maximum = 500,
- Minimum = 80
- };
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- _mBoxView,
- sliderHorizontal,
- sliderVertical
- },
- },
- Title = "Size Layout Test",
- };
-
- sliderHorizontal.ValueChanged += (o, e) =>
- {
- _mBoxView.WidthRequest = sliderHorizontal.Value;
- };
-
- sliderVertical.ValueChanged += (o, e) =>
- {
- _mBoxView.HeightRequest = sliderVertical.Value;
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- sliderHorizontal.ValueChanged -= (o, e) =>
- {
- _mBoxView.WidthRequest = sliderHorizontal.Value;
- };
-
- sliderVertical.ValueChanged -= (o, e) =>
- {
- _mBoxView.HeightRequest = sliderVertical.Value;
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the Opacity property")]
- [Property("SPEC", "Xamarin.Forms.BoxView P")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Seek Opacity Slider after observe")]
- [Step(3, "Pass If Opacity of BoxView changed otherwise false")]
- [Postcondition(1, "Click Back button.")]
- public async Task BoxView_Opacity_UILK()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
- _mBoxView = new BoxView
- {
- BackgroundColor = Color.Blue.WithLuminosity(0.9),
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 100,
- WidthRequest = 200
- };
-
- var sliderOpacity = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.Blue,
- Maximum = 1,
- Minimum = 0,
- Value = 1
- };
-
- _mBoxView.BindingContext = sliderOpacity;
- _mBoxView.SetBinding(Button.OpacityProperty, "Value");
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- _mBoxView,
- sliderOpacity,
- },
- },
- Title = "OpacityTest",
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the Margin property")]
- [Property("SPEC", "Xamarin.Forms.BoxView P")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(4, "Pass If Margin of BoxView changed otherwise False")]
- [Postcondition(1, "Click Back button.")]
- public async Task BoxView_Margin_UILK()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
- _mBoxView = new BoxView
- {
- BackgroundColor = Color.Blue.WithLuminosity(0.9),
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 100,
- WidthRequest = 200
- };
-
- String[] dataTest = { "", "", "" };
- dataTest[0] = "MarginTop: 50";
- dataTest[1] = "MarginTop: 100";
- dataTest[2] = "MarginTop: 150";
- var text = "Select a Margin test";
- var title = "Margin Test";
- //CreatePageTestToButton(text, title, dataTest);
- List<ControlTest> controlTest = new List<ControlTest>
- {
- new ControlTest(dataTest[0]),
- new ControlTest(dataTest[1]),
- new ControlTest(dataTest[2])
- };
- var _listview = new ListView
- {
- RowHeight = 100,
- ItemsSource = controlTest,
- ItemTemplate = new DataTemplate(() =>
- {
- Label nameLabel = new Label()
- {
- TextColor = Color.Black,
- BackgroundColor = Color.White,
- HorizontalOptions = LayoutOptions.Center,
- };
- nameLabel.SetBinding(Label.TextProperty, "Name");
- return new ViewCell
- {
- View = new StackLayout
- {
- Padding = new Thickness(0, 5),
- Children =
- {
- new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Spacing = 0,
- Children =
- {
- nameLabel,
- }
- }
- }
- }
- };
- })
- };
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest ctlTest = (ControlTest)e.Item;
- if (ctlTest.Name.Equals(dataTest[0]))
- {
- _mBoxView.Margin = new Thickness(0, 50, 0, 0);
- }
- else if (ctlTest.Name.Equals(dataTest[1]))
- {
- _mBoxView.Margin = new Thickness(0, 100, 0, 0);
- }
- else
- {
- _mBoxView.Margin = new Thickness(0, 150, 0, 0);
- }
- };
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- _mBoxView,
- _listview,
- },
- BackgroundColor = Color.Navy
- },
- Title = title,
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the Rotation property")]
- [Property("SPEC", "Xamarin.Forms.BoxView P")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(3, "Pass If Rotation of BoxView changed otherwise False")]
- [Postcondition(1, "Click Back button.")]
- public async Task BoxView_Rotation_UILK()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
- _mBoxView = new BoxView
- {
- BackgroundColor = Color.Blue.WithLuminosity(0.9),
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 100,
- WidthRequest = 200
- };
-
- String[] dataTest = { "", "", "" };
- dataTest[0] = "50";
- dataTest[1] = "90";
- dataTest[2] = "180";
- var text = "Select a Rotation test";
- var title = "Rotation Test";
- List<ControlTest> controlTest = new List<ControlTest>
- {
- new ControlTest(dataTest[0]),
- new ControlTest(dataTest[1]),
- new ControlTest(dataTest[2])
- };
- var _listview = new ListView
- {
- RowHeight = 100,
- ItemsSource = controlTest,
- ItemTemplate = new DataTemplate(() =>
- {
- Label nameLabel = new Label()
- {
- TextColor = Color.Black,
- BackgroundColor = Color.White,
- HorizontalOptions = LayoutOptions.Center,
- };
- nameLabel.SetBinding(Label.TextProperty, "Name");
- return new ViewCell
- {
- View = new StackLayout
- {
- Padding = new Thickness(0, 5),
- Children =
- {
- new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Spacing = 0,
- Children =
- {
- nameLabel,
- }
- }
- }
- }
- };
- })
- };
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest ctlTest = (ControlTest)e.Item;
- if (ctlTest.Name.Equals(dataTest[0]))
- {
- _mBoxView.Rotation = 50;
- }
- else if (ctlTest.Name.Equals(dataTest[1]))
- {
- _mBoxView.Rotation = 90;
- }
- else
- {
- _mBoxView.Rotation = 180;
- }
- };
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- _mBoxView,
- new Label
- {
- Text=text,
- TextColor=Color.White,
- HorizontalOptions = LayoutOptions.Center
- },
- _listview,
- },
- BackgroundColor = Color.Navy
- },
- Title = title,
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the Scale property")]
- [Property("SPEC", "Xamarin.Forms.BoxView P")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(3, "Pass If Scale of BoxView changed otherwise False")]
- [Postcondition(1, "Click Back button.")]
- public async Task BoxView_Scale_UILK()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
- _mBoxView = new BoxView
- {
- BackgroundColor = Color.Blue.WithLuminosity(0.9),
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 100,
- WidthRequest = 200,
- };
-
- String[] dataTest = { "", "", "" };
- dataTest[0] = "0.5";
- dataTest[1] = "1.0";
- dataTest[2] = "2.0";
- var text = "Select a Scale test";
- var title = "Scale Test";
- List<ControlTest> controlTest = new List<ControlTest>
- {
- new ControlTest(dataTest[0]),
- new ControlTest(dataTest[1]),
- new ControlTest(dataTest[2])
- };
- var _listview = new ListView
- {
- RowHeight = 100,
- ItemsSource = controlTest,
- ItemTemplate = new DataTemplate(() =>
- {
- Label nameLabel = new Label()
- {
- TextColor = Color.Black,
- BackgroundColor = Color.White,
- HorizontalOptions = LayoutOptions.Center,
- };
- nameLabel.SetBinding(Label.TextProperty, "Name");
- return new ViewCell
- {
- View = new StackLayout
- {
- Padding = new Thickness(0, 5),
- Children =
- {
- new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Spacing = 0,
- Children =
- {
- nameLabel,
- }
- }
- }
- }
- };
- })
- };
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest ctlTest = (ControlTest)e.Item;
- if (ctlTest.Name.Equals(dataTest[0]))
- {
- _mBoxView.Scale = 0.5;
- }
- else if (ctlTest.Name.Equals(dataTest[1]))
- {
- _mBoxView.Scale = 1.0;
- }
- else
- {
- _mBoxView.Scale = 2.0;
- }
- };
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- _mBoxView,
- _listview,
- },
- BackgroundColor = Color.Navy
- },
- Title = title,
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, 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 NUnit.Framework;
-using NUnit.Framework.TUnit;
-using System.Threading.Tasks;
-using XamarinApplication.Tizen;
-using System.Collections.Generic;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class ButtonTests
- {
- private static TestPage _testPage = TestPage.GetInstance();
- private Button _button;
- private static ListView _listview;
- private string _appResourcePath = Program.Current.DirectoryInfo.Resource;
-
- class ControlTest
- {
- public ControlTest(string name)
- {
- this.Name = name;
- }
-
- public string Name { private set; get; }
- };
-
- [SetUp]
- public void SetUp()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Button CLASS: Setup---------------------------------");
- _button = new Button();
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Button CLASS: Teardown---------------------------------");
- _button = null;
- }
-
- //support function
- public void CreatePageTestToButton(String txtDisplay, String title, String[] dataTest)
- {
- _button = new Button
- {
- Text = "This is button test",
- HorizontalOptions = LayoutOptions.Center,
- Font = Font.SystemFontOfSize(NamedSize.Medium),
- WidthRequest = 200,
- HeightRequest = 100,
- IsEnabled = true,
- };
- List<ControlTest> controlTest = new List<ControlTest>
- {
- new ControlTest(dataTest[0]),
- new ControlTest(dataTest[1]),
- new ControlTest(dataTest[2])
- };
- _listview = new ListView
- {
- RowHeight = 100,
- ItemsSource = controlTest,
- ItemTemplate = new DataTemplate(() =>
- {
- Label nameLabel = new Label()
- {
- TextColor = Color.Black,
- BackgroundColor = Color.White,
- HorizontalOptions = LayoutOptions.Center,
- };
- nameLabel.SetBinding(Label.TextProperty, "Name");
- return new ViewCell
- {
- View = new StackLayout
- {
- Padding = new Thickness(0, 5),
- Children =
- {
- new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Spacing = 0,
- Children =
- {
- nameLabel,
- }
- }
- }
- }
- };
- })
- };
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- _button,
- _listview,
- },
- BackgroundColor = Color.Blue,
- },
- Title = title
- });
- }
-
- //--------------BHLK Testing--------------
- [Test]
- [Category("P1")]
- [Description("Test: Button look")]
- [Property("SPEC", "Tizen.UI.Button.Text A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click and Observe all button's behaviours/looks")]
- [Step(3, "Pass If buttons show clearly, they don't overlap otherwise fail")]
- [Postcondition(1, "NA")]
- public async Task Button_BHLK_FULL()
- {
- //Stack1
- var mButton1 = new Button()
- {
- Text = "Default",
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- WidthRequest = 320,
- HeightRequest = 80
- };
- var mStack1 = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.Start,
- Orientation = StackOrientation.Horizontal,
- HeightRequest = 120,
- Children =
- {
- mButton1
- },
- Padding = new Thickness()
- {
- Top = 0,
- },
- };
-
- mButton1.Clicked += (sender, e) =>
- {
- mButton1.Text = "Clicked";
- };
- //Stack2
- var mButton21 = new Button()
- {
- Text = "Default",
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.Center,
- };
- var mButton22 = new Button()
- {
- Text = "Disabled",
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.Center,
- IsEnabled = false
- };
- var mStack2 = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.Start,
- Orientation = StackOrientation.Horizontal,
- HeightRequest = 120,
- Children =
- {
- mButton21,
- mButton22,
- },
- Spacing = 0
- };
- //Stack3
- var mButton31 = new Button()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.Center,
- HeightRequest = 80,
- Image = new FileImageSource()
- {
- File = _appResourcePath + "icon/settings_restart.png"
- }
- };
- var mButton32 = new Button()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.Center,
- HeightRequest = 80,
- Image = new FileImageSource()
- {
- File = _appResourcePath + "icon/settings_date_and_time.png"
- },
- };
- var mButton33 = new Button()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.Center,
- HeightRequest = 80,
- Image = new FileImageSource()
- {
- File = _appResourcePath + "icon/settings_network.png"
- },
- IsEnabled = false
- };
- var mStack3 = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.Start,
- Orientation = StackOrientation.Horizontal,
- HeightRequest = 200,
- Spacing = 10,
- Children =
- {
- mButton31,
- mButton32,
- mButton33
- },
- };
- //Stack4
- var mButton41 = new Button()
- {
- HorizontalOptions = LayoutOptions.Center,
- VerticalOptions = LayoutOptions.Center,
- Image = new FileImageSource()
- {
- File = _appResourcePath + "icon/settings_sound.png",
- },
- WidthRequest = 82,
- HeightRequest = 82,
- };
- var mStackChild1 = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- mButton41,
- new Label()
- {
- HorizontalTextAlignment = TextAlignment.Center,
- Text = "Speakers",
- Font = Font.SystemFontOfSize(NamedSize.Medium),
- }
- },
- Spacing = 20,
- Padding = new Thickness()
- {
- Top = 70
- }
- };
- var mButton42 = new Button()
- {
- HorizontalOptions = LayoutOptions.Center,
- VerticalOptions = LayoutOptions.Center,
- Image = new FileImageSource()
- {
- File = _appResourcePath + "icon/settings_restart.png",
- },
- WidthRequest = 82,
- HeightRequest = 82,
- };
- var mStackChild2 = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- mButton42
- },
- Padding = new Thickness()
- {
- Top = 90
- }
- };
- var mButton43 = new Button()
- {
- HorizontalOptions = LayoutOptions.Center,
- VerticalOptions = LayoutOptions.Center,
- Image = new FileImageSource()
- {
- File = _appResourcePath + "icon/settings_network.png",
- // IsSmooth = true,
- },
- WidthRequest = 82,
- HeightRequest = 82,
- IsEnabled = false
- };
- var mStackChild3 = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- mButton43,
- new Label()
- {
- HorizontalTextAlignment = TextAlignment.Center,
- Text = "Network",
- Font = Font.SystemFontOfSize(NamedSize.Medium),
- }
- },
- Spacing = 20,
- Padding = new Thickness()
- {
- Top = 70
- }
- };
- var mStack4 = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.Start,
- Orientation = StackOrientation.Horizontal,
- HeightRequest = 350,
- Children =
- {
- mStackChild1,
- mStackChild2,
- mStackChild3
- }
- };
- //Stack5
- var mButton51 = new Button()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.Center,
- HeightRequest = 80,
- Image = new FileImageSource()
- {
- File = _appResourcePath + "icon/settings_restart.png"
- },
- Text = "Restart"
- };
- var mButton52 = new Button()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.Center,
- HeightRequest = 80,
- Image = new FileImageSource()
- {
- File = _appResourcePath + "icon/settings_date_and_time.png"
- },
- Text = "Calendar"
- };
- var mStack5 = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- Orientation = StackOrientation.Horizontal,
- Children =
- {
- mButton51,
- mButton52
- },
- Padding = new Thickness()
- {
- Left = 25,
- Right = 25
- },
- Spacing = 10
- };
- //Stack6
- var mButton61 = new Button()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.Center,
- HeightRequest = 100,
- Image = new FileImageSource()
- {
- File = _appResourcePath + "icon/settings_restart.png"
- },
- TextColor = new Color(255, 255, 255)
- };
- var mButton62 = new Button()
- {
- HorizontalOptions = LayoutOptions.Center,
- VerticalOptions = LayoutOptions.Center,
- HeightRequest = 100,
- WidthRequest = 110,
- Image = new FileImageSource()
- {
- File = _appResourcePath + "icon/settings_account.png"
- },
- TextColor = new Color(255, 255, 255)
- };
- var mButton63 = new Button()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.Center,
- HeightRequest = 100,
- Image = new FileImageSource()
- {
- File = _appResourcePath + "icon/settings_network.png"
- },
- IsEnabled = false,
- TextColor = new Color(255, 255, 255)
- };
- var mStack6 = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- Orientation = StackOrientation.Horizontal,
- Children =
- {
- mButton61,
- mButton62,
- mButton63
- },
- Spacing = 60,
- };
- //Main stack
- var mainStack = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- mStack1,
- mStack2,
- mStack3,
- mStack4,
- mStack5,
- mStack6,
- },
- BackgroundColor = Color.White
- };
-
- var view = new ScrollView
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- Content = mainStack
- };
-
- var contentPage = new ContentPage()
- {
- Content = view
- };
- /*add*/
- contentPage.Title = "Button Test";
- _testPage.ExecuteTC(contentPage);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Button look")]
- [Property("SPEC", "Tizen.UI.Button.Text A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- [Precondition(1, "When you test on TV, you should click button after changing background color.")]
- [Step(1, "Click run TC")]
- [Step(2, "Select a Color after observe BackgroundColor of button is changed")]
- [Step(3, "Pass If BackgroundColor of Button changed otherwise false")]
- [Postcondition(1, "NA")]
- public async Task BackgroundColor_COLOR_CHANGE()
- {
- _button = new Button()
- {
- HorizontalOptions = LayoutOptions.Center,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 80,
- WidthRequest = 320,
- BorderColor = Color.Pink,
- BorderWidth = 10,
- BorderRadius = 5,
- Text = "BackgroundColor",
- Font = Font.SystemFontOfSize(NamedSize.Medium),
- };
-
- var imageRed = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.Red,
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "RED",
- HorizontalTextAlignment = TextAlignment.Center,
- }
- }
- };
-
- var imageGreen = new StackLayout()
- {
- BackgroundColor = Color.Green,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "GREEN",
- HorizontalTextAlignment = TextAlignment.Center,
- }
- }
- };
-
- var imageGray = new StackLayout()
- {
- BackgroundColor = Color.Gray,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "GRAY",
- HorizontalTextAlignment = TextAlignment.Center,
- }
- }
- };
-
- var tapGestureRecognizerRed = new TapGestureRecognizer();
- tapGestureRecognizerRed.Tapped += async (s, e) =>
- {
- _button.BackgroundColor = Color.Red;
- _button.Text = "RED";
- await Task.Delay(2000);
- };
- imageRed.GestureRecognizers.Add(tapGestureRecognizerRed);
-
- var tapGestureRecognizerGreen = new TapGestureRecognizer();
- tapGestureRecognizerGreen.Tapped += async (s, e) =>
- {
- _button.BackgroundColor = Color.Green;
- _button.Text = "GREEN";
- await Task.Delay(2000);
- };
- imageGreen.GestureRecognizers.Add(tapGestureRecognizerGreen);
-
- var tapGestureRecognizerGray = new TapGestureRecognizer();
- tapGestureRecognizerGray.Tapped += (s, e) =>
- {
- _button.BackgroundColor = Color.Gray;
- _button.Text = "GRAY";
- };
- imageGray.GestureRecognizers.Add(tapGestureRecognizerGray);
-
- var mainUI = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
-
- Children =
- {
- _button,
- new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 180,
- Orientation = StackOrientation.Horizontal,
- Spacing = 10,
- Padding = new Thickness()
- {
- Left = 20,
- Right = 20
- },
-
- Children =
- {
- imageRed,
- imageGreen,
- imageGray
- }
- }
- }
- };
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = mainUI,
- Title = "BackgoundColor Test"
- });
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Button look")]
- [Property("SPEC", "Tizen.UI.Button")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Seek Silder for Width and Height after observe")]
- [Step(3, "Pass If Height and Width of Button changed otherwise false")]
- [Postcondition(1, "NA")]
- public async Task WidthAndHeight_CHANGE_SIZE()
- {
- _button = new Button()
- {
- HorizontalOptions = LayoutOptions.Center,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- BorderColor = Color.Pink,
- BorderWidth = 10,
- BorderRadius = 5,
- Text = "Size",
- Font = Font.SystemFontOfSize(NamedSize.Small),
- };
-
- var sliderHorizontal = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.Pink,
- Maximum = 500,
- Minimum = 120
- };
-
- var sliderVertical = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.Pink,
- Maximum = 500,
- Minimum = 80
- };
-
- sliderHorizontal.ValueChanged += (o, e) =>
- {
- _button.WidthRequest = sliderHorizontal.Value;
- };
-
- sliderVertical.ValueChanged += (o, e) =>
- {
- _button.HeightRequest = sliderVertical.Value;
- };
-
- var mainUI = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.White,
- Children =
- {
- _button,
- new StackLayout() {
- Orientation = StackOrientation.Horizontal,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- new Label()
- {
- Text = "Width: ",
- },
- sliderHorizontal
- }
- },
- new StackLayout() {
- Orientation = StackOrientation.Horizontal,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- new Label()
- {
- Text = "Height: ",
- },
- sliderVertical
- }
- }
- }
- };
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = mainUI,
- Title = "Size Button Test"
- });
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Button look")]
- [Property("SPEC", "Tizen.UI.Button")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Seek Opacity Slider after observe")]
- [Step(3, "Pass If Opacity of Button changed otherwise false")]
- [Postcondition(1, "NA")]
- public async Task Opacity_LOOK()
- {
- _button = new Button()
- {
- HorizontalOptions = LayoutOptions.Center,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 80,
- WidthRequest = 220,
- BorderColor = Color.Pink,
- BorderWidth = 10,
- BorderRadius = 5,
- Text = "OpacityTest",
- Font = Font.SystemFontOfSize(NamedSize.Medium),
- };
- var sliderOpacity = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.BlueViolet,
- Maximum = 1,
- Minimum = 0,
- Value = 0.5
- };
-
- _button.BindingContext = sliderOpacity;
- _button.SetBinding(Button.OpacityProperty, "Value");
-
- var mainUI = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.White,
- Padding = new Thickness()
- {
- Top = 20,
- Bottom = 50,
- },
- Spacing = 25,
- Children =
- {
- _button,
- sliderOpacity
- //new StackLayout() {
- // Orientation = StackOrientation.Horizontal,
- // HorizontalOptions = LayoutOptions.FillAndExpand,
- // Padding = new Thickness() {
- // Left = 20,
- // Right = 20,
- // },
- // Children =
- // {
- // //new Label()
- // //{
- // // Text = "Opacity: ",
- // // Font = Font.SystemFontOfSize(NamedSize.Large)
- // //},
- // }
- //},
- }
- };
-
- if (ManualTest.IsWearable())
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Not supported on this profile");
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
- else
- {
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = mainUI,
- Title = "Opacity Button Test"
- });
- await ManualTest.WaitForConfirm();
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Button look")]
- [Property("SPEC", "Tizen.UI.Button")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- [Precondition(1, "When you test on TV, you should click button after changing background color.")]
- [Step(1, "Click run TC")]
- [Step(2, "Select a icon after observe icon of button is changed")]
- [Step(3, "Pass If icon of Button changed otherwise false")]
- [Postcondition(1, "NA")]
- public async Task Image_ICON_CHANGE()
- {
- _button = new Button()
- {
- HorizontalOptions = LayoutOptions.Center,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 80,
- WidthRequest = 320,
- BorderColor = Color.Pink,
- BorderWidth = 10,
- BorderRadius = 5,
- Font = Font.SystemFontOfSize(NamedSize.Medium),
- };
-
- var image1 = new Image()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- Source = _appResourcePath + "icon/settings_sound.png",
- BackgroundColor = Color.Gray
- };
-
- var image2 = new Image()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- Source = _appResourcePath + "icon/settings_storage.png",
- BackgroundColor = Color.Gray
- };
-
- var image3 = new Image()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- Source = _appResourcePath + "icon/settings_SIM_card_manager.png",
- BackgroundColor = Color.Gray
- };
-
- var tapGestureRecognizerRed = new TapGestureRecognizer();
- tapGestureRecognizerRed.Tapped += async (s, e) =>
- {
- _button.Image = new FileImageSource()
- {
- File = _appResourcePath + "icon/settings_sound.png",
- };
- await Task.Delay(2000);
- };
- image1.GestureRecognizers.Add(tapGestureRecognizerRed);
-
- var tapGestureRecognizerGreen = new TapGestureRecognizer();
- tapGestureRecognizerGreen.Tapped += async (s, e) =>
- {
- _button.Image = new FileImageSource()
- {
- File = _appResourcePath + "icon/settings_storage.png",
- };
- await Task.Delay(2000);
- };
- image2.GestureRecognizers.Add(tapGestureRecognizerGreen);
-
- var tapGestureRecognizerGray = new TapGestureRecognizer();
- tapGestureRecognizerGray.Tapped += (s, e) =>
- {
- _button.Image = new FileImageSource()
- {
- File = _appResourcePath + "icon/settings_SIM_card_manager.png",
- };
- };
- image3.GestureRecognizers.Add(tapGestureRecognizerGray);
-
- var mainUI = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.White,
-
- Children =
- {
- _button,
- new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 180,
- Orientation = StackOrientation.Horizontal,
- Spacing = 10,
- Padding = new Thickness()
- {
- Left = 20,
- Right = 20
- },
-
- Children =
- {
- image1,
- image2,
- image3
- }
- }
- }
- };
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = mainUI,
- Title = "Image Test"
- });
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: FontSize BHBH")]
- [Property("SPEC", "Xamarin.Forms.Button.FontSize A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "BHBH")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click button after new page shown and check")]
- [Step(3, "Click item of Listview")]
- [Step(4, "Pass If FontSize of Button changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task FontSize_Button_BHBH()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "15.2";
- dataTest[1] = "25.3";
- dataTest[2] = "45.5";
- var text = "Select a FontSize test";
- var title = "FontSize Test";
- CreatePageTestToButton(text, title, dataTest);
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[0]))
- {
- _button.FontSize = 15.2;
- }
- else if (controlTest.Name.Equals(dataTest[1]))
- {
- _button.FontSize = 25.3;
- }
- else
- {
- _button.FontSize = 35.4;
- }
- };
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: TextColor BHBH")]
- [Property("SPEC", "Xamarin.Forms.Button.TextColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "BHBH")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click button after new page shown and check")]
- [Step(3, "Click item of Listview")]
- [Step(4, "Pass If TextColor of Button changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task TextColor_Button_BHBH()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "Red";
- dataTest[1] = "Green";
- dataTest[2] = "Yellow";
- var text = "Select a TextColor test";
- var title = "TextColor Test";
- CreatePageTestToButton(text, title, dataTest);
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[0]))
- {
- _button.TextColor = Color.Red;
- }
- else if (controlTest.Name.Equals(dataTest[1]))
- {
- _button.TextColor = Color.Green;
- }
- else
- {
- _button.TextColor = Color.Yellow;
- }
- };
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Text BHBH")]
- [Property("SPEC", "Xamarin.Forms.Button.Text A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "BHBH")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click button after new page shown and check")]
- [Step(3, "Click item of Listview")]
- [Step(4, "Pass If Text of Button changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task Text_Button_BHBH()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "Text 1";
- dataTest[1] = "This is 2 text";
- dataTest[2] = "Text 3 test";
- var text = "Select a Text test";
- var title = "Text Test";
- CreatePageTestToButton(text, title, dataTest);
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[0]))
- {
- _button.Text = dataTest[0];
- }
- else if (controlTest.Name.Equals(dataTest[1]))
- {
- _button.Text = dataTest[1];
- }
- else
- {
- _button.Text = dataTest[2];
- }
- };
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Image BHBH")]
- [Property("SPEC", "Xamarin.Forms.Button.Image A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "BHBH")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click button after new page shown and check")]
- [Step(3, "Click item of Listview")]
- [Step(4, "Pass If Image of Button changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task Image_Button_BHBH()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "Image 01";
- dataTest[1] = "Image 02";
- dataTest[2] = "Image 03";
- var text = "Select a Image test";
- var title = "Image Test";
- var file1 = _appResourcePath + "TED/thumbnail/a.jpg";
- var file2 = _appResourcePath + "TED/thumbnail/b.jpg";
- var file3 = _appResourcePath + "TED/thumbnail/c.jpg";
- CreatePageTestToButton(text, title, dataTest);
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[0]))
- {
- var fileImageSource1 = new FileImageSource()
- {
- File = file1,
- };
- _button.Image = fileImageSource1;
- }
- else if (controlTest.Name.Equals(dataTest[1]))
- {
- var fileImageSource2 = new FileImageSource()
- {
- File = file2,
- };
- _button.Image = fileImageSource2;
- }
- else
- {
- var fileImageSource3 = new FileImageSource()
- {
- File = file3,
- };
- _button.Image = fileImageSource3;
- }
- };
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: FontAttributes BHBH")]
- [Property("SPEC", "Xamarin.Forms.Button.FontAttributes A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "BHBH")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click button after new page shown and check")]
- [Step(3, "Click item of Listview")]
- [Step(4, "Pass If FontAttributes of Button changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task FontAttributes_Button_BHBH()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "None";
- dataTest[1] = "Bold";
- dataTest[2] = "Italic";
- var text = "Select a FontAttributes test";
- var title = "FontAttributes Test";
- CreatePageTestToButton(text, title, dataTest);
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals("None"))
- {
- _button.FontAttributes = FontAttributes.None;
- }
- else if (controlTest.Name.Equals("Bold"))
- {
- _button.FontAttributes = FontAttributes.Bold;
- }
- else
- {
- _button.FontAttributes = FontAttributes.Italic;
- }
- };
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Font BHBH")]
- [Property("SPEC", "Xamarin.Forms.Button.Font A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "BHBH")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click button after new page shown and check")]
- [Step(3, "Click item of Listview")]
- [Step(4, "Pass If Font of Button changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task Font_Button_BHBH()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "Font: Small";
- dataTest[1] = "Font: Medium";
- dataTest[2] = "Font: Large";
- var text = "Select a Font test";
- var title = "Font Test";
- CreatePageTestToButton(text, title, dataTest);
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[0]))
- {
- _button.Font = Font.SystemFontOfSize(NamedSize.Small);
- }
- else if (controlTest.Name.Equals(dataTest[1]))
- {
- _button.Font = Font.SystemFontOfSize(NamedSize.Medium);
- }
- else
- {
- _button.Font = Font.SystemFontOfSize(NamedSize.Large);
- }
- };
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Margin BHBH")]
- [Property("SPEC", "Xamarin.Forms.Button.Margin A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "BHBH")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click button after new page shown and check")]
- [Step(3, "Click item of Listview")]
- [Step(4, "Pass If Margin of Button changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task Margin_Button_BHBH()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "MarginTop: 50";
- dataTest[1] = "MarginTop: 100";
- dataTest[2] = "MarginTop: 150";
- var text = "Select a Margin test";
- var title = "Margin Test";
- CreatePageTestToButton(text, title, dataTest);
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[0]))
- {
- _button.Margin = new Thickness(0, 50, 0, 0);
- }
- else if (controlTest.Name.Equals(dataTest[1]))
- {
- _button.Margin = new Thickness(0, 100, 0, 0);
- }
- else
- {
- _button.Margin = new Thickness(0, 150, 0, 0);
- }
- };
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Rotation BHBH")]
- [Property("SPEC", "Xamarin.Forms.Button.Rotation A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "BHBH")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click button after new page shown and check")]
- [Step(3, "Click item of Listview")]
- [Step(4, "Pass If Rotation of Button changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task Rotation_Button_BHBH()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "50";
- dataTest[1] = "90";
- dataTest[2] = "180";
- var text = "Select a Rotation test";
- var title = "Rotation Test";
- CreatePageTestToButton(text, title, dataTest);
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[0]))
- {
- _button.Rotation = 50;
- }
- else if (controlTest.Name.Equals(dataTest[1]))
- {
- _button.Rotation = 90;
- }
- else
- {
- _button.Rotation = 180;
- }
- };
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Scale BHBH")]
- [Property("SPEC", "Xamarin.Forms.Button.Scale A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "BHBH")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click button after new page shown and check")]
- [Step(3, "Click item of Listview")]
- [Step(4, "Pass If Scale of Button changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task Scale_Button_BHBH()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "0.5";
- dataTest[1] = "1.0";
- dataTest[2] = "2.0";
- var text = "Select a Scale test";
- var title = "Scale Test";
- CreatePageTestToButton(text, title, dataTest);
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[0]))
- {
- _button.Scale = 0.5;
- }
- else if (controlTest.Name.Equals(dataTest[1]))
- {
- _button.Scale = 1.0;
- }
- else
- {
- _button.Scale = 2.0;
- }
- };
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: IsEnabled BHBH")]
- [Property("SPEC", "Xamarin.Forms.Button.IsEnabled A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "BHBH")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click button after new page shown and check")]
- [Step(3, "Click item of Listview")]
- [Step(4, "Pass If IsEnabled of Button changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task IsEnabled_Button_BHBH()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "Enable";
- dataTest[1] = "Disable";
- dataTest[2] = "Enable";
- var text = "Select a IsEnabled test";
- var title = "IsEnabled Test";
- CreatePageTestToButton(text, title, dataTest);
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[1]))
- {
- _button.IsEnabled = false;
- }
- else
- {
- _button.IsEnabled = true;
- }
- };
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: IsVisible BHBH")]
- [Property("SPEC", "Xamarin.Forms.Button.IsVisible A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "BHBH")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click button after new page shown and check")]
- [Step(3, "Click item of Listview")]
- [Step(4, "Pass If IsVisible of Button changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task IsVisible_Button_BHBH()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "Visible";
- dataTest[1] = "Invisible";
- dataTest[2] = "Visible";
- var text = "Select a IsVisible test";
- var title = "IsVisible Test";
- CreatePageTestToButton(text, title, dataTest);
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[1]))
- {
- _button.IsVisible = false;
- }
- else
- {
- _button.IsVisible = true;
- }
- };
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- private static Button _button1;
-
- private static void CreateButton(string buttonText)
- {
- var layout = new StackLayout()
- {
- IsVisible = true,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- };
-
- _button1 = new Button()
- {
- Text = buttonText,
- VerticalOptions = LayoutOptions.Center,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- };
-
- layout.Children.Add(_button1);
- _testPage.ExecuteTC(layout);
- }
-
- private static void OnClicked(object sender, EventArgs e)
- {
- // If your test is fail, you should set Assert.True(false , "msg");
- Assert.True(true);
- // ManualTest.Confirm() API will terminate WaitForConfirm() method, and will execute rest of the code.
- ManualTest.Confirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Clicked event is invoked or not")]
- [Property("SPEC", "Xamarin.Forms.Button.Clicked E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click the Button")]
- [Step(2, "Testcase result will show automatically")]
- [Postcondition(1, "NA")]
- public async Task Clicked_EVENT()
- {
- CreateButton("Click Me!!!!!!!!!!!!!.");
- _button1.Clicked += OnClicked;
- // Waits for user confirmation.
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _button1.Clicked -= OnClicked;
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-using System.Threading.Tasks;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.Cell Tests")]
- public class CellTests
- {
-
- private static TestPage _testPage = TestPage.GetInstance();
- private Cell _cell;
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("BoundsTypeConverterTests --------------- Setup()");
- _cell = new EntryCell
- {
- IsEnabled = true
- };
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("BoundsTypeConverterTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether occurs when the Cell is Tapped.")]
- [Property("SPEC", "Xamarin.Forms.Cell.Tapped E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Tap to an entry cell: row will receive focus when select")]
- [Step(3, "Click BACK button: Testcase result will show PASS or FAIL automatically")]
- [Postcondition(1, "NA")]
- public async Task Tapped_EVENT()
- {
- TextCell _cell = new TextCell
- {
- Text = "TextCell:",
- };
-
- TextCell _cell2 = new TextCell
- {
- Text = "TextCell2 :",
- };
-
- TableView tableView = new TableView
- {
- Intent = TableIntent.Form,
- Root = new TableRoot
- {
- new TableSection
- {
- _cell,
- _cell
- }
- }
- };
-
- var page = new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- tableView,
- }
- },
- Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5),
- Title = "Test: Tapped",
- };
-
- _cell.Tapped += onCellTapped;
- _cell2.Tapped += onCellTapped;
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _cell.Tapped -= onCellTapped;
- _cell2.Tapped -= onCellTapped;
- }
-
- private void onCellTapped(object sender, EventArgs e)
- {
- Assert.True(true);
- ManualTest.Confirm();
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System.Threading.Tasks;
-using XamarinApplication.Tizen;
-using System.Collections.Generic;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class ContentPageTest
- {
- private static ContentPage _contentPage = null;
- private static TestPage _testPage = TestPage.GetInstance();
- private string _appResourcePath = Program.Current.DirectoryInfo.Resource;
-
- public class CustomContentPage : ContentPage
- {
- public bool _flagOnBackButtonPressed;
-
- protected override bool OnBackButtonPressed()
- {
- _flagOnBackButtonPressed = true;
- return base.OnBackButtonPressed();
- }
- }
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("ContentPageTest --------------- SetUp()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("ContentPageTest --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check Content of a ContentPage can be displayed")]
- [Property("SPEC", "Xamarin.Forms.ContentPage.Content A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Observe")]
- [Step(3, "Click Pass if \"Content has been set\" text dispalyed, vice versa")]
- [Postcondition(1, "Click back button")]
- public async Task Content_UIBH()
- {
- /* TEST CODE */
- _contentPage = new CustomContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- Children =
- {
- new Label
- {
- Text = "Content has been set"
- }
- }
- }
- };
-
- _testPage.ExecuteTC(_contentPage);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check BackgroundColor can be set with content page.")]
- [Property("SPEC", "Xamarin.Forms.ContentPage.BackgroundColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Observe Background")]
- [Step(3, "Click Pass if background color is red, vice versa")]
- [Postcondition(1, "Click back button")]
- public async Task BackgroundColor_UILK()
- {
- /* TEST CODE */
- _contentPage = new CustomContentPage();
-
- _contentPage.BackgroundColor = Color.Red;
- _testPage.ExecuteTC(_contentPage);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check BackgroundImage can be set with content page.")]
- [Property("SPEC", "Xamarin.Forms.ContentPage.BackgroundImage A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Observe Background")]
- [Step(3, "Click Pass if background image shown, vice versa")]
- [Postcondition(1, "Click back button")]
- public async Task BackgroundImage_UILK()
- {
- /* TEST CODE */
- _contentPage = new CustomContentPage();
-
- _contentPage.BackgroundImage = _appResourcePath + "icon/settings_date_and_time.png";
- _testPage.ExecuteTC(_contentPage);
- await ManualTest.WaitForConfirm();
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check Icon can be set with content page.")]
- [Property("SPEC", "Xamarin.Forms.ContentPage.Icon A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Observe")]
- [Step(3, "Click Pass if icon shown, vice versa")]
- [Postcondition(1, "Click back button")]
- public async Task Icon_UILK()
- {
- /* TEST CODE */
- _contentPage = new CustomContentPage();
- _contentPage.Icon = _appResourcePath + "icon/settings_date_and_time.png";
- _contentPage.Title = "Title";
- _testPage.ExecuteTC(_contentPage);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check Padding can be set")]
- [Property("SPEC", "Xamarin.Forms.ContentPage.Padding A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click Change padding button")]
- [Step(3, "Click Pass if padding change, vice versa")]
- [Postcondition(1, "Click back button")]
- public async Task Padding_UILK()
- {
- /* TEST CODE */
- var btnPadding = new Button
- {
- Text = "Change padding",
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.StartAndExpand,
- BackgroundColor = Color.Maroon
- };
-
- _contentPage = new CustomContentPage
- {
- Content = new StackLayout
- {
- Children =
- {
- btnPadding
- }
- }
- };
-
- btnPadding.Clicked += (sender, e) =>
- {
- _contentPage.Padding = new Thickness(20.5);
- };
-
- _testPage.ExecuteTC(_contentPage);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check Title can be set")]
- [Property("SPEC", "Xamarin.Forms.ContentPage.Title A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click Change Title button")]
- [Step(3, "Click Pass if Title is shown, vice versa")]
- [Postcondition(1, "Click back button")]
- public async Task Title_UILK()
- {
- /* TEST CODE */
- var btnPadding = new Button
- {
- Text = "Change Title",
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.StartAndExpand
- };
-
- _contentPage = new CustomContentPage
- {
- Title = "Title",
- Content = new StackLayout
- {
- Children =
- {
- btnPadding
- }
- }
- };
-
- btnPadding.Clicked += (sender, e) =>
- {
- _contentPage.Title = "Title test";
- };
-
- _testPage.ExecuteTC(_contentPage);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check ToolbarItems can be set")]
- [Property("SPEC", "Xamarin.Forms.ContentPage.ToolbarItems A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")]
- [Step(1, "Click run TC")]
- [Step(2, "Click Change Title button")]
- [Step(3, "Click Pass if ToolbarItems shown, vice versa")]
- [Postcondition(1, "Click back button")]
- public async Task ToolbarItems_UIBH()
- {
- /* TEST CODE */
- if (Device.Idiom == TargetIdiom.Phone)
- {
- var btnPadding = new Button
- {
- Text = "Add ToolBarItems",
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.StartAndExpand
- };
-
- _contentPage = new CustomContentPage
- {
- Content = new StackLayout
- {
- Children =
- {
- btnPadding
- }
- }
- };
-
- btnPadding.Clicked += (sender, e) =>
- {
- _contentPage.ToolbarItems.Add(new ToolbarItem
- {
- Icon = _appResourcePath + "icon/settings_restart.png",
- Name = "Restart",
- Command = new Command(() => { }),
- Order = ToolbarItemOrder.Primary
- }
- );
-
- _contentPage.ToolbarItems.Add(new ToolbarItem
- {
- Icon = _appResourcePath + "icon/settings_date_and_time.png",
- Name = "Settings",
- Command = new Command(() => { }),
- Order = ToolbarItemOrder.Secondary
- }
- );
- };
-
- _testPage.ExecuteTC(_contentPage);
- await ManualTest.WaitForConfirm();
- }
- else
- {
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check ToolbarItems can be set")]
- [Property("SPEC", "Xamarin.Forms.ContentPage.Appearing M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click back button")]
- [Step(3, "If Appearing event fire the TC will pass autometically, fail otherwaise")]
- [Postcondition(1, "N/A")]
- public async Task Appearing_UIBH()
- {
- /* TEST CODE */
-
- _contentPage = new CustomContentPage();
- _contentPage.Title = "Appearing Test";
-
- _contentPage.Appearing += (sender, e) =>
- {
- Assert.IsTrue(true);
- ManualTest.Confirm();
- };
-
- _testPage.ExecuteTC(_contentPage);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check ToolbarItems can be set")]
- [Property("SPEC", "Xamarin.Forms.ContentPage.Disappearing M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click back button")]
- [Step(3, "If Disappearing event fire the TC will pass autometically, fail otherwaise")]
- [Postcondition(1, "N/A")]
- public async Task Disappearing_UIBH()
- {
- /* TEST CODE */
-
- _contentPage = new CustomContentPage();
- _contentPage.Title = "Disappearing Test";
-
- _contentPage.Disappearing += (sender, e) =>
- {
- Assert.IsTrue(true);
- ManualTest.Confirm();
- };
-
- _testPage.ExecuteTC(_contentPage);
- await ManualTest.WaitForConfirm();
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System.Threading.Tasks;
-using XamarinApplication.Tizen;
-using System.Collections.Generic;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class DatePickerTest
- {
- private static TestPage _testPage = TestPage.GetInstance();
- private static DatePicker _datePicker = null;
-
- [SetUp]
- public void SetUp()
- {
- if (Device.Idiom == TargetIdiom.Phone || Device.Idiom == TargetIdiom.TV)
- {
- Console.WriteLine("DatePickerTest --------------- SetUp()");
- }
- else
- {
- Console.WriteLine("Not supported on this profile");
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("DatePickerTest --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check DatePicker look")]
- [Property("SPEC", "Xamarin.Forms.DatePicker.Format")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Observe")]
- [Step(3, "Click Pass if date has been shown as \"Tuesday, March 10, 2020\", vice versa")]
- [Postcondition(1, "Click back button")]
- public async Task Date_UILK()
- {
- /* TEST CODE */
- var contentPage = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- Children =
- {
- new DatePicker
- {
- Format="D",
- Date = new DateTime(2020,03,10),
- VerticalOptions = LayoutOptions.CenterAndExpand
- }
- }
- }
- };
-
- _testPage.ExecuteTC(contentPage);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check DatePicker look")]
- [Property("SPEC", "Xamarin.Forms.DatePicker.DatePicker ")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Observe a date is showing as formate <day name, month name with date, 4 digit year>")]
- [Step(3, "Click on the date")]
- [Step(4, "Observe a Choose Date popup shown.")]
- [Step(5, "Change date and press Set button.")]
- [Step(6, "Observe the date has been changed")]
- [Step(7, "Click back button")]
- [Step(8, "Click Pass if date has been changed after press the Set button , vice versa")]
- [Postcondition(1, "Click back button")]
- public async Task DatePicker_UIBH()
- {
- if (Device.Idiom == TargetIdiom.TV)
- {
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
- /* TEST CODE */
- var contentPage = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- Children =
- {
- new DatePicker
- {
- Format="D",
- VerticalOptions = LayoutOptions.CenterAndExpand
- }
- }
- }
- };
-
- _testPage.ExecuteTC(contentPage);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check DatePicker look")]
- [Property("SPEC", "Xamarin.Forms.DatePicker.MaximumDate")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Observe a date is showing as formate <day name, month name with date, 4 digit year>")]
- [Step(3, "Click on the date")]
- [Step(4, "Observe a Choose Date popup shown.")]
- [Step(5, "Try to change date more than 10-Mar-2018.")]
- [Step(3, "Click Pass if date can not set more than 10-Mar-2018, vice versa")]
- [Postcondition(1, "Click back button")]
- public async Task MaximumDate_UIBH()
- {
- if (Device.Idiom == TargetIdiom.TV)
- {
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
-
- /* TEST CODE */
- var contentPage = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- Children =
- {
- new DatePicker
- {
- Format="D",
- MaximumDate = new DateTime(2018,03,10),
- VerticalOptions = LayoutOptions.CenterAndExpand
- }
- }
- }
- };
-
- _testPage.ExecuteTC(contentPage);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check DatePicker look")]
- [Property("SPEC", "Xamarin.Forms.DatePicker.MinimumDate")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Observe a date is showing as formate <day name, month name with date, 4 digit year>")]
- [Step(3, "Click on the date")]
- [Step(4, "Observe a Choose Date popup shown.")]
- [Step(5, "Try to change date less than 10-Mar-2016.")]
- [Step(6, "Click Pass if date can not set less than 10-Mar-2016, vice versa")]
- [Postcondition(1, "Click back button")]
- public async Task MinimumDate_UIBH()
- {
- if (Device.Idiom == TargetIdiom.TV)
- {
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
-
- /* TEST CODE */
- var contentPage = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- Children =
- {
- new DatePicker
- {
- Format="D",
- MinimumDate = new DateTime(2016,03,10),
- VerticalOptions = LayoutOptions.CenterAndExpand
- }
- }
- }
- };
-
- _testPage.ExecuteTC(contentPage);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check DatePicker look")]
- [Property("SPEC", "Xamarin.Forms.DatePicker.TextColor")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Observe a date is showing as formate <day name, month name with date, 4 digit year>")]
- [Step(3, "Click Pass if text color of date is red, vice versa")]
- [Postcondition(1, "Click back button")]
- public async Task TextColor_UILK()
- {
- /* TEST CODE */
- var contentPage = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- Children =
- {
- new DatePicker
- {
- Format="D",
- TextColor=Color.Red,
- VerticalOptions = LayoutOptions.CenterAndExpand
- }
- }
- }
- };
-
- _testPage.ExecuteTC(contentPage);
- await ManualTest.WaitForConfirm();
- }
- }
-}
+++ /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 System.Threading.Tasks;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.Device.Styles Tests")]
- public class DeviceStylesTests
- {
- private static TestPage _testPage = TestPage.GetInstance();
-
- [SetUp]
- public void SetUp()
- {
- if (ManualTest.IsWearable())
- {
- Console.Write("Not supported on this profile");
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
- else
- {
- Console.WriteLine("DeviceStylesTests --------------- Setup()");
- }
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("DeviceStylesTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether BodyStyle is working properly.")]
- [Property("SPEC", "Xamarin.Forms.Device.Styles.BodyStyle A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Run the TC")]
- [Step(2, "Check if \"body styles\" text style is different than Subtitle style text.")]
- [Step(3, "Press back button and confirm Pass/Fail.")]
- [Postcondition(1, "NA")]
- public async Task BodyStyle_UILK()
- {
- /* TEST CODE */
- Label bodyStyle = new Label
- {
- Text = "Body Style",
- Style = Device.Styles.BodyStyle,
- TextColor = Color.Green
- };
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- new Label { Text = "Title style",TextColor =Color.Black, Style = Device.Styles.TitleStyle },
- new Label { Text = "Subtitle style",TextColor =Color.Red, Style = Device.Styles.SubtitleStyle },
- bodyStyle
- }
- },
- Title = "Test: BodyStyles",
- BackgroundColor = Color.White,
- };
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether CaptionStyle is working properly.")]
- [Property("SPEC", "Xamarin.Forms.Device.Styles.CaptionStyle A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Run the TC")]
- [Step(2, "Check if \"Caption styles\" text style is different than Body style text.")]
- [Step(3, "Press back button and confirm Pass/Fail.")]
- [Postcondition(1, "NA")]
- public async Task CaptionStyle_UILK()
- {
- /* TEST CODE */
- Label captionStyle = new Label
- {
- Text = "Caption Style",
- Style = Device.Styles.CaptionStyle,
- TextColor = Color.Blue
- };
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- new Label { Text = "Title style",TextColor =Color.Black, Style = Device.Styles.TitleStyle },
- captionStyle,
- new Label { Text = "Body style",TextColor =Color.Red, Style = Device.Styles.BodyStyle }
- }
- },
- Title = "Test: CaptionStyle",
- BackgroundColor = Color.White,
- };
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether SubtitleStyle is working properly.")]
- [Property("SPEC", "Xamarin.Forms.Device.Styles.SubtitleStyle A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Run the TC")]
- [Step(2, "Check if \"subtitle styles\" text style is different than Body style text.")]
- [Step(3, "Press back button and confirm Pass/Fail.")]
- [Postcondition(1, "NA")]
- public async Task SubtitleStyle_UILK()
- {
- /* TEST CODE */
- Label subtitleStyle = new Label
- {
- Text = "Subtitle Style",
- Style = Device.Styles.SubtitleStyle,
- TextColor = Color.Red
- };
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- new Label { Text = "Title style",TextColor =Color.Black, Style = Device.Styles.TitleStyle },
- subtitleStyle,
- new Label { Text = "Body style",TextColor =Color.Red, Style = Device.Styles.BodyStyle }
- }
- },
- Title = "Test: CaptionStyle",
- BackgroundColor = Color.White,
- };
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether TitleStyle is working properly.")]
- [Property("SPEC", "Xamarin.Forms.Device.Styles.TitleStyle A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Run the TC")]
- [Step(2, "Check if \"Title Style\" text style is different than Body style text.")]
- [Step(3, "Press back button and confirm Pass/Fail.")]
- [Postcondition(1, "NA")]
- public async Task TitleStyle_UILK()
- {
- /* TEST CODE */
- Label titleStyle = new Label
- {
- Text = "Title Style",
- Style = Device.Styles.TitleStyle,
- TextColor = Color.Green
- };
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- titleStyle,
- new Label { Text = "Body style",TextColor =Color.Red, Style = Device.Styles.BodyStyle }
- }
- },
- Title = "Test: TitleStyle",
- BackgroundColor = Color.White,
- };
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ListItemDetailTextStyle is working properly.")]
- [Property("SPEC", "Xamarin.Forms.Device.Styles.ListItemDetailTextStyle A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Run the TC")]
- [Step(2, "Check if \"ListItemDetailTextStyle\" text style is different than Body style text.")]
- [Step(3, "Press back button and confirm Pass/Fail.")]
- [Postcondition(1, "NA")]
- public async Task ListItemDetailTextStyle_UILK()
- {
- /* TEST CODE */
- Label listItemDetailTextStyle = new Label
- {
- Text = "ListItemDetailTextStyle",
- Style = Device.Styles.ListItemDetailTextStyle,
- TextColor = Color.Blue
- };
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- listItemDetailTextStyle,
- new Label { Text = "Body style",TextColor =Color.Red, Style = Device.Styles.BodyStyle }
- }
- },
- Title = "Test: ListItemDetailTextStyle",
- BackgroundColor = Color.White,
- };
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ListItemTextStyle is working properly.")]
- [Property("SPEC", "Xamarin.Forms.Device.Styles.ListItemTextStyle A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Run the TC")]
- [Step(2, "Check if \"ListItemTextStyle\" text style is different than Body style text.")]
- [Step(3, "Press back button and confirm Pass/Fail.")]
- [Postcondition(1, "NA")]
- public async Task ListItemTextStyle_UILK()
- {
- /* TEST CODE */
- Label listItemTextStyle = new Label
- {
- Text = "ListItemTextStyle",
- Style = Device.Styles.ListItemTextStyle,
- TextColor = Color.Blue
- };
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- listItemTextStyle,
- new Label { Text = "Body style",TextColor =Color.Red, Style = Device.Styles.BodyStyle }
- }
- },
- Title = "Test: ListItemTextStyle",
- BackgroundColor = Color.White,
- };
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
- }
-}
+++ /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 System.Threading.Tasks;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.Device Tests")]
- public class DeviceTests
- {
- private static TestPage _testPage = TestPage.GetInstance();
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("DeviceTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("DeviceTests --------------- TearDown()");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Checking a Uri to open.")]
- [Property("SPEC", "Xamarin.Forms.Device.OpenUri M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan , nguyen.vtan@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Observe a uri, which is opened")]
- [Postcondition(1, "NA")]
- public async Task OpenUri_Uri()
- {
- /* TEST CODE */
- var uri = "mailto:info@johankarlsson.net?subject=subject&body=body";
- Device.OpenUri(new Uri(uri));
- await ManualTest.WaitForConfirm();
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System;
-using System.Collections.Generic;
-using System.Threading.Tasks;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class EditorTests
- {
- Editor _editor;
- private static TestPage _testPage = TestPage.GetInstance();
-
- class ControlTest
- {
- public ControlTest(string name)
- {
- this.Name = name;
- }
-
- public string Name { private set; get; }
- };
-
- private void onEditorCompleted(object sender, System.EventArgs e)
- {
- Assert.True(true);
- ManualTest.Confirm();
- }
-
- private void onEditorTextChanged(object sender, System.EventArgs e)
- {
- Assert.True(true);
- ManualTest.Confirm();
- }
-
- [SetUp]
- public void SetUp()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Editor CLASS: Setup---------------------------------");
- _editor = new Editor();
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Editor CLASS: Teardown---------------------------------");
- _editor = null;
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Completed events can be invoked or not when the Editor object created complete.")]
- [Property("SPEC", "Xamarin.Forms.Editor.Completed E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click cusor text line and edit")]
- [Step(3, "Typing some characters")]
- [Step(4, "Tap outside screen")]
- [Step(5, "Click BACK button: Testcase result will show PASS or FAIL automatically")]
- [Postcondition(1, "NA")]
- public async Task Completed_CHECK_EVENT()
- {
- if (Device.Idiom == TargetIdiom.TV)
- {
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
-
- ///*TEST CODE*/
- _editor.Text = "TestEditor";
- _editor.HorizontalOptions = LayoutOptions.FillAndExpand;
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _editor
- }
- },
- Title = "Test: Completed",
- };
- _editor.Completed += onEditorCompleted;
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _editor.Completed -= onEditorCompleted;
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether TextChanged events can be invoked or not when the Text has been changed in Editor.")]
- [Property("SPEC", "Xamarin.Forms.Editor.TextChanged E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click cusor text line and edit")]
- [Step(3, "Typing some characters")]
- [Step(4, "Tap outside screen")]
- [Step(5, "Click BACK button: Testcase result will show PASS or FAIL automatically")]
- [Postcondition(1, "NA")]
- public async Task TextChanged_CHECK_EVENT()
- {
- if (Device.Idiom == TargetIdiom.TV)
- {
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
- ///*TEST CODE*/
- _editor = new Editor();
- _editor.Text = "TestEditor";
- _editor.HorizontalOptions = LayoutOptions.FillAndExpand;
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _editor
- }
- },
- Title = "Test: TextChanged",
- };
- _editor.TextChanged += onEditorTextChanged;
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _editor.TextChanged -= onEditorTextChanged;
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: FontAttributes UIBH")]
- [Property("SPEC", "Xamarin.Forms.Editor.FontAttributes A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UiBH")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(3, "Pass If FontAttributes of Editor changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task FontAttributes_Editor_UIBH()
- {
- /*TEST CODE*/
- _editor = new Editor
- {
- BackgroundColor = Color.Blue.WithLuminosity(0.9),
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 200,
- Text = "Xamarin Forms"
- };
-
- String[] dataTest = { "", "", "" };
- dataTest[0] = "None";
- dataTest[1] = "Bold";
- dataTest[2] = "Italic";
- var text = "Select a FontAttributes test";
- var title = "FontAttributes Test";
- List<ControlTest> controlTest = new List<ControlTest>
- {
- new ControlTest(dataTest[0]),
- new ControlTest(dataTest[1]),
- new ControlTest(dataTest[2])
- };
- var _listview = new ListView
- {
- RowHeight = 100,
- ItemsSource = controlTest,
- ItemTemplate = new DataTemplate(() =>
- {
- Label nameLabel = new Label()
- {
- Margin = new Thickness(100, 0, 0, 0),
- TextColor = Color.Black,
- BackgroundColor = Color.White,
- HorizontalOptions = LayoutOptions.Center,
- };
- nameLabel.SetBinding(Label.TextProperty, "Name");
- return new ViewCell
- {
- View = new StackLayout
- {
- Padding = new Thickness(0, 5),
- Orientation = StackOrientation.Horizontal,
- Children =
- {
- new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Spacing = 0,
- Children =
- {
- nameLabel,
- }
- }
- }
- }
- };
- })
- };
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest ctlTest = (ControlTest)e.Item;
- if (ctlTest.Name.Equals("None"))
- {
- _editor.FontAttributes = FontAttributes.None;
- }
- else if (ctlTest.Name.Equals("Bold"))
- {
- _editor.FontAttributes = FontAttributes.Bold;
- }
- else
- {
- _editor.FontAttributes = FontAttributes.Italic;
- }
- };
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- _editor,
- _listview,
- },
- BackgroundColor = Color.Navy
- },
- Title = title,
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: FontFamily UIBH")]
- [Property("SPEC", "Xamarin.Forms.Editor.FontFamily A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "Several fonts are not supported on TV product")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(3, "Pass If FontFamily of Editor changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task FontFamily_Editor_UIBH()
- {
- if (Device.Idiom == TargetIdiom.TV || Device.Idiom == TargetIdiom.Unsupported)
- {
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
-
- _editor = new Editor
- {
- BackgroundColor = Color.Blue.WithLuminosity(0.9),
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 200,
- WidthRequest = 300,
- Text = "Xamarin Forms"
- };
-
- String[] dataTest = { "", "", "" };
- dataTest[0] = "Times New Roman";
- dataTest[1] = "Sans";
- dataTest[2] = "Sans Bold";
- var text = "Select a FontFamily test";
- var title = "FontFamily Test";
- List<ControlTest> controlTest = new List<ControlTest>
- {
- new ControlTest(dataTest[0]),
- new ControlTest(dataTest[1]),
- new ControlTest(dataTest[2])
- };
- var _listview = new ListView
- {
- RowHeight = 100,
- ItemsSource = controlTest,
- ItemTemplate = new DataTemplate(() =>
- {
- Label nameLabel = new Label()
- {
- Margin = new Thickness(100, 0, 0, 0),
- TextColor = Color.Black,
- BackgroundColor = Color.White,
- HorizontalOptions = LayoutOptions.Center,
- };
- nameLabel.SetBinding(Label.TextProperty, "Name");
- return new ViewCell
- {
- View = new StackLayout
- {
- Padding = new Thickness(0, 5),
- Orientation = StackOrientation.Horizontal,
- Children =
- {
- new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Spacing = 0,
- Children =
- {
- nameLabel,
- }
- }
- }
- }
- };
- })
- };
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest ctlTest = (ControlTest)e.Item;
- if (ctlTest.Name.Equals(dataTest[0]))
- {
- _editor.FontFamily = "Times New Roman:style=Regular";
- }
- else if (ctlTest.Name.Equals(dataTest[1]))
- {
- _editor.FontFamily = "Sans:style=Regular";
- }
- else
- {
- _editor.FontFamily = "Sans:style=Bold";
- }
- };
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- _editor,
- _listview,
- },
- BackgroundColor = Color.Navy
- },
- Title = title,
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: FontFamily UIBH")]
- [Property("SPEC", "Xamarin.Forms.Editor.FontSize A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(3, "Pass If FontSize of Editor changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task FontSize_Editor_UIBH()
- {
- /*TEST CODE*/
-
- var size = 10;
-
- if (Device.Idiom == TargetIdiom.TV)
- {
- size = size * 3;
- }
-
- _editor = new Editor
- {
- BackgroundColor = Color.Blue.WithLuminosity(0.9),
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- HeightRequest = 200,
- Text = "Xamarin Forms"
- };
-
- String[] dataTest = { "", "", "" };
- dataTest[0] = size.ToString();
- dataTest[1] = (size * 2).ToString();
- dataTest[2] = (size * 3).ToString();
- var text = "Select a FontSize test";
- var title = "FontSize Test";
- List<ControlTest> controlTest = new List<ControlTest>
- {
- new ControlTest(dataTest[0]),
- new ControlTest(dataTest[1]),
- new ControlTest(dataTest[2])
- };
- var _listview = new ListView
- {
- RowHeight = 100,
- ItemsSource = controlTest,
- ItemTemplate = new DataTemplate(() =>
- {
- Label nameLabel = new Label()
- {
- Margin = new Thickness(100, 0, 0, 0),
- TextColor = Color.Black,
- BackgroundColor = Color.White,
- HorizontalOptions = LayoutOptions.Center,
- };
- nameLabel.SetBinding(Label.TextProperty, "Name");
- return new ViewCell
- {
- View = new StackLayout
- {
- Padding = new Thickness(0, 5),
- Orientation = StackOrientation.Horizontal,
- Children =
- {
- new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Spacing = 0,
- Children =
- {
- nameLabel,
- }
- }
- }
- }
- };
- })
- };
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest ctlTest = (ControlTest)e.Item;
- if (ctlTest.Name.Equals(dataTest[0]))
- {
- _editor.FontSize = size;
- }
- else if (ctlTest.Name.Equals(dataTest[1]))
- {
- _editor.FontSize = size * 2;
- }
- else
- {
- _editor.FontSize = size * 3;
- }
- };
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- _editor,
- new Label
- {
- Text=text,
- TextColor=Color.White,
- HorizontalOptions = LayoutOptions.Center
- },
- _listview,
- },
- BackgroundColor = Color.Navy
- },
- Title = title,
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: FontFamily UIBH")]
- [Property("SPEC", "Xamarin.Forms.Editor.Text A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click The button Set Text")]
- [Step(3, "Pass If Editor 1 text is displaying in Editor 2 then Pass, Fail otherwaise")]
- [Postcondition(1, "NA")]
- public async Task Text_Editor_UIBH()
- {
- /*TEST CODE*/
- var text = "Select a FontSize test";
- var title = "FontSize Test";
- _editor = new Editor
- {
- BackgroundColor = Color.Blue.WithLuminosity(0.9),
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- HeightRequest = 200,
- WidthRequest = 300,
- Text = "Xamarin Forms"
- };
-
- var editor2 = new Editor
- {
- BackgroundColor = Color.Blue.WithLuminosity(0.9),
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- HeightRequest = 200,
- WidthRequest = 300,
- };
-
- var labl1 = new Label
- {
- Text = "Editor 1",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- };
-
- var labl2 = new Label
- {
- Text = "Editor 2",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- };
-
- var btnSettEXT = new Button
- {
- Text = "Set Text",
- VerticalOptions = LayoutOptions.EndAndExpand,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- };
-
- btnSettEXT.Clicked += (s, e) =>
- {
- editor2.Text = _editor.Text;
- };
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- labl1,
- _editor,
- labl2,
- editor2,
- btnSettEXT
- },
- BackgroundColor = Color.Navy
- },
- Title = title,
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- btnSettEXT.Clicked -= (s, e) =>
- {
- editor2.Text = _editor.Text;
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: FontFamily UIBH")]
- [Property("SPEC", "Xamarin.Forms.Editor.TextColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(3, "Pass If TextColor of Editor changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task TextColor_Editor_UIBH()
- {
- /*TEST CODE*/
- _editor = new Editor
- {
- BackgroundColor = Color.Blue.WithLuminosity(0.9),
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 200,
- Text = "Xamarin Forms"
- };
-
- String[] dataTest = { "", "", "" };
- dataTest[0] = "Red";
- dataTest[1] = "Green";
- dataTest[2] = "Blue";
- var text = "Select a TextColor test";
- var title = "TextColor Test";
- List<ControlTest> controlTest = new List<ControlTest>
- {
- new ControlTest(dataTest[0]),
- new ControlTest(dataTest[1]),
- new ControlTest(dataTest[2])
- };
- var _listview = new ListView
- {
- RowHeight = 100,
- ItemsSource = controlTest,
- ItemTemplate = new DataTemplate(() =>
- {
- Label nameLabel = new Label()
- {
- Margin = new Thickness(100, 0, 0, 0),
- TextColor = Color.Black,
- BackgroundColor = Color.White,
- HorizontalOptions = LayoutOptions.Center,
- };
- nameLabel.SetBinding(Label.TextProperty, "Name");
- return new ViewCell
- {
- View = new StackLayout
- {
- Padding = new Thickness(0, 5),
- Orientation = StackOrientation.Horizontal,
- Children =
- {
- new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Spacing = 0,
- Children =
- {
- nameLabel,
- }
- }
- }
- }
- };
- })
- };
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest ctlTest = (ControlTest)e.Item;
- if (ctlTest.Name.Equals(dataTest[0]))
- {
- _editor.TextColor = Color.Red;
- }
- else if (ctlTest.Name.Equals(dataTest[1]))
- {
- _editor.TextColor = Color.Green;
- }
- else
- {
- _editor.TextColor = Color.Blue;
- }
- };
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- _editor,
- new Label
- {
- Text=text,
- TextColor=Color.White,
- HorizontalOptions = LayoutOptions.Center
- },
- _listview,
- },
- BackgroundColor = Color.Navy
- },
- Title = title,
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- //================================================================================================
-
- [Test]
- [Category("P1")]
- [Description("Check the IsVisible property")]
- [Property("SPEC", "Xamarin.Forms.Editor.IsVisible P")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click Change button")]
- [Step(3, "Observe change of the Editor")]
- [Step(4, "Testcase PASS if click Visible button -> Show the Editor and click Hide button-> Hide the Editor, otherwise FAIL")]
- [Postcondition(1, "Click Back button.")]
- public async Task IsVisible_Editor_UIBH()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
- _editor = new Editor
- {
- BackgroundColor = Color.Blue.WithLuminosity(0.9),
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 200,
- WidthRequest = 300,
- Text = "Editor"
- };
-
- var mBtnVisible = new Button
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.End,
- Text = "Visible",
- Margin = new Thickness()
- {
- Right = 10,
- Left = 10
- }
- };
-
- var mBtnHide = new Button
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.End,
- Text = "Hide",
- Margin = new Thickness()
- {
- Right = 10,
- Left = 10
- }
- };
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- _editor,
- mBtnVisible,
- mBtnHide
- },
- },
- Title = "IsVisible Test",
- };
-
- mBtnVisible.Clicked += (e, o) =>
- {
- _editor.IsVisible = true;
- };
-
- mBtnHide.Clicked += (e, o) =>
- {
- _editor.IsVisible = false;
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- mBtnVisible.Clicked -= (e, o) =>
- {
- _editor.IsVisible = true;
- };
-
- mBtnHide.Clicked -= (e, o) =>
- {
- _editor.IsVisible = false;
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the BackgroundColor property")]
- [Property("SPEC", "Xamarin.Forms.Editor.BackgroundColor P")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Select a Color after observe BackgroundColor of Editor is changed")]
- [Step(3, "Testcase PASS If BackgroundColor of Editor changed otherwise false")]
- [Postcondition(1, "Click Back button.")]
- public async Task BackgroundColor_Editor_Change_UILK()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
- _editor = new Editor
- {
- BackgroundColor = Color.Blue.WithLuminosity(0.9),
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 200,
- WidthRequest = 300
- };
-
- var mBtnRed = new Button
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.End,
- BackgroundColor = Color.Red,
- Text = "Red",
- Margin = new Thickness()
- {
- Right = 10,
- Left = 10
- }
- };
-
- var mBtnGreen = new Button
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.End,
- BackgroundColor = Color.Green,
- Text = "Green",
- Margin = new Thickness()
- {
- Right = 10,
- Left = 10
- }
- };
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- _editor,
- mBtnRed,
- mBtnGreen
- },
- },
- Title = "BackgoundColor Test",
- };
-
- mBtnRed.Clicked += (e, o) =>
- {
- _editor.BackgroundColor = Color.Red;
- };
-
- mBtnGreen.Clicked += (e, o) =>
- {
- _editor.BackgroundColor = Color.Green;
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- mBtnRed.Clicked -= (e, o) =>
- {
- _editor.BackgroundColor = Color.Red;
- };
-
- mBtnGreen.Clicked -= (e, o) =>
- {
- _editor.BackgroundColor = Color.Green;
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the HeightRequest & WidthRequest property")]
- [Property("SPEC", "Xamarin.Forms.Editor P")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Seek Silder for Width and Height after observe")]
- [Step(3, "Pass If Height and Width of the Editor changed otherwise false")]
- [Postcondition(1, "Click Back button.")]
- public async Task WidthAndHeight_Editor_CHANGE_SIZE_UILK()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
- _editor = new Editor
- {
- BackgroundColor = Color.Blue.WithLuminosity(0.9),
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- };
-
- var sliderHorizontal = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- BackgroundColor = Color.Pink,
- Maximum = 500,
- Minimum = 120
- };
-
- var sliderVertical = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- BackgroundColor = Color.Pink,
- Maximum = 500,
- Minimum = 80
- };
-
- if (Device.Idiom == TargetIdiom.Unsupported)
- {
- sliderVertical.Maximum = 200;
- sliderVertical.Minimum = 0;
- }
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- _editor,
- sliderHorizontal,
- sliderVertical
- },
- },
- Title = "Size Layout Test",
- };
-
- sliderHorizontal.ValueChanged += (o, e) =>
- {
- _editor.WidthRequest = sliderHorizontal.Value;
- };
-
- sliderVertical.ValueChanged += (o, e) =>
- {
- _editor.HeightRequest = sliderVertical.Value;
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- sliderHorizontal.ValueChanged -= (o, e) =>
- {
- _editor.WidthRequest = sliderHorizontal.Value;
- };
-
- sliderVertical.ValueChanged -= (o, e) =>
- {
- _editor.HeightRequest = sliderVertical.Value;
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the Opacity property")]
- [Property("SPEC", "Xamarin.Forms.Editor.Opacity P")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Seek Opacity Slider after observe")]
- [Step(3, "Pass If Opacity of Editor changed otherwise false")]
- [Postcondition(1, "Click Back button.")]
- public async Task Opacity_Editor_UILK()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
- _editor = new Editor
- {
- BackgroundColor = Color.Blue.WithLuminosity(0.9),
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 200,
- WidthRequest = 300
- };
-
- var sliderOpacity = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.Blue,
- Maximum = 1,
- Minimum = 0,
- Value = 1
- };
-
- _editor.BindingContext = sliderOpacity;
- _editor.SetBinding(Button.OpacityProperty, "Value");
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- _editor,
- sliderOpacity,
- },
- },
- Title = "OpacityTest",
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the Margin property")]
- [Property("SPEC", "Xamarin.Forms.Editor.Margin P")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(4, "Pass If Margin of Editor changed otherwise False")]
- [Postcondition(1, "Click Back button.")]
- public async Task Margin_Editor_UILK()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
- _editor = new Editor
- {
- BackgroundColor = Color.Blue.WithLuminosity(0.9),
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 200,
- WidthRequest = 300
- };
-
- String[] dataTest = { "", "", "" };
- dataTest[0] = "MarginTop: 50";
- dataTest[1] = "MarginTop: 100";
- dataTest[2] = "MarginTop: 150";
- var text = "Select a Margin test";
- var title = "Margin Test";
- //CreatePageTestToButton(text, title, dataTest);
- List<ControlTest> controlTest = new List<ControlTest>
- {
- new ControlTest(dataTest[0]),
- new ControlTest(dataTest[1]),
- new ControlTest(dataTest[2])
- };
- var _listview = new ListView
- {
- RowHeight = 100,
- ItemsSource = controlTest,
- ItemTemplate = new DataTemplate(() =>
- {
- Label nameLabel = new Label()
- {
- Margin = new Thickness(100, 0, 0, 0),
- TextColor = Color.Black,
- BackgroundColor = Color.White,
- HorizontalOptions = LayoutOptions.Center,
- };
- nameLabel.SetBinding(Label.TextProperty, "Name");
- return new ViewCell
- {
- View = new StackLayout
- {
- Padding = new Thickness(0, 5),
- Orientation = StackOrientation.Horizontal,
- Children =
- {
- new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Spacing = 0,
- Children =
- {
- nameLabel,
- }
- }
- }
- }
- };
- })
- };
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest ctlTest = (ControlTest)e.Item;
- if (ctlTest.Name.Equals(dataTest[0]))
- {
- _editor.Margin = new Thickness(0, 50, 0, 0);
- }
- else if (ctlTest.Name.Equals(dataTest[1]))
- {
- _editor.Margin = new Thickness(0, 100, 0, 0);
- }
- else
- {
- _editor.Margin = new Thickness(0, 150, 0, 0);
- }
- };
- //await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- _editor,
- new Label
- {
- Text=text,
- TextColor=Color.White,
- HorizontalOptions = LayoutOptions.Center
- },
- _listview,
- },
- BackgroundColor = Color.Navy
- },
- Title = title,
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the Rotation property")]
- [Property("SPEC", "Xamarin.Forms.Editor.Rotation P")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(3, "Pass If Rotation of Editor changed otherwise False")]
- [Postcondition(1, "Click Back button.")]
- public async Task Rotation_Editor_UILK()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
- _editor = new Editor
- {
- BackgroundColor = Color.Blue.WithLuminosity(0.9),
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 200,
- WidthRequest = 300
- };
-
- String[] dataTest = { "", "", "" };
- dataTest[0] = "50";
- dataTest[1] = "90";
- dataTest[2] = "180";
- var text = "Select a Rotation test";
- var title = "Rotation Test";
- //CreatePageTestToButton(text, title, dataTest);
- List<ControlTest> controlTest = new List<ControlTest>
- {
- new ControlTest(dataTest[0]),
- new ControlTest(dataTest[1]),
- new ControlTest(dataTest[2])
- };
- var _listview = new ListView
- {
- RowHeight = 100,
- ItemsSource = controlTest,
- ItemTemplate = new DataTemplate(() =>
- {
- Label nameLabel = new Label()
- {
- Margin = new Thickness(100, 0, 0, 0),
- TextColor = Color.Black,
- BackgroundColor = Color.White,
- HorizontalOptions = LayoutOptions.Center,
- };
- nameLabel.SetBinding(Label.TextProperty, "Name");
- return new ViewCell
- {
- View = new StackLayout
- {
- Padding = new Thickness(0, 5),
- Orientation = StackOrientation.Horizontal,
- Children =
- {
- new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Spacing = 0,
- Children =
- {
- nameLabel,
- }
- }
- }
- }
- };
- })
- };
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest ctlTest = (ControlTest)e.Item;
- if (ctlTest.Name.Equals(dataTest[0]))
- {
- _editor.Rotation = 50;
- }
- else if (ctlTest.Name.Equals(dataTest[1]))
- {
- _editor.Rotation = 90;
- }
- else
- {
- _editor.Rotation = 180;
- }
- };
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- _editor,
- new Label
- {
- Text=text,
- TextColor=Color.White,
- HorizontalOptions = LayoutOptions.Center
- },
- _listview,
- },
- BackgroundColor = Color.Navy
- },
- Title = title,
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the Scale property")]
- [Property("SPEC", "Xamarin.Forms.Editor.Scale P")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(3, "Pass If Scale of Editor changed otherwise False")]
- [Postcondition(1, "Click Back button.")]
- public async Task Scale_Editor_UILK()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
- _editor = new Editor
- {
- BackgroundColor = Color.Blue.WithLuminosity(0.9),
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 200,
- WidthRequest = 300,
- };
-
- String[] dataTest = { "", "", "" };
- dataTest[0] = "0.5";
- dataTest[1] = "1.0";
- dataTest[2] = "2.0";
- var text = "Select a Scale test";
- var title = "Scale Test";
- //CreatePageTestToButton(text, title, dataTest);
- List<ControlTest> controlTest = new List<ControlTest>
- {
- new ControlTest(dataTest[0]),
- new ControlTest(dataTest[1]),
- new ControlTest(dataTest[2])
- };
- var _listview = new ListView
- {
- RowHeight = 100,
- ItemsSource = controlTest,
- ItemTemplate = new DataTemplate(() =>
- {
- Label nameLabel = new Label()
- {
- Margin = new Thickness(100, 0, 0, 0),
- TextColor = Color.Black,
- BackgroundColor = Color.White,
- HorizontalOptions = LayoutOptions.Center,
- };
- nameLabel.SetBinding(Label.TextProperty, "Name");
- return new ViewCell
- {
- View = new StackLayout
- {
- Padding = new Thickness(0, 5),
- Orientation = StackOrientation.Horizontal,
- Children =
- {
- new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Spacing = 0,
- Children =
- {
- nameLabel,
- }
- }
- }
- }
- };
- })
- };
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest ctlTest = (ControlTest)e.Item;
- if (ctlTest.Name.Equals(dataTest[0]))
- {
- _editor.Scale = 0.5;
- }
- else if (ctlTest.Name.Equals(dataTest[1]))
- {
- _editor.Scale = 1.0;
- }
- else
- {
- _editor.Scale = 2.0;
- }
- };
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- _editor,
- new Label
- {
- Text=text,
- TextColor=Color.White,
- HorizontalOptions = LayoutOptions.Center
- },
- _listview,
- },
- BackgroundColor = Color.Navy
- },
- Title = title,
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the IsEnabled property")]
- [Property("SPEC", "Xamarin.Forms.Editor.IsEnabled P")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(3, "Pass If text can not be entered in Editor after select the Disable from Listview, otherwaise False")]
- [Postcondition(1, "Click Back button.")]
- public async Task IsEnabled_Editor_UIBH()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
- _editor = new Editor
- {
- BackgroundColor = Color.Blue.WithLuminosity(0.9),
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 200,
- WidthRequest = 300,
- };
-
- String[] dataTest = { "", "", "" };
- dataTest[0] = "Enable";
- dataTest[1] = "Disable";
- dataTest[2] = "Enable";
- var text = "Select a IsEnabled test";
- var title = "IsEnabled Test";
- //CreatePageTestToButton(text, title, dataTest);
- List<ControlTest> controlTest = new List<ControlTest>
- {
- new ControlTest(dataTest[0]),
- new ControlTest(dataTest[1]),
- new ControlTest(dataTest[2])
- };
- var _listview = new ListView
- {
- RowHeight = 100,
- ItemsSource = controlTest,
- ItemTemplate = new DataTemplate(() =>
- {
- Label nameLabel = new Label()
- {
- Margin = new Thickness(100, 0, 0, 0),
- TextColor = Color.Black,
- BackgroundColor = Color.White,
- HorizontalOptions = LayoutOptions.Center,
- };
- nameLabel.SetBinding(Label.TextProperty, "Name");
- return new ViewCell
- {
- View = new StackLayout
- {
- Padding = new Thickness(0, 5),
- Orientation = StackOrientation.Horizontal,
- Children =
- {
- new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Spacing = 0,
- Children =
- {
- nameLabel,
- }
- }
- }
- }
- };
- })
- };
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest ctlTest = (ControlTest)e.Item;
- if (ctlTest.Name.Equals(dataTest[1]))
- {
- _editor.IsEnabled = false;
- }
- else
- {
- _editor.IsEnabled = true;
- }
- };
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- _editor,
- new Label
- {
- Text=text,
- TextColor=Color.White,
- HorizontalOptions = LayoutOptions.Center
- },
- _listview,
- },
- BackgroundColor = Color.Navy
- },
- Title = title,
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, 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.Threading.Tasks;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class EntryCellTests
- {
- private EntryCell _entryCell, _entryCell2;
- private static TestPage _testPage = TestPage.GetInstance();
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("EntryCellTests --------------- SetUp()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("EntryCellTests --------------- TearDown()");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check whether Completed event is invoked or not")]
- [Property("SPEC", "Xamarin.Forms.EntryCell.Completed E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "click a entry cell")]
- [Step(2, "Edit some character")]
- [Step(3, "Touch 'done' btn on keyboard.")]
- [Step(4, "Testcase result will show automatically")]
- [Postcondition(1, "NA")]
- public async Task Completed_EVENT()
- {
- // This event will come when touch 'done' btn on keyboard.
- /* TEST CODE */
- Label header = new Label
- {
- Text = "EntryCell",
- FontSize = Device.GetNamedSize(NamedSize.Large, typeof(EntryCell)),
- HorizontalOptions = LayoutOptions.Center
- };
- _entryCell = new EntryCell
- {
- Label = "EntryCell:",
- Placeholder = "Type Text Here"
- };
- _entryCell2 = new EntryCell
- {
- Label = "EntryCell2:",
- Placeholder = "Type Text Here2"
- };
- TableView tableView = new TableView
- {
- Intent = TableIntent.Form,
- Root = new TableRoot
- {
- new TableSection
- {
- _entryCell
- }
- }
- };
-
- TableView tableView1 = new TableView
- {
- Intent = TableIntent.Form,
- Root = new TableRoot
- {
- new TableSection
- {
- _entryCell2
- }
- }
- };
-
- _entryCell.Completed += (o, e) =>
- {
- Assert.True(true);
- ManualTest.Confirm();
- };
- var page = new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- header,
- tableView,
- tableView1
- }
- },
- Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5)
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _entryCell.Completed -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether HorizontalTextAlignment align Placeholder text Start,Center & End")]
- [Property("SPEC", "Xamarin.Forms.EntryCell. HorizontalTextAlignment A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Run TC")]
- [Step(2, "Click Aign Start Button")]
- [Step(3, "Click Aign Center Button")]
- [Step(4, "Click Aign End Button")]
- [Step(5, "Click Pass if alignment of text has been changed, Fail otherwaise")]
- [Postcondition(1, "NA")]
- public async Task HorizontalTextAlignment_UILK()
- {
- // This event will come when touch 'done' btn on keyboard.
- /* TEST CODE */
- _entryCell = new EntryCell
- {
- Label = "EntryCell:",
- Placeholder = "Type Text Here"
- };
-
- TableView tableView = new TableView
- {
- Intent = TableIntent.Form,
- Root = new TableRoot
- {
- new TableSection
- {
- _entryCell
- }
- }
- };
-
- var btnStart = new Button
- {
- Text = "Align Start",
- Command = new Command(() => { _entryCell.HorizontalTextAlignment = TextAlignment.Start; })
- };
-
- var btnCenter = new Button
- {
- Text = "Align Center",
- Command = new Command(() => { _entryCell.HorizontalTextAlignment = TextAlignment.Center; })
- };
-
- var btnEnd = new Button
- {
- Text = "Align End",
- Command = new Command(() => { _entryCell.HorizontalTextAlignment = TextAlignment.End; })
- };
-
- var page = new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- tableView,
- btnStart,
- btnCenter,
- btnEnd
- }
- },
- Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5)
- };
-
- _testPage.ExecuteTC(page);
-
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Label gets or sets the fixed text presented next to the Entry in the EntryCell")]
- [Property("SPEC", "Xamarin.Forms.EntryCell.Label A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Run TC")]
- [Step(2, "Click Change lable text button")]
- [Step(3, "Observe")]
- [Step(4, "Click Back Button")]
- [Step(5, "Click Pass if Label text has been changed, Fail otherwaise")]
- [Postcondition(1, "NA")]
- public async Task Label_UILK()
- {
- // This event will come when touch 'done' btn on keyboard.
- /* TEST CODE */
-
- _entryCell = new EntryCell
- {
- Label = "EntryCell:",
- Placeholder = "Type Text Here"
- };
-
- TableView tableView = new TableView
- {
- Intent = TableIntent.Form,
- Root = new TableRoot
- {
- new TableSection
- {
- _entryCell
- }
- }
- };
-
- var btnChangeLabel = new Button
- {
- Text = "Change lable text",
- Command = new Command(() => { _entryCell.Label = "Label text changed"; })
- };
-
- var page = new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- tableView,
- btnChangeLabel,
- }
- },
- Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5)
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Label color can be changed.")]
- [Property("SPEC", "Xamarin.Forms.EntryCell.LabelColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Run TC")]
- [Step(2, "Click Change lable color button")]
- [Step(3, "Observe")]
- [Step(4, "Click Back Button")]
- [Step(5, "Click Pass if Label color has been changed, Fail otherwaise")]
- [Postcondition(1, "NA")]
- public async Task LabelColor_UILK()
- {
- // This event will come when touch 'done' btn on keyboard.
- /* TEST CODE */
- _entryCell = new EntryCell
- {
- Label = "EntryCell:",
- Placeholder = "Type Text Here"
- };
-
- TableView tableView = new TableView
- {
- Intent = TableIntent.Form,
- Root = new TableRoot
- {
- new TableSection
- {
- _entryCell
- }
- }
- };
-
- var btnChangeLabelColor = new Button
- {
- Text = "Change label color",
- Command = new Command(() => { _entryCell.LabelColor = Color.Red; })
- };
-
- var page = new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- tableView,
- btnChangeLabelColor,
- }
- },
- Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5)
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Label color can be changed.")]
- [Property("SPEC", "Xamarin.Forms.EntryCell.Placeholder A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Run TC")]
- [Step(2, "Click Change placeholder text button")]
- [Step(3, "Observe")]
- [Step(4, "Click Pass if Placeholder text has been changed, Fail otherwaise")]
- [Postcondition(1, "NA")]
- public async Task Placeholder_UILK()
- {
- // This event will come when touch 'done' btn on keyboard.
- /* TEST CODE */
- _entryCell = new EntryCell
- {
- Label = "EntryCell:",
- Placeholder = "Type Text Here"
- };
-
- TableView tableView = new TableView
- {
- Intent = TableIntent.Form,
- Root = new TableRoot
- {
- new TableSection
- {
- _entryCell
- }
- }
- };
-
- var btnChangePlaceholder = new Button
- {
- Text = "Change placeholder text",
- Command = new Command(() => { _entryCell.Placeholder = " Text has been changed"; })
- };
-
- var page = new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- tableView,
- btnChangePlaceholder,
- }
- },
- Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5)
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Text of the Entry of the EntryCell can be changed.")]
- [Property("SPEC", "Xamarin.Forms.EntryCell.Text A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Run TC")]
- [Step(2, "Click Change text button")]
- [Step(3, "Observe")]
- [Step(4, "Click Back Button")]
- [Step(5, "Click Pass if Text of the Entry of the EntryCell has been changed, Fail otherwaise")]
- [Postcondition(1, "NA")]
- public async Task Text_UIBH()
- {
- // This event will come when touch 'done' btn on keyboard.
- /* TEST CODE */
- _entryCell = new EntryCell
- {
- Label = "EntryCell:",
- Placeholder = "Type Text Here"
- };
-
- TableView tableView = new TableView
- {
- Intent = TableIntent.Form,
- Root = new TableRoot
- {
- new TableSection
- {
- _entryCell
- }
- }
- };
-
- var btnChangeText = new Button
- {
- Text = "Change Text",
- Command = new Command(() => { _entryCell.Text = " Text has been changed"; })
- };
-
- var page = new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- tableView,
- btnChangeText,
- }
- },
- Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5)
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether XAlign align Text property to Start,Center & End")]
- [Property("SPEC", "Xamarin.Forms.EntryCell.XAlign A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Run TC")]
- [Step(2, "Click Aign Start Button")]
- [Step(3, "Click Aign Center Button")]
- [Step(4, "Click Aign End Button")]
- [Step(5, "Click Pass if alignment of text has been changed, Fail otherwaise")]
- [Postcondition(1, "NA")]
- public async Task XAlign_UILK()
- {
- // This event will come when touch 'done' btn on keyboard.
- /* TEST CODE */
- _entryCell = new EntryCell
- {
- Label = "EntryCell:",
- Placeholder = "Type Text Here"
- };
-
- TableView tableView = new TableView
- {
- Intent = TableIntent.Form,
- Root = new TableRoot
- {
- new TableSection
- {
- _entryCell
- }
- }
- };
-
- var btnStart = new Button
- {
- Text = "Align Start",
- Command = new Command(() => { _entryCell.XAlign = TextAlignment.Start; })
- };
-
- var btnCenter = new Button
- {
- Text = "Align Center",
- Command = new Command(() => { _entryCell.XAlign = TextAlignment.Center; })
- };
-
- var btnEnd = new Button
- {
- Text = "Align End",
- Command = new Command(() => { _entryCell.XAlign = TextAlignment.End; })
- };
-
- var page = new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- tableView,
- btnStart,
- btnCenter,
- btnEnd
- }
- },
- Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5)
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- // Currently, Xamarin Forms Limitation
- //[Test]
- [Category("P1")]
- [Description("Check whether Height of the entry cell can be changed")]
- [Property("SPEC", "Xamarin.Forms.EntryCell.Height A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Run TC")]
- [Step(2, "Click Buttons")]
- [Step(4, "Click Back Button")]
- [Step(4, "Click Pass if Height of EentryCell has been changed, Fail otherwaise")]
- [Postcondition(1, "NA")]
- public async Task Height_UILK()
- {
- // This event will come when touch 'done' btn on keyboard.
- /* TEST CODE */
- _entryCell = new EntryCell
- {
- Label = "EntryCell:",
- Placeholder = "Type Text Here"
- };
-
- TableView tableView = new TableView
- {
- Intent = TableIntent.Form,
- Root = new TableRoot
- {
- new TableSection
- {
- _entryCell
- }
- }
- };
-
- var btnHeight100 = new Button
- {
- Text = "Change Height to 100",
- Command = new Command(() => { _entryCell.Height = 100; })
- };
-
- var btnHeight50 = new Button
- {
- Text = "Change Height to 50",
- Command = new Command(() => { _entryCell.Height = 50; })
- };
-
- var btnHeight150 = new Button
- {
- Text = "Change Height to 150",
- Command = new Command(() => { _entryCell.Height = 150; })
- };
-
- var page = new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- tableView,
- btnHeight100,
- btnHeight50,
- btnHeight150
- }
- },
- Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5)
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether entry cell can be enable and disable")]
- [Property("SPEC", "Xamarin.Forms.EntryCell.IsEnabled A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Run TC")]
- [Step(2, "Click Buttons")]
- [Step(4, "Click Back Button")]
- [Step(4, "Click Pass if EntryCell disabled after pressing Disable button and enabled after pressing Enable button, Fail otherwaise")]
- [Postcondition(1, "NA")]
- public async Task IsEnabled_UILK()
- {
- // This event will come when touch 'done' btn on keyboard.
- /* TEST CODE */
- _entryCell = new EntryCell
- {
- Label = "EntryCell:",
- Placeholder = "Type Text Here"
- };
-
- TableView tableView = new TableView
- {
- Intent = TableIntent.Form,
- Root = new TableRoot
- {
- new TableSection
- {
- _entryCell
- }
- }
- };
-
- var btnDisable = new Button
- {
- Text = "Disable",
- Command = new Command(() => { _entryCell.IsEnabled = false; })
- };
-
- var btnEnable = new Button
- {
- Text = "Enable",
- Command = new Command(() => { _entryCell.IsEnabled = true; })
- };
-
- var page = new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- tableView,
- btnDisable,
- btnEnable,
- }
- },
- Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5)
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
- }
-}
+++ /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 Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class FrameTest
- {
- private Frame _frame;
- private static TestPage _testPage = TestPage.GetInstance();
-
- class ControlTest
- {
- public ControlTest(string name)
- {
- this.Name = name;
- }
-
- public string Name { private set; get; }
- };
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("Frame --------------- SetUp()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("Frame --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OutlineColor of a Frame can be change")]
- [Property("SPEC", "Xamarin.Forms.Frame.OutlineColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Run TC")]
- [Step(2, "Click Buttons")]
- [Step(4, "Click Back Button")]
- [Step(4, "Click Pass if Fram OutlineColor after pressing Silver & Orange button, Fail otherwaise")]
- [Postcondition(1, "NA")]
- public async Task OutlineColor_UILK()
- {
- // This event will come when touch 'done' btn on keyboard.
- /* TEST CODE */
- Label header = new Label
- {
- Text = "Frame OutlineColor",
- };
- _frame = new Frame
- {
- Content = header,
- OutlineColor = Color.Blue,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HorizontalOptions = LayoutOptions.Center,
- };
-
- var btnSilver = new Button
- {
- Text = "Silver",
- Command = new Command(() => { _frame.OutlineColor = Color.Silver; })
- };
-
- var btnOrange = new Button
- {
- Text = "Orange",
- Command = new Command(() => { _frame.OutlineColor = Color.Orange; })
- };
-
- var page = new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- _frame,
- btnSilver,
- btnOrange,
- }
- },
- Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5)
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether HasShadow of a Frame can be change")]
- [Property("SPEC", "Xamarin.Forms.Frame.HasShadow A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Run TC")]
- [Step(2, "Click Buttons")]
- [Step(4, "Click Back Button")]
- [Step(4, "Click Pass if Fram HasShadow after pressing buttons, Fail otherwaise")]
- [Postcondition(1, "NA")]
- public async Task HasShadow_UILK()
- {
- // This event will come when touch 'done' btn on keyboard.
- /* TEST CODE */
- Label header = new Label
- {
- Text = "Frame HasShadow",
- };
- _frame = new Frame
- {
- Content = header,
- OutlineColor = Color.Blue,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HorizontalOptions = LayoutOptions.Center
- };
-
- var btnHasShadow = new Button
- {
- Text = "Has shadow",
- Command = new Command(() => { _frame.HasShadow = true; })
- };
-
- var btnHasNoShadow = new Button
- {
- Text = "Has no shadow",
- Command = new Command(() => { _frame.HasShadow = false; })
- };
-
- var page = new ContentPage()
- {
- Content = new StackLayout
- {
- BackgroundColor = Color.White,
- Children =
- {
- _frame,
- btnHasShadow,
- btnHasNoShadow,
- }
- },
- Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5)
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- //===============================================================
-
- [Test]
- [Category("P1")]
- [Description("Check the IsVisible property")]
- [Property("SPEC", "Xamarin.Forms.Frame.IsVisible A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click Change button")]
- [Step(3, "Observe change of the Editor")]
- [Step(4, "Testcase PASS if click Visible button -> Show the Frame and click Hide button-> Hide the Frame, otherwise FAIL")]
- [Postcondition(1, "Click Back button.")]
- public async Task IsVisible_Frame_UIBH()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
-
- Label header = new Label
- {
- Text = "Frame IsVisible",
- };
- _frame = new Frame
- {
- Content = header,
- OutlineColor = Color.Blue,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HorizontalOptions = LayoutOptions.Center
- };
-
- var mBtnVisible = new Button
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.End,
- Text = "Visible",
- Margin = new Thickness()
- {
- Right = 10,
- Left = 10
- }
- };
-
- var mBtnHide = new Button
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.End,
- Text = "Hide",
- Margin = new Thickness()
- {
- Right = 10,
- Left = 10
- }
- };
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- _frame,
- mBtnVisible,
- mBtnHide
- },
- },
- Title = "IsVisible Test",
- };
-
- mBtnVisible.Clicked += (e, o) =>
- {
- _frame.IsVisible = true;
- };
-
- mBtnHide.Clicked += (e, o) =>
- {
- _frame.IsVisible = false;
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- mBtnVisible.Clicked -= (e, o) =>
- {
- _frame.IsVisible = true;
- };
-
- mBtnHide.Clicked -= (e, o) =>
- {
- _frame.IsVisible = false;
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the BackgroundColor property")]
- [Property("SPEC", "Xamarin.Forms.Frame.BackgroundColor P")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Select a Color after observe BackgroundColor of Frame is changed")]
- [Step(3, "Testcase PASS If BackgroundColor of Frame changed otherwise false")]
- [Postcondition(1, "Click Back button.")]
- public async Task BackgroundColor_Frame_Change_UILK()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
- Label header = new Label
- {
- Text = "Frame BackgroundColor",
- };
- _frame = new Frame
- {
- Content = header,
- OutlineColor = Color.Blue,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HorizontalOptions = LayoutOptions.Center,
- //BackgroundColor = Color.White
- };
-
- var mBtnRed = new Button
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.End,
- BackgroundColor = Color.Red,
- Text = "Red",
- Margin = new Thickness()
- {
- Right = 10,
- Left = 10
- }
- };
-
- var mBtnGreen = new Button
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.End,
- BackgroundColor = Color.Green,
- Text = "Green",
- Margin = new Thickness()
- {
- Right = 10,
- Left = 10
- }
- };
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- _frame,
- mBtnRed,
- mBtnGreen
- },
- },
- Title = "BackgoundColor Test",
- };
-
- mBtnRed.Clicked += (e, o) =>
- {
- _frame.BackgroundColor = Color.Red;
- };
-
- mBtnGreen.Clicked += (e, o) =>
- {
- _frame.BackgroundColor = Color.Green;
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- mBtnRed.Clicked -= (e, o) =>
- {
- _frame.BackgroundColor = Color.Red;
- };
-
- mBtnGreen.Clicked -= (e, o) =>
- {
- _frame.BackgroundColor = Color.Green;
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the HeightRequest & WidthRequest property")]
- [Property("SPEC", "Xamarin.Forms.Frame P")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Seek Silder for Width and Height after observe")]
- [Step(3, "Pass If Height and Width of the Frame changed otherwise false")]
- [Postcondition(1, "Click Back button.")]
- public async Task WidthAndHeight_Frame_CHANGE_SIZE_UILK()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
- var header = new Label
- {
- Text = "Frame Width and Height Request",
- };
- _frame = new Frame
- {
- Content = header,
- OutlineColor = Color.Blue,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HorizontalOptions = LayoutOptions.Center,
- };
-
- var sliderHorizontal = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- BackgroundColor = Color.Pink,
- Maximum = 500,
- Minimum = 120
- };
-
- var sliderVertical = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- BackgroundColor = Color.Pink,
- Maximum = 500,
- Minimum = 80
- };
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- _frame,
- sliderHorizontal,
- sliderVertical
- },
- },
- Title = "Size Layout Test",
- };
-
- sliderHorizontal.ValueChanged += (o, e) =>
- {
- _frame.WidthRequest = sliderHorizontal.Value;
- };
-
- sliderVertical.ValueChanged += (o, e) =>
- {
- _frame.HeightRequest = sliderVertical.Value;
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- sliderHorizontal.ValueChanged -= (o, e) =>
- {
- _frame.WidthRequest = sliderHorizontal.Value;
- };
-
- sliderVertical.ValueChanged -= (o, e) =>
- {
- _frame.HeightRequest = sliderVertical.Value;
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the Opacity property")]
- [Property("SPEC", "Xamarin.Forms.Frame.Opacity P")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Seek Opacity Slider after observe")]
- [Step(3, "Pass If Opacity of Frame changed otherwise false")]
- [Postcondition(1, "Click Back button.")]
- public async Task Opacity_Frame_UILK()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
- Label header = new Label
- {
- Text = "Frame Opacity",
- };
- _frame = new Frame
- {
- Content = header,
- OutlineColor = Color.Blue,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HorizontalOptions = LayoutOptions.Center
- };
-
- var sliderOpacity = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.Blue,
- Maximum = 1,
- Minimum = 0,
- Value = 1
- };
-
- _frame.BindingContext = sliderOpacity;
- _frame.SetBinding(Button.OpacityProperty, "Value");
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- _frame,
- sliderOpacity,
- },
- },
- Title = "OpacityTest",
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the Margin property")]
- [Property("SPEC", "Xamarin.Forms.Frame.Margin P")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(4, "Pass If Margin of Frame changed otherwise False")]
- [Postcondition(1, "Click Back button.")]
- public async Task Margin_Frame_UILK()
- {
- Label header = new Label
- {
- Text = "Frame Margin",
- };
- _frame = new Frame
- {
- Content = header,
- OutlineColor = Color.Blue,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HorizontalOptions = LayoutOptions.Center,
- BackgroundColor = Color.White
- };
-
- String[] dataTest = { "", "", "" };
- dataTest[0] = "MarginTop: 50";
- dataTest[1] = "MarginTop: 100";
- dataTest[2] = "MarginTop: 150";
- var title = "Margin Test";
- List<ControlTest> controlTest = new List<ControlTest>
- {
- new ControlTest(dataTest[0]),
- new ControlTest(dataTest[1]),
- new ControlTest(dataTest[2])
- };
- var _listview = new ListView
- {
- RowHeight = 100,
- ItemsSource = controlTest,
- ItemTemplate = new DataTemplate(() =>
- {
- Label nameLabel = new Label()
- {
- TextColor = Color.Pink,
- HorizontalOptions = LayoutOptions.Center,
- };
- nameLabel.SetBinding(Label.TextProperty, "Name");
- return new ViewCell
- {
- View = new StackLayout
- {
- Padding = new Thickness(0, 5),
- Children =
- {
- new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Spacing = 0,
- Children =
- {
- nameLabel,
- }
- }
- }
- }
- };
- })
- };
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest ctlTest = (ControlTest)e.Item;
- if (ctlTest.Name.Equals(dataTest[0]))
- {
- _frame.Margin = new Thickness(0, 50, 0, 0);
- }
- else if (ctlTest.Name.Equals(dataTest[1]))
- {
- _frame.Margin = new Thickness(0, 100, 0, 0);
- }
- else
- {
- _frame.Margin = new Thickness(0, 150, 0, 0);
- }
- };
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- _frame,
- _listview,
- },
- BackgroundColor = Color.Navy
- },
- Title = title,
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the Rotation property")]
- [Property("SPEC", "Xamarin.Forms.Frame.Rotation P")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(3, "Pass If Rotation of Frame changed otherwise False")]
- [Postcondition(1, "Click Back button.")]
- public async Task Rotation_Frame_UILK()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
- Label header = new Label
- {
- Text = "Frame Rotation",
- };
- _frame = new Frame
- {
- Content = header,
- OutlineColor = Color.Blue,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HorizontalOptions = LayoutOptions.Center,
- BackgroundColor = Color.White
- };
-
- String[] dataTest = { "", "", "" };
- dataTest[0] = "50";
- dataTest[1] = "90";
- dataTest[2] = "180";
- var text = "Select a Rotation test";
- var title = "Rotation Test";
- List<ControlTest> controlTest = new List<ControlTest>
- {
- new ControlTest(dataTest[0]),
- new ControlTest(dataTest[1]),
- new ControlTest(dataTest[2])
- };
- var _listview = new ListView
- {
- RowHeight = 100,
- ItemsSource = controlTest,
- ItemTemplate = new DataTemplate(() =>
- {
- Label nameLabel = new Label()
- {
- TextColor = Color.Black,
- BackgroundColor = Color.White,
- HorizontalOptions = LayoutOptions.Center,
- };
- nameLabel.SetBinding(Label.TextProperty, "Name");
- return new ViewCell
- {
- View = new StackLayout
- {
- Padding = new Thickness(0, 5),
- Children =
- {
- new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Spacing = 0,
- Children =
- {
- nameLabel,
- }
- }
- }
- }
- };
- })
- };
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest ctlTest = (ControlTest)e.Item;
- if (ctlTest.Name.Equals(dataTest[0]))
- {
- _frame.Rotation = 50;
- }
- else if (ctlTest.Name.Equals(dataTest[1]))
- {
- _frame.Rotation = 90;
- }
- else
- {
- _frame.Rotation = 180;
- }
- };
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- _frame,
- new Label
- {
- Text=text,
- TextColor=Color.White,
- HorizontalOptions = LayoutOptions.Center
- },
- _listview,
- },
- BackgroundColor = Color.Navy
- },
- Title = title,
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the Scale property")]
- [Property("SPEC", "Xamarin.Forms.Frame.Scale P")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(3, "Pass If Scale of Frame changed otherwise False")]
- [Postcondition(1, "Click Back button.")]
- public async Task Scale_Frame_UILK()
- {
- Label header = new Label
- {
- Text = "Frame Scale",
- TextColor = Color.Blue,
- };
- _frame = new Frame
- {
- Content = header,
- OutlineColor = Color.Blue,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HorizontalOptions = LayoutOptions.Center,
- BackgroundColor = Color.White,
- };
-
- String[] dataTest = { "", "", "" };
- dataTest[0] = "0.5";
- dataTest[1] = "1.0";
- dataTest[2] = "2.0";
- var title = "Select a Scale";
- List<ControlTest> controlTest = new List<ControlTest>
- {
- new ControlTest(dataTest[0]),
- new ControlTest(dataTest[1]),
- new ControlTest(dataTest[2])
- };
- var _listview = new ListView
- {
- BackgroundColor = Color.Black,
- RowHeight = 100,
- ItemsSource = controlTest,
- ItemTemplate = new DataTemplate(() =>
- {
- Label nameLabel = new Label()
- {
- TextColor = Color.Blue,
- HorizontalOptions = LayoutOptions.Center,
- HorizontalTextAlignment = TextAlignment.Center
- };
- nameLabel.SetBinding(Label.TextProperty, "Name");
- return new ViewCell
- {
- View = new StackLayout
- {
- Children =
- {
- new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Spacing = 0,
- Children =
- {
- nameLabel,
- }
- }
- }
- }
- };
- })
- };
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest ctlTest = (ControlTest)e.Item;
- if (ctlTest.Name.Equals(dataTest[0]))
- {
- _frame.Scale = 0.5;
- }
- else if (ctlTest.Name.Equals(dataTest[1]))
- {
- _frame.Scale = 1.0;
- }
- else
- {
- _frame.Scale = 2.0;
- }
- };
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- _frame,
- _listview,
- },
- BackgroundColor = Color.Navy
- },
- Title = title,
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the IsEnabled property")]
- [Property("SPEC", "Xamarin.Forms.Frame.IsEnabled P")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(3, "Pass If Frame IsEnabled button can not be clicked after select the Disable from Listview, otherwaise False")]
- [Postcondition(1, "Click Back button.")]
- public async Task IsEnabled_Frame_UIBH()
- {
- var header = new Button
- {
- Text = "Frame",
- };
- _frame = new Frame
- {
- Content = header,
- OutlineColor = Color.Blue,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HorizontalOptions = LayoutOptions.Center,
- BackgroundColor = Color.White
- };
-
- String[] dataTest = { "", "", "" };
- dataTest[0] = "Enable";
- dataTest[1] = "Disable";
- dataTest[2] = "Enable";
- var title = "IsEnabled Test";
- List<ControlTest> controlTest = new List<ControlTest>
- {
- new ControlTest(dataTest[0]),
- new ControlTest(dataTest[1]),
- new ControlTest(dataTest[2])
- };
- var _listview = new ListView
- {
- RowHeight = 100,
- ItemsSource = controlTest,
- ItemTemplate = new DataTemplate(() =>
- {
- Label nameLabel = new Label()
- {
- TextColor = Color.Pink,
- HorizontalOptions = LayoutOptions.Center,
- };
- nameLabel.SetBinding(Label.TextProperty, "Name");
- return new ViewCell
- {
- View = new StackLayout
- {
- Children =
- {
- new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Children =
- {
- nameLabel,
- }
- }
- }
- }
- };
- })
- };
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest ctlTest = (ControlTest)e.Item;
- if (ctlTest.Name.Equals(dataTest[1]))
- {
- _frame.IsEnabled = false;
- }
- else
- {
- _frame.IsEnabled = true;
- }
- };
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- _frame,
- _listview,
- },
- BackgroundColor = Color.Navy
- },
- Title = title,
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, 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 NUnit.Framework;
-using NUnit.Framework.TUnit;
-using System.Threading.Tasks;
-using XamarinApplication.Tizen;
-using System.Collections.Generic;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class GridTests
- {
- private static TestPage _testPage = TestPage.GetInstance();
- private static Grid _grid1, _grid2, _grid3, _grid4, _grid5, _grid6;
- private static ListView _listview;
- private static Button _button1;
- private static Boolean isSizeChanged;
-
- class ControlTest
- {
- public ControlTest(string name)
- {
- this.Name = name;
- }
-
- public string Name { private set; get; }
- };
-
- class CustomGrid : Grid
- {
- protected override void OnAdded(View view)
- {
- Assert.True(true);
- ManualTest.Confirm();
- base.OnAdded(view);
- }
-
- protected override void OnBindingContextChanged()
- {
- Assert.True(true);
- ManualTest.Confirm();
- base.OnBindingContextChanged();
- }
-
- protected override void OnRemoved(View view)
- {
- Assert.True(true);
- ManualTest.Confirm();
- base.OnRemoved(view);
- }
-
- protected override SizeRequest OnSizeRequest(double widthConstraint, double heightConstraint)
- {
- if (isSizeChanged)
- {
- Assert.True(true);
- ManualTest.Confirm();
- }
- return base.OnSizeRequest(widthConstraint, heightConstraint);
- }
- }
-
- [SetUp]
- public void SetUp()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Grid CLASS: Setup---------------------------------");
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Grid CLASS: Teardown---------------------------------");
- }
-
- private static void HandleClick(object sender, EventArgs e)
- {
- _grid2.ColumnSpacing = 200;
- _button1.Text = "Clicked" + _grid2.ColumnSpacing.ToString();
- _grid2.ForceLayout();
- }
-
- //support function
- public void CreatePageTestToGrid(String txtDisplay, String title, String[] dataTest)
- {
- _grid5 = new Grid
- {
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- BackgroundColor = Color.Gray,
- HeightRequest = 100,
- WidthRequest = 300,
- Margin = 20
- };
- _grid5.Children.Add(new Label
- {
- Text = "This is A Grid.",
- TextColor = Color.White
- });
-
- List<ControlTest> controlTest = new List<ControlTest>
- {
- new ControlTest(dataTest[0]),
- new ControlTest(dataTest[1]),
- new ControlTest(dataTest[2])
- };
-
- _listview = new ListView
- {
- RowHeight = 100,
- ItemsSource = controlTest,
- ItemTemplate = new DataTemplate(() =>
- {
- Label nameLabel = new Label()
- {
- TextColor = Color.Black,
- BackgroundColor = Color.White,
- HorizontalOptions = LayoutOptions.Center,
- };
- nameLabel.SetBinding(Label.TextProperty, "Name");
- return new ViewCell
- {
- View = new StackLayout
- {
- Padding = new Thickness(0, 5),
- Children =
- {
- new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Spacing = 0,
- Children =
- {
- nameLabel,
- }
- }
- }
- }
- };
- })
- };
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- _grid5,
- _listview,
- },
- BackgroundColor = Color.Blue,
- },
- Title = title
- });
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if Grid object is created.")]
- [Property("SPEC", "Xamarin.Forms.Grid.Grid C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click Run TC")]
- [Step(2, "Check if Grid is visible.")]
- [Step(3, "Confirm pass or fail")]
- [Postcondition(1, "NA")]
- public async Task Grid_INIT()
- {
- /* TEST CODE */
- _grid1 = new Grid
- {
- VerticalOptions = LayoutOptions.FillAndExpand,
- RowDefinitions =
- {
- new RowDefinition { Height = GridLength.Auto },
- new RowDefinition { Height = GridLength.Auto },
- new RowDefinition { Height = new GridLength(1, GridUnitType.Star) },
- new RowDefinition { Height = new GridLength(100, GridUnitType.Absolute) }
- },
- ColumnDefinitions =
- {
- new ColumnDefinition { Width = GridLength.Auto },
- new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) },
- new ColumnDefinition { Width = new GridLength(100, GridUnitType.Absolute) }
- }
- };
-
- _grid1.Children.Add(new Label
- {
- Text = "Grid",
- HorizontalOptions = LayoutOptions.Center
- }, 0, 3, 0, 1);
-
- _grid1.Children.Add(new Label
- {
- Text = "Autosized cell",
- TextColor = Color.White,
- BackgroundColor = Color.Blue
- }, 0, 1);
-
- _grid1.Children.Add(new BoxView
- {
- Color = Color.Silver,
- HeightRequest = 0
- }, 1, 1);
-
- _grid1.Children.Add(new BoxView
- {
- Color = Color.Teal
- }, 0, 2);
-
- _grid1.Children.Add(new Label
- {
- Text = "Leftover space",
- TextColor = Color.Purple,
- BackgroundColor = Color.Aqua,
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center,
- }, 1, 2);
-
- _grid1.Children.Add(new Label
- {
- Text = "Span two rows (or more if you want)",
- TextColor = Color.Yellow,
- BackgroundColor = Color.Navy,
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center
- }, 2, 3, 1, 3);
-
- _grid1.Children.Add(new Label
- {
- Text = "Span 2 columns",
- TextColor = Color.Blue,
- BackgroundColor = Color.Yellow,
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center
- }, 0, 2, 3, 4);
-
- _grid1.Children.Add(new Label
- {
- Text = "Fixed 100x100",
- TextColor = Color.Aqua,
- BackgroundColor = Color.Red,
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center
- }, 2, 3);
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- _grid1
- },
- BackgroundColor = Color.White,
- },
- });
-
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if column spacing is working properly.")]
- [Property("SPEC", "Xamarin.Forms.Grid.ColumnSpacing A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click Run TC")]
- [Step(2, "Check if column spacing in Grid is changing with slider move.")]
- [Step(3, "Confirm pass or fail")]
- [Postcondition(1, "NA")]
- public async Task ColumnSpacing_UIBH()
- {
- /* TEST CODE */
- _grid2 = new Grid
- {
- VerticalOptions = LayoutOptions.FillAndExpand,
- ColumnSpacing = 50.00
- };
-
- _grid2.Children.Add(new Label
- {
- Text = "Grid",
- HorizontalOptions = LayoutOptions.Center
- });
-
- _grid2.Children.Add(new Label
- {
- Text = "Cell 1",
- TextColor = Color.White,
- BackgroundColor = Color.Blue
- }, 0, 1);
-
- _grid2.Children.Add(new BoxView
- {
- Color = Color.Silver,
- HeightRequest = 0
- }, 1, 1);
-
- _grid2.Children.Add(new BoxView
- {
- Color = Color.Teal
- }, 0, 2);
-
- _grid2.Children.Add(new BoxView
- {
- Color = Color.BlueViolet,
- }, 1, 2);
-
- var sliderColumnSpacing = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.BlueViolet,
- Maximum = 300.00,
- Minimum = 10.00,
- Value = 10.00
- };
-
- _grid2.BindingContext = sliderColumnSpacing;
- _grid2.SetBinding(Grid.ColumnSpacingProperty, "Value");
-
- sliderColumnSpacing.ValueChanged += (sender, e) =>
- {
- _grid2.ForceLayout();
- };
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- _grid2,
- new Label()
- {
- Text = "Column Spacing: ",
- },
- sliderColumnSpacing
- },
- BackgroundColor = Color.White,
- },
- });
-
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if RowDefinitions property of Grid working properly.")]
- [Property("SPEC", "Xamarin.Forms.Grid.RowDefinitions A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click Run TC")]
- [Step(2, "Check if clicking the button changes RowDefinitions.")]
- [Step(3, "Confirm pass or fail")]
- [Postcondition(1, "NA")]
- public async Task RowDefinitions_UIBH()
- {
- /* TEST CODE */
- _button1 = new Button
- {
- Text = "GridUnitType.Absolute"
- };
-
- _grid1 = new Grid
- {
- VerticalOptions = LayoutOptions.FillAndExpand,
- RowDefinitions =
- {
- new RowDefinition { Height = new GridLength(1, GridUnitType.Absolute) },
- }
- };
-
- _grid1.Children.Add(new Label
- {
- Text = "Test: RowDefinitions",
- HorizontalOptions = LayoutOptions.Center
- }, 0, 3, 0, 1);
-
- _grid1.Children.Add(new Label
- {
- Text = "Autosized cell",
- TextColor = Color.White,
- BackgroundColor = Color.Blue
- }, 0, 1);
-
- _grid1.Children.Add(new BoxView
- {
- Color = Color.Silver,
- HeightRequest = 0
- }, 1, 1);
-
- _grid1.Children.Add(new BoxView
- {
- Color = Color.Teal
- }, 0, 2);
-
- _grid1.Children.Add(new Label
- {
- Text = "Leftover space",
- TextColor = Color.Purple,
- BackgroundColor = Color.Aqua,
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center,
- }, 1, 2);
-
- _grid1.Children.Add(new Label
- {
- Text = "Span two rows (or more if you want)",
- TextColor = Color.Yellow,
- BackgroundColor = Color.Navy,
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center
- }, 2, 3, 1, 3);
-
- _grid1.Children.Add(new Label
- {
- Text = "Span 2 columns",
- TextColor = Color.Blue,
- BackgroundColor = Color.Yellow,
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center
- }, 0, 2, 3, 4);
-
- _grid1.Children.Add(new Label
- {
- Text = "Fixed 100x100",
- TextColor = Color.Aqua,
- BackgroundColor = Color.Red,
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center
- }, 2, 3);
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- _grid1,
- _button1
- },
- BackgroundColor = Color.White,
- },
- });
-
- _button1.Clicked += (sender, e) =>
- {
- if (_button1.Text == "GridUnitType.Absolute")
- {
- _button1.Text = "GridUnitType.Auto";
- _grid1.RowDefinitions = new RowDefinitionCollection
- {
- new RowDefinition { Height = new GridLength(1, GridUnitType.Auto) },
- };
- _grid1.ForceLayout();
- }
- else
- {
- _button1.Text = "GridUnitType.Absolute";
- _grid1.RowDefinitions = new RowDefinitionCollection
- {
- new RowDefinition { Height = new GridLength(1, GridUnitType.Absolute) },
- };
- _grid1.ForceLayout();
- }
- };
-
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Gets or sets the amount of space left between rows in the Grid. This is a bindable property.")]
- [Property("SPEC", "Xamarin.Forms.Grid.RowSpacing A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click Run TC")]
- [Step(2, "Check if Row Spacing in Grid is changing with slider move.")]
- [Step(3, "Confirm pass or fail")]
- [Postcondition(1, "NA")]
- public async Task RowSpacing_UIBH()
- {
- /* TEST CODE */
- _grid2 = new Grid
- {
- VerticalOptions = LayoutOptions.FillAndExpand,
- RowSpacing = 50.00
- };
-
- _grid2.Children.Add(new Label
- {
- Text = "Grid",
- HorizontalOptions = LayoutOptions.Center
- });
-
- _grid2.Children.Add(new Label
- {
- Text = "Cell 1",
- TextColor = Color.Pink,
- BackgroundColor = Color.Blue
- }, 0, 1);
-
- _grid2.Children.Add(new BoxView
- {
- Color = Color.Silver,
- HeightRequest = 0
- }, 1, 1);
-
- _grid2.Children.Add(new BoxView
- {
- Color = Color.Teal
- }, 0, 2);
-
- _grid2.Children.Add(new BoxView
- {
- Color = Color.BlueViolet,
- }, 1, 2);
-
- var sliderRowSpacing = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.BlueViolet,
- Maximum = 300.00,
- Minimum = 10.00,
- Value = 1.00
- };
-
- if (Device.Idiom == TargetIdiom.Unsupported)
- {
- sliderRowSpacing.Minimum = 0;
- sliderRowSpacing.Maximum = 20;
- }
-
- _grid2.BindingContext = sliderRowSpacing;
- _grid2.SetBinding(Grid.RowSpacingProperty, "Value");
-
- sliderRowSpacing.ValueChanged += (sender, e) =>
- {
- _grid2.ForceLayout();
- };
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- _grid2,
- new Label()
- {
- Text = "Row Spacing: ",
- TextColor = Color.Pink
- },
- sliderRowSpacing
- },
- BackgroundColor = Color.White,
- },
- });
-
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Gets the collection of child elements of the Grid.")]
- [Property("SPEC", "Xamarin.Forms.Grid.Children A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click Run TC")]
- [Step(2, "Click the button Click for Children.")]
- [Step(3, "Check if clicking the button add child in the grid and children count is visible.")]
- [Step(4, "Confirm pass or fail")]
- [Postcondition(1, "NA")]
- public async Task Children_UILK()
- {
- /* TEST CODE */
- Label childCount = new Label
- {
- Text = "No Of Children in Grid",
- Margin = 10
- };
- _grid2 = new Grid
- {
- RowSpacing = 5.00,
- BackgroundColor = Color.Gold
- };
- _grid2.Children.Add(childCount, 0, 1);
-
- _grid2.Children.Add(new Label
- {
- Text = "Grid",
- HorizontalOptions = LayoutOptions.Center
- });
-
- _button1 = new Button()
- {
- HorizontalOptions = LayoutOptions.Center,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 100,
- WidthRequest = 500,
- BorderWidth = 10,
- BorderRadius = 5,
- Text = "Click for Childern.",
- TextColor = Color.Black,
- };
-
- int i, j;
- i = 0;
- j = 2;
- _button1.Clicked += (sender, e) =>
- {
- childCount.Text = "No Of Children in Grid : " + (_grid2.Children.Count - 1).ToString();
- _grid2.Children.Add(new Label
- {
- Text = "Child No : " + (_grid2.Children.Count - 1).ToString(),
- TextColor = Color.White,
- BackgroundColor = Color.Blue,
- HeightRequest = 10
- }, i, j);
- j++;
- _grid2.ForceLayout();
- };
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- _grid2,_button1
- },
- BackgroundColor = Color.White,
- },
- });
-
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if ColumnDefinitions property of Grid working properly.")]
- [Property("SPEC", "Xamarin.Forms.Grid.ColumnDefinitions A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click Run TC")]
- [Step(2, "Check if clicking the button changes ColumnDefinitions.")]
- [Step(3, "Confirm pass or fail")]
- [Postcondition(1, "NA")]
- public async Task ColumnDefinitions_UIBH()
- {
- /* TEST CODE */
- _button1 = new Button
- {
- Text = "GridUnitType.Absolute"
- };
-
- _grid1 = new Grid
- {
- VerticalOptions = LayoutOptions.FillAndExpand,
- ColumnDefinitions =
- {
- new ColumnDefinition { Width = new GridLength(1, GridUnitType.Absolute) },
- }
- };
-
- _grid1.Children.Add(new Label
- {
- Text = "Test: ColumnDefinitions",
- HorizontalOptions = LayoutOptions.Center
- }, 0, 3, 0, 1);
-
- _grid1.Children.Add(new Label
- {
- Text = "Autosized cell",
- TextColor = Color.White,
- BackgroundColor = Color.Blue
- }, 0, 1);
-
- _grid1.Children.Add(new BoxView
- {
- Color = Color.Silver,
- HeightRequest = 0
- }, 1, 1);
-
- _grid1.Children.Add(new BoxView
- {
- Color = Color.Teal
- }, 0, 2);
-
- _grid1.Children.Add(new Label
- {
- Text = "Leftover space",
- TextColor = Color.Purple,
- BackgroundColor = Color.Aqua,
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center,
- }, 1, 2);
-
- _grid1.Children.Add(new Label
- {
- Text = "Span two rows (or more if you want)",
- TextColor = Color.Yellow,
- BackgroundColor = Color.Navy,
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center
- }, 2, 3, 1, 3);
-
- _grid1.Children.Add(new Label
- {
- Text = "Span 2 columns",
- TextColor = Color.Blue,
- BackgroundColor = Color.Yellow,
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center
- }, 0, 2, 3, 4);
-
- _grid1.Children.Add(new Label
- {
- Text = "Fixed 100x100",
- TextColor = Color.Aqua,
- BackgroundColor = Color.Red,
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center
- }, 2, 3);
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- _grid1,
- _button1
- },
- BackgroundColor = Color.White,
- },
- });
-
- _button1.Clicked += (sender, e) =>
- {
- if (_button1.Text == "GridUnitType.Absolute")
- {
- _button1.Text = "GridUnitType.Auto";
- _grid1.ColumnDefinitions = new ColumnDefinitionCollection
- {
- new ColumnDefinition { Width = new GridLength(1, GridUnitType.Auto) },
- };
- _grid1.ForceLayout();
- }
- else
- {
- _button1.Text = "GridUnitType.Absolute";
- _grid1.ColumnDefinitions = new ColumnDefinitionCollection
- {
- new ColumnDefinition { Width = new GridLength(1, GridUnitType.Absolute) },
- };
- _grid1.ForceLayout();
- }
- };
-
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if opacity is changing properly.")]
- [Property("SPEC", "Xamarin.Forms.Grid.Opacity A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Seek Opacity Slider after observe")]
- [Step(3, "Pass If Opacity of Grid changed owtherwise false")]
- [Postcondition(1, "NA")]
- public async Task Opacity_UIBH()
- {
- _grid3 = new Grid
- {
- VerticalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.Blue,
- HeightRequest = 200,
- WidthRequest = 500
- };
-
- _grid3.Children.Add(new Label
- {
- Text = "This is A Grid.",
- TextColor = Color.White
- });
-
- var sliderOpacity = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.BlueViolet,
- Maximum = 1,
- Minimum = 0,
- Value = 1
- };
-
- _grid3.BindingContext = sliderOpacity;
- _grid3.SetBinding(Grid.OpacityProperty, "Value");
-
- var mainUI = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.White,
- Padding = new Thickness()
- {
- Top = 20,
- Bottom = 50,
- },
- Spacing = 25,
- Children =
- {
- _grid3,
- new StackLayout() {
- Orientation = StackOrientation.Horizontal,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Padding = new Thickness() {
- Left = 20,
- Right = 20,
- },
- Children =
- {
- new Label()
- {
- Text = "Opacity: ",
- },
- sliderOpacity
- }
- },
- }
- };
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = mainUI,
- Title = "Opacity Slider Test"
- });
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if background color is changing properly.")]
- [Property("SPEC", "Xamarin.Forms.Grid.BackgroundColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Select a Color after observe BackgroundColor of Grid is changed")]
- [Step(3, "Pass If BackgroundColor of Grid changed owtherwise false")]
- [Postcondition(1, "NA")]
- public async Task BackgroundColor_UILK()
- {
- _grid4 = new Grid
- {
- VerticalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.Blue,
- HeightRequest = 100,
- WidthRequest = 300
- };
-
- _grid4.Children.Add(new Label
- {
- Text = "This is A Grid.",
- TextColor = Color.White
- });
-
- var imageRed = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.Red,
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "RED",
- HorizontalTextAlignment = TextAlignment.Center,
- }
- }
- };
-
- var imageGreen = new StackLayout()
- {
- BackgroundColor = Color.Green,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "GREEN",
- HorizontalTextAlignment = TextAlignment.Center,
- }
- }
- };
-
- var imageGray = new StackLayout()
- {
- BackgroundColor = Color.Gray,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "GRAY",
- HorizontalTextAlignment = TextAlignment.Center,
- }
- }
- };
-
- var tapGestureRecognizerRed = new TapGestureRecognizer();
- tapGestureRecognizerRed.Tapped += async (s, e) =>
- {
- _grid4.BackgroundColor = Color.Red;
- await Task.Delay(2000);
- };
- imageRed.GestureRecognizers.Add(tapGestureRecognizerRed);
-
- var tapGestureRecognizerGreen = new TapGestureRecognizer();
- tapGestureRecognizerGreen.Tapped += async (s, e) =>
- {
- _grid4.BackgroundColor = Color.Green;
- await Task.Delay(2000);
- };
- imageGreen.GestureRecognizers.Add(tapGestureRecognizerGreen);
-
- var tapGestureRecognizerGray = new TapGestureRecognizer();
- tapGestureRecognizerGray.Tapped += async (s, e) =>
- {
- _grid4.BackgroundColor = Color.Gray;
- await Task.Delay(2000);
- };
- imageGray.GestureRecognizers.Add(tapGestureRecognizerGray);
-
- var mainUI = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.White,
-
- Children =
- {
- _grid4,
- new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 180,
- Orientation = StackOrientation.Horizontal,
- Spacing = 10,
- Padding = new Thickness()
- {
- Left = 20,
- Right = 20
- },
-
- Children =
- {
- imageRed,
- imageGreen,
- imageGray
- }
- }
- }
- };
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = mainUI,
- Title = "BackgoundColor Test"
- });
-
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if IsVisible is working properly.")]
- [Property("SPEC", "Xamarin.Forms.Grid.IsVisible A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(3, "Click item of Listview")]
- [Step(4, "Pass If IsVisible of Grid changed otherwise Fail")]
- [Postcondition(1, "NA")]
- public async Task IsVisible_UIBH()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "Visible";
- dataTest[1] = "Invisible";
- var text = "Select a IsVisible test";
- var title = "IsVisible Test";
- CreatePageTestToGrid(text, title, dataTest);
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[1]))
- {
- _grid5.IsVisible = false;
- }
- else
- {
- _grid5.IsVisible = true;
- }
- };
- await ManualTest.WaitForConfirm();
-
- /* POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if IsEnabled is working properly.")]
- [Property("SPEC", "Xamarin.Forms.Grid.IsEnabled A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(3, "Pass If IsEnabled of Grid changed owtherwise Fail")]
- [Postcondition(1, "NA")]
- public async Task IsEnabled_UIBH()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "Enable";
- dataTest[1] = "Disable";
- var text = "Select a IsEnabled test";
- var title = "IsEnabled Test";
-
- CreatePageTestToGrid(text, title, dataTest);
- _grid5.HeightRequest = 200;
- _grid5.WidthRequest = 300;
- _grid5.Children.Add(new Button
- {
- Text = "This is a button.",
- TextColor = Color.White,
- WidthRequest = 20,
- HeightRequest = 10
- }, 0, 1);
-
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[1]))
- {
- _grid5.IsEnabled = false;
- }
- else
- {
- _grid5.IsEnabled = true;
- }
- };
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if Scale is working properly.")]
- [Property("SPEC", "Xamarin.Forms.Grid.Scale A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(3, "Pass If Scale of Grid changed owtherwise Fail")]
- [Postcondition(1, "NA")]
- public async Task Scale_UIBH()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "0.5";
- dataTest[1] = "1.0";
- dataTest[2] = "2.0";
- var text = "Select a Scale test";
- var title = "Scale Test";
- CreatePageTestToGrid(text, title, dataTest);
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[0]))
- {
- _grid5.Scale = 0.5;
- }
- else if (controlTest.Name.Equals(dataTest[1]))
- {
- _grid5.Scale = 1.0;
- }
- else
- {
- _grid5.Scale = 2.0;
- }
- };
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if rotation is working properly.")]
- [Property("SPEC", "Xamarin.Forms.Grid.Rotation A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(3, "Pass If Rotation of Grid changed owtherwise Fail")]
- [Postcondition(1, "NA")]
- public async Task Rotation_UIBH()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "50";
- dataTest[1] = "90";
- dataTest[2] = "180";
- var text = "Select a Rotation test";
- var title = "Rotation Test";
- CreatePageTestToGrid(text, title, dataTest);
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[0]))
- {
- _grid5.Rotation = 50;
- }
- else if (controlTest.Name.Equals(dataTest[1]))
- {
- _grid5.Rotation = 90;
- }
- else
- {
- _grid5.Rotation = 180;
- }
- };
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if margin is changing properly.")]
- [Property("SPEC", "Xamarin.Forms.Grid.Margin A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(3, "Pass If Margin of Grid changed owtherwise False")]
- [Postcondition(1, "NA")]
- public async Task Margin_UIBH()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "MarginTop: 50";
- dataTest[1] = "MarginTop: 100";
- dataTest[2] = "MarginTop: 150";
- var text = "Select a Margin test";
- var title = "Margin Test";
- CreatePageTestToGrid(text, title, dataTest);
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[0]))
- {
- _grid5.Margin = new Thickness(0, 50, 0, 0);
- }
- else if (controlTest.Name.Equals(dataTest[1]))
- {
- _grid5.Margin = new Thickness(0, 100, 0, 0);
- }
- else
- {
- _grid5.Margin = new Thickness(0, 150, 0, 0);
- }
- };
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Change grid width and height with WidthRequest and HeightRequest respectively.")]
- [Property("SPEC", "Xamarin.Forms.Grid.Width A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Seek Silder for Width and Height after observe")]
- [Step(3, "Pass If Height and Width of Button changed owtherwise Fail")]
- [Postcondition(1, "NA")]
- public async Task WidthAndHeight_CHANGE_SIZE()
- {
- _grid6 = new Grid
- {
- HorizontalOptions = LayoutOptions.Center,
- BackgroundColor = Color.Blue,
- //HeightRequest = 100,
- //WidthRequest = 200,
- //Margin = 10
- };
- _grid6.Children.Add(new Label
- {
- Text = "This is A Grid.",
- TextColor = Color.Pink,
- HorizontalTextAlignment = TextAlignment.Center
- });
-
- var sliderHorizontal = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.Pink,
- Maximum = 500,
- Minimum = 100
- };
-
- var sliderVertical = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.Pink,
- Maximum = 500,
- Minimum = 80
- };
-
- if (Device.Idiom == TargetIdiom.Unsupported)
- {
- sliderVertical.Maximum = 200;
- sliderVertical.Minimum = 20;
- }
-
- sliderHorizontal.ValueChanged += (o, e) =>
- {
- _grid6.WidthRequest = sliderHorizontal.Value;
- _grid6.ForceLayout();
- };
-
- sliderVertical.ValueChanged += (o, e) =>
- {
- _grid6.HeightRequest = sliderVertical.Value;
- _grid6.ForceLayout();
- };
-
- var mainUI = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.White,
- Children =
- {
- _grid6,
- new StackLayout() {
- Orientation = StackOrientation.Horizontal,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- new Label()
- {
- Text = "Width: ",
- TextColor = Color.Pink
- },
- sliderHorizontal
- }
- },
- new StackLayout() {
- Orientation = StackOrientation.Horizontal,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- new Label()
- {
- Text = "Height: ",
- TextColor = Color.Pink
- },
- sliderVertical
- }
- }
- }
- };
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = mainUI,
- Title = "Size Button Test"
- });
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if SetColumn is working properly")]
- [Property("SPEC", "Xamarin.Forms.Grid.SetColumn M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click Run TC")]
- [Step(2, "Click Change Column button and check if last item column is changed.")]
- [Step(3, "Click BACK button: Mark Pass if column is changed or mark Fail.")]
- [Postcondition(1, "NA")]
- public async Task SetColumn_UIBH()
- {
- /* TEST CODE */
- _button1 = new Button
- {
- Text = "Change Column"
- };
-
- CustomGrid grid = new CustomGrid
- {
- VerticalOptions = LayoutOptions.FillAndExpand,
- RowDefinitions =
- {
- new RowDefinition { Height = new GridLength(1, GridUnitType.Auto) },
- }
- };
-
- grid.Children.Add(new Label
- {
- Text = "Test: SetColumn",
- HorizontalOptions = LayoutOptions.Center
- }, 0, 3, 0, 1);
-
- grid.Children.Add(new Label
- {
- Text = "Autosized cell",
- TextColor = Color.White,
- BackgroundColor = Color.Blue
- }, 0, 1);
-
- grid.Children.Add(new BoxView
- {
- Color = Color.Silver,
- HeightRequest = 0
- }, 1, 1);
-
- grid.Children.Add(new Label
- {
- Text = "Leftover space",
- TextColor = Color.Purple,
- BackgroundColor = Color.Aqua,
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center,
- }, 1, 2);
-
- grid.Children.Add(new Label
- {
- Text = "Span two rows (or more if you want)",
- TextColor = Color.Yellow,
- BackgroundColor = Color.Navy,
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center
- }, 2, 3, 1, 3);
-
- Label label = new Label
- {
- Text = "Last Item",
- TextColor = Color.Blue,
- BackgroundColor = Color.Yellow,
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center
- };
- grid.Children.Add(label, 0, 2);
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- grid,
- _button1
- },
- BackgroundColor = Color.White,
- },
- });
-
- _button1.Clicked += (sender, e) =>
- {
- Grid.SetColumn(label, 2);
- };
-
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if SetColumnSpan can set properly.")]
- [Property("SPEC", "Xamarin.Forms.Grid.SetColumnSpan M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click Run TC")]
- [Step(2, "Click button and check if column span is changed accordingly.")]
- [Step(3, "Click BACK button: Mark Pass if span is changed accordingly or mark Fail.")]
- [Postcondition(1, "NA")]
- public async Task SetColumnSpan_UIBH()
- {
- /* TEST CODE */
- _button1 = new Button
- {
- Text = "Span 2"
- };
-
- CustomGrid grid = new CustomGrid
- {
- VerticalOptions = LayoutOptions.FillAndExpand,
- RowDefinitions =
- {
- new RowDefinition { Height = new GridLength(1, GridUnitType.Auto) },
- }
- };
-
- grid.Children.Add(new Label
- {
- Text = "Test: SetColumnSpan",
- HorizontalOptions = LayoutOptions.Center
- }, 0, 3, 0, 1);
-
- grid.Children.Add(new Label
- {
- Text = "Autosized cell",
- TextColor = Color.White,
- BackgroundColor = Color.Blue
- }, 0, 1);
-
- grid.Children.Add(new BoxView
- {
- Color = Color.Silver,
- HeightRequest = 0
- }, 1, 1);
-
- grid.Children.Add(new BoxView
- {
- Color = Color.Teal
- }, 0, 2);
-
- grid.Children.Add(new Label
- {
- Text = "Leftover space",
- TextColor = Color.Purple,
- BackgroundColor = Color.Aqua,
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center,
- }, 1, 2);
-
- grid.Children.Add(new Label
- {
- Text = "Span two rows (or more if you want)",
- TextColor = Color.Yellow,
- BackgroundColor = Color.Navy,
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center
- }, 2, 3, 1, 3);
-
- Label label = new Label
- {
- Text = "Column Span 2",
- TextColor = Color.Blue,
- BackgroundColor = Color.Yellow,
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center
- };
- grid.Children.Add(label, 0, 2, 3, 4);
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- grid,
- _button1
- },
- BackgroundColor = Color.White,
- },
- });
-
- _button1.Clicked += (sender, e) =>
- {
- if (_button1.Text == "Span 2")
- {
- label.Text = "Column span 1";
- _button1.Text = "Span 1";
- Grid.SetColumnSpan(label, 1);
- }
- else
- {
- label.Text = "Column span 2";
- _button1.Text = "Span 2";
- Grid.SetColumnSpan(label, 2);
- }
- };
-
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if SetRow is working properly.")]
- [Property("SPEC", "Xamarin.Forms.Grid.SetRow M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click Run TC")]
- [Step(2, "Click Change Column button and check if last item row is changed.")]
- [Step(3, "Click BACK button: Mark Pass if row is changed or mark Fail.")]
- [Postcondition(1, "NA")]
- public async Task SetRow_UIBH()
- {
- /* TEST CODE */
- _button1 = new Button
- {
- Text = "Change Column"
- };
-
- CustomGrid grid = new CustomGrid
- {
- VerticalOptions = LayoutOptions.FillAndExpand,
- RowDefinitions =
- {
- new RowDefinition { Height = new GridLength(1, GridUnitType.Auto) },
- }
- };
-
- grid.Children.Add(new Label
- {
- Text = "Test: SetRow",
- HorizontalOptions = LayoutOptions.Center
- }, 0, 3, 0, 1);
-
- grid.Children.Add(new Label
- {
- Text = "Autosized cell",
- TextColor = Color.White,
- BackgroundColor = Color.Blue
- }, 0, 1);
-
- grid.Children.Add(new BoxView
- {
- Color = Color.Silver,
- HeightRequest = 0
- }, 1, 1);
-
- grid.Children.Add(new BoxView
- {
- Color = Color.Teal
- }, 0, 2);
-
- grid.Children.Add(new Label
- {
- Text = "Leftover space",
- TextColor = Color.Purple,
- BackgroundColor = Color.Aqua,
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center,
- }, 1, 2);
-
- grid.Children.Add(new Label
- {
- Text = "Span two rows (or more if you want)",
- TextColor = Color.Yellow,
- BackgroundColor = Color.Navy,
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center
- }, 2, 3, 1, 3);
-
- Label label = new Label
- {
- Text = "Last Item",
- TextColor = Color.Blue,
- BackgroundColor = Color.Yellow,
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center
- };
- grid.Children.Add(label, 0, 2, 3, 4);
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- grid,
- _button1
- },
- BackgroundColor = Color.White,
- },
- });
-
- _button1.Clicked += (sender, e) =>
- {
- Grid.SetRow(label, 1);
- };
-
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if row span can set properly.")]
- [Property("SPEC", "Xamarin.Forms.Grid.SetRowSpan M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click Run TC")]
- [Step(2, "Click button and check if row span is changed accordingly.")]
- [Step(3, "Click BACK button: Mark Pass if span is changed accordingly or mark Fail.")]
- [Postcondition(1, "NA")]
- public async Task SetRowSpan_UIBH()
- {
- /* TEST CODE */
- _button1 = new Button
- {
- Text = "Span 1"
- };
-
- CustomGrid grid = new CustomGrid
- {
- VerticalOptions = LayoutOptions.FillAndExpand,
- RowDefinitions =
- {
- new RowDefinition { Height = new GridLength(1, GridUnitType.Auto) },
- }
- };
-
- grid.Children.Add(new Label
- {
- Text = "Test: SetColumnSpan",
- HorizontalOptions = LayoutOptions.Center
- }, 0, 3, 0, 1);
-
- grid.Children.Add(new Label
- {
- Text = "Autosized cell",
- TextColor = Color.White,
- BackgroundColor = Color.Blue
- }, 0, 1);
-
- grid.Children.Add(new BoxView
- {
- Color = Color.Silver,
- HeightRequest = 0
- }, 1, 1);
-
- grid.Children.Add(new BoxView
- {
- Color = Color.Teal
- }, 0, 2);
-
- Label label = new Label
- {
- Text = "Row span 1",
- TextColor = Color.Purple,
- BackgroundColor = Color.Aqua,
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center,
- };
- grid.Children.Add(label, 1, 2);
-
- grid.Children.Add(new Label
- {
- Text = "Span two rows (or more if you want)",
- TextColor = Color.Yellow,
- BackgroundColor = Color.Navy,
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center
- }, 2, 3, 1, 3);
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- grid,
- _button1
- },
- BackgroundColor = Color.White,
- },
- });
-
- _button1.Clicked += (sender, e) =>
- {
- if (_button1.Text == "Span 2")
- {
- label.Text = "Row span 1";
- _button1.Text = "Span 1";
- Grid.SetRowSpan(label, 1);
- }
- else
- {
- label.Text = "Row span 2";
- _button1.Text = "Span 2";
- Grid.SetRowSpan(label, 2);
- }
- };
-
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if OnAdded is called when children is added.")]
- [Property("SPEC", "Xamarin.Forms.Grid.OnAdded M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click Run TC")]
- [Step(2, "Click Add Children button and check if a children is added.")]
- [Step(3, "Click BACK button: TC will Pass automatically or mark Fail.")]
- [Postcondition(1, "NA")]
- public async Task OnAdded_UIBH()
- {
- /* TEST CODE */
- _button1 = new Button
- {
- Text = "Add Children"
- };
-
- CustomGrid grid = new CustomGrid
- {
- VerticalOptions = LayoutOptions.FillAndExpand,
- RowDefinitions =
- {
- new RowDefinition { Height = new GridLength(1, GridUnitType.Auto) },
- }
- };
-
- grid.Children.Add(new Label
- {
- Text = "Test: OnAdded",
- HorizontalOptions = LayoutOptions.Center
- }, 0, 3, 0, 1);
-
- grid.Children.Add(new Label
- {
- Text = "Autosized cell",
- TextColor = Color.White,
- BackgroundColor = Color.Blue
- }, 0, 1);
-
- grid.Children.Add(new BoxView
- {
- Color = Color.Silver,
- HeightRequest = 0
- }, 1, 1);
-
- grid.Children.Add(new BoxView
- {
- Color = Color.Teal
- }, 0, 2);
-
- grid.Children.Add(new Label
- {
- Text = "Leftover space",
- TextColor = Color.Purple,
- BackgroundColor = Color.Aqua,
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center,
- }, 1, 2);
-
- grid.Children.Add(new Label
- {
- Text = "Span two rows (or more if you want)",
- TextColor = Color.Yellow,
- BackgroundColor = Color.Navy,
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center
- }, 2, 3, 1, 3);
-
- grid.Children.Add(new Label
- {
- Text = "Span 2 columns",
- TextColor = Color.Blue,
- BackgroundColor = Color.Yellow,
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center
- }, 0, 2, 3, 4);
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- grid,
- _button1
- },
- BackgroundColor = Color.White,
- },
- });
-
- _button1.Clicked += (sender, e) =>
- {
- grid.Children.Add(new Label
- {
- Text = "Fixed 100x100",
- TextColor = Color.Aqua,
- BackgroundColor = Color.Red,
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center
- }, 2, 3);
- };
-
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if OnBindingContextChanged is called when binding context is changed.")]
- [Property("SPEC", "Xamarin.Forms.Grid.OnBindingContextChanged M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click Run TC")]
- [Step(2, "Click Change Binding Context button.")]
- [Step(3, "Click BACK button: TC will Pass automatically or mark Fail.")]
- [Postcondition(1, "NA")]
- public async Task OnBindingContextChanged_UIBH()
- {
- /* TEST CODE */
- _button1 = new Button
- {
- Text = "Change Binding Context"
- };
-
- CustomGrid grid = new CustomGrid
- {
- VerticalOptions = LayoutOptions.FillAndExpand,
- RowDefinitions =
- {
- new RowDefinition { Height = new GridLength(1, GridUnitType.Auto) },
- }
- };
-
- CustomGrid gridNew = new CustomGrid
- {
- VerticalOptions = LayoutOptions.FillAndExpand,
- RowDefinitions =
- {
- new RowDefinition { Height = new GridLength(1, GridUnitType.Auto) },
- }
- };
-
- grid.Children.Add(new Label
- {
- Text = "Test: OnBindingContextChanged",
- HorizontalOptions = LayoutOptions.Center
- }, 0, 3, 0, 1);
-
- grid.Children.Add(new Label
- {
- Text = "Autosized cell",
- TextColor = Color.White,
- BackgroundColor = Color.Blue
- }, 0, 1);
-
- grid.Children.Add(new BoxView
- {
- Color = Color.Silver,
- HeightRequest = 0
- }, 1, 1);
-
- grid.Children.Add(new BoxView
- {
- Color = Color.Teal
- }, 0, 2);
-
- Label leftover = new Label
- {
- Text = "Leftover space",
- TextColor = Color.Purple,
- BackgroundColor = Color.Aqua,
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center,
- };
- grid.Children.Add(leftover, 1, 2);
-
- grid.Children.Add(new Label
- {
- Text = "Span two rows (or more if you want)",
- TextColor = Color.Yellow,
- BackgroundColor = Color.Navy,
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center
- }, 2, 3, 1, 3);
-
- Label label = new Label
- {
- Text = "Span 2 columns",
- TextColor = Color.Blue,
- BackgroundColor = Color.Yellow,
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center
- };
- gridNew.Children.Add(label, 0, 1, 3, 4);
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- grid,
- gridNew,
- _button1
- },
- BackgroundColor = Color.White,
- },
- });
-
- _button1.Clicked += (sender, e) =>
- {
- gridNew.BindingContext = grid;
- gridNew.SetBinding(Grid.ColumnSpanProperty, "ColumnSpan");
- };
-
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if OnRemoved is called when children is removed.")]
- [Property("SPEC", "Xamarin.Forms.Grid.OnRemoved M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click Run TC")]
- [Step(2, "Click Remove Children button and check if a children is removed.")]
- [Step(3, "Click BACK button: TC will Pass automatically or mark Fail.")]
- [Postcondition(1, "NA")]
- public async Task OnRemoved_UIBH()
- {
- /* TEST CODE */
- _button1 = new Button
- {
- Text = "Remove Children"
- };
-
- CustomGrid grid = new CustomGrid
- {
- VerticalOptions = LayoutOptions.FillAndExpand,
- RowDefinitions =
- {
- new RowDefinition { Height = new GridLength(1, GridUnitType.Auto) },
- }
- };
-
- grid.Children.Add(new Label
- {
- Text = "Test: OnRemoved",
- HorizontalOptions = LayoutOptions.Center
- }, 0, 3, 0, 1);
-
- grid.Children.Add(new Label
- {
- Text = "Autosized cell",
- TextColor = Color.White,
- BackgroundColor = Color.Blue
- }, 0, 1);
-
- grid.Children.Add(new BoxView
- {
- Color = Color.Silver,
- HeightRequest = 0
- }, 1, 1);
-
- grid.Children.Add(new BoxView
- {
- Color = Color.Teal
- }, 0, 2);
-
- grid.Children.Add(new Label
- {
- Text = "Leftover space",
- TextColor = Color.Purple,
- BackgroundColor = Color.Aqua,
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center,
- }, 1, 2);
-
- grid.Children.Add(new Label
- {
- Text = "Span two rows (or more if you want)",
- TextColor = Color.Yellow,
- BackgroundColor = Color.Navy,
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center
- }, 2, 3, 1, 3);
-
- grid.Children.Add(new Label
- {
- Text = "Span 2 columns",
- TextColor = Color.Blue,
- BackgroundColor = Color.Yellow,
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center
- }, 0, 2, 3, 4);
-
- var label = new Label
- {
- Text = "Fixed 100x100",
- TextColor = Color.Aqua,
- BackgroundColor = Color.Red,
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center
- };
-
- grid.Children.Add(label, 2, 3);
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- grid,
- _button1
- },
- BackgroundColor = Color.White,
- },
- });
-
- _button1.Clicked += (sender, e) =>
- {
- grid.Children.Remove(label);
- };
-
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if OnSizeRequest is called when an attempt is made to resize this Grid element.")]
- [Property("SPEC", "Xamarin.Forms.Grid.OnSizeRequest M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click Run TC")]
- [Step(2, "Click button to change row span.")]
- [Step(3, "Click BACK button: TC will Pass automatically or mark Fail.")]
- [Postcondition(1, "NA")]
- public async Task OnSizeRequest_UIBH()
- {
- /* TEST CODE */
- _button1 = new Button
- {
- Text = "Span 2"
- };
-
- CustomGrid grid = new CustomGrid
- {
- VerticalOptions = LayoutOptions.FillAndExpand,
- RowDefinitions =
- {
- new RowDefinition { Height = new GridLength(1, GridUnitType.Auto) },
- }
- };
-
- grid.Children.Add(new Label
- {
- Text = "Test: SetColumnSpan",
- HorizontalOptions = LayoutOptions.Center
- }, 0, 3, 0, 1);
-
- grid.Children.Add(new Label
- {
- Text = "Autosized cell",
- TextColor = Color.White,
- BackgroundColor = Color.Blue
- }, 0, 1);
-
- grid.Children.Add(new BoxView
- {
- Color = Color.Silver,
- HeightRequest = 0
- }, 1, 1);
-
- grid.Children.Add(new BoxView
- {
- Color = Color.Teal
- }, 0, 2);
-
- grid.Children.Add(new Label
- {
- Text = "Leftover space",
- TextColor = Color.Purple,
- BackgroundColor = Color.Aqua,
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center,
- }, 1, 2);
-
- grid.Children.Add(new Label
- {
- Text = "Span two rows (or more if you want)",
- TextColor = Color.Yellow,
- BackgroundColor = Color.Navy,
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center
- }, 2, 3, 1, 3);
-
- Label label = new Label
- {
- Text = "Column Span 2",
- TextColor = Color.Blue,
- BackgroundColor = Color.Yellow,
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center
- };
- grid.Children.Add(label, 0, 2, 3, 4);
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- grid,
- _button1
- },
- BackgroundColor = Color.White,
- },
- });
- isSizeChanged = true;
-
- _button1.Clicked += (sender, e) =>
- {
- if (_button1.Text == "Span 2")
- {
- label.Text = "Column span 1";
- _button1.Text = "Span 1";
- Grid.SetColumnSpan(label, 1);
- }
- else
- {
- label.Text = "Column span 2";
- _button1.Text = "Span 2";
- Grid.SetColumnSpan(label, 2);
- }
- };
-
- await ManualTest.WaitForConfirm();
- isSizeChanged = false;
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System;
-using System.Collections.Generic;
-using System.Threading.Tasks;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class ImageTests
- {
- private static Image _imageOne, _imageTwo, _imageThree;
- private static Label _labelOne, _labelTwo, _labelThree;
- private static Button _button;
- private static TestPage _testPage = TestPage.GetInstance();
-
- [SetUp]
- public void SetUp()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Image CLASS: Setup---------------------------------");
- _imageOne = new Image();
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Image CLASS: Teardown---------------------------------");
- _imageOne = null;
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Image BanckgroundColor is displayed property.")]
- [Property("SPEC", "Xamarin.Forms.Image.BackgroundColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click the button to change BanckgroundColor accordingly.")]
- [Step(3, "Click BACK button: Click Pass if image BanckgroundColor is changed accordingly.")]
- [Postcondition(1, "NA")]
- public async Task BackgroundColor_UILK()
- {
- /*TEST CODE*/
- _button = new Button();
- _button.Text = "Red";
- _labelOne = new Label
- {
- Text = "Click button to change Background Color."
- };
-
- _imageOne.Source = "../shared/res/Tizen.XamarinForms.Manual.Tests.png";
- _imageOne.HeightRequest = 100;
- _imageOne.WidthRequest = 100;
- _imageOne.Aspect = Aspect.AspectFit;
- _imageOne.BackgroundColor = Color.Green;
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _labelOne,
- _imageOne,
- _button
- }
- },
- Title = "Test: BackgroundColor",
- BackgroundColor = Color.White
- };
-
- _button.Clicked += onRedOrGreen;
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _button.Clicked -= onRedOrGreen;
- }
-
- private void onRedOrGreen(object sender, System.EventArgs e)
- {
- if (_button.Text == "Red")
- {
- _imageOne.BackgroundColor = Color.Red;
- _button.Text = "Green";
- }
- else
- {
- _imageOne.BackgroundColor = Color.Green;
- _button.Text = "Red";
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Image is displayed with proper WidthRequest property.")]
- [Property("SPEC", "Xamarin.Forms.Image.WidthRequest A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Check if Image is diplayed with proper WidthRequest property.")]
- [Step(3, "Click BACK button: Click Pass if WidthRequest property is working properly.")]
- [Postcondition(1, "NA")]
- public async Task WidthRequest_UIBH()
- {
- /*TEST CODE*/
- _labelOne = new Label
- {
- Text = "Width of below image is 50."
- };
-
- _imageOne.Source = "../shared/res/Tizen.XamarinForms.Manual.Tests.png";
- _imageOne.WidthRequest = 50;
- _imageOne.Aspect = Aspect.AspectFit;
-
- _labelTwo = new Label
- {
- Text = "Width of below image is 200."
- };
-
- _imageTwo = new Image
- {
- Source = "../shared/res/Tizen.XamarinForms.Manual.Tests.png",
- WidthRequest = 200,
- Aspect = Aspect.AspectFit
- };
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _labelOne,
- _imageOne,
- _labelTwo,
- _imageTwo
- }
- },
- Title = "Test: WidthRequest",
- BackgroundColor = Color.White
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Image is displayed with proper HeightRequest property.")]
- [Property("SPEC", "Xamarin.Forms.Image.HeightRequest A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Move the slider position to check if Image height is changing..")]
- [Step(3, "Click BACK button: Click Pass if Height changes accordingly.")]
- [Postcondition(1, "NA")]
- public async Task HeightRequest_UIBH()
- {
- /*TEST CODE*/
- _labelOne = new Label
- {
- Text = "Move the slider position to change height."
- };
-
- var sliderHeight = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.BlueViolet,
- Maximum = 300,
- Minimum = 100,
- Value = 10
- };
-
- _imageOne.WidthRequest = 100;
- _imageOne.Source = "../shared/res/Tizen.XamarinForms.Manual.Tests.png";
- _imageOne.BindingContext = sliderHeight;
- _imageOne.SetBinding(Image.HeightRequestProperty, "Value");
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _labelOne,
- _imageOne,
- sliderHeight
- }
- },
- Title = "Test: HeightRequest",
- BackgroundColor = Color.White
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Image is displayed with proper Opacity property.")]
- [Property("SPEC", "Xamarin.Forms.Image.Opacity A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Move the slider position to check if Image Opacity is changing..")]
- [Step(3, "Click BACK button: Click Pass if Opacity changes accordingly.")]
- [Postcondition(1, "NA")]
- public async Task Opacity_UIBH()
- {
- /*TEST CODE*/
- var sliderOpacity = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.BlueViolet,
- Maximum = 1,
- Minimum = 0,
- Value = 1
- };
-
- _imageOne.Source = "../shared/res/Tizen.XamarinForms.Manual.Tests.png";
- _imageOne.BindingContext = sliderOpacity;
- _imageOne.SetBinding(Image.OpacityProperty, "Value");
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _imageOne,
- sliderOpacity
- }
- },
- Title = "Test: Opacity",
- BackgroundColor = Color.White
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Image is displayed with proper Margin property.")]
- [Property("SPEC", "Xamarin.Forms.Image.Margin A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Move the slider position to check if Image Margin is changing..")]
- [Step(3, "Click BACK button: Click Pass if Margin changes accordingly.")]
- [Postcondition(1, "NA")]
- public async Task Margin_UIBH()
- {
- /*TEST CODE*/
-
- var sliderMargin = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.BlueViolet,
- Maximum = 100,
- Minimum = 10,
- Value = 5
- };
-
- _imageOne.Source = "../shared/res/Tizen.XamarinForms.Manual.Tests.png";
- _imageOne.BindingContext = sliderMargin;
- _imageOne.SetBinding(Image.MarginProperty, "Value");
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _imageOne,
- sliderMargin
- }
- },
- Title = "Test: Margin",
- BackgroundColor = Color.White
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Image visibility is changed properly.")]
- [Property("SPEC", "Xamarin.Forms.Image.IsVisible A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click the Button to change visibility.")]
- [Step(3, "Click BACK button: Click Pass if visibility is changed accordingliy.")]
- [Postcondition(1, "NA")]
- public async Task IsVisible_UIBH()
- {
- /*TEST CODE*/
- _button = new Button();
- _button.Text = "Hide";
- _labelOne = new Label
- {
- Text = "Click the button to change visibility."
- };
-
- _imageOne.Source = "../shared/res/Tizen.XamarinForms.Manual.Tests.png";
- _imageOne.HeightRequest = 100;
- _imageOne.WidthRequest = 100;
- _imageOne.Aspect = Aspect.AspectFit;
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _imageOne,
- _button
- }
- },
- Title = "Test: IsVisible",
- BackgroundColor = Color.White
- };
-
- _button.Clicked += onShowOrHide;
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _button.Clicked -= onShowOrHide;
- }
-
- private void onShowOrHide(object sender, System.EventArgs e)
- {
- if (_button.Text == "Hide")
- {
- _imageOne.IsVisible = false;
- _button.Text = "Show";
- }
- else
- {
- _imageOne.IsVisible = true;
- _button.Text = "Hide";
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Image is displayed with proper Scale property.")]
- [Property("SPEC", "Xamarin.Forms.Image.Scale A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Move slider to change the scaling value.")]
- [Step(3, "Click BACK button: Click Pass if scaling is working.")]
- [Postcondition(1, "NA")]
- public async Task Scale_UIBH()
- {
- /*TEST CODE*/
-
- var sliderScale = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.BlueViolet,
- Maximum = 1,
- Minimum = 0.5,
- Value = 1
- };
-
- _imageOne.Source = "../shared/res/Tizen.XamarinForms.Manual.Tests.png";
- _imageOne.BindingContext = sliderScale;
- _imageOne.SetBinding(Image.ScaleProperty, "Value");
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _imageOne,
- sliderScale
- }
- },
- Title = "Test: Scale",
- BackgroundColor = Color.White
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Image is displayed with proper Rotation property.")]
- [Property("SPEC", "Xamarin.Forms.Image.Rotation A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Move the slider position to apply rotation.")]
- [Step(3, "Click BACK button: Click Pass if rotation is working propertly.")]
- [Postcondition(1, "NA")]
- public async Task Rotation_UIBH()
- {
- /*TEST CODE*/
-
- var sliderRotation = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.BlueViolet,
- Maximum = 360,
- Minimum = 0,
- Value = 5
- };
-
- _imageOne.Source = "../shared/res/Tizen.Image.png";
- _imageOne.BindingContext = sliderRotation;
- _imageOne.SetBinding(Image.RotationProperty, "Value");
- _imageOne.Margin = 50;
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _imageOne,
- sliderRotation
- }
- },
- Title = "Test: Rotation",
- BackgroundColor = Color.White
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Image is displayed with proper Aspect property.")]
- [Property("SPEC", "Xamarin.Forms.Image.Aspect A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Check if Image is diplayed with proper Aspect property.")]
- [Step(3, "Click BACK button: Click Pass if Aspect property is working properly.")]
- [Postcondition(1, "NA")]
- public async Task Aspect_UIBH()
- {
- /*TEST CODE*/
- _imageOne.Source = "../shared/res/Tizen.XamarinForms.Manual.Tests.png";
- _imageOne.HeightRequest = 100;
- _imageOne.WidthRequest = 100;
- _imageOne.Aspect = Aspect.AspectFill;
-
- _imageTwo = new Image
- {
- Source = "../shared/res/Tizen.XamarinForms.Manual.Tests.png",
- HeightRequest = 100,
- WidthRequest = 100,
- Aspect = Aspect.AspectFit
- };
-
- _imageThree = new Image
- {
- Source = "../shared/res/Tizen.XamarinForms.Manual.Tests.png",
- HeightRequest = 100,
- WidthRequest = 100,
- Aspect = Aspect.Fill
- };
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _imageOne,
- _imageTwo,
- _imageThree
- }
- },
- Title = "Test: Aspect",
- BackgroundColor = Color.White
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Image is displayed with proper IsOpaque property.")]
- [Property("SPEC", "Xamarin.Forms.Image.IsOpaque A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Check if Image is diplayed with proper IsOpaque property.")]
- [Step(3, "Click BACK button: Click Pass if IsOpaque property is working properly.")]
- [Postcondition(1, "NA")]
- public async Task IsOpaque_UIBH()
- {
- /*TEST CODE*/
-
- _imageOne.Source = "../shared/res/Tizen.XamarinForms.Manual.Tests.png";
- _imageOne.HeightRequest = 100;
- _imageOne.WidthRequest = 100;
- _imageOne.IsOpaque = false;
-
- _imageTwo = new Image
- {
- Source = "../shared/res/Tizen.XamarinForms.Manual.Tests.png",
- HeightRequest = 100,
- WidthRequest = 100,
- IsOpaque = true
- };
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _imageOne,
- _imageTwo
- }
- },
- Title = "Test: IsOpaque",
- BackgroundColor = Color.White
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Image is displayed using Source property.")]
- [Property("SPEC", "Xamarin.Forms.Image.Source A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Check if an Image is diplayed.")]
- [Step(3, "Click BACK button: Click Pass if an Image is visible.")]
- [Postcondition(1, "NA")]
- public async Task Source_UIBH()
- {
- /*TEST CODE*/
-
- _imageOne.Source = ImageSource.FromFile("../shared/res/Tizen.XamarinForms.Manual.Tests.png");
- _imageOne.HeightRequest = 100;
- _imageOne.WidthRequest = 100;
- _imageOne.IsOpaque = false;
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _imageOne
- }
- },
- Title = "Test: Source",
- BackgroundColor = Color.White
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System;
-using System.Collections.Generic;
-using System.Threading.Tasks;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class ImageCellTests
- {
- private static ImageCell _imageCellOne, _imageCellTwo;
- private static Label _labelOne, _labelTwo;
- private static TestPage _testPage = TestPage.GetInstance();
-
- [SetUp]
- public void SetUp()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "ImageCell CLASS: Setup---------------------------------");
- _imageCellOne = new ImageCell();
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "ImageCell CLASS: Teardown---------------------------------");
- _imageCellOne = null;
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if imagesource displays Image.")]
- [Property("SPEC", "Xamarin.Forms.ImageCell.ImageSource A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Check if an Image is diplayed.")]
- [Step(3, "Click BACK button: Click Pass if an Image is visible.")]
- [Postcondition(1, "NA")]
- public async Task ImageSource_UIBH()
- {
- /*TEST CODE*/
- _labelOne = new Label
- {
- Text = "An image should be displayed below."
- };
- _imageCellOne.ImageSource = ImageSource.FromFile("../shared/res/Tizen.XamarinForms.Manual.Tests.png");
-
- TableView tableView = new TableView
- {
- Intent = TableIntent.Form,
- Root = new TableRoot
- {
- new TableSection
- {
- _imageCellOne
- }
- }
- };
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _labelOne,
- tableView
- }
- },
- Title = "Test: ImageSource",
- BackgroundColor = Color.White
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System;
-using System.Collections.Generic;
-using System.Threading.Tasks;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class LabelTests
- {
- private static Label _labelOne, _labelTwo;
- private static Button _button;
- private static TestPage _testPage = TestPage.GetInstance();
-
- [SetUp]
- public void SetUp()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Label CLASS: Setup---------------------------------");
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Label CLASS: Teardown---------------------------------");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Label BanckgroundColor is displayed property.")]
- [Property("SPEC", "Xamarin.Forms.Label.BackgroundColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Check if Label BanckgroundColor is Purple.")]
- [Step(3, "Click BACK button: Click Pass if Label BanckgroundColor is Purple.")]
- [Postcondition(1, "NA")]
- public async Task BackgroundColor_UILK()
- {
- /*TEST CODE*/
- _labelOne = new Label
- {
- Text = "Background Color of this text should be purple.",
- BackgroundColor = Color.Purple
- };
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _labelOne
- }
- },
- Title = "Test: BackgroundColor"
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Label is displayed with proper WidthRequest property.")]
- [Property("SPEC", "Xamarin.Forms.Label.WidthRequest A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Move slider position to check if width is working properly.")]
- [Step(3, "Click BACK button: Click Pass if Height is minimum when Width is maximum.")]
- [Postcondition(1, "NA")]
- public async Task WidthRequest_UIBH()
- {
- /*TEST CODE*/
- _labelOne = new Label
- {
- HorizontalOptions = LayoutOptions.Start,
- VerticalOptions = LayoutOptions.Start,
- Text = "Move the cursor position to change width.",
- BackgroundColor = Color.Purple
- };
-
- var sliderOpacity = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.BlueViolet,
- Maximum = 300,
- Minimum = 0,
- Value = 200
- };
-
- _labelOne.BindingContext = sliderOpacity;
- _labelOne.SetBinding(Label.WidthRequestProperty, "Value");
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _labelOne,
- sliderOpacity
- }
- },
- Title = "Test: WidthRequest"
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Label is displayed with proper HeightRequest property.")]
- [Property("SPEC", "Xamarin.Forms.Label.HeightRequest A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Move the slider position to check if Label height is changing.")]
- [Step(3, "Click BACK button: Click Pass if Height changes accordingly.")]
- [Postcondition(1, "NA")]
- public async Task HeightRequest_UIBH()
- {
- /*TEST CODE*/
- _labelOne = new Label
- {
- Text = "Move the slider position to change height.",
- BackgroundColor = Color.Purple
- };
-
- var sliderHeight = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.BlueViolet,
- Maximum = 300,
- Minimum = 100,
- Value = 10
- };
-
- _labelOne.BindingContext = sliderHeight;
- _labelOne.SetBinding(Label.HeightRequestProperty, "Value");
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _labelOne,
- sliderHeight
- }
- },
- Title = "Test: HeightRequest"
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Label is displayed with proper Opacity property.")]
- [Property("SPEC", "Xamarin.Forms.Label.Opacity A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Move the slider position to check if Label Opacity is changing..")]
- [Step(3, "Click BACK button: Click Pass if Opacity changes accordingly.")]
- [Postcondition(1, "NA")]
- public async Task Opacity_UIBH()
- {
- /*TEST CODE*/
- _labelOne = new Label
- {
- Text = "Move the silder position to change Opacity.",
- BackgroundColor = Color.Purple
- };
-
- var sliderOpacity = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.BlueViolet,
- Maximum = 1,
- Minimum = 0,
- Value = 1
- };
-
- _labelOne.BindingContext = sliderOpacity;
- _labelOne.SetBinding(Label.OpacityProperty, "Value");
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _labelOne,
- sliderOpacity
- }
- },
- Title = "Test: Opacity"
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Label is displayed with proper Margin property.")]
- [Property("SPEC", "Xamarin.Forms.Label.Margin A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Move the slider position to check if Label Margin is changing..")]
- [Step(3, "Click BACK button: Click Pass if Margin changes accordingly.")]
- [Postcondition(1, "NA")]
- public async Task Margin_UIBH()
- {
- /*TEST CODE*/
- _labelOne = new Label
- {
- Text = "Move the silder position to change Margin.",
- BackgroundColor = Color.Purple
- };
-
- var sliderMargin = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.BlueViolet,
- Maximum = 100,
- Minimum = 10,
- Value = 5
- };
-
- _labelOne.BindingContext = sliderMargin;
- _labelOne.SetBinding(Label.MarginProperty, "Value");
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _labelOne,
- sliderMargin
- }
- },
- Title = "Test: Margin"
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Label visibility is changed properly.")]
- [Property("SPEC", "Xamarin.Forms.Label.IsVisible A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click the Button to change visibility.")]
- [Step(3, "Click BACK button: Click Pass if visibility is changed accordingliy.")]
- [Postcondition(1, "NA")]
- public async Task IsVisible_UIBH()
- {
- /*TEST CODE*/
- _button = new Button();
- _button.Text = "Hide";
- _labelOne = new Label
- {
- Text = "Click the button to change visibility.",
- BackgroundColor = Color.Purple
- };
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _labelOne,
- _button
- }
- },
- Title = "Test: IsVisible"
- };
-
- _button.Clicked += onShowOrHide;
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _button.Clicked -= onShowOrHide;
- }
-
- private void onShowOrHide(object sender, System.EventArgs e)
- {
- if (_button.Text == "Hide")
- {
- _labelOne.IsVisible = false;
- _button.Text = "Show";
- }
- else
- {
- _labelOne.IsVisible = true;
- _button.Text = "Hide";
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Label is displayed with proper Scale property.")]
- [Property("SPEC", "Xamarin.Forms.Label.Scale A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Move slider to change the scaling value.")]
- [Step(3, "Click BACK button: Click Pass if scaling is working.")]
- [Postcondition(1, "NA")]
- public async Task Scale_UIBH()
- {
- /*TEST CODE*/
- _labelOne = new Label
- {
- Text = "Move the slider position to change the scaling value.",
- BackgroundColor = Color.Purple
- };
-
- var sliderScale = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.BlueViolet,
- Maximum = 2,
- Minimum = 0.5,
- Value = 0.3
- };
-
- _labelOne.BindingContext = sliderScale;
- _labelOne.SetBinding(Label.ScaleProperty, "Value");
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _labelOne,
- sliderScale
- }
- },
- Title = "Test: Scale"
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Label is displayed with proper Rotation property.")]
- [Property("SPEC", "Xamarin.Forms.Label.Rotation A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Move the slider position to apply rotation.")]
- [Step(3, "Click BACK button: Click Pass if rotation is working propertly.")]
- [Postcondition(1, "NA")]
- public async Task Rotation_UIBH()
- {
- /*TEST CODE*/
- _labelOne = new Label
- {
- Text = "Move the slider position to apply rotation",
- BackgroundColor = Color.Purple
- };
-
- var sliderRotation = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.BlueViolet,
- Maximum = 360,
- Minimum = 0,
- Value = 5
- };
-
- _labelOne.BindingContext = sliderRotation;
- _labelOne.SetBinding(Label.RotationProperty, "Value");
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _labelOne,
- sliderRotation
- }
- },
- Title = "Test: Rotation"
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Label is displayed with proper FontAttributes property.")]
- [Property("SPEC", "Xamarin.Forms.Label.FontAttributes A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Check if two labels are displayed with different FontAttributes.")]
- [Step(3, "Click BACK button: Click Pass if Labels are showing proper FontAttributes.")]
- [Postcondition(1, "NA")]
- public async Task FontAttributes_UILK()
- {
- /*TEST CODE*/
- _labelOne = new Label
- {
- Text = "This line should be Bold.",
- FontAttributes = FontAttributes.Bold
- };
-
- _labelTwo = new Label
- {
- Text = "This line should be Italic.",
- FontAttributes = FontAttributes.Italic
- };
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _labelOne,
- _labelTwo
- }
- },
- Title = "Test: FontAttributes",
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Label is displayed with proper FontFamily property.")]
- [Property("SPEC", "Xamarin.Forms.Label.FontFamily A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Check if two labels are displayed with different FontFamily.")]
- [Step(3, "Click BACK button: Click Pass if Labels are showing different FontFamily.")]
- [Postcondition(1, "NA")]
- public async Task FontFamily_UILK()
- {
- /*TEST CODE*/
- _labelOne = new Label
- {
- Text = "This line is in Times New Roman.",
- FontFamily = "Times New Roman"
- };
-
- _labelTwo = new Label
- {
- Text = "This line should is in Sans:style=Bold.",
- FontFamily = "Sans:style=Bold"
- };
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _labelOne,
- _labelTwo
- }
- },
- Title = "Test: FontFamily"
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Label is displayed with proper FontSize property.")]
- [Property("SPEC", "Xamarin.Forms.Label.FontSize A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Check if two labels are displayed with different FontSize.")]
- [Step(3, "Click BACK button: Click Pass if Labels are showing proper FontSize.")]
- [Postcondition(1, "NA")]
- public async Task FontSize_UIBH()
- {
- var size = 10;
-
- if ((Device.Idiom == TargetIdiom.Phone) || (Device.Idiom == TargetIdiom.TV))
- {
- size = size * 2;
- }
-
- /*TEST CODE*/
- _labelOne = new Label
- {
- Text = "FontSize " + size,
- FontAttributes = FontAttributes.Bold,
- FontSize = size
- };
-
- _labelTwo = new Label
- {
- Text = "FontSize " + (size * 2),
- FontAttributes = FontAttributes.Bold,
- FontSize = (size * 2)
- };
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _labelOne,
- _labelTwo
- }
- },
- Title = "Test: FontSize"
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Label is displayed with proper FormattedText property.")]
- [Property("SPEC", "Xamarin.Forms.Label.FormattedText A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Check if 3 texts are matched with looks.")]
- [Step(3, "Click BACK button: Click Pass if FormattedText is matched.")]
- [Postcondition(1, "NA")]
- public async Task FormattedText_UILK()
- {
- /*TEST CODE*/
-
- var fstring = new FormattedString();
- fstring.Spans.Add(new Span { Text = "Red bold ", ForegroundColor = Color.Red, FontAttributes = FontAttributes.Bold });
- fstring.Spans.Add(new Span { Text = "Default " });
- fstring.Spans.Add(new Span { Text = "italic small", FontAttributes = FontAttributes.Italic, FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label)) });
-
- _labelTwo = new Label
- {
- FormattedText = fstring
- };
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _labelTwo
- }
- },
- Title = "Test: FormattedText"
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Label is displayed with proper HorizontalTextAlignment property.")]
- [Property("SPEC", "Xamarin.Forms.Label.HorizontalTextAlignment A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Check if two labels are displayed with different HorizontalTextAlignment.")]
- [Step(3, "Click BACK button: Click Pass if Labels are showing proper HorizontalTextAlignment.")]
- [Postcondition(1, "NA")]
- public async Task HorizontalTextAlignment_UIBH()
- {
- /*TEST CODE*/
- _labelOne = new Label
- {
- Text = "Text Alignment of this line should be from Start.",
- HorizontalTextAlignment = TextAlignment.Start
- };
-
- _labelTwo = new Label
- {
- Text = "Text Alignment of this line should be from End.",
- HorizontalTextAlignment = TextAlignment.End
- };
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _labelOne,
- _labelTwo
- }
- },
- Title = "Test: HorizontalTextAlignment"
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Label is displayed with proper LineBreakMode property.")]
- [Property("SPEC", "Xamarin.Forms.Label.LineBreakMode A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Check if two labels are displayed with different LineBreakMode.")]
- [Step(3, "Click BACK button: Click Pass if Labels are showing proper LineBreakMode.")]
- [Postcondition(1, "NA")]
- public async Task LineBreakMode_UILK()
- {
- string text1 = "LineBreakMode test with CharacterWrap";
- string text2 = "LineBreakMode test with WordWrap";
- if ((Device.Idiom == TargetIdiom.Phone) || (Device.Idiom == TargetIdiom.TV))
- {
- text1 = "LineBreakMode of this line should is CharacterWrap.LineBreakMode of this line should is CharacterWrap. LineBreakMode of this line should is CharacterWrap.LineBreakMode of this line should is CharacterWrap. LineBreakMode of this line should is CharacterWrap.LineBreakMode of this line should is CharacterWrap. LineBreakMode of this line should is CharacterWrap.LineBreakMode of this line should is CharacterWrap. LineBreakMode of this line should is CharacterWrap.LineBreakMode of this line should is CharacterWrap.";
- text2 = "LineBreakMode of this line should is WordWrap.LineBreakMode of this line should is WordWrap. LineBreakMode of this line should is WordWrap.LineBreakMode of this line should is WordWrap. LineBreakMode of this line should is WordWrap.LineBreakMode of this line should is WordWrap. LineBreakMode of this line should is WordWrap.LineBreakMode of this line should is WordWrap.";
- }
-
- /*TEST CODE*/
- _labelOne = new Label
- {
- Text = text1,
- LineBreakMode = LineBreakMode.CharacterWrap
- };
-
- _labelTwo = new Label
- {
- Text = text2,
- LineBreakMode = LineBreakMode.WordWrap
- };
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _labelOne,
- _labelTwo
- }
- },
- Title = "Test: LineBreakMode"
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Label is displayed with proper Text property.")]
- [Property("SPEC", "Xamarin.Forms.Label.Text A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Check if a label is displayed with Text.")]
- [Step(3, "Click BACK button: Click Pass if Label is are showing properly.")]
- [Postcondition(1, "NA")]
- public async Task Text_UILK()
- {
- /*TEST CODE*/
- _labelOne = new Label
- {
- Text = "This text should be visible.",
- LineBreakMode = LineBreakMode.CharacterWrap
- };
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _labelOne
- }
- },
- Title = "Test: Text"
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Label is displayed with proper TextColor property.")]
- [Property("SPEC", "Xamarin.Forms.Label.TextColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Check if two labels are displayed with different TextColor.")]
- [Step(3, "Click BACK button: Click Pass if Labels are showing proper TextColor.")]
- [Postcondition(1, "NA")]
- public async Task TextColor_UIBH()
- {
- /*TEST CODE*/
- _labelOne = new Label
- {
- Text = "Text color of this line should be Green.",
- TextColor = Color.Green
- };
-
- _labelTwo = new Label
- {
- Text = "Text color of this line should be Red",
- TextColor = Color.Red
- };
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _labelOne,
- _labelTwo
- }
- },
- Title = "Test: TextColor"
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- // Currently, Xamarin Forms Limitations
- //[Test]
- [Category("P1")]
- [Description("Check whether Label is displayed with proper VerticalTextAlignment property.")]
- [Property("SPEC", "Xamarin.Forms.Label.VerticalTextAlignment A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Check if two labels are displayed with different VerticalTextAlignment.")]
- [Step(3, "Click BACK button: Click Pass if Labels are showing proper VerticalTextAlignment.")]
- [Postcondition(1, "NA")]
- public async Task VerticalTextAlignment_UIBH()
- {
- /*TEST CODE*/
- _labelOne = new Label
- {
- Text = "Alignment of this text is Start.",
- VerticalTextAlignment = TextAlignment.Start
- };
-
- _labelTwo = new Label
- {
- Text = "Alignment of this text is Center.",
- VerticalTextAlignment = TextAlignment.Center
- };
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _labelOne,
- _labelTwo
- }
- },
- Title = "Test: VerticalTextAlignment"
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Threading.Tasks;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class ListViewTests
- {
- private static ListView _listView;
- private static Button _button;
- private static Label _labelOne;
- private static TestPage _testPage = TestPage.GetInstance();
-
- [SetUp]
- public void SetUp()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "ListView CLASS: Setup---------------------------------");
- _listView = new ListView();
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "ListView CLASS: Teardown---------------------------------");
- _listView = null;
- }
-
- class Person
- {
- public string FullName
- {
- get;
- set;
- }
-
- public string Address
- {
- get;
- set;
- }
- }
-
- class Group : ObservableCollection<Person>
- {
- public Group(string firstInitial)
- {
- FirstInitial = firstInitial;
- }
-
- public string FirstInitial
- {
- get;
- private set;
- }
- }
-
- Group[] mygroup;
-
- [Test]
- [Category("P1")]
- [Description("Check whether ListView is displayed with proper Opacity property.")]
- [Property("SPEC", "Xamarin.Forms.ListView.Opacity A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Move the slider position to check if ListView Opacity is changing.")]
- [Step(3, "Click BACK button: Click Pass if Opacity changes accordingly.")]
- [Postcondition(1, "NA")]
- public async Task Opacity_UIBH()
- {
- /*TEST CODE*/
- var sliderOpacity = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.BlueViolet,
- HeightRequest = 500,
- Maximum = 1,
- Minimum = 0,
- Value = 1
- };
-
- var items = new List<String>()
- {
- "This line is the first Children.",
- "This line is the second Children."
- };
-
- _listView.ItemsSource = items;
- _listView.HeightRequest = 200;
- _listView.BindingContext = sliderOpacity;
- _listView.SetBinding(ListView.OpacityProperty, "Value");
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _listView,
- sliderOpacity
- }
- },
- Title = "Test: Opacity",
- BackgroundColor = Color.White
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ListView is displayed with proper Margin property.")]
- [Property("SPEC", "Xamarin.Forms.ListView.Margin A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Move the slider position to check if ListView Margin is changing.")]
- [Step(3, "Click BACK button: Click Pass if ListView changes accordingly.")]
- [Postcondition(1, "NA")]
- public async Task Margin_UIBH()
- {
- /*TEST CODE*/
- _labelOne = new Label
- {
- Text = "Move the silder position to change Margin."
- };
-
- var sliderMargin = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.BlueViolet,
- Maximum = 100,
- Minimum = 10,
- Value = 5
- };
-
- var items = new List<String>()
- {
- "This line is the first Children.",
- "This line is the second Children."
- };
-
- _listView.ItemsSource = items;
- _listView.BindingContext = sliderMargin;
- _listView.SetBinding(ListView.MarginProperty, "Value");
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- sliderMargin,
- _listView,
- _labelOne,
- }
- },
- Title = "Test: Margin",
- BackgroundColor = Color.White
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ListView visibility is changed properly.")]
- [Property("SPEC", "Xamarin.Forms.ListView.IsVisible A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click the Button to change visibility.")]
- [Step(3, "Click BACK button: Click Pass if visibility is changed accordingliy.")]
- [Postcondition(1, "NA")]
- public async Task IsVisible_UIBH()
- {
- /*TEST CODE*/
- _button = new Button();
- _button.Text = "Hide";
- _labelOne = new Label
- {
- Text = "Click the button to change visibility."
- };
-
- var items = new List<String>()
- {
- "This line is the first Children.",
- "This line is the second Children."
- };
-
- _listView.ItemsSource = items;
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _labelOne,
- _listView,
- _button
- }
- },
- Title = "Test: IsVisible",
- BackgroundColor = Color.White
- };
-
- _button.Clicked += onShowOrHide;
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _button.Clicked -= onShowOrHide;
- }
-
- private void onShowOrHide(object sender, System.EventArgs e)
- {
- if (_button.Text == "Hide")
- {
- _listView.IsVisible = false;
- _button.Text = "Show";
- }
- else
- {
- _listView.IsVisible = true;
- _button.Text = "Hide";
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ListView is displayed with proper Scale property.")]
- [Property("SPEC", "Xamarin.Forms.ListView.Scale A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Move slider to change the scaling value.")]
- [Step(3, "Click BACK button: Click Pass if scaling is working.")]
- [Postcondition(1, "NA")]
- public async Task Scale_UIBH()
- {
- /*TEST CODE*/
- _labelOne = new Label
- {
- Text = "Move the slider position to change the scaling value."
- };
-
- var sliderScale = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.Blue,
- Maximum = 2,
- Minimum = 0.5,
- Value = 0.3
- };
-
- var items = new List<String>()
- {
- "This line is the first Children.",
- "This line is the second Children."
- };
-
- _listView.ItemsSource = items;
- _listView.BindingContext = sliderScale;
- _listView.SetBinding(ListView.ScaleProperty, "Value");
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- sliderScale,
- _listView,
- _labelOne,
- }
- },
- Title = "Test: Scale",
- BackgroundColor = Color.White
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ListView is displayed with proper Rotation property.")]
- [Property("SPEC", "Xamarin.Forms.ListView.Rotation A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Move the slider position to apply rotation.")]
- [Step(3, "Click BACK button: Click Pass if rotation is working propertly.")]
- [Postcondition(1, "NA")]
- public async Task Rotation_UIBH()
- {
- /*TEST CODE*/
- _labelOne = new Label
- {
- Text = "Move the slider position to apply rotation"
- };
-
- var sliderRotation = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.Blue,
- Maximum = 360,
- Minimum = 0,
- Value = 5
- };
-
- var items = new List<String>()
- {
- "This line is the first Children.",
- "This line is the second Children."
- };
-
- _listView.ItemsSource = items;
- _listView.BindingContext = sliderRotation;
- _listView.SetBinding(Image.RotationProperty, "Value");
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- sliderRotation,
- _listView,
- _labelOne,
- }
- },
- Title = "Test: Rotation",
- BackgroundColor = Color.White
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ListView is displayed with proper Footer property.")]
- [Property("SPEC", "Xamarin.Forms.ListView.Footer A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Check if footer is displayed after all other children.")]
- [Step(3, "Click BACK button: Click Pass if footer is displayed after all other children.")]
- [Postcondition(1, "NA")]
- public async Task Footer_UILK()
- {
- /*TEST CODE*/
- _labelOne = new Label
- {
- Text = "Footer: should display after all other children.",
- HeightRequest = 200
- };
-
- var items = new List<String>()
- {
- "This line is the first Children.",
- "This line is the second Children."
- };
-
- _listView.ItemsSource = items;
- _listView.Footer = _labelOne;
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _listView
- }
- },
- Title = "Test: Footer",
- BackgroundColor = Color.White
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ListView is displayed with proper FooterTemplate property.")]
- [Property("SPEC", "Xamarin.Forms.ListView.FooterTemplate A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Check if footer text is displayed on a button.")]
- [Step(3, "Click BACK button: Click Pass if footer text is displayed on a button.")]
- [Postcondition(1, "NA")]
- public async Task FooterTemplate_UILK()
- {
- /*TEST CODE*/
- _listView.FooterTemplate = new DataTemplate(typeof(Button))
- {
- Bindings = {
- { Button.TextProperty, new Binding (".") }
- }
- };
-
- var items = new List<String>()
- {
- "This line is the first Children.",
- "This line is the second Children."
- };
-
- _listView.Footer = "This footer text will apppear on a Button.";
- _listView.ItemsSource = items;
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _listView
- }
- },
- Title = "Test: FooterTemplate",
- BackgroundColor = Color.White
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ListView is displayed with proper GroupDisplayBinding property.")]
- [Property("SPEC", "Xamarin.Forms.ListView.GroupDisplayBinding A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Check if list of people is displayed, grouped using FirstInitial.")]
- [Step(3, "Click BACK button: Click Pass if grouped people are displayed.")]
- [Postcondition(1, "NA")]
- public async Task GroupDisplayBinding_UILK()
- {
- /*TEST CODE*/
- _labelOne = new Label()
- {
- Text = "First Initial will be the Group Header.",
- };
-
- _listView.IsGroupingEnabled = true;
- _listView.GroupDisplayBinding = new Binding("FirstInitial");
-
- var template = new DataTemplate(typeof(TextCell));
- template.SetBinding(TextCell.TextProperty, "FullName");
- template.SetBinding(TextCell.DetailProperty, "Address");
-
- _listView.ItemTemplate = template;
- _listView.ItemsSource = new[] {
- new Group ("C") {
- new Person { FullName = "Caprice Nave" }
- },
- new Group ("J") {
- new Person { FullName = "James Smith", Address = "404 Nowhere Street" },
- new Person { FullName = "John Doe", Address = "404 Nowhere Ave" }
- }
- };
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _labelOne,
- _listView
- }
- },
- Title = "Test: GroupDisplayBinding",
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ListView is displayed with proper GroupHeaderTemplate property.")]
- [Property("SPEC", "Xamarin.Forms.ListView.GroupHeaderTemplate A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Check if group header is replaced with an Entry Cell.")]
- [Step(3, "Click BACK button: Click Pass if Group Header is replaced with entry cell.")]
- [Postcondition(1, "NA")]
- public async Task GroupHeaderTemplate_UILK()
- {
- /*TEST CODE*/
- _labelOne = new Label()
- {
- Text = "The group header will be replaced with an entry cell:",
- };
-
- _listView.IsGroupingEnabled = true;
- //_listView.GroupDisplayBinding = new Binding("FirstInitial");
- _listView.GroupShortNameBinding = new Binding("FirstInitial");
- _listView.GroupHeaderTemplate = new DataTemplate(typeof(EntryCell));
-
- var template = new DataTemplate(typeof(TextCell));
- template.SetBinding(TextCell.TextProperty, "FullName");
- template.SetBinding(TextCell.DetailProperty, "Address");
-
- _listView.ItemTemplate = template;
- _listView.ItemsSource = new[] {
- new Group ("C") {
- new Person { FullName = "Caprice Nave" }
- },
- new Group ("J") {
- new Person { FullName = "James Smith", Address = "404 Nowhere Street" },
- new Person { FullName = "John Doe", Address = "404 Nowhere Ave" }
- }
- };
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _labelOne,
- _listView
- }
- },
- Title = "Test: GroupHeaderTemplate",
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ListView is displayed with proper GroupShortNameBinding property.")]
- [Property("SPEC", "Xamarin.Forms.ListView.GroupShortNameBinding A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "This test will be automatically passed, due to limitation on platform ")]
- [Step(1, "Click run TC")]
- [Step(2, "Check if list of people is displayed, grouped using FirstInitial.")]
- [Step(3, "Click BACK button: Click Pass if grouped people are displayed.")]
- [Postcondition(1, "NA")]
- public async Task GroupShortNameBinding_UILK()
- {
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ListView is displayed with proper Header property.")]
- [Property("SPEC", "Xamarin.Forms.ListView.Header A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Check if Header is displayed above all other children.")]
- [Step(3, "Click BACK button: Click Pass if Header is displayed above all.")]
- [Postcondition(1, "NA")]
- public async Task Header_UILK()
- {
- /*TEST CODE*/
- _labelOne = new Label
- {
- Text = "Header: should display above all other children."
- };
-
- var items = new List<String>()
- {
- "This line is the first Children.",
- "This line is the second Children."
- };
-
- _listView.ItemsSource = items;
- _listView.Header = _labelOne;
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _listView
- }
- },
- Title = "Test: Header",
- BackgroundColor = Color.White
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ListView is displayed with proper HeaderTemplate property.")]
- [Property("SPEC", "Xamarin.Forms.ListView.HeaderTemplate A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Check if header text is displayed on a button.")]
- [Step(3, "Click BACK button: Click Pass if header text is displayed on a button.")]
- [Postcondition(1, "NA")]
- public async Task HeaderTemplate_UILK()
- {
- /*TEST CODE*/
- _listView.HeaderTemplate = new DataTemplate(typeof(Button))
- {
- Bindings = {
- { Button.TextProperty, new Binding (".") }
- }
- };
-
- var items = new List<String>()
- {
- "This line is the first Children.",
- "This line is the second Children."
- };
-
- _listView.Header = "This header text will apppear on a Button.";
- _listView.ItemsSource = items;
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _listView
- }
- },
- Title = "Test: HeaderTemplate",
- BackgroundColor = Color.White
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ListView is displayed with proper IsGroupingEnabled property.")]
- [Property("SPEC", "Xamarin.Forms.ListView.IsGroupingEnabled A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Check if one item is displayed. (if you can't see the item, scroll down the list)")]
- [Step(3, "Click BACK button: Click Pass if one item is displayed.")]
- [Postcondition(1, "NA")]
- public async Task IsGroupingEnabled_UILK()
- {
- /*TEST CODE*/
- _labelOne = new Label()
- {
- Text = "Grouping is disabled",
- };
-
- _listView.IsGroupingEnabled = false;
- _listView.GroupDisplayBinding = new Binding("FirstInitial");
- _listView.GroupShortNameBinding = new Binding("FirstInitial");
-
- var template = new DataTemplate(typeof(TextCell));
- template.SetBinding(TextCell.TextProperty, "FullName");
- template.SetBinding(TextCell.DetailProperty, "Address");
-
- _listView.ItemTemplate = template;
- _listView.ItemsSource = new object[] {
- new Group ("C") {
- new Person { FullName = "Caprice Nave" }
- },
- new Group ("J") {
- new Person { FullName = "James Smith", Address = "404 Nowhere Street" },
- },
- new Person { FullName = "James Smith", Address = "404 Nowhere Street" },
- };
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _labelOne,
- _listView
- }
- },
- Title = "Test: IsGroupingEnabled",
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ListView is displayed with proper SelectedItem property.")]
- [Property("SPEC", "Xamarin.Forms.ListView.SelectedItem A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Check if first item of list view is selected.")]
- [Step(3, "Click BACK button: Click Pass if first item is selected.")]
- [Postcondition(1, "NA")]
- public async Task SelectedItem_UILK()
- {
- /*TEST CODE*/
- _labelOne = new Label
- {
- Text = "The first item should be selected.",
- BackgroundColor = Color.White
- };
-
- var items = new List<String>()
- {
- "This line is the first Children.",
- "This line is the second Children."
- };
-
- _listView.ItemsSource = items;
- _listView.SelectedItem = items[0];
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _labelOne,
- _listView
- }
- },
- Title = "Test: SelectedItem"
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- // Currently, Xamarin Forms Limitation
- //[Test]
- [Category("P1")]
- [Description("Check whether ListView is displayed with proper SeparatorColor property.")]
- [Property("SPEC", "Xamarin.Forms.ListView.SeparatorColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Check if separator color of list view item is green.")]
- [Step(3, "Click BACK button: Click Pass if listview separator color is green.")]
- [Postcondition(1, "NA")]
- public async Task SeparatorColor_UILK()
- {
- /*TEST CODE*/
- _labelOne = new Label
- {
- Text = "ListView Separator Color should be green.",
- HeightRequest = 200,
- BackgroundColor = Color.White
- };
-
- var items = new List<String>()
- {
- "This line is the first Children.",
- "This line is the second Children.",
- "This line is the third Children.",
- "This line is the fourth Children."
- };
-
- _listView.SeparatorVisibility = SeparatorVisibility.Default;
- _listView.SeparatorColor = Color.Green;
- _listView.ItemsSource = items;
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _labelOne,
- _listView
- }
- },
- Title = "Test: SeparatorColor",
- BackgroundColor = Color.Red
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- // Currently, Xamarin Forms Limitation
- //[Test]
- [Category("P1")]
- [Description("Check whether ListView is displayed with proper SeparatorVisibility property.")]
- [Property("SPEC", "Xamarin.Forms.ListView.SeparatorVisibility A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Check if separator is visible and separator color of list view item is green.")]
- [Step(3, "Click BACK button: Click Pass if listview separator is visible.")]
- [Postcondition(1, "NA")]
- public async Task SeparatorVisibility_UILK()
- {
- /*TEST CODE*/
- _labelOne = new Label
- {
- Text = "ListView Separator should be visible:",
- HeightRequest = 200,
- BackgroundColor = Color.White
- };
-
- var items = new List<String>()
- {
- "This line is the first Children.",
- "This line is the second Children.",
- "This line is the third Children.",
- "This line is the fourth Children."
- };
-
- _listView.SeparatorVisibility = SeparatorVisibility.Default;
- _listView.SeparatorColor = Color.Green;
- _listView.ItemsSource = items;
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _labelOne,
- _listView
- }
- },
- Title = "Test: SeparatorVisibility",
- BackgroundColor = Color.Red
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether listview is scrolled to expected item.")]
- [Property("SPEC", "Xamarin.Forms.ListView.ScrollTo M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click the button to scroll to last or top.")]
- [Step(3, "Click BACK button: Click Pass if scrolling is working properly.")]
- [Postcondition(1, "NA")]
- [Property("COVPARAM", "")]
- public async Task ScrollTo_UIBH()
- {
- _button = new Button();
- _button.Text = "Scroll to Last";
-
- var items = new List<String>();
- for (int i = 1; i < 50; i++)
- {
- String text = "Sentence #" + i;
- items.Add(text);
- }
-
- _listView.ItemsSource = items;
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _button,
- _listView
- }
- },
- Title = "Test: ScrollTo",
- BackgroundColor = Color.Gray
- };
-
- _button.Clicked += onScrollToItemPosition;
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _button.Clicked -= onScrollToItemPosition;
- }
-
- private void onScrollToItemPosition(object sender, System.EventArgs e)
- {
- if (_button.Text == "Scroll to Last")
- {
- _button.Text = "Scroll to Top";
- _listView.ScrollTo("Sentence #49", ScrollToPosition.Start, true);
- }
- else
- {
- _button.Text = "Scroll to Last";
- _listView.ScrollTo("Sentence #1", ScrollToPosition.Start, true);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether listview is scrolled to expected item of expected group.")]
- [Property("SPEC", "Xamarin.Forms.ListView.ScrollTo M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click the button to scroll to last or top of the group list.")]
- [Step(3, "Click BACK button: Click Pass if scrolling is working properly.")]
- [Postcondition(1, "NA")]
- [Property("COVPARAM", "")]
- public async Task ScrollTo_OBJECT_UIBH()
- {
- /*TEST CODE*/
- _button = new Button();
- _button.Text = "Scroll to Last";
- _labelOne = new Label()
- {
- Text = "Click the button to scroll to last or top of the group list.",
- };
-
- _listView.IsGroupingEnabled = true;
- _listView.GroupDisplayBinding = new Binding("FirstInitial");
- _listView.GroupShortNameBinding = new Binding("FirstInitial");
-
- var template = new DataTemplate(typeof(TextCell));
- template.SetBinding(TextCell.TextProperty, "FullName");
- template.SetBinding(TextCell.DetailProperty, "Address");
- mygroup = new[] {
- new Group ("C") {
- new Person { FullName = "Caprice Nave"},
- new Person { FullName = "Caprice Nave-1" },
- new Person { FullName = "Caprice Nave-2" },
- new Person { FullName = "Caprice Nave-3" },
- new Person { FullName = "Caprice Nave-4" },
- new Person { FullName = "Caprice Nave-5" },
- new Person { FullName = "Caprice Nave-6" },
- new Person { FullName = "Caprice Nave-7" },
- new Person { FullName = "Caprice Nave-8" },
- new Person { FullName = "Caprice Nave-9" },
- new Person { FullName = "Caprice Nave-10" },
- new Person { FullName = "Caprice Nave-11" },
- new Person { FullName = "Caprice Nave-12" },
- new Person { FullName = "Caprice Nave-13" }
- },
- new Group ("J") {
- new Person { FullName = "James Smith", Address = "404 Nowhere Street" },
- new Person { FullName = "John Doe", Address = "404 Nowhere Ave" }
- },
- new Group ("F") {
- new Person { FullName = "Caprice Nave"},
- new Person { FullName = "Caprice Nave-1" },
- new Person { FullName = "Caprice Nave-2" },
- new Person { FullName = "Caprice Nave-3" },
- new Person { FullName = "Caprice Nave-4" },
- new Person { FullName = "Caprice Nave-5" },
- new Person { FullName = "Caprice Nave-6" },
- new Person { FullName = "Caprice Nave-7" },
- new Person { FullName = "Caprice Nave-8" },
- new Person { FullName = "Caprice Nave-9" },
- new Person { FullName = "Caprice Nave-10" },
- new Person { FullName = "Caprice Nave-11" },
- new Person { FullName = "Caprice Nave-12" },
- new Person { FullName = "Caprice Nave-13" }
- },
- new Group ("G") {
- new Person { FullName = "Caprice Nave"},
- new Person { FullName = "Caprice Nave-1" },
- new Person { FullName = "Caprice Nave-2" },
- new Person { FullName = "Caprice Nave-3" },
- new Person { FullName = "Caprice Nave-4" },
- new Person { FullName = "Caprice Nave-5" },
- new Person { FullName = "Caprice Nave-6" },
- new Person { FullName = "Caprice Nave-7" },
- new Person { FullName = "Caprice Nave-8" },
- new Person { FullName = "Caprice Nave-9" },
- new Person { FullName = "Caprice Nave-10" },
- new Person { FullName = "Caprice Nave-11" },
- new Person { FullName = "Caprice Nave-12" },
- new Person { FullName = "Caprice Nave-13" }
- },
- new Group ("H") {
- new Person { FullName = "Caprice Nave"},
- new Person { FullName = "Caprice Nave-1" },
- new Person { FullName = "Caprice Nave-2" },
- new Person { FullName = "Caprice Nave-3" },
- new Person { FullName = "Caprice Nave-4" },
- new Person { FullName = "Caprice Nave-5" },
- new Person { FullName = "Caprice Nave-6" },
- new Person { FullName = "Caprice Nave-7" },
- new Person { FullName = "Caprice Nave-8" },
- new Person { FullName = "Caprice Nave-9" },
- new Person { FullName = "Caprice Nave-10" },
- new Person { FullName = "Caprice Nave-11" },
- new Person { FullName = "Caprice Nave-12" },
- new Person { FullName = "Caprice Nave-13" }
- },
- };
-
- _listView.ItemTemplate = template;
- _listView.ItemsSource = mygroup;
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _button,
- _listView,
- }
- },
- Title = "Test: ScrollTo",
- BackgroundColor = Color.White
- };
-
- _button.Clicked += onScrollToGroupPosition;
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _button.Clicked -= onScrollToGroupPosition;
- }
-
- private void onScrollToGroupPosition(object sender, System.EventArgs e)
- {
- if (_button.Text == "Scroll to Last")
- {
- _button.Text = "Scroll to Top";
- var person = mygroup[4][13];
- var group = mygroup[4];
- _listView.ScrollTo(person, group, ScrollToPosition.Start, true);
- }
- else
- {
- var person = mygroup[0][1];
- var group = mygroup[0];
- _button.Text = "Scroll to Last";
- _listView.ScrollTo(person, group, ScrollToPosition.Start, true);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ItemAppearing events can be invoked or not when an item appear in ListView.")]
- [Property("SPEC", "Xamarin.Forms.ListView.ItemAppearing E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click BACK button: Testcase result will show PASS automatically or it's FAIL")]
- [Postcondition(1, "NA")]
- public async Task ItemAppearing_CHECK_EVENT()
- {
- /*TEST CODE*/
- var items = new List<String>()
- {
- "This is children One",
- "This is children Two",
- "This is children Three",
- };
-
- _listView.ItemsSource = items;
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _listView
- }
- },
- Title = "Test: ItemAppearing",
- BackgroundColor = Color.Green
- };
-
- _listView.ItemAppearing += onItemAppearing;
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listView.ItemAppearing -= onItemAppearing;
- }
-
- private void onItemAppearing(object sender, System.EventArgs e)
- {
- Assert.True(true);
- ManualTest.Confirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ItemSelected events can be invoked or not when an item of ListView is Selected.")]
- [Property("SPEC", "Xamarin.Forms.ListView.ItemSelected E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Select the Item")]
- [Step(3, "Click BACK button: Testcase result will show PASS or FAIL automatically")]
- [Postcondition(1, "NA")]
- public async Task ItemSelected_CHECK_EVENT()
- {
- /*TEST CODE*/
- var items = new List<String>()
- {
- "Tap this Text."
- };
-
- _listView.ItemsSource = items;
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _listView
- }
- },
- Title = "Test: ItemSelected",
- BackgroundColor = Color.Green
- };
- _listView.ItemSelected += onItemSelected;
- _testPage.ExecuteTC(page);
-
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listView.ItemSelected -= onItemSelected;
- }
-
- private void onItemSelected(object sender, System.EventArgs e)
- {
- Assert.True(true);
- ManualTest.Confirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ItemTapped events can be invoked or not when an item of ListView is Tapped.")]
- [Property("SPEC", "Xamarin.Forms.ListView.ItemTapped E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Tap the Item")]
- [Step(3, "Click BACK button: Testcase result will show PASS or FAIL automatically")]
- [Postcondition(1, "NA")]
- public async Task ItemTapped_CHECK_EVENT()
- {
- /*TEST CODE*/
- var items = new List<String>()
- {
- "Tap this Text."
- };
-
- _listView.ItemsSource = items;
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _listView
- }
- },
- Title = "Test: ItemTapped",
- BackgroundColor = Color.Green
- };
- _listView.ItemTapped += onItemTapped;
- _testPage.ExecuteTC(page);
-
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listView.ItemTapped -= onItemTapped;
- }
-
- private void onItemTapped(object sender, System.EventArgs e)
- {
- Assert.True(true);
- ManualTest.Confirm();
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System.Threading.Tasks;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class MasterDetailPageTests
- {
- private static TestPage _testPage = TestPage.GetInstance();
- private static NavigationPage _navigationPage = TestPage.GetInstance().getNavigationPage();
- private ListView _listView;
- private Label _detail, _header;
- private static Button _button;
- private static Boolean isBackPressCheck, appearingCheck, isParentSet;
- private CustomMasterDetailPage _masterpage;
-
- public class CustomMasterDetailPage : MasterDetailPage
- {
- protected override bool OnBackButtonPressed()
- {
- if (isBackPressCheck)
- {
- Assert.True(true);
- ManualTest.Confirm();
- }
- return base.OnBackButtonPressed();
- }
-
- protected override void OnAppearing()
- {
- if (appearingCheck)
- {
- Assert.True(true);
- ManualTest.Confirm();
- }
- base.OnAppearing();
- }
-
- protected override void OnDisappearing()
- {
- if (appearingCheck)
- {
- Assert.True(true);
- ManualTest.Confirm();
- }
- base.OnDisappearing();
- }
-
- protected override void OnParentSet()
- {
- if (isParentSet)
- {
- Assert.True(true);
- ManualTest.Confirm();
- }
- base.OnParentSet();
- }
- }
-
- private void CreateMasterPage(CustomMasterDetailPage masterPage)
- {
- _header = new Label
- {
- Text = "MasterDetailPage",
- FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)),
- HorizontalOptions = LayoutOptions.Center
- };
-
- _detail = new Label
- {
- Text = "Detail Page",
- FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)),
- HorizontalOptions = LayoutOptions.Center
- };
-
- string[] pageDetailArray =
- {
- "Page 1", "Page 2", "Page 3", "Page 4"
- };
- _listView = new ListView
- {
- ItemsSource = pageDetailArray
- };
-
- masterPage.Master = new ContentPage
- {
- Title = _header.Text,
- Content = new StackLayout
- {
- Children =
- {
- _header,
- _listView
- }
- }
- };
- masterPage.Detail = new ContentPage { Content = _detail };
- _listView.ItemSelected += (sender, arg) =>
- {
- _detail.Text = arg.SelectedItem.ToString();
- };
- _navigationPage.PushAsync(masterPage);
- }
-
- [SetUp]
- public void Setup()
- {
- if (Device.Idiom == TargetIdiom.Phone || Device.Idiom == TargetIdiom.TV)
- {
- _masterpage = new CustomMasterDetailPage();
- Console.WriteLine("MasterDetailPageTests --------------- Setup()");
- }
- else
- {
- Console.WriteLine("Not supported on this profile");
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
- }
-
- [TearDown]
- public void TearDown()
- {
- if (_masterpage != null)
- {
- _masterpage.IsGestureEnabled = true;
- _masterpage = null;
- }
- Console.WriteLine("MasterDetailPageTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether MasterDetailPage.BackgroundColor is displayed properly?")]
- [Property("SPEC", "Xamarin.Forms.MasterDetailPage.BackgroundColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click the button to change BackgroundColor accordingly.")]
- [Step(3, "Click BACK button: Click Pass if MasterDetailPage BackgroundColor is changed accordingly.")]
- [Postcondition(1, "NA")]
- public async Task BackgroundColor_UILK()
- {
- /*TEST CODE*/
- _button = new Button();
- _button.Text = "Red";
- _masterpage = new CustomMasterDetailPage();
-
- CreateMasterPage(_masterpage);
-
- _masterpage.BackgroundColor = Color.Green;
- _detail.Text = "Click the button to change Background Color.";
- _masterpage.Detail = new ContentPage
- {
- Title = "Test: BackgroundColor",
- Content = new StackLayout
- {
- Children =
- {
- _detail,
- _button
- }
- }
- };
-
- _button.Clicked += onRedOrGreen;
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _button.Clicked -= onRedOrGreen;
- }
-
- private void onRedOrGreen(object sender, System.EventArgs e)
- {
- if (_button.Text == "Red")
- {
- _masterpage.BackgroundColor = Color.Red;
- _button.Text = "Green";
- }
- else
- {
- _masterpage.BackgroundColor = Color.Green;
- _button.Text = "Red";
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether MasterDetailPage is displayed with proper Opacity property.")]
- [Property("SPEC", "Xamarin.Forms.MasterDetailPage.Opacity A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Move the slider position to check if MasterDetailPage Opacity is changing.")]
- [Step(3, "Click BACK button: Click Pass if Opacity changes accordingly.")]
- [Postcondition(1, "NA")]
- public async Task Opacity_UIBH()
- {
- /*TEST CODE*/
- var sliderOpacity = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.BlueViolet,
- Maximum = 1,
- Minimum = 0,
- Value = 1
- };
- _masterpage = new CustomMasterDetailPage();
-
- CreateMasterPage(_masterpage);
-
- _masterpage.BackgroundColor = Color.Green;
- _detail.Text = "Move the slider position to change page Opacity.";
- _masterpage.Detail = new ContentPage
- {
- Title = "Test: Opacity",
- Content = new StackLayout
- {
- Children =
- {
- _detail,
- sliderOpacity
- }
- }
- };
-
- _masterpage.BindingContext = sliderOpacity;
- _masterpage.SetBinding(MasterDetailPage.OpacityProperty, "Value");
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether MasterDetailPage visibility is changed properly.")]
- [Property("SPEC", "Xamarin.Forms.MasterDetailPage.IsVisible A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click the Button to change visibility.")]
- [Step(3, "Click BACK button: Click Pass if the page disappear.")]
- [Postcondition(1, "NA")]
- public async Task IsVisible_UIBH()
- {
- /*TEST CODE*/
- _button = new Button();
- _button.Text = "Hide";
- _masterpage = new CustomMasterDetailPage();
-
- CreateMasterPage(_masterpage);
-
- _masterpage.BackgroundColor = Color.Green;
- _detail.Text = "Click the button.";
- _masterpage.Detail = new ContentPage
- {
- Title = "Test: IsVisible",
- Content = new StackLayout
- {
- Children =
- {
- _detail,
- _button
- }
- }
- };
-
- _button.Clicked += (sender, e) =>
- {
- _masterpage.IsVisible = false;
- };
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether MasterDetailPage is displayed with proper Detail property.")]
- [Property("SPEC", "Xamarin.Forms.MasterDetailPage.Detail A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Check if a line of text is visible.")]
- [Step(3, "Click BACK button: Click Pass if a line is visible.")]
- [Postcondition(1, "NA")]
- public async Task Detail_UILK()
- {
- /*TEST CODE*/
- CustomMasterDetailPage masterPage = new CustomMasterDetailPage();
- CreateMasterPage(masterPage);
- _detail.Text = "This line should be visible.";
-
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether MasterDetailPage is displayed with proper IsGestureEnabled property.")]
- [Property("SPEC", "Xamarin.Forms.MasterDetailPage.IsGestureEnabled A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Check if a bar should be visible at left to view page list as the gesture is not enabled.")]
- [Step(3, "Click BACK button: Click Pass if gesture is not enabled.")]
- [Postcondition(1, "NA")]
- public async Task IsGestureEnabled_UIBH()
- {
- if (Device.Idiom == TargetIdiom.TV || Device.Idiom == TargetIdiom.Phone)
- {
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
- /*TEST CODE*/
- _masterpage = new CustomMasterDetailPage();
- _masterpage.IsGestureEnabled = false;
- CreateMasterPage(_masterpage);
- _detail.Text = "Gesture is disabled.So a bar should be visible at left to view page list.";
-
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether MasterDetailPage is displayed with proper IsPresented property.")]
- [Property("SPEC", "Xamarin.Forms.MasterDetailPage.IsPresented A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Check if by default the page list is opened.")]
- [Step(3, "Click BACK button: Click Pass if by default page list is opened.")]
- [Postcondition(1, "NA")]
- public async Task IsPresented_UIBH()
- {
- /*TEST CODE*/
- CustomMasterDetailPage masterPage = new CustomMasterDetailPage();
- masterPage.IsPresented = true;
- CreateMasterPage(masterPage);
- _detail.Text = "By default the page list should be opened.";
-
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether MasterDetailPage is displayed with proper Master property.")]
- [Property("SPEC", "Xamarin.Forms.MasterDetailPage.Master A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Check the master page menu (swipe from left to right to see page list at left side of the page).")]
- [Step(3, "Click BACK button: Click Pass if a new master page is visible (Titled: NEW MASTER page)")]
- [Postcondition(1, "NA")]
- public async Task Master_UILK()
- {
- if (Device.Idiom == TargetIdiom.TV)
- {
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
- /*TEST CODE*/
- CustomMasterDetailPage masterPage = new CustomMasterDetailPage();
- CreateMasterPage(masterPage);
- _detail.Text = "Swipe from left to right to see page list.";
-
- string[] pageDetailArray =
- {
- "New Page 1", "New Page 2", "New Page 3", "New Page 4"
- };
-
- _listView.ItemsSource = pageDetailArray;
- _header.Text = "NEW MASTER page";
-
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether MasterDetailPage is displayed with proper MasterBehavior property.")]
- [Property("SPEC", "Xamarin.Forms.MasterDetailPage.MasterBehavior A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Swipe the screen from left to right.")]
- [Step(3, "Click BACK button: Click Pass if master page popover.")]
- [Postcondition(1, "NA")]
- public async Task MasterBehavior_UIBH()
- {
- if (Device.Idiom == TargetIdiom.TV)
- {
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
-
- /*TEST CODE*/
- CustomMasterDetailPage masterPage = new CustomMasterDetailPage();
- CreateMasterPage(masterPage);
- masterPage.MasterBehavior = MasterBehavior.Popover;
- _detail.Text = "Swipe the screen from left to right.";
-
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OnAppearing is raised when a detail appears.")]
- [Property("SPEC", "Xamarin.Forms.MasterDetailPage.OnAppearing M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Press back button")]
- [Step(3, "Testcase result will show PASS or mark FAIL.")]
- [Postcondition(1, "NA")]
- public async Task OnAppearing_UIBH()
- {
- if (Device.Idiom == TargetIdiom.TV)
- {
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
-
- /* TEST CODE */
- CustomMasterDetailPage masterPage = new CustomMasterDetailPage();
- CreateMasterPage(masterPage);
- _detail.Text = "Press back button.";
- appearingCheck = true;
-
- await ManualTest.WaitForConfirm();
- appearingCheck = false;
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OnBackButtonPressed is raised when the back button is pressed or not.")]
- [Property("SPEC", "Xamarin.Forms.MasterDetailPage.OnBackButtonPressed M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Press back button")]
- [Step(3, "Testcase result will show PASS of FAIL automatically")]
- [Postcondition(1, "NA")]
- public async Task OnBackButtonPressed_UIBH()
- {
- /* TEST CODE */
- isBackPressCheck = true;
- CustomMasterDetailPage masterPage = new CustomMasterDetailPage();
- CreateMasterPage(masterPage);
-
- await ManualTest.WaitForConfirm();
- isBackPressCheck = false;
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listView.ItemSelected -= (sender, arg) =>
- {
- _detail.Text = arg.SelectedItem.ToString();
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OnDisappearing is raised when a detail disappears.")]
- [Property("SPEC", "Xamarin.Forms.MasterDetailPage.OnDisappearing M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Press back button")]
- [Step(3, "Testcase result will show PASS or mark FAIL.")]
- [Postcondition(1, "NA")]
- public async Task OnDisappearing_UIBH()
- {
- /* TEST CODE */
- CustomMasterDetailPage masterPage = new CustomMasterDetailPage();
- CreateMasterPage(masterPage);
- _detail.Text = "Press back button.";
- appearingCheck = true;
-
- await ManualTest.WaitForConfirm();
- appearingCheck = false; ;
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OnParentSet is raised when Parent property is set.")]
- [Property("SPEC", "Xamarin.Forms.MasterDetailPage.OnParentSet M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Press back button")]
- [Step(3, "Testcase result will show PASS or mark FAIL.")]
- [Postcondition(1, "NA")]
- public async Task OnParentSet_UIBH()
- {
- /* TEST CODE */
- CustomMasterDetailPage masterPage = new CustomMasterDetailPage();
- CreateMasterPage(masterPage);
- _detail.Text = "Press back button.";
- masterPage.Parent = _navigationPage;
- isParentSet = true;
-
- await ManualTest.WaitForConfirm();
- isParentSet = false;
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether IsPresentedChanged is raised when IsPresent property of master is changed.")]
- [Property("SPEC", "Xamarin.Forms.MasterDetailPage.IsPresentedChanged E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Swipe left to right to view page list. And then press BACK Button")]
- [Step(3, "Testcase result will show PASS automatically or otherwise it's FAIL")]
- [Postcondition(1, "NA")]
- public async Task IsPresentedChanged_UIBH()
- {
- if (Device.Idiom == TargetIdiom.TV)
- {
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
-
- /* TEST CODE */
- CustomMasterDetailPage masterPage = new CustomMasterDetailPage();
- CreateMasterPage(masterPage);
- masterPage.IsPresented = false;
- _detail.Text = "Swipe left to right to view page list.";
-
- masterPage.IsPresentedChanged += onMasterPresented;
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- masterPage.IsPresentedChanged -= onMasterPresented;
- }
-
- private void onMasterPresented(object sender, System.EventArgs e)
- {
- Assert.True(true);
- ManualTest.Confirm();
- }
- }
-}
+++ /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;
-using XamarinApplication.Tizen;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class MenuItemTests
- {
- private static NavigationPage _mainPage = (NavigationPage)Program.GetApp().MainPage;
- private static TestPage _testPage = TestPage.GetInstance();
- private static string _file = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "TED/thumbnail/click.jpg";
-
- //Create a class that inherit ToolbarItem to test Clicked event and OnClicked of MenuItem.
- //Because ToolbarItem inherit MenuItem.
- class SubToolbarItem : ToolbarItem
- {
- public bool FlagOnClicked { get; set; }
-
- protected override void OnClicked()
- {
- FlagOnClicked = true;
- ManualTest.Confirm();
- base.OnClicked();
- }
- }
-
- private void CreateLayout()
- {
- var page = new ContentPage();
- ListView listview = new ListView();
- listview.ItemTemplate = new DataTemplate(() =>
- {
- var _menuItemI = new MenuItem { Text = "MenuI" };
- _menuItemI.SetBinding(MenuItem.CommandParameterProperty, new Binding("."));
- _menuItemI.Clicked += (sender, args) =>
- {
- ManualTest.Confirm();
- };
- var _menuItemII = new MenuItem { Text = "MenuII" };
- _menuItemII.SetBinding(MenuItem.CommandParameterProperty, new Binding("."));
- var _customCell = new ViewCell();
- _customCell.ContextActions.Add(_menuItemI);
- _customCell.ContextActions.Add(_menuItemII);
- _customCell.View = new Label { Text = "List Item" };
-
- return _customCell;
- });
- List<string> listData = new List<string>();
- listData.Add("TestItem1");
- listData.Add("TestItem2");
- listData.Add("TestItem3");
- listview.ItemsSource = listData;
- page.Content = listview;
- _mainPage.PushAsync(page);
- }
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("MenuItemTests --------------- SetUp()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("MenuItemTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Clicked event is invoked when click on MenuItem or not.")]
- [Property("SPEC", "Xamarin.Forms.MenuItem.Clicked E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")]
- [Step(1, "Click run TC")]
- [Step(2, "Click on Toolbar Button (Top-Right of Screen)")]
- [Postcondition(1, "Back to TestPage")]
- [Postcondition(2, "Test result will show PASS or FAIL automatically")]
- public async Task Clicked_EVENT_CHECK()
- {
- if (Device.Idiom == TargetIdiom.Phone)
- {
- /* Precondition: ToolbarItem inherit MenuItem. Can test Clicked event by ToolbarItem
- - Create new page have a ToolbarItem
- */
- ToolbarItem toolbarItem = new ToolbarItem();
- //toolbarItem.Text = "Click Me!";
- var fileImageSource = new FileImageSource()
- {
- File = _file,
- };
- toolbarItem.Icon = fileImageSource;
- ContentPage testPage = new ContentPage()
- {
- Title = "Test: OnClicked"
- };
- testPage.ToolbarItems.Add(toolbarItem);
- var label = new Label() { Text = "Click on Image of Toolbar Button (Top-Right of Screen)" };
- testPage.Content = label;
- await _mainPage.PushAsync(testPage);
- /* TESTCODE */
- //CreateLayout();
- toolbarItem.Clicked += (sender, args) =>
- {
- ManualTest.Confirm();
- label.Text = "Back to test page";
- };
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- toolbarItem.Clicked -= (sender, args) =>
- {
- };
- }
- else
- {
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OnClicked is invoked when click on MenuItem or not.")]
- [Property("SPEC", "Xamarin.Forms.MenuItem.OnClicked M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limi tation on TV)")]
- [Step(1, "Click run TC")]
- [Step(2, "Click on Toolbar Button (Top-Right of Screen)")]
- [Postcondition(1, "Back to TestPage")]
- public async Task OnClicked_CHECK()
- {
- if (Device.Idiom == TargetIdiom.Phone)
- {
- /* Precondition: ToolbarItem inherit MenuItem. Can test Clicked event by ToolbarItem
- - Create new page have a ToolbarItem
- */
- SubToolbarItem toolbarItem = new SubToolbarItem();
- //toolbarItem.Text = "Click Me!";
- var fileImageSource = new FileImageSource()
- {
- File = _file,
- };
- toolbarItem.Icon = fileImageSource;
- ContentPage testPage = new ContentPage()
- {
- Title = "Test: OnClicked"
- };
- testPage.ToolbarItems.Add(toolbarItem);
- var label = new Label() { Text = "Click on Toolbar Button (Top-Right of Screen)\n After press back button" };
- testPage.Content = label;
- await _mainPage.PushAsync(testPage);
-
- /* TESTCODE */
- toolbarItem.FlagOnClicked = false;
- await ManualTest.WaitForConfirm();
- Assert.IsTrue(toolbarItem.FlagOnClicked, "OnClicked is not invoked");
- }
- else
- {
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System;
-using System.Threading.Tasks;
-using System.Runtime.CompilerServices;
-using XamarinApplication.Tizen;
-using System.Collections.Specialized;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class MultiPageTemplateTests
- {
- private static NavigationPage _navigationPage = TestPage.GetInstance().getNavigationPage();
- private static TestPage _testPage = TestPage.GetInstance();
- private string _appResourcePath = Program.Current.DirectoryInfo.Resource;
-
- class CustomizeMultiPage : TabbedPage
- {
- public bool _tcOnBackButtonPressed = false;
- public bool flagOnBackButtonPressed = false;
- public bool _tcOnCurrentPageChanged = false;
- public bool _flagOnCurrentPageChanged = false;
- public bool _tcOnPropertyChanged = false;
- public bool _flagOnPropertyChanged = false;
- public bool _tcOnPagesChanged = false;
- public bool _flagOnPagesChanged = false;
- public bool _tcOnChildAdded = false;
- public bool _flagOnChildAdded = false;
-
- public CustomizeMultiPage() : base()
- {
- this.ItemsSource = new NamedColor[] {
- new NamedColor ("Red", Color.Red),
- new NamedColor ("Yellow", Color.Yellow),
- new NamedColor ("Green", Color.Green),
- new NamedColor ("Aqua", Color.Aqua),
- new NamedColor ("Blue", Color.Blue),
- new NamedColor ("Purple", Color.Purple)
- };
- this.ItemTemplate = new DataTemplate(() =>
- {
- return new NamedColorPage();
- });
- }
-
- protected override bool OnBackButtonPressed()
- {
- if (_tcOnBackButtonPressed)
- {
- flagOnBackButtonPressed = true;
- ManualTest.Confirm();
- }
- return base.OnBackButtonPressed();
- }
-
- protected override void OnCurrentPageChanged()
- {
- if (_tcOnCurrentPageChanged)
- {
- _flagOnCurrentPageChanged = true;
- ManualTest.Confirm();
- }
- base.OnCurrentPageChanged();
- }
-
- protected override void OnPropertyChanged([CallerMemberName] string propertyName = null)
- {
- if (_tcOnPropertyChanged)
- {
- _flagOnPropertyChanged = true;
- ManualTest.Confirm();
- }
- base.OnPropertyChanged(propertyName);
- }
-
- protected override async void OnPagesChanged(NotifyCollectionChangedEventArgs e)
- {
- if (_tcOnPagesChanged)
- {
- _flagOnPagesChanged = true;
- ManualTest.Confirm();
- await _navigationPage.PopAsync();
- }
- base.OnPagesChanged(e);
- }
-
- protected override async void OnChildAdded(Element child)
- {
- if (_tcOnChildAdded)
- {
- _flagOnChildAdded = true;
- ManualTest.Confirm();
- await _navigationPage.PopAsync();
- }
- base.OnChildAdded(child);
- }
- }
-
- // Data type:
- class NamedColor
- {
- public NamedColor(string name, Color color)
- {
- this.Name = name;
- this.Color = color;
- }
-
- public string Name { private set; get; }
-
- public Color Color { private set; get; }
-
- public override string ToString()
- {
- return Name;
- }
- }
-
- // Format page
- class NamedColorPage : ContentPage
- {
- public NamedColorPage()
- {
- // This binding is necessary to label the tabs in
- // the TabbedPage.
- this.SetBinding(ContentPage.TitleProperty, "Name");
- // BoxView to show the color.
- BoxView boxView = new BoxView
- {
- WidthRequest = 100,
- HeightRequest = 100,
- HorizontalOptions = LayoutOptions.Center
- };
- boxView.SetBinding(BoxView.ColorProperty, "Color");
-
- // Build the page
- this.Content = boxView;
- }
- }
-
- [SetUp]
- public void SetUp()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "MultiPage CLASS: Setup---------------------------------");
- if (ManualTest.IsWearable())
- {
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "MultiPage CLASS: Teardown---------------------------------");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether CurrentPage has been displayed or not.")]
- [Property("SPEC", "Xamarin.Forms.MultiPage<T>.CurrentPage A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click the second's tab with Page2 text")]
- [Step(3, "Press Back Button")]
- [Step(4, "Testcase result will show PASS automatically otherwise FAIL")]
- [Postcondition(1, "Back to TestPage")]
- public async Task CurrentPage_MultiPage_UIBH()
- {
- var multiPage = new CustomizeMultiPage();
- multiPage.ItemsSource = null;
- multiPage.ItemTemplate = null;
-
- var btnAdd = new Button
- {
- Text = "Change Page",
- BackgroundColor = Color.Blue,
- WidthRequest = 200,
- HeightRequest = 100,
- };
- var stackLayout = new StackLayout
- {
- VerticalOptions = LayoutOptions.EndAndExpand,
- Children =
- {
- new Label
- {
- Text = "This is a Label on Page1"
- }
- }
- };
-
- var page1 = new ContentPage();
- page1.Title = "Page1";
- page1.Content = stackLayout;
- var page2 = new ContentPage();
- page2.Title = "Page2";
-
- page2.Appearing += (s, o) =>
- {
- ManualTest.Confirm();
- };
- btnAdd.Clicked += (s, o) =>
- {
- multiPage.CurrentPage = page2;
- };
- //myMultiPage.ItemsSource = new[] { cPage };
- multiPage.Children.Add(page1);
- multiPage.Children.Add(page2);
-
- await _navigationPage.PushAsync(multiPage);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether SelectedItem property is changed or not.")]
- [Property("SPEC", "Xamarin.Forms.MultiPage<T>.SelectedItem A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Press Back Button")]
- [Step(3, "Pass If Page2 has been displayed otherwise Fail")]
- [Postcondition(1, "Back to TestPage")]
- public async Task SelectedItem_MultiPage_UILK()
- {
- var multiPage = new CustomizeMultiPage();
- multiPage.ItemsSource = null;
- multiPage.ItemTemplate = null;
-
- var page1 = new ContentPage();
- page1.Title = "Page1";
- var page2 = new ContentPage();
- page2.Title = "Page2";
- multiPage.Children.Add(page1);
- multiPage.Children.Add(page2);
- multiPage.SelectedItem = page2;
-
- await _navigationPage.PushAsync(multiPage);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ItemsSource property is displayed or not.")]
- [Property("SPEC", "Xamarin.Forms.MultiPage<T>.ItemsSource A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Press Back Button")]
- [Step(3, "Pass If Page has been displayed with 6 Color Names otherwise Fail")]
- [Postcondition(1, "Back to TestPage")]
- public async Task ItemsSource_MultiPage_UILK()
- {
- var multiPage = new CustomizeMultiPage();
-
- await _navigationPage.PushAsync(multiPage);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ItemTemplate property is displayed or not.")]
- [Property("SPEC", "Xamarin.Forms.MultiPage<T>.ItemTemplate A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Press all color tab")]
- [Step(3, "Press Back Button")]
- [Step(4, "Pass If color tab has been displayed with corresponding color box otherwise Fail")]
- [Postcondition(1, "Back to TestPage")]
- public async Task ItemTemplate_MultiPage_UIBH()
- {
- var multiPage = new CustomizeMultiPage();
-
- await _navigationPage.PushAsync(multiPage);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether CurrentPageChanged event has been evoked or not.")]
- [Property("SPEC", "Xamarin.Forms.MultiPage<T>.CurrentPageChanged E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click 'Page2' Tab")]
- [Step(3, "Press Back Button")]
- [Step(4, "Testcase result will show PASS automatically otherwise FAIL")]
- [Postcondition(1, "Back to TestPage")]
- public async Task CurrentPageChanged_MultiPage_UIBH()
- {
- var multiPage = new CustomizeMultiPage();
- multiPage.ItemsSource = null;
- multiPage.ItemTemplate = null;
-
- var page1 = new ContentPage();
- page1.Title = "Page1";
- var page2 = new ContentPage();
- page2.Title = "Page2";
-
- multiPage.CurrentPageChanged += (s, o) =>
- {
- ManualTest.Confirm();
- };
- multiPage.Children.Add(page1);
- multiPage.Children.Add(page2);
-
- await _navigationPage.PushAsync(multiPage);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether PagesChanged event has been evoked or not.")]
- [Property("SPEC", "Xamarin.Forms.MultiPage<T>.PagesChanged E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Press 'Add Page' button")]
- [Step(3, "If PagesChanged event invoked Testcase result will show PASS automatically otherwise FAIL")]
- [Postcondition(1, "Back to TestPage")]
- public async Task PagesChanged_MultiPage_UIBH()
- {
- var multiPage = new CustomizeMultiPage();
- multiPage.ItemsSource = null;
- multiPage.ItemTemplate = null;
-
- var btnAdd = new Button
- {
- Text = "Add Page",
- BackgroundColor = Color.Blue,
- WidthRequest = 200,
- HeightRequest = 100,
- };
- var stackLayout = new StackLayout
- {
- VerticalOptions = LayoutOptions.EndAndExpand,
- Children =
- {
- btnAdd
- }
- };
-
- var page1 = new ContentPage();
- page1.Title = "Page1";
- page1.Content = stackLayout;
- var page2 = new ContentPage();
- page2.Title = "Page2";
-
- multiPage.Children.Add(page1);
- //multiPage.Children.Add(page2);
-
- multiPage.PagesChanged += async (s, o) =>
- {
- Assert.True(true);
- ManualTest.Confirm();
- await _navigationPage.PopAsync();
- };
- btnAdd.Clicked += (s, o) =>
- {
- //multiPage.CurrentPage = page2;
- multiPage.Children.Add(page2);
- //multiPage.Children.Remove(page2);
- };
-
- await _navigationPage.PushAsync(multiPage);
- //_testPage.ExecuteTC(multiPage);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OnCurrentPageChanged method has been evoked or not.")]
- [Property("SPEC", "Xamarin.Forms.MultiPage<T>.OnCurrentPageChanged M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click 'Page2' Tab")]
- [Step(3, "Press Back Button")]
- [Step(4, "Testcase result will show PASS or FAIL automatically")]
- [Postcondition(1, "Back to TestPage")]
- public async Task OnCurrentPageChanged_MultiPage_UIBH()
- {
- var multiPage = new CustomizeMultiPage();
- multiPage._flagOnCurrentPageChanged = false;
- multiPage.ItemsSource = null;
- multiPage.ItemTemplate = null;
-
- var page1 = new ContentPage();
- page1.Title = "Page1";
- var page2 = new ContentPage();
- page2.Title = "Page2";
- multiPage.Children.Add(page1);
- multiPage.Children.Add(page2);
-
- multiPage._tcOnCurrentPageChanged = true;
- await _navigationPage.PushAsync(multiPage);
- await ManualTest.WaitForConfirm();
- Assert.IsTrue(multiPage._flagOnCurrentPageChanged, "OnCurrentPageChanged is not invoked");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OnChildAdded method has been evoked or not.")]
- [Property("SPEC", "Xamarin.Forms.MultiPage<T>.OnChildAdded M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click 'Add Child' Button")]
- [Step(3, "If OnChildAdded method invoked Testcase result will show PASS automatically otherwise FAIL")]
- [Postcondition(1, "Back to TestPage")]
- public async Task OnChildAdded_MultiPage_UIBH()
- {
- var multiPage = new CustomizeMultiPage();
- multiPage._flagOnChildAdded = false;
- multiPage.ItemsSource = null;
- multiPage.ItemTemplate = null;
-
- var btnAdd = new Button
- {
- Text = "Add Child",
- BackgroundColor = Color.Blue,
- WidthRequest = 200,
- HeightRequest = 100,
- };
- var stackLayout = new StackLayout
- {
- VerticalOptions = LayoutOptions.EndAndExpand,
- Children =
- {
- btnAdd
- }
- };
-
- var page1 = new ContentPage();
- page1.Title = "Page1";
- page1.Content = stackLayout;
- var page2 = new ContentPage();
- page2.Title = "Page2";
-
- btnAdd.Clicked += (s, o) =>
- {
- //multiPage.SelectedItem = page2;
- multiPage.Children.Add(page2);
- //multiPage.Children.Remove(page2);
- };
- multiPage.Children.Add(page1);
- //multiPage.Children.Add(page2);
-
- multiPage._tcOnChildAdded = true;
- await _navigationPage.PushAsync(multiPage);
- await ManualTest.WaitForConfirm();
- Assert.IsTrue(multiPage._flagOnChildAdded, "OnChildAdded is not invoked");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OnPagesChanged method has been evoked or not.")]
- [Property("SPEC", "Xamarin.Forms.MultiPage<T>.OnPagesChanged M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click 'Add Page' button")]
- [Step(3, "If OnPagesChanged method invoked Testcase result will show PASS automatically otherwise FAIL")]
- [Postcondition(1, "Back to TestPage")]
- public async Task OnPagesChanged_MultiPage_UIBH()
- {
- var multiPage = new CustomizeMultiPage();
- multiPage._flagOnPagesChanged = false;
- multiPage.ItemsSource = null;
- multiPage.ItemTemplate = null;
-
- var btnAdd = new Button
- {
- Text = "Add Page",
- BackgroundColor = Color.Blue,
- WidthRequest = 200,
- HeightRequest = 100,
- };
- var stackLayout = new StackLayout
- {
- VerticalOptions = LayoutOptions.EndAndExpand,
- Children =
- {
- btnAdd
- }
- };
-
- var page1 = new ContentPage();
- page1.Title = "Page1";
- page1.Content = stackLayout;
- var page2 = new ContentPage();
- page2.Title = "Page2";
-
- btnAdd.Clicked += (s, o) =>
- {
- //multiPage.SelectedItem = page2;
- multiPage.Children.Add(page2);
- //multiPage.Children.Remove(page2);
- };
- multiPage.Children.Add(page1);
- //multiPage.Children.Add(page2);
-
- multiPage._tcOnPagesChanged = true;
- await _navigationPage.PushAsync(multiPage);
- await ManualTest.WaitForConfirm();
- Assert.IsTrue(multiPage._flagOnPagesChanged, "OnPagesChanged is not invoked");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OnPropertyChanged method has been evoked or not.")]
- [Property("SPEC", "Xamarin.Forms.MultiPage<T>.OnPropertyChanged M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Press 'Page2' Tab")]
- [Step(3, "Press Back Button")]
- [Step(4, "Testcase result will show PASS or FAIL automatically")]
- [Postcondition(1, "Back to TestPage")]
- public async Task OnPropertyChanged_MultiPage_UIBH()
- {
- var multiPage = new CustomizeMultiPage();
- multiPage.ItemsSource = null;
- multiPage.ItemTemplate = null;
- var page1 = new ContentPage();
- page1.Title = "Page1";
- var page2 = new ContentPage();
- page2.Title = "Page2";
- multiPage.Children.Add(page1);
- multiPage.Children.Add(page2);
-
- await _navigationPage.PushAsync(multiPage);
- multiPage._tcOnPropertyChanged = true;
- multiPage._flagOnPropertyChanged = false;
- await ManualTest.WaitForConfirm();
- Assert.IsTrue(multiPage._flagOnPropertyChanged, "OnPropertyChanged is not invoked");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check override method OnBackButtonPressed is invoked.")]
- [Property("SPEC", "Xamarin.Forms.MultiPage<T>.OnBackButtonPressed M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Press back button")]
- [Step(3, "Select each color tab")]
- [Postcondition(1, "Back to TestPage")]
- [Postcondition(2, "Test result will show PASS or FAIL automatically")]
- public async Task OnBackButtonPressed_OVERRIDE_METHOD()
- {
- CustomizeMultiPage customMultiPage = new CustomizeMultiPage();
- customMultiPage._tcOnBackButtonPressed = true;
- await _navigationPage.PushAsync(customMultiPage);
- customMultiPage.flagOnBackButtonPressed = false;
- await ManualTest.WaitForConfirm();
- Assert.IsTrue(customMultiPage.flagOnBackButtonPressed, "OnBackButtonPressed is not invoked");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Appearing event has been evoked or not.")]
- [Property("SPEC", "Xamarin.Forms.MultiPage<T>.Appearing E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click back button")]
- [Step(3, "If Appearing event fire the TC will pass autometically, fail otherwise")]
- [Postcondition(1, "N/A")]
- public async Task Appearing_UIBH()
- {
- /* TEST CODE */
- CustomizeMultiPage multiPage = new CustomizeMultiPage();
- multiPage.Title = "Appearing Test";
- multiPage.ItemsSource = null;
- multiPage.ItemTemplate = null;
- var page1 = new ContentPage();
- page1.Title = "Page1";
- var page2 = new ContentPage();
- page2.Title = "Page2";
- multiPage.Children.Add(page1);
- multiPage.Children.Add(page2);
-
- multiPage.Appearing += (sender, e) =>
- {
- Assert.IsTrue(true);
- ManualTest.Confirm();
- };
-
- _testPage.ExecuteTC(multiPage);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Disappearing event has been evoked or not.")]
- [Property("SPEC", "Xamarin.Forms.MultiPage<T>.Disappearing E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click back button")]
- [Step(3, "If Disappearing event fire the TC will pass autometically, fail otherwise")]
- [Postcondition(1, "N/A")]
- public async Task Disappearing_UIBH()
- {
- /* TEST CODE */
- CustomizeMultiPage multiPage = new CustomizeMultiPage();
- multiPage.Title = "Disappearing Test";
- multiPage.ItemsSource = null;
- multiPage.ItemTemplate = null;
- var page1 = new ContentPage();
- page1.Title = "Page1";
- var page2 = new ContentPage();
- page2.Title = "Page2";
- multiPage.Children.Add(page1);
- multiPage.Children.Add(page2);
-
- multiPage.Disappearing += (sender, e) =>
- {
- Assert.IsTrue(true);
- ManualTest.Confirm();
- };
-
- _testPage.ExecuteTC(multiPage);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Title can set or not.")]
- [Property("SPEC", "Xamarin.Forms.MultiPage<T>.Title A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click Change Title button")]
- [Step(3, "Click Pass if Title is changed, vice versa")]
- [Postcondition(1, "Click back button")]
- public async Task Title_UIBH()
- {
- var multiPage = new CustomizeMultiPage();
- multiPage.ItemsSource = null;
- multiPage.ItemTemplate = null;
- multiPage.Title = "Title";
-
- var btnAdd = new Button
- {
- Text = "Change Title",
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.StartAndExpand
- };
- var stackLayout = new StackLayout
- {
- VerticalOptions = LayoutOptions.EndAndExpand,
- Children =
- {
- btnAdd
- }
- };
-
- var page1 = new ContentPage();
- page1.Title = "Page1";
- page1.Content = stackLayout;
- var page2 = new ContentPage();
- page2.Title = "Page2";
-
- btnAdd.Clicked += (s, o) =>
- {
- multiPage.Title = "Title Changed";
- };
- multiPage.Children.Add(page1);
- multiPage.Children.Add(page2);
-
- _testPage.ExecuteTC(multiPage);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether BackgroundColor can set or not.")]
- [Property("SPEC", "Xamarin.Forms.MultiPage<T>.BackgroundColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click Change BackgroundColor button")]
- [Step(3, "Click Pass if BackgroundColor is changed, vice versa")]
- [Postcondition(1, "Click back button")]
- public async Task BackgroundColor_UIBH()
- {
- var multiPage = new CustomizeMultiPage();
- multiPage.ItemsSource = null;
- multiPage.ItemTemplate = null;
- multiPage.BackgroundColor = Color.Green;
-
- var btnAdd = new Button
- {
- Text = "Change BackgroundColor",
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.StartAndExpand
- };
- var stackLayout = new StackLayout
- {
- VerticalOptions = LayoutOptions.EndAndExpand,
- Children =
- {
- btnAdd
- }
- };
-
- var page1 = new ContentPage();
- page1.Title = "Page1";
- page1.Content = stackLayout;
- var page2 = new ContentPage();
- page2.Title = "Page2";
-
- btnAdd.Clicked += (s, o) =>
- {
- multiPage.BackgroundColor = Color.Yellow;
- };
- multiPage.Children.Add(page1);
- multiPage.Children.Add(page2);
-
- _testPage.ExecuteTC(multiPage);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ToolbarItems can set or not.")]
- [Property("SPEC", "Xamarin.Forms.MultiPage<T>.ToolbarItems A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")]
- [Step(1, "Click run TC")]
- [Step(2, "Click Add ToolbarItems button")]
- [Step(3, "Click Pass if ToolbarItems is added, vice versa")]
- [Postcondition(1, "Click back button")]
- public async Task ToolbarItems_UIBH()
- {
- if (Device.Idiom == TargetIdiom.Phone)
- {
- var multiPage = new CustomizeMultiPage();
- multiPage.ItemsSource = null;
- multiPage.ItemTemplate = null;
- var btnAdd = new Button
- {
- Text = "Add ToolbarItems",
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.StartAndExpand
- };
- var stackLayout = new StackLayout
- {
- VerticalOptions = LayoutOptions.EndAndExpand,
- Children =
- {
- btnAdd
- }
- };
-
- var page1 = new ContentPage();
- page1.Title = "Page1";
- page1.Content = stackLayout;
- var page2 = new ContentPage();
- page2.Title = "Page2";
-
- btnAdd.Clicked += (s, o) =>
- {
- multiPage.ToolbarItems.Add(new ToolbarItem
- {
- Icon = _appResourcePath + "icon/settings_restart.png",
- Name = "Restart",
- Command = new Command(() => { }),
- Order = ToolbarItemOrder.Primary
- }
- );
-
- multiPage.ToolbarItems.Add(new ToolbarItem
- {
- Icon = _appResourcePath + "icon/settings_date_and_time.png",
- Name = "Settings",
- Command = new Command(() => { }),
- Order = ToolbarItemOrder.Secondary
- }
- );
- };
- multiPage.Children.Add(page1);
- multiPage.Children.Add(page2);
-
- _testPage.ExecuteTC(multiPage);
- await ManualTest.WaitForConfirm();
- }
- else
- {
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
- }
- }
-}
+++ /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.Threading.Tasks;
-using WT = WearableTemplate;
-
-using Common = NUnit.Framework;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.NavigationPage test")]
- public class NavigationPageTests
- {
- private static NavigationPage _navigationPage = TestPage.GetInstance().getNavigationPage();
- private static TestPage _testPage = TestPage.GetInstance();
- private static NavigationPage _navigationpage;
- private static StackLayout imageGray;
- private static StackLayout imageRed;
- private static StackLayout imageGreen;
-
- public class CustomNavigationPage : NavigationPage
- {
- public bool _flagOnBackButtonPressed;
-
- public CustomNavigationPage()
- {
- this.Title = "<= Press This Back Button";
- this.BarTextColor = Color.Red;
- }
-
- public CustomNavigationPage(Page page) : base(page)
- {
- //base(page);
- this.Title = "<= Press This Back Button";
- this.BarTextColor = Color.Red;
- }
-
- protected override bool OnBackButtonPressed()
- {
- _flagOnBackButtonPressed = true;
- ManualTest.Confirm();
- return base.OnBackButtonPressed();
- }
- }
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("NavigationPageTests --------------- SetUp()");
- if (ManualTest.IsWearable())
- {
- _navigationPage = WT.TestPage.GetInstance().getNavigationPage();
- }
- else
- {
- _navigationPage = Common.TestPage.GetInstance().getNavigationPage();
- }
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("NavigationPageTests --------------- TearDown()");
- }
-
- private void CreateNavigationPage()
- {
- imageRed = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.Red,
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "RED",
- HorizontalTextAlignment = TextAlignment.Center,
- //Font = Font.BoldSystemFontOfSize(NamedSize.Large)
- }
- }
- };
-
- imageGreen = new StackLayout()
- {
- BackgroundColor = Color.Green,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "GREEN",
- HorizontalTextAlignment = TextAlignment.Center,
- //Font = Font.BoldSystemFontOfSize(NamedSize.Large)
- }
- }
- };
-
- imageGray = new StackLayout()
- {
- BackgroundColor = Color.Gray,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "GRAY",
- HorizontalTextAlignment = TextAlignment.Center,
- //Font = Font.BoldSystemFontOfSize(NamedSize.Large)
- }
- }
- };
-
- var mainUI = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.White,
-
- Children =
- {
- new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 180,
- Orientation = StackOrientation.Horizontal,
- Spacing = 10,
- Padding = new Thickness()
- {
- Left = 20,
- Right = 20
- },
-
- Children =
- {
- imageRed,
- imageGreen,
- imageGray
- }
- }
- }
- };
-
- var page = new ContentPage
- {
- Content = mainUI,
- };
-
- _navigationpage = new NavigationPage(page)
- {
- Title = "Press This Back Button"
- };
-
- _testPage.ExecuteTC(_navigationpage);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OnBackButtonPressed event is invoked or not")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.OnBackButtonPressed E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Press back button")]
- [Step(2, "Testcase result will show PASS of FAIL automatically")]
- [Postcondition(1, "Back to TestPage")]
- public async Task OnBackButtonPressed_EVENT()
- {
- /* TEST CODE */
- CustomNavigationPage navigationPage = new CustomNavigationPage(new ContentPage());
- //NavigationPage navigationPage = new NavigationPage(new Page());
- //await navigationPage.PushAsync(new ContentPage());
- await _navigationPage.PushAsync(navigationPage);
- navigationPage._flagOnBackButtonPressed = false;
- await ManualTest.WaitForConfirm();
- Assert.IsTrue(navigationPage._flagOnBackButtonPressed, "OnBackButtonPressed is not invoked");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether BarBackgroundColor property is changed or not")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.BarBackgroundColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Select a Color after observe BarBackgroundColor of NavigationPage is changed")]
- [Step(3, "Pass If BackgroundColor of NavigationPage changed otherwise Fail")]
- [Postcondition(1, "NA")]
- public async Task BarBackgroundColor_NavigationPage_UIBH()
- {
- if (Device.Idiom == TargetIdiom.Unsupported)
- {
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
-
- CreateNavigationPage();
-
- var tapGestureRecognizerRed = new TapGestureRecognizer();
- tapGestureRecognizerRed.Tapped += async (s, e) =>
- {
- _navigationPage.BarBackgroundColor = Color.Red;
- _navigationPage.Title = "RED";
- await Task.Delay(2000);
- };
- imageRed.GestureRecognizers.Add(tapGestureRecognizerRed);
-
- var tapGestureRecognizerGreen = new TapGestureRecognizer();
- tapGestureRecognizerGreen.Tapped += async (s, e) =>
- {
- _navigationPage.BarBackgroundColor = Color.Green;
- _navigationPage.Title = "GREEN";
- await Task.Delay(2000);
- };
- imageGreen.GestureRecognizers.Add(tapGestureRecognizerGreen);
-
- var tapGestureRecognizerGray = new TapGestureRecognizer();
- tapGestureRecognizerGray.Tapped += (s, e) =>
- {
- _navigationPage.BarBackgroundColor = Color.Gray;
- _navigationPage.Title = "GRAY";
- };
- imageGray.GestureRecognizers.Add(tapGestureRecognizerGray);
- _navigationPage.BarBackgroundColor = Color.Default;
-
- NavigationPage.SetHasNavigationBar(_navigationPage, false);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether BarTextColor property is changed or not")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.BarTextColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Select a Color after observe BarTextColor of NavigationPage is changed")]
- [Step(3, "Pass If BarTextColor of NavigationPage changed otherwise Fail")]
- [Postcondition(1, "NA")]
- public async Task BarTextColor_NavigationPage_UIBH()
- {
- CreateNavigationPage();
-
- var tapGestureRecognizerRed = new TapGestureRecognizer();
- tapGestureRecognizerRed.Tapped += async (s, e) =>
- {
- _navigationPage.Title = "RED";
- _navigationPage.BarTextColor = Color.Red;
- await Task.Delay(2000);
- };
- imageRed.GestureRecognizers.Add(tapGestureRecognizerRed);
-
- var tapGestureRecognizerGreen = new TapGestureRecognizer();
- tapGestureRecognizerGreen.Tapped += async (s, e) =>
- {
- _navigationPage.Title = "GREEN";
- _navigationPage.BarTextColor = Color.Green;
- await Task.Delay(2000);
- };
- imageGreen.GestureRecognizers.Add(tapGestureRecognizerGreen);
-
- var tapGestureRecognizerGray = new TapGestureRecognizer();
- tapGestureRecognizerGray.Tapped += async (s, e) =>
- {
- _navigationPage.Title = "GRAY";
- _navigationPage.BarTextColor = Color.Gray;
- await Task.Delay(2000);
- };
- imageGray.GestureRecognizers.Add(tapGestureRecognizerGray);
- _navigationPage.BarBackgroundColor = Color.Default;
- _navigationPage.BarTextColor = Color.Default;
- await ManualTest.WaitForConfirm();
- }
-
- // Need to FIX
- // [Test]
- [Category("P1")]
- [Description("Check whether SetBackButtonTitle property is set or not")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.SetBackButtonTitle M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Check whether SetBackButtonTitle property is set to '*' or not")]
- [Step(3, "Pass If Back Button Title is * otherwise Fail")]
- [Postcondition(1, "Back to TestPage")]
- public async Task SetBackButtonTitle_NavigationPage_UIBL()
- {
- /* TEST CODE */
- var page = new ContentPage();
-
- var value = "*";
- NavigationPage.SetBackButtonTitle(page, value);
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether BackButton has been displayed or not")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.SetHasBackButton M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")]
- [Step(1, "Click run TC")]
- [Step(2, "Select BackButton true and false then observe Back Button has been displayed and hidden")]
- [Step(3, "Pass If Back Button display changed otherwise Fail")]
- [Postcondition(1, "Back to TestPage")]
- public async Task SetHasBackButton_NavigationPage_UIBH()
- {
- /* TEST CODE */
- if (Device.Idiom == TargetIdiom.Phone)
- {
- _navigationPage.BarBackgroundColor = Color.Default;
- _navigationPage.BarTextColor = Color.Default;
- imageRed = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.Red,
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "BackButton SHOW",
- HorizontalTextAlignment = TextAlignment.Center,
- //Font = Font.BoldSystemFontOfSize(NamedSize.Large)
- }
- }
- };
-
- imageGray = new StackLayout()
- {
- BackgroundColor = Color.Green,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "BackButton HIDE",
- HorizontalTextAlignment = TextAlignment.Center,
- //Font = Font.BoldSystemFontOfSize(NamedSize.Large)
- }
- }
- };
-
- var mainUI = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.White,
-
- Children =
- {
- new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 180,
- Orientation = StackOrientation.Horizontal,
- Spacing = 10,
- Padding = new Thickness()
- {
- Left = 20,
- Right = 20
- },
-
- Children =
- {
- imageRed,
- imageGray
- }
- }
- }
- };
-
- var page = new ContentPage
- {
- Content = mainUI,
- };
- NavigationPage.SetHasBackButton(page, true);
-
- _testPage.ExecuteTC(page);
-
- var tapGestureRecognizerRed = new TapGestureRecognizer();
- tapGestureRecognizerRed.Tapped += async (s, e) =>
- {
- NavigationPage.SetHasBackButton(page, true);
- await Task.Delay(2000);
- };
- imageRed.GestureRecognizers.Add(tapGestureRecognizerRed);
-
- var tapGestureRecognizerGray = new TapGestureRecognizer();
- tapGestureRecognizerGray.Tapped += async (s, e) =>
- {
- NavigationPage.SetHasBackButton(page, false);
- await Task.Delay(2000);
- };
- imageGray.GestureRecognizers.Add(tapGestureRecognizerGray);
-
- await ManualTest.WaitForConfirm();
- }
- else
- {
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether SetHasNavigationBar property is changed or not")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.SetHasNavigationBar M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Select Navigation Bar true and false then observe Navigation Bar has been displayed and hidden")]
- [Step(3, "Pass If Navigation Bar display changed otherwise Fail")]
- [Postcondition(1, "NA")]
- public async Task SetHasNavigationBar_NavigationPage_UIBH()
- {
- _navigationPage.BarBackgroundColor = Color.Default;
- _navigationPage.BarTextColor = Color.Default;
- imageRed = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.Red,
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "NavigationBar SHOW",
- HorizontalTextAlignment = TextAlignment.Center,
- //Font = Font.BoldSystemFontOfSize(NamedSize.Large)
- }
- }
- };
-
- imageGray = new StackLayout()
- {
- BackgroundColor = Color.Green,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "NavigationBar HIDE",
- HorizontalTextAlignment = TextAlignment.Center,
- //Font = Font.BoldSystemFontOfSize(NamedSize.Large)
- }
- }
- };
-
- var mainUI = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.White,
-
- Children =
- {
- new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 180,
- Orientation = StackOrientation.Horizontal,
- Spacing = 10,
- Padding = new Thickness()
- {
- Left = 20,
- Right = 20
- },
-
- Children =
- {
- imageRed,
- imageGray
- }
- }
- }
- };
-
- var page = new ContentPage
- {
- Content = mainUI,
- };
- NavigationPage.SetHasNavigationBar(page, true);
-
- _testPage.ExecuteTC(page);
-
- var tapGestureRecognizerRed = new TapGestureRecognizer();
- tapGestureRecognizerRed.Tapped += async (s, e) =>
- {
- NavigationPage.SetHasNavigationBar(page, true);
- await Task.Delay(2000);
- };
- imageRed.GestureRecognizers.Add(tapGestureRecognizerRed);
-
- var tapGestureRecognizerGray = new TapGestureRecognizer();
- tapGestureRecognizerGray.Tapped += async (s, e) =>
- {
- NavigationPage.SetHasNavigationBar(page, false);
- await Task.Delay(2000);
- };
- imageGray.GestureRecognizers.Add(tapGestureRecognizerGray);
-
- await ManualTest.WaitForConfirm();
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check whether SetTitleIcon property is set or not")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.SetTitleIcon M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Check whether Title Icon is displayed or not")]
- [Step(3, "Pass If Title Icon Title is displayed otherwise Fail")]
- [Postcondition(1, "Back to TestPage")]
- public async Task SetTitleIcon_NavigationPage_UIBL()
- {
- /* TEST CODE */
- var value1 = new FileImageSource();
- var file1 = "../shared/res/Tizen.XamarinForms.Manual.Tests.png";
- value1.File = file1;
-
- var page = new ContentPage();
- NavigationPage.SetTitleIcon(page, value1);
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether a page is presented or not.")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.PushAsync M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")]
- [Step(1, "Click run TC")]
- [Step(2, "Click on 'Go To Page2>>' observe Page2 is displayed or not")]
- [Step(3, "Click on 'Press This Back Button' observe Page1 is displayed or not")]
- [Step(4, "Click on 'Press This Back Button'")]
- [Step(5, "Pass If Everything goes well otherwise Fail")]
- [Postcondition(1, "NA")]
- public async Task PushAsync_NavigationPage_UIBH()
- {
- if (Device.Idiom == TargetIdiom.Phone)
- {
- _navigationPage.BarBackgroundColor = Color.Default;
- _navigationPage.BarTextColor = Color.Default;
-
- var imageRed = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 100,
- WidthRequest = 400,
-
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "Go To Page2 >>",
- HorizontalTextAlignment = TextAlignment.Center,
- //Font = Font.BoldSystemFontOfSize(NamedSize.Large)
- }
- }
- };
-
- NavigationPage navigationPage = new NavigationPage(new ContentPage
- {
- Title = "Page 1",
- Content = imageRed
- });
- navigationPage.Title = "Press This Back Button";
- await _navigationPage.PushAsync(navigationPage);
-
- var page2 = new ContentPage
- {
- Title = "Page 2",
- //Content = imageGreen
- };
-
- var tapGestureRecognizerRed = new TapGestureRecognizer();
- tapGestureRecognizerRed.Tapped += async (s, e) =>
- {
- await navigationPage.PushAsync(page2);
- await Task.Delay(2000);
- };
- imageRed.GestureRecognizers.Add(tapGestureRecognizerRed);
-
- await ManualTest.WaitForConfirm();
- }
- else
- {
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
- }
-
- // [Test] UX guilde will be fixed, then add it.
- [Category("P1")]
- [Description("Check whether a page is presented with animation or not.")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.PushAsync M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click on 'Go To Page2>>' observe Page2 is displayed with animation or not")]
- [Step(3, "Click on 'Press This Back Button' observe Page1 is displayed or not")]
- [Step(4, "Click on 'Press This Back Button'")]
- [Step(5, "Pass If Everything goes well otherwise Fail")]
- [Postcondition(1, "NA")]
- public async Task PushAsync_NavigationPage_WITH_ANIMATION_UIBH()
- {
- _navigationPage.BarBackgroundColor = Color.Default;
- _navigationPage.BarTextColor = Color.Default;
-
- var imageRed = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 100,
- WidthRequest = 400,
- BackgroundColor = Color.White,
-
- Children =
- {
- new Button()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "Go To Page2 >> Without Animation",
- //HorizontalTextAlignment = TextAlignment.Center,
- //Font = Font.BoldSystemFontOfSize(NamedSize.Large)
- },
- }
- };
-
- NavigationPage navigationPage = new NavigationPage(new ContentPage
- {
- Title = "Page 1",
- Content = imageRed,
- BackgroundColor = Color.Red
- });
- navigationPage.Title = "Press This Back Button";
-
- await _navigationPage.PushAsync(navigationPage, true);
-
- var page2 = new ContentPage
- {
- Title = "Page 2",
- //Content = imageGreen
- };
-
- var tapGestureRecognizerRed = new TapGestureRecognizer();
- tapGestureRecognizerRed.Tapped += async (s, e) =>
- {
- await navigationPage.PushAsync(page2, true);
- await Task.Delay(2000);
- };
- imageRed.GestureRecognizers.Add(tapGestureRecognizerRed);
-
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether top page is removed or not.")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.PopAsync M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")]
- [Step(1, "Click run TC")]
- [Step(2, "Click on 'Go To Page2>>' observe Page2 is displayed or not")]
- [Step(3, "Click on 'Back To Page1' observe Page1 is displayed or not")]
- [Step(4, "Click on 'Press This Back Button'")]
- [Step(5, "Pass If Everything goes well otherwise Fail")]
- [Postcondition(1, "NA")]
- public async Task PopAsync_NavigationPage_UIBH()
- {
- if (Device.Idiom == TargetIdiom.Phone)
- {
- _navigationPage.BarBackgroundColor = Color.Default;
- _navigationPage.BarTextColor = Color.Default;
- var imageRed = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 100,
- WidthRequest = 400,
-
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "Go To Page2 >>",
- HorizontalTextAlignment = TextAlignment.Center,
- //Font = Font.BoldSystemFontOfSize(NamedSize.Large)
- }
- }
- };
-
- var imageGreen = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 100,
- WidthRequest = 400,
- BackgroundColor = Color.White,
-
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "<< Back To Page1",
- HorizontalTextAlignment = TextAlignment.Center,
- //Font = Font.BoldSystemFontOfSize(NamedSize.Large)
- }
- }
- };
-
- NavigationPage navigationPage = new NavigationPage(new ContentPage
- {
- Title = "Page 1",
- Content = imageRed
- });
- navigationPage.Title = "Press This Back Button";
- await _navigationPage.PushAsync(navigationPage);
-
- var page2 = new ContentPage
- {
- Title = "Page 2",
- Content = imageGreen
- };
-
- var tapGestureRecognizerRed = new TapGestureRecognizer();
- tapGestureRecognizerRed.Tapped += async (s, e) =>
- {
- await navigationPage.PushAsync(page2);
- await Task.Delay(2000);
- };
- imageRed.GestureRecognizers.Add(tapGestureRecognizerRed);
-
- var tapGestureRecognizerGreen = new TapGestureRecognizer();
- tapGestureRecognizerGreen.Tapped += async (s, e) =>
- {
- await navigationPage.PopAsync();
- await Task.Delay(2000);
- };
- imageGreen.GestureRecognizers.Add(tapGestureRecognizerGreen);
-
- await ManualTest.WaitForConfirm();
- }
- else
- {
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
- }
-
- // [Test] UX guilde will be fixed, then add it.
- [Category("P1")]
- [Description("Check whether top page is removed with animation or not.")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.PopAsync M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click on 'Go To Page2>>' observe Page2 is displayed or not")]
- [Step(3, "Click on 'Back To Page1' observe Page1 is displayed with animation or not")]
- [Step(4, "Click on 'Press This Back Button'")]
- [Step(5, "Pass If Everything goes well otherwise Fail")]
- [Postcondition(1, "NA")]
- public async Task PopAsync_NavigationPage_WITH_ANIMATION_UIBH()
- {
- _navigationPage.BarBackgroundColor = Color.Default;
- _navigationPage.BarTextColor = Color.Default;
- var imageRed = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 100,
- WidthRequest = 400,
- BackgroundColor = Color.White,
-
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "Go To Page2 >>",
- HorizontalTextAlignment = TextAlignment.Center,
- //Font = Font.BoldSystemFontOfSize(NamedSize.Large)
- }
- }
- };
-
- var imageGreen = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 100,
- WidthRequest = 400,
- BackgroundColor = Color.White,
-
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "<< Back To Page1",
- HorizontalTextAlignment = TextAlignment.Center,
- //Font = Font.BoldSystemFontOfSize(NamedSize.Large)
- }
- }
- };
-
- NavigationPage navigationPage = new NavigationPage(new ContentPage
- {
- Title = "Page 1",
- Content = imageRed
- });
- navigationPage.Title = "Press This Back Button";
- await _navigationPage.PushAsync(navigationPage, true);
-
- var page2 = new ContentPage
- {
- Title = "Page 2",
- Content = imageGreen
- };
-
- var tapGestureRecognizerRed = new TapGestureRecognizer();
- tapGestureRecognizerRed.Tapped += async (s, e) =>
- {
- await navigationPage.PushAsync(page2, true);
- await Task.Delay(2000);
- };
- imageRed.GestureRecognizers.Add(tapGestureRecognizerRed);
-
- var tapGestureRecognizerGreen = new TapGestureRecognizer();
- tapGestureRecognizerGreen.Tapped += async (s, e) =>
- {
- await navigationPage.PopAsync(true);
- await Task.Delay(2000);
- };
- imageGreen.GestureRecognizers.Add(tapGestureRecognizerGreen);
-
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether all page is removed except root page or not.")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.PopToRootAsync M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")]
- [Step(1, "Click run TC")]
- [Step(2, "Click on 'Go To Page2>>' observe Page2 is displayed or not")]
- [Step(3, "Click on 'Go To Page3>>' observe Page3 is displayed or not")]
- [Step(4, "Click on 'Back To Page1' observe Page1 is displayed or not")]
- [Step(5, "Click on 'Press This Back Button'")]
- [Step(6, "Pass If Everything goes well otherwise Fail")]
- [Postcondition(1, "NA")]
- public async Task PopToRootAsync_NavigationPage_UIBH()
- {
- if (Device.Idiom == TargetIdiom.Phone)
- {
- _navigationPage.BarBackgroundColor = Color.Default;
- _navigationPage.BarTextColor = Color.Default;
-
- var imageRed = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 100,
- WidthRequest = 400,
- };
- var imageBlue = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 100,
- WidthRequest = 400,
- };
- var imageGreen = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 100,
- WidthRequest = 400,
- };
-
- NavigationPage navigationPage = new NavigationPage(new ContentPage
- {
- Title = "Page 1",
- Content = imageRed
- });
- navigationPage.Title = "Press This Back Button";
- await _navigationPage.PushAsync(navigationPage);
-
- var page2 = new ContentPage
- {
- Title = "Page 2",
- Content = imageBlue
- };
- var page3 = new ContentPage
- {
- Title = "Page 3",
- Content = imageGreen
- };
-
- var button1 = new Button
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "Go To Page2 >>",
- };
- button1.Clicked += async (s, e) =>
- {
- await navigationPage.PushAsync(page2);
- await Task.Delay(2000);
- };
- imageRed.Children.Add(button1);
-
- var button2 = new Button
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "Go To Page3 >>",
- BackgroundColor = Color.Black,
- };
- button2.Clicked += async (s, e) =>
- {
- await navigationPage.PushAsync(page3);
- await Task.Delay(2000);
- };
- imageBlue.Children.Add(button2);
-
- var button3 = new Button
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "<< Back To Page1",
- BackgroundColor = Color.Black,
- };
- button3.Clicked += async (s, e) =>
- {
- await navigationPage.PopToRootAsync();
- await Task.Delay(2000);
- };
- imageGreen.Children.Add(button3);
-
- await ManualTest.WaitForConfirm();
- }
- else
- {
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
- }
-
- //[Test] UX guilde will be fixed, then add it.
- [Category("P1")]
- [Description("Check whether all page is removed except root page with animation or not.")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.PopToRootAsync M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click on 'Go To Page2>>' observe Page2 is displayed or not")]
- [Step(3, "Click on 'Go To Page3>>' observe Page3 is displayed or not")]
- [Step(4, "Click on 'Back To Page1' observe Page1 is displayed with animation or not")]
- [Step(5, "Click on 'Press This Back Button'")]
- [Step(6, "Pass If Everything goes well otherwise Fail")]
- [Postcondition(1, "NA")]
- public async Task PopToRootAsync_NavigationPage_WITH_ANIMATION_UIBH()
- {
- var imageRed = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 100,
- WidthRequest = 400,
- BackgroundColor = Color.White,
-
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "Go To Page2 >>",
- HorizontalTextAlignment = TextAlignment.Center,
- //Font = Font.BoldSystemFontOfSize(NamedSize.Large)
- }
- }
- };
- var imageBlue = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 100,
- WidthRequest = 400,
- BackgroundColor = Color.White,
-
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "Go To Page3 >>",
- HorizontalTextAlignment = TextAlignment.Center,
- //Font = Font.BoldSystemFontOfSize(NamedSize.Large)
- }
- }
- };
- var imageGreen = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 100,
- WidthRequest = 400,
- BackgroundColor = Color.White,
-
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "<< Back To Page1",
- HorizontalTextAlignment = TextAlignment.Center,
- //Font = Font.BoldSystemFontOfSize(NamedSize.Large)
- }
- }
- };
-
- NavigationPage navigationPage = new NavigationPage(new ContentPage
- {
- Title = "Page 1",
- Content = imageRed
- });
- navigationPage.Title = "Press This Back Button";
- await _navigationPage.PushAsync(navigationPage);
-
- var page2 = new ContentPage
- {
- Title = "Page 2",
- Content = imageBlue
- };
- var page3 = new ContentPage
- {
- Title = "Page 3",
- Content = imageGreen
- };
-
- var tapGestureRecognizerRed = new TapGestureRecognizer();
- tapGestureRecognizerRed.Tapped += async (s, e) =>
- {
- await navigationPage.PushAsync(page2, true);
- await Task.Delay(2000);
- };
- imageRed.GestureRecognizers.Add(tapGestureRecognizerRed);
-
- var tapGestureRecognizerBlue = new TapGestureRecognizer();
- tapGestureRecognizerBlue.Tapped += async (s, e) =>
- {
- await navigationPage.PushAsync(page3, true);
- await Task.Delay(2000);
- };
- imageBlue.GestureRecognizers.Add(tapGestureRecognizerBlue);
-
- var tapGestureRecognizerGreen = new TapGestureRecognizer();
- tapGestureRecognizerGreen.Tapped += async (s, e) =>
- {
- await navigationPage.PopToRootAsync(true);
- await Task.Delay(2000);
- };
- imageGreen.GestureRecognizers.Add(tapGestureRecognizerGreen);
-
- await ManualTest.WaitForConfirm();
- }
-
- private static void OnPushed(object sender, EventArgs e)
- {
- // If your test is fail, you should set Assert.True(false , "msg");
- Assert.True(true);
- // ManualTest.Confirm() API will terminate WaitForConfirm() method, and will execute rest of the code.
- ManualTest.Confirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Pushed event is invoked or not")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.Pushed E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click on 'Go To Page2>>' observe Page2 is displayed or not")]
- [Step(3, "Click on 'Press This Back Button' observe Page1 is displayed or not")]
- [Step(4, "Click on 'Press This Back Button'")]
- [Step(5, "Testcase result will show automatically")]
- [Postcondition(1, "NA")]
- public async Task Pushed_NavigationPage_EVENT()
- {
- var imageRed = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 100,
- WidthRequest = 400,
- BackgroundColor = Color.White,
-
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "Go To Page2 >>",
- TextColor = Color.Black,
- BackgroundColor = Color.White,
- HorizontalTextAlignment = TextAlignment.Center,
- //Font = Font.BoldSystemFontOfSize(NamedSize.Large)
- }
- }
- };
-
- NavigationPage navigationPage = new NavigationPage(new ContentPage
- {
- Title = "Page 1",
- Content = imageRed
- });
- navigationPage.Title = "Press This Back Button";
- await _navigationPage.PushAsync(navigationPage);
-
- var page2 = new ContentPage
- {
- Title = "Page 2",
- //Content = imageGreen
- };
-
- navigationPage.Pushed += OnPushed;
- var tapGestureRecognizerRed = new TapGestureRecognizer();
- tapGestureRecognizerRed.Tapped += async (s, e) =>
- {
- await navigationPage.PushAsync(page2);
- await Task.Delay(2000);
- };
- imageRed.GestureRecognizers.Add(tapGestureRecognizerRed);
-
- await ManualTest.WaitForConfirm();
- navigationPage.Pushed -= OnPushed;
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Popped event is invoked or not")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.Popped E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click on 'Go To Page2>>' observe Page2 is displayed or not")]
- [Step(3, "Click on '<<Back To Page1' observe Page1 is displayed or not")]
- [Step(4, "Click on 'Press This Back Button'")]
- [Step(5, "Testcase result will show automatically")]
- [Postcondition(1, "NA")]
- public async Task Popped_NavigationPage_EVENT()
- {
- var imageRed = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 100,
- WidthRequest = 400,
- BackgroundColor = Color.White,
-
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "Go To Page2 >>",
- TextColor = Color.Black,
- BackgroundColor = Color.White,
- HorizontalTextAlignment = TextAlignment.Center,
- //Font = Font.BoldSystemFontOfSize(NamedSize.Large)
- }
- }
- };
-
- var imageGreen = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 100,
- WidthRequest = 400,
- BackgroundColor = Color.White,
-
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "<< Back To Page1",
- HorizontalTextAlignment = TextAlignment.Center,
- //Font = Font.BoldSystemFontOfSize(NamedSize.Large)
- }
- }
- };
-
- NavigationPage navigationPage = new NavigationPage(new ContentPage
- {
- Title = "Page 1",
- Content = imageRed
- });
- navigationPage.Title = "Press This Back Button";
- await _navigationPage.PushAsync(navigationPage);
-
- var page2 = new ContentPage
- {
- Title = "Page 2",
- Content = imageGreen
- };
-
- var tapGestureRecognizerRed = new TapGestureRecognizer();
- tapGestureRecognizerRed.Tapped += async (s, e) =>
- {
- await navigationPage.PushAsync(page2);
- await Task.Delay(2000);
- };
- imageRed.GestureRecognizers.Add(tapGestureRecognizerRed);
-
- navigationPage.Popped += OnPushed;
-
- var tapGestureRecognizerGreen = new TapGestureRecognizer();
- tapGestureRecognizerGreen.Tapped += async (s, e) =>
- {
- await navigationPage.PopAsync();
- await Task.Delay(2000);
- };
- imageGreen.GestureRecognizers.Add(tapGestureRecognizerGreen);
-
- await ManualTest.WaitForConfirm();
- navigationPage.Popped += OnPushed;
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether PoppedToRoot event is invoked or not")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.PoppedToRoot E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click on 'Go To Page2>>' observe Page2 is displayed or not")]
- [Step(3, "Click on 'Go To Page3>>' observe Page3 is displayed or not")]
- [Step(4, "Click on '<<Back To Page1' observe Page1 is displayed or not")]
- [Step(5, "Click on 'Press This Back Button'")]
- [Step(6, "Testcase result will show automatically")]
- [Postcondition(1, "NA")]
- public async Task PoppedToRoot_NavigationPage_EVENT()
- {
- var imageRed = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 100,
- WidthRequest = 400,
- BackgroundColor = Color.White,
-
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "Go To Page2 >>",
- TextColor = Color.Black,
- BackgroundColor = Color.White,
- HorizontalTextAlignment = TextAlignment.Center,
- //Font = Font.BoldSystemFontOfSize(NamedSize.Large)
- }
- }
- };
- var imageBlue = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 100,
- WidthRequest = 400,
- BackgroundColor = Color.White,
-
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "Go To Page3 >>",
- HorizontalTextAlignment = TextAlignment.Center,
- //Font = Font.BoldSystemFontOfSize(NamedSize.Large)
- }
- }
- };
- var imageGreen = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 100,
- WidthRequest = 400,
- BackgroundColor = Color.White,
-
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "<< Back To Page1",
- HorizontalTextAlignment = TextAlignment.Center,
- //Font = Font.BoldSystemFontOfSize(NamedSize.Large)
- }
- }
- };
-
- NavigationPage navigationPage = new NavigationPage(new ContentPage
- {
- Title = "Page 1",
- Content = imageRed
- });
- navigationPage.Title = "Press This Back Button";
- await _navigationPage.PushAsync(navigationPage);
-
- var page2 = new ContentPage
- {
- Title = "Page 2",
- Content = imageBlue
- };
- var page3 = new ContentPage
- {
- Title = "Page 3",
- Content = imageGreen
- };
-
- var tapGestureRecognizerRed = new TapGestureRecognizer();
- tapGestureRecognizerRed.Tapped += async (s, e) =>
- {
- await navigationPage.PushAsync(page2);
- await Task.Delay(2000);
- };
- imageRed.GestureRecognizers.Add(tapGestureRecognizerRed);
-
- var tapGestureRecognizerBlue = new TapGestureRecognizer();
- tapGestureRecognizerBlue.Tapped += async (s, e) =>
- {
- await navigationPage.PushAsync(page3);
- await Task.Delay(2000);
- };
- imageBlue.GestureRecognizers.Add(tapGestureRecognizerBlue);
-
- navigationPage.Pushed += OnPushed;
- var tapGestureRecognizerGreen = new TapGestureRecognizer();
- tapGestureRecognizerGreen.Tapped += async (s, e) =>
- {
- await navigationPage.PopToRootAsync();
- await Task.Delay(2000);
- };
- imageGreen.GestureRecognizers.Add(tapGestureRecognizerGreen);
-
- await ManualTest.WaitForConfirm();
- navigationPage.Pushed -= OnPushed;
- }
- }
-}
+++ /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;
-using WT = WearableTemplate;
-using Common = NUnit.Framework;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class PageTests
- {
- private static Page _page = TestPage.GetInstance().getNavigationPage();
-
- public class CustomNavigationPage : NavigationPage
- {
- public bool _flagOnBackButtonPressed;
-
- protected override bool OnBackButtonPressed()
- {
- _flagOnBackButtonPressed = true;
- ManualTest.Confirm();
- return base.OnBackButtonPressed();
- }
- }
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("PageTests --------------- SetUp()");
- if (ManualTest.IsWearable())
- {
- _page = WT.TestPage.GetInstance().getNavigationPage();
- }
- else
- {
- _page = Common.TestPage.GetInstance().getNavigationPage();
- }
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("PageTests --------------- TearDown()");
- }
-
- private void CreateNavigationPage()
- {
- }
-
- [Test]
- [Category("P1")]
- [Description("Check an alert occur. Please click 'Cancel' to turn off it.")]
- [Property("SPEC", "Xamarin.Forms.Page.DisplayAlert M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("COVPARAM", "string, string, string")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Observe Alert")]
- [Step(3, "Click Pass if alert occur, vice versa")]
- [Postcondition(1, "NA")]
- public async Task DisplayAlert_RETURN()
- {
- /* TEST CODE */
- await _page.DisplayAlert("AlertPage", "This is an alert. If you want to turn off this please click Cancel. Then click Pass", "Cancel");
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check an alert occur. Please click 'No'.")]
- [Property("SPEC", "Xamarin.Forms.Page.DisplayAlert M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("COVPARAM", "string, string, string, string")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Observe Alert")]
- [Step(3, "Click 'No'")]
- [Step(4, "Testcase result will show automatically")]
- [Postcondition(1, "Click back button")]
- public async Task DisplayAlert_CONFIRM_NO()
- {
- /* TEST CODE */
- var confirm = await _page.DisplayAlert("AlertPage", "This is an alert. Please click No", "Yes", "No");
- Assert.IsInstanceOf<bool>(confirm);
- Assert.IsFalse(confirm, "Confirm should be return false");
- TestPage.GetInstance().UnlockUIButton();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check an alert occur. Please click 'Yes'.")]
- [Property("SPEC", "Xamarin.Forms.Page.DisplayAlert M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("COVPARAM", "string, string, string, string")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Observe Alert")]
- [Step(3, "Click 'Yes'")]
- [Step(4, "Testcase result will show automatically")]
- [Postcondition(1, "Click back button")]
- public async Task DisplayAlert_CONFIRM_YES()
- {
- /* TEST CODE */
- var confirm = await _page.DisplayAlert("AlertPage", "This is an alert. Please click Yes", "Yes", "No");
- Assert.IsInstanceOf<bool>(confirm);
- Assert.IsTrue(confirm, "Confirm should be return true");
- TestPage.GetInstance().UnlockUIButton();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check an alert occur. Click any button then check log return.")]
- [Property("SPEC", "Xamarin.Forms.Page.DisplayActionSheet M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("COVPARAM", "string, string, string, string")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Alert show an action sheet")]
- [Step(3, "Click any button(except 'Cancel')")]
- [Step(4, "This TC is pass if DisplayActionSheet dissappear")]
- [Postcondition(1, "Click back button")]
- public async Task DisplayActionSheet_RETURN()
- {
- /* TEST CODE */
- var confirm = await _page.DisplayActionSheet("AlertPage", "Cancel", "Destruction", "Btn0", "Btn1", "Btn2");
- Tizen.Log.Debug("TCT", "DisplayActionSheet_RETURN return string is :" + confirm.ToString());
- Console.WriteLine("DisplayActionSheet_RETURN return string is :" + confirm.ToString());
- Assert.IsInstanceOf<string>(confirm);
- TestPage.GetInstance().UnlockUIButton();
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System.Threading.Tasks;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.PanGestureRecognizer test")]
- public class PanGestureRecognizerTests
- {
- private bool _flagPanUpdated = false;
- private PanGestureRecognizer _panGestureRecognizer;
- private static NavigationPage _navigationPage = TestPage.GetInstance().getNavigationPage();
-
- [SetUp]
- public void Setup()
- {
- Console.WriteLine("PanGestureRecognizerTests --------------- Setup()");
- _panGestureRecognizer = new PanGestureRecognizer();
- if (ManualTest.IsWearable())
- {
- _navigationPage = WearableTemplate.TestPage.GetInstance().getNavigationPage();
- }
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("PanGestureRecognizerTests --------------- TearDown()");
- _panGestureRecognizer = null;
- }
-
- private void CreateLayout()
- {
- LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "CreateButton");
-
- var layout = new StackLayout()
- {
- IsVisible = true,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- };
-
- Image image = new Image()
- {
- Source = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "TED/thumbnail/a.jpg",
- };
- image.GestureRecognizers.Add(_panGestureRecognizer);
- layout.Children.Add(image);
-
- _navigationPage.PushAsync(new ContentPage { Content = layout, Title = "Test PanUpdated" });
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether PanUpdated Event is raised when the pan gesture changes.")]
- [Property("SPEC", "Xamarin.Forms.PanGestureRecognizer.PanUpdated E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Slide your finger on shown image")]
- [Step(3, "Click Back button")]
- [Step(4, "Testcase result will show PASS of FAIL automatically")]
- [Postcondition(1, "NA")]
- public async Task PanUpdated_EVENT()
- {
- /* TEST CODE */
- _panGestureRecognizer.TouchPoints = 3;
- _panGestureRecognizer.PanUpdated += onPanUpdated;
- _flagPanUpdated = false;
- CreateLayout();
- await ManualTest.WaitForConfirm();
- Assert.IsTrue(_flagPanUpdated, "PanUpdated is not called");
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _panGestureRecognizer.PanUpdated -= onPanUpdated;
- }
-
- private void onPanUpdated(object sender, PanUpdatedEventArgs e)
- {
- _flagPanUpdated = true;
- TLogger.Write("PanUpdated Event!!!");
- ManualTest.Confirm();
- }
- }
-}
+++ /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 Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.Picker test")]
- public class PickerTests
- {
- private static NavigationPage _navigationPage = TestPage.GetInstance().getNavigationPage();
- private static TestPage _testPage = TestPage.GetInstance();
- private static Picker _picker;
- private static Dictionary<string, Color> _nameToColor;
- private static ContentPage _page;
- private static BoxView _boxView;
-
- [SetUp]
- public void SetUp()
- {
- if (Device.Idiom == TargetIdiom.Phone || Device.Idiom == TargetIdiom.TV)
- {
- Console.WriteLine("PickerTests --------------- SetUp()");
- _picker = new Picker();
- }
- else
- {
- Console.WriteLine("Not supported on this profile");
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("PickerTests --------------- TearDown()");
- }
-
- private static void CreateColorPicker()
- {
- _nameToColor = new Dictionary<string, Color>
- {
- { "Aqua", Color.Aqua }, { "Black", Color.Black },
- { "Blue", Color.Blue },
- { "Gray", Color.Gray }, { "Green", Color.Green },
- { "Lime", Color.Lime }, { "Maroon", Color.Maroon },
- { "Navy", Color.Navy }, { "Olive", Color.Olive },
- { "Purple", Color.Purple }, { "Red", Color.Red },
- { "Silver", Color.Silver }, { "Teal", Color.Teal },
- { "White", Color.White }, { "Yellow", Color.Yellow }
- };
- foreach (string colorName in _nameToColor.Keys)
- {
- _picker.Items.Add(colorName);
- }
-
- _boxView = new BoxView
- {
- WidthRequest = 150,
- HeightRequest = 150,
- HorizontalOptions = LayoutOptions.Center,
- VerticalOptions = LayoutOptions.CenterAndExpand
- };
-
- _page = new ContentPage
- {
- Content = new StackLayout
- {
- Children =
- {
- _picker,_boxView
- }
- }
- };
-
- _testPage.ExecuteTC(_page);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the title for the Picker is displayed or not")]
- [Property("SPEC", "Xamarin.Forms.Picker.Title A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click on Picker")]
- [Step(3, "Pass If Picker Title is displayed otherwise Fail")]
- [Postcondition(1, "Back to TestPage")]
- public async Task Title_Picker_UILK()
- {
- /* TEST CODE */
- CreateColorPicker();
- _picker.Title = "Picker Title";
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the TextColor property is worked properly or not")]
- [Property("SPEC", "Xamarin.Forms.Picker.TextColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "When you test on TV, you should click Picker and then check the text color.")]
- [Step(1, "Click run TC")]
- [Step(2, "Click on Picker and select any item.")]
- [Step(3, "Pass If Picker Text Color is Red, otherwise Fail")]
- [Postcondition(1, "Back to TestPage")]
- public async Task TextColor_Picker_UILK()
- {
- /* TEST CODE */
- CreateColorPicker();
- _picker.Title = "Picker Title";
- _picker.TextColor = Color.Red;
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the SelectedItem property is worked properly or not")]
- [Property("SPEC", "Xamarin.Forms.Picker.SelectedItem A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click on Picker")]
- [Step(3, "Select any item on Picker")]
- [Step(4, "Pass If picker's text is same with text of selected item, otherwise Fail")]
- [Postcondition(1, "Back to TestPage")]
- public async Task SelectedItem_Picker_UILK()
- {
- /* TEST CODE */
- CreateColorPicker();
- _picker.Title = "Picker Title";
- _picker.TextColor = Color.Green;
- _picker.SelectedItem = _picker.Items[4];
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the SelectedIndex property is worked properly or not")]
- [Property("SPEC", "Xamarin.Forms.Picker.SelectedIndex A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click on Picker")]
- [Step(3, "Select any item on Picker")]
- [Step(4, "Pass If picker's text is same with text of selected item, otherwise Fail")]
- [Postcondition(1, "Back to TestPage")]
- public async Task SelectedIndex_Picker_UILK()
- {
- /* TEST CODE */
- CreateColorPicker();
- _picker.Title = "Picker Title";
- _picker.TextColor = Color.Red;
- _picker.SelectedIndex = 5;
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the SelectedIndex property is worked properly or not")]
- [Property("SPEC", "Xamarin.Forms.Picker.SelectedIndex A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click on Picker")]
- [Step(3, "Select any item on Picker")]
- [Step(4, "Pass If picker's text is same with text of selected item, otherwise Fail")]
- [Postcondition(1, "Back to TestPage")]
- public async Task ItemsSource_Picker_UILK()
- {
- /* TEST CODE */
- //CreateColorPicker();
-
- var colorTable = new List<string>()
- {
- { "Color.Aqua" },
- { "Color.Blue"},
- { "Color.Fuchsia"},
- { "Color.Green"},
- };
- var picker = new Picker();
- picker.Title = "Picker Title";
- picker.TextColor = Color.Red;
-
- string[] pageDetailArray =
- {
- "PickerItem 1", "PickerItem 2", "PickerItem 3", "PickerItem 4"
- };
- picker.ItemsSource = pageDetailArray;
-
- var page = new ContentPage
- {
- Content = new StackLayout
- {
- Children =
- {
- picker
- }
- }
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the SelectedIndexChanged event is invoked or not")]
- [Property("SPEC", "Xamarin.Forms.Picker.SelectedIndexChanged E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click on Picker")]
- [Step(3, "Select any color from the color list")]
- [Step(3, "Pass If a BoxView Color is changed accordingly otherwise Fail")]
- [Postcondition(1, "Back to TestPage")]
- public async Task SelectedIndexChanged_Picker_EVENT()
- {
- /* TEST CODE */
- CreateColorPicker();
- _picker.Title = "Picker Title";
-
- _picker.SelectedIndexChanged += (sender, args) =>
- {
- if (_picker.SelectedIndex == -1)
- {
- _boxView.Color = Color.Default;
- }
- else
- {
- string colorName = _picker.Items[_picker.SelectedIndex];
- _boxView.Color = _nameToColor[colorName];
- }
- };
-
- await ManualTest.WaitForConfirm();
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System.Threading.Tasks;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.PinchGestureRecognizer test")]
- public class PinchGestureRecognizerTests
- {
- private bool _flagPinchUpdated = false;
- private static TestPage _testPage = TestPage.GetInstance();
- private PinchGestureRecognizer _pinchGestureRecognizer;
- private static NavigationPage _navigationPage = TestPage.GetInstance().getNavigationPage();
-
- [SetUp]
- public void Setup()
- {
- Console.WriteLine("PinchGestureRecognizerTests --------------- Setup()");
- _pinchGestureRecognizer = new PinchGestureRecognizer();
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("PinchGestureRecognizerTests --------------- TearDown()");
- _pinchGestureRecognizer = null;
- }
-
- private void CreateLayout()
- {
- LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "CreateButton");
-
- var layout = new StackLayout()
- {
- IsVisible = true,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- };
-
- Image image = new Image()
- {
- Source = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "TED/thumbnail/a.jpg",
- };
- image.GestureRecognizers.Add(_pinchGestureRecognizer);
- layout.Children.Add(image);
- _navigationPage.PushAsync(new ContentPage { Content = layout, Title = "Test: PinchUpdated" });
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether PinchUpdated Event is raised when the pan gesture changes.")]
- [Property("SPEC", "Xamarin.Forms.PinchGestureRecognizer.PinchUpdated E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")]
- [Step(1, "Click run TC")]
- [Step(2, "Action as zoom image")]
- [Step(3, "Zoom event will pass automatically ( althought image not zoom in view)")]
- [Postcondition(1, "Press back to return Test Page")]
- public async Task PinchUpdated_EVENT()
- {
- /* TEST CODE */
- if (Device.Idiom == TargetIdiom.Phone)
- {
- _pinchGestureRecognizer.PinchUpdated += onPinchUpdatedGestureRecognizer;
- _flagPinchUpdated = false;
- CreateLayout();
- await ManualTest.WaitForConfirm();
- Assert.IsTrue(_flagPinchUpdated, "PinchUpdated is not called");
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _pinchGestureRecognizer.PinchUpdated -= onPinchUpdatedGestureRecognizer;
- }
- else
- {
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
- }
-
- private void onPinchUpdatedGestureRecognizer(object sender, PinchGestureUpdatedEventArgs e)
- {
- _flagPinchUpdated = true;
- TLogger.Write("PinchUpdated Event!!!");
- ManualTest.Confirm();
- }
- }
-}
+++ /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;
-using WT = WearableTemplate;
-using Common = NUnit.Framework;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.ProgressBar test")]
- public class ProgressBarTests
- {
- private static NavigationPage _navigationPage = TestPage.GetInstance().getNavigationPage();
- private static TestPage _testPage = TestPage.GetInstance();
- private static ProgressBar _progressBar;
- private static Button _btnProgressIncrease, _btnProgressDecrease;
- private static StackLayout _stackLayout, _mainStack;
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("ProgressBarTests --------------- SetUp()");
- _progressBar = new ProgressBar();
- _btnProgressIncrease = new Button();
- _btnProgressDecrease = new Button();
-
- if (ManualTest.IsWearable())
- {
- _navigationPage = WT.TestPage.GetInstance().getNavigationPage();
- }
- else
- {
- _navigationPage = Common.TestPage.GetInstance().getNavigationPage();
- }
-
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("ProgressBarTests --------------- TearDown()");
- }
-
- private static void CreateProgressBarNewPage(string progressBarText)
- {
- _progressBar = new ProgressBar()
- {
- IsVisible = false,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- };
- _btnProgressIncrease = new Button()
- {
- IsVisible = false,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- FontAttributes = FontAttributes.Bold,
- WidthRequest = 50,
- Text = "+"
- };
- _btnProgressDecrease = new Button()
- {
- IsVisible = false,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- FontAttributes = FontAttributes.Bold,
- WidthRequest = 50,
- Text = "-"
- };
-
- _stackLayout = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _progressBar, _btnProgressIncrease, _btnProgressDecrease
- },
- Spacing = 20,
- };
- _mainStack = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.Center,
- Children =
- {
- _stackLayout,
- },
- Padding = new Thickness()
- {
- Left = 50,
- Right = 50
- }
- };
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = _mainStack,
- Title = progressBarText,
- });
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the Progress increase/decrease in progressbar or not")]
- [Property("SPEC", "Xamarin.Forms.ProgressBar.Progress A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click on (+) or (-) Button")]
- [Step(3, "Pass If Progress increase or decrease accordingly otherwise Fail")]
- [Postcondition(1, "Back to TestPage")]
- public async Task Progress_ProgressBar_UILK()
- {
- /* TEST CODE */
- var text = "ProgressBarTest-Progress";
- double d = 0.0;
- CreateProgressBarNewPage(text);
- _progressBar.IsVisible = true;
-
- _btnProgressIncrease.IsVisible = true;
- _btnProgressIncrease.Clicked += (s, e) =>
- {
- d += 0.2;
- if (d > 1.0)
- d = 1.0;
- _progressBar.Progress=d;
- };
-
- _btnProgressDecrease.IsVisible = true;
- _btnProgressDecrease.Clicked += (s, e) =>
- {
- d -= 0.2;
- if (d < 0.0)
- d = 0.0;
- _progressBar.Progress = d;
- };
-
- await ManualTest.WaitForConfirm();
- }
-
- // Tizen Limitation in preview3
- //[Test]
- [Category("P1")]
- [Description("Check whether the Progress increase/decrease in progressbar or not")]
- [Property("SPEC", "Xamarin.Forms.ProgressBar.ProgressTo A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click on (+) or (-) Button")]
- [Step(3, "Pass If Progress increase or decrease accordingly with BounceOut animation otherwise Fail")]
- [Postcondition(1, "Back to TestPage")]
- public async Task ProgressTo_ProgressBar_UILK()
- {
- /* TEST CODE */
- var text = "ProgressBarTest-Progress";
- double d = 0.0;
- CreateProgressBarNewPage(text);
- _progressBar.IsVisible = true;
-
- _btnProgressIncrease.IsVisible = true;
- _btnProgressIncrease.Clicked += async (s, e) =>
- {
- d += 0.2;
- if (d > 1.0)
- d = 1.0;
- await _progressBar.ProgressTo(d, 1, Easing.BounceOut);
- };
-
- _btnProgressDecrease.IsVisible = true;
- _btnProgressDecrease.Clicked += async (s, e) =>
- {
- d -= 0.2;
- if (d < 0.0)
- d = 0.0;
- await _progressBar.ProgressTo(d, 1, Easing.BounceOut);
- };
-
- await ManualTest.WaitForConfirm();
- }
- }
-}
+++ /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.Expressions;
-using System.Threading.Tasks;
-using Xamarin.Forms.Platform.Tizen;
-using WT = WearableTemplate;
-
-using Common = NUnit.Framework;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.RelativeLayout test")]
- public class RelativeLayoutTests
- {
- private static NavigationPage _navigationPage = TestPage.GetInstance().getNavigationPage();
- private static TestPage _testPage = TestPage.GetInstance();
- private static RelativeLayout _relativeLayout;
- private static StackLayout _stackLayout, _mainStack;
- private static Point point;
- private static Point p;
-
- private static Boolean isOnAdd;
-
- public class CustomRelativeLayout : RelativeLayout
- {
- public bool _flagOnAdded;
- public bool _flagOnRemoved;
- public bool _flagOnSize;
-
- protected override void OnAdded(View view)
- {
- //if (isOnAdd)
- //{
- _flagOnAdded = true;
- //TLogger.Write("MasterDetailPage-OnBackButtonPressed!!!");
- //ManualTest.Confirm();
- //}
- base.OnAdded(view);
- }
-
- protected override void OnRemoved(View view)
- {
- _flagOnRemoved = true;
- base.OnRemoved(view);
- }
-
- protected override SizeRequest OnSizeRequest(double widthConstraint, double heightConstraint)
- {
- _flagOnSize = true;
- return base.OnSizeRequest(widthConstraint, heightConstraint);
- }
- }
-
- class ControlTest
- {
- public ControlTest(string name)
- {
- this.Name = name;
- }
-
- public string Name { private set; get; }
- };
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("RelativeLayoutTests --------------- SetUp()");
- _relativeLayout = new RelativeLayout();
- if (ManualTest.IsWearable())
- {
- _navigationPage = WT.TestPage.GetInstance().getNavigationPage();
- }
- else
- {
- _navigationPage = Common.TestPage.GetInstance().getNavigationPage();
- }
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("RelativeLayoutTests --------------- TearDown()");
- }
-
- private static void CreateRelativeLayout(CustomRelativeLayout relativeLayout)
- {
- //relativeLayout = new RelativeLayout()
- //{
- // HorizontalOptions = LayoutOptions.FillAndExpand,
- // VerticalOptions = LayoutOptions.FillAndExpand,
- // Padding = new Thickness(20),
- // BackgroundColor = Color.Red,
- //};
- //Point point;
- point.X = 50;
- point.Y = 20;
- Button[] buttons = new Button[100];
- var layoutSub = new StackLayout()
- {
- IsVisible = true,
- Orientation = StackOrientation.Horizontal,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.Center,
- };
- var count = 0;
- var btnAdd = new Button()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.Center,
- Text = "Add",
- WidthRequest = 150,
- //HeightRequest = 80,
- };
- var btnRemove = new Button()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.Center,
- Text = "Remove",
- WidthRequest = 150,
- //HeightRequest = 80,
- };
- btnAdd.Clicked += (s, e) =>
- {
- if (count < 15)
- {
- count++;
- buttons[count] = new Button()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.Start,
- Text = "Test " + count,
- WidthRequest = 200,
- //HeightRequest = 80,
- };
- //relativeLayout.Children.Add(buttons[count], point);
- relativeLayout.Children.Add(buttons[count], Constraint.Constant(0),
- Constraint.Constant(0),
- Constraint.Constant(200),
- Constraint.Constant(100));
- if (point.X < 330)
- {
- point.X += 100;
- }
- else
- {
- point.Y += 100;
- point.X = 50;
- }
- }
- };
- btnRemove.Clicked += (s, e) =>
- {
- if (count >= 1)
- {
- relativeLayout.Children.Remove(buttons[count]);
- if (point.X <= 50)
- {
- point.Y -= 100;
- point.X = 410;
- }
- else
- {
- point.X -= 180;
- }
- count--;
- }
- };
- layoutSub.Children.Add(btnAdd);
- layoutSub.Children.Add(btnRemove);
- //Point p;
- p.X = 50;
- p.Y = 50;
- //relativeLayout.Children.Add(layoutSub, p);
- //relativeLayout.Children.Add(layoutSub, Constraint.Constant(0),
- // Constraint.Constant(100),
- // Constraint.Constant(300),
- // Constraint.Constant(200));
-
- relativeLayout.Children.Add(layoutSub, Constraint.RelativeToParent((parent) =>
- {
- return 0;
- }));
-
- var contentPage = new ContentPage()
- {
- Content = relativeLayout
- };
- contentPage.Title = "RelativeLayout Test";
- //window.CurrentPage = contentPage;
- _testPage.ExecuteTC(contentPage);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OnAdded method is invoked or not")]
- [Property("SPEC", "Xamarin.Forms.RelativeLayout.OnAdded M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click 'Add' button")]
- [Step(3, "Press back button")]
- [Step(4, "Testcase result will show PASS or FAIL automatically")]
- [Postcondition(1, "Back to TestPage")]
- public async Task OnAdded_RelativeLayout_UIBH()
- {
- /* TEST CODE */
- CustomRelativeLayout relativeLayout = new CustomRelativeLayout();
- relativeLayout._flagOnAdded = false;
- //CreateRelativeLayout(relativeLayout);
- var btnAdd = new Button()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- Text = "Add",
- WidthRequest = 300,
- //HeightRequest = 80,
- };
- btnAdd.Clicked += (s, e) =>
- {
- var buttons = new Button()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.StartAndExpand,
- Text = "Test Button ",
- WidthRequest = 300,
- //HeightRequest = 80,
- };
-
- relativeLayout.Children.Add(buttons, Constraint.Constant(100),
- Constraint.Constant(0),
- Constraint.Constant(150),
- Constraint.Constant(100));
-
- if (relativeLayout._flagOnAdded == true)
- ManualTest.Confirm();
- };
-
- relativeLayout.Children.Add(btnAdd,
- Constraint.RelativeToParent((parent) =>
- {
- return parent.Width / 6;
- }),
- Constraint.RelativeToParent((parent) =>
- {
- return parent.Height / 2;
- }));
- relativeLayout._flagOnAdded = false;
-
- var contentPage = new ContentPage()
- {
- Content = relativeLayout
- };
- contentPage.Title = "RelativeLayout Test";
- _testPage.ExecuteTC(contentPage);
- await ManualTest.WaitForConfirm();
- //isOnAdd = false;
- btnAdd.Clicked -= (s, e) =>
- {
- };
- Assert.IsTrue(relativeLayout._flagOnAdded, "OnAdded is not invoked");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OnRemoved method is invoked or not")]
- [Property("SPEC", "Xamarin.Forms.RelativeLayout.OnRemoved M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Press Add button")]
- [Step(3, "Press Remove button")]
- [Step(4, "Press back button")]
- [Step(5, "Testcase result will show PASS or FAIL automatically")]
- [Postcondition(1, "Back to TestPage")]
- public async Task OnRemoved_RelativeLayout_UIBH()
- {
- /* TEST CODE */
- CustomRelativeLayout relativeLayout = new CustomRelativeLayout();
- relativeLayout._flagOnRemoved = false;
- //CreateRelativeLayout(relativeLayout);
- var btnAdd = new Button()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- Text = "Add",
- WidthRequest = 300,
- //HeightRequest = 80,
- };
- var btnRemove = new Button()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- Text = "Remove",
- WidthRequest = 300,
- //HeightRequest = 80,
- };
- var buttons = new Button()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.StartAndExpand,
- Text = "Test Button ",
- WidthRequest = 300,
- //HeightRequest = 80,
- };
- btnAdd.Clicked += (s, e) =>
- {
- relativeLayout.Children.Add(buttons, Constraint.Constant(200),
- Constraint.Constant(0),
- Constraint.Constant(300),
- Constraint.Constant(200));
- };
- btnRemove.Clicked += (s, e) =>
- {
- relativeLayout.Children.Remove(buttons);
- if (relativeLayout._flagOnRemoved == true)
- ManualTest.Confirm();
- };
-
- relativeLayout.Children.Add(btnAdd,
- Constraint.RelativeToParent((parent) =>
- {
- return parent.Width / 6;
- }),
- Constraint.RelativeToParent((parent) =>
- {
- return parent.Height / 3;
- }));
- relativeLayout.Children.Add(btnRemove,
- Constraint.RelativeToParent((parent) =>
- {
- return parent.Width / 6;
- }),
- Constraint.RelativeToParent((parent) =>
- {
- return parent.Height / 2;
- }));
- relativeLayout._flagOnRemoved = false;
-
- var contentPage = new ContentPage()
- {
- Content = relativeLayout
- };
- contentPage.Title = "RelativeLayout Test";
- _testPage.ExecuteTC(contentPage);
-
- //_testPage.ExecuteTC(relativeLayout);
- await ManualTest.WaitForConfirm();
- btnAdd.Clicked -= (s, e) =>
- {
- };
- Assert.IsTrue(relativeLayout._flagOnRemoved, "OnRemoved is not invoked");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OnSizeRequest method is invoked or not")]
- [Property("SPEC", "Xamarin.Forms.RelativeLayout.OnSizeRequest M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Press 'Change Size' button")]
- [Step(3, "Press back button")]
- [Step(4, "Testcase result will show PASS or FAIL automatically")]
- [Postcondition(1, "Back to TestPage")]
- public async Task OnSizeRequest_RelativeLayout_UIBH()
- {
- /* TEST CODE */
- CustomRelativeLayout relativeLayout = new CustomRelativeLayout();
- relativeLayout._flagOnSize = false;
- //CreateRelativeLayout(relativeLayout);
- var btnRemove = new Button()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.Center,
- Text = "Change Size",
- WidthRequest = 300,
- //HeightRequest = 80,
- };
-
- btnRemove.Clicked += (s, e) =>
- {
- relativeLayout.WidthRequest = 80.00;
- relativeLayout.HeightRequest = 100.00;
- relativeLayout.GetSizeRequest(80.00, 100.00);
-
- if (relativeLayout._flagOnSize == true)
- ManualTest.Confirm();
- };
-
- relativeLayout.Children.Add(btnRemove,
- Constraint.RelativeToParent((parent) =>
- {
- return parent.Width / 6;
- }),
- Constraint.RelativeToParent((parent) =>
- {
- return parent.Height / 2;
- }));
- relativeLayout._flagOnSize = false;
-
- var contentPage = new ContentPage()
- {
- Content = relativeLayout
- };
- contentPage.Title = "RelativeLayout Test";
- _testPage.ExecuteTC(contentPage);
- await ManualTest.WaitForConfirm();
- btnRemove.Clicked -= (s, e) =>
- {
- };
- Assert.IsTrue(relativeLayout._flagOnSize, "OnSizeRequest is not invoked");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the IsVisible property")]
- [Property("SPEC", "Xamarin.Forms.RelativeLayout.IsVisible A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click 'Visible' and 'Hide' button")]
- [Step(3, "Observe change of the layout")]
- [Step(4, "Testcase PASS if click Visible button -> Show the layout and click Hide button-> Hide the layout, otherwise FAIL")]
- [Postcondition(1, "Click Back button.")]
- public async Task RelativeLayout_IsVisible_UIBH()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
- RelativeLayout simpleLayout = new RelativeLayout
- {
- BackgroundColor = Color.Blue.WithLuminosity(0.9),
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 100,
- WidthRequest = 300
- };
-
- var mBtnVisible = new Button
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.End,
- Text = "Visible",
- Margin = new Thickness()
- {
- Right = 10,
- Left = 10
- }
- };
-
- var mBtnHide = new Button
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.End,
- Text = "Hide",
- Margin = new Thickness()
- {
- Right = 10,
- Left = 10
- }
- };
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- simpleLayout,
- mBtnVisible,
- mBtnHide
- },
- },
- Title = "IsVisible Test",
- };
-
- mBtnVisible.Clicked += (e, o) =>
- {
- simpleLayout.IsVisible = true;
- };
-
- mBtnHide.Clicked += (e, o) =>
- {
- simpleLayout.IsVisible = false;
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- mBtnVisible.Clicked -= (e, o) =>
- {
- simpleLayout.IsVisible = true;
- };
-
- mBtnHide.Clicked -= (e, o) =>
- {
- simpleLayout.IsVisible = false;
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the BackgroundColor property")]
- [Property("SPEC", "Xamarin.Forms.RelativeLayout.BackgroundColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Select a Color after observe BackgroundColor of layout is changed")]
- [Step(3, "Testcase PASS If BackgroundColor of Layout changed otherwise FAIL")]
- [Postcondition(1, "Click Back button.")]
- public async Task RelativeLayout_BackgroundColor_Change_UIBH()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
- RelativeLayout simpleLayout = new RelativeLayout
- {
- BackgroundColor = Color.Blue.WithLuminosity(0.9),
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 100,
- WidthRequest = 300
- };
-
- var mBtnRed = new Button
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.End,
- BackgroundColor = Color.Red,
- Text = "Red",
- Margin = new Thickness()
- {
- Right = 10,
- Left = 10
- }
- };
-
- var mBtnGreen = new Button
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.End,
- BackgroundColor = Color.Green,
- Text = "Green",
- Margin = new Thickness()
- {
- Right = 10,
- Left = 10
- }
- };
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- simpleLayout,
- mBtnRed,
- mBtnGreen
- },
- },
- Title = "BackgoundColor Test",
- };
-
- mBtnRed.Clicked += (e, o) =>
- {
- simpleLayout.BackgroundColor = Color.Red;
- };
-
- mBtnGreen.Clicked += (e, o) =>
- {
- simpleLayout.BackgroundColor = Color.Green;
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- mBtnRed.Clicked -= (e, o) =>
- {
- simpleLayout.BackgroundColor = Color.Red;
- };
-
- mBtnGreen.Clicked -= (e, o) =>
- {
- simpleLayout.BackgroundColor = Color.Green;
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the HeightRequest & WidthRequest property")]
- [Property("SPEC", "Xamarin.Forms.RelativeLayout.Width A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Seek Silder for Width and Height after observe")]
- [Step(3, "Pass If Height and Width of the layout changed otherwise Fail")]
- [Postcondition(1, "Click Back button.")]
- public async Task RelativeLayout_WidthAndHeight_CHANGE_SIZE_UIBH()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
- RelativeLayout simpleLayout = new RelativeLayout
- {
- BackgroundColor = Color.Blue.WithLuminosity(0.9),
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 100,
- WidthRequest = 300
- };
-
- var sliderHorizontal = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- BackgroundColor = Color.Pink,
- Maximum = 500,
- Minimum = 120
- };
-
- var sliderVertical = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- BackgroundColor = Color.Pink,
- Maximum = 500,
- Minimum = 80
- };
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- simpleLayout,
- sliderHorizontal,
- sliderVertical
- },
- },
- Title = "Size Layout Test",
- };
-
- sliderHorizontal.ValueChanged += (o, e) =>
- {
- simpleLayout.WidthRequest = sliderHorizontal.Value;
- };
-
- sliderVertical.ValueChanged += (o, e) =>
- {
- simpleLayout.HeightRequest = sliderVertical.Value;
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- sliderHorizontal.ValueChanged -= (o, e) =>
- {
- simpleLayout.WidthRequest = sliderHorizontal.Value;
- };
-
- sliderVertical.ValueChanged -= (o, e) =>
- {
- simpleLayout.HeightRequest = sliderVertical.Value;
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the Opacity property")]
- [Property("SPEC", "Xamarin.Forms.RelativeLayout.Opacity A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Seek Opacity Slider after observe")]
- [Step(3, "Pass If Opacity of layout changed otherwise Fail")]
- [Postcondition(1, "Click Back button.")]
- public async Task RelativeLayout_Opacity_UIBH()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
- RelativeLayout simpleLayout = new RelativeLayout
- {
- BackgroundColor = Color.Blue.WithLuminosity(0.9),
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 100,
- WidthRequest = 300
- };
-
- var sliderOpacity = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.Blue,
- Maximum = 1,
- Minimum = 0,
- Value = 1
- };
-
- simpleLayout.BindingContext = sliderOpacity;
- simpleLayout.SetBinding(Button.OpacityProperty, "Value");
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- simpleLayout,
- sliderOpacity,
- },
- },
- Title = "OpacityTest",
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the Margin property")]
- [Property("SPEC", "Xamarin.Forms.RelativeLayout.Margin A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview (Margin Options)")]
- [Step(4, "Pass If Margin of layout changed otherwise Fail")]
- [Postcondition(1, "Click Back button.")]
- public async Task RelativeLayout_Margin_UIBH()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
- RelativeLayout simpleLayout = new RelativeLayout
- {
- BackgroundColor = Color.Blue.WithLuminosity(0.9),
- VerticalOptions = LayoutOptions.Fill,
- HorizontalOptions = LayoutOptions.Fill,
- HeightRequest = 100,
- WidthRequest = 300
- };
-
- String[] dataTest = { "", "", "" };
- dataTest[0] = "MarginTop: 50";
- dataTest[1] = "MarginTop: 100";
- dataTest[2] = "MarginTop: 150";
- var text = "Select a Margin Options";
- var title = "Margin Test";
- //CreatePageTestToButton(text, title, dataTest);
- List<ControlTest> controlTest = new List<ControlTest>
- {
- new ControlTest(dataTest[0]),
- new ControlTest(dataTest[1]),
- new ControlTest(dataTest[2])
- };
- var _listview = new ListView
- {
- RowHeight = 100,
- ItemsSource = controlTest,
- ItemTemplate = new DataTemplate(() =>
- {
- Label nameLabel = new Label()
- {
- TextColor = Color.Black,
- BackgroundColor = Color.White,
- HorizontalOptions = LayoutOptions.Center,
- };
- nameLabel.SetBinding(Label.TextProperty, "Name");
- return new ViewCell
- {
- View = new StackLayout
- {
- Padding = new Thickness(0, 5),
- Children =
- {
- new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Spacing = 0,
- Children =
- {
- nameLabel,
- }
- }
- }
- }
- };
- })
- };
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest ctlTest = (ControlTest)e.Item;
- if (ctlTest.Name.Equals(dataTest[0]))
- {
- simpleLayout.Margin = new Thickness(0, 50, 0, 0);
- }
- else if (ctlTest.Name.Equals(dataTest[1]))
- {
- simpleLayout.Margin = new Thickness(0, 100, 0, 0);
- }
- else
- {
- simpleLayout.Margin = new Thickness(0, 150, 0, 0);
- }
- };
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- simpleLayout,
- _listview,
- },
- BackgroundColor = Color.Navy
- },
- Title = title,
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the Rotation property")]
- [Property("SPEC", "Xamarin.Forms.RelativeLayout.Rotation A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview (Rotation Options)")]
- [Step(3, "Pass If Rotation of layout changed otherwise Fail")]
- [Postcondition(1, "Click Back button.")]
- public async Task RelativeLayout_Rotation_UIBH()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
- RelativeLayout simpleLayout = new RelativeLayout
- {
- BackgroundColor = Color.Blue.WithLuminosity(0.9),
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 100,
- WidthRequest = 300
- };
-
- String[] dataTest = { "", "", "" };
- dataTest[0] = "50";
- dataTest[1] = "90";
- dataTest[2] = "180";
- var text = "Select a Rotation Options";
- var title = "Rotation Test";
- //CreatePageTestToButton(text, title, dataTest);
- List<ControlTest> controlTest = new List<ControlTest>
- {
- new ControlTest(dataTest[0]),
- new ControlTest(dataTest[1]),
- new ControlTest(dataTest[2])
- };
- var _listview = new ListView
- {
- RowHeight = 100,
- ItemsSource = controlTest,
- ItemTemplate = new DataTemplate(() =>
- {
- Label nameLabel = new Label()
- {
- TextColor = Color.Black,
- BackgroundColor = Color.White,
- HorizontalOptions = LayoutOptions.Center,
- };
- nameLabel.SetBinding(Label.TextProperty, "Name");
- return new ViewCell
- {
- View = new StackLayout
- {
- Padding = new Thickness(0, 5),
- Children =
- {
- new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Spacing = 0,
- Children =
- {
- nameLabel,
- }
- }
- }
- }
- };
- })
- };
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest ctlTest = (ControlTest)e.Item;
- if (ctlTest.Name.Equals(dataTest[0]))
- {
- simpleLayout.Rotation = 50;
- }
- else if (ctlTest.Name.Equals(dataTest[1]))
- {
- simpleLayout.Rotation = 90;
- }
- else
- {
- simpleLayout.Rotation = 180;
- }
- };
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- simpleLayout,
- _listview,
- },
- BackgroundColor = Color.Navy
- },
- Title = title,
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the Scale property")]
- [Property("SPEC", "Xamarin.Forms.RelativeLayout.Scale A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(3, "Pass If Scale of layout changed otherwise Fail")]
- [Postcondition(1, "Click Back button.")]
- public async Task RelativeLayout_Scale_UIBH()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
- RelativeLayout simpleLayout = new RelativeLayout
- {
- BackgroundColor = Color.Blue.WithLuminosity(0.9),
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 100,
- WidthRequest = 300
- };
-
- String[] dataTest = { "", "", "" };
- dataTest[0] = "0.5";
- dataTest[1] = "1.0";
- dataTest[2] = "2.0";
- var text = "Select a Scale test";
- var title = "Scale Test";
- //CreatePageTestToButton(text, title, dataTest);
- List<ControlTest> controlTest = new List<ControlTest>
- {
- new ControlTest(dataTest[0]),
- new ControlTest(dataTest[1]),
- new ControlTest(dataTest[2])
- };
- var _listview = new ListView
- {
- RowHeight = 100,
- ItemsSource = controlTest,
- ItemTemplate = new DataTemplate(() =>
- {
- Label nameLabel = new Label()
- {
- TextColor = Color.Black,
- BackgroundColor = Color.White,
- HorizontalOptions = LayoutOptions.Center,
- };
- nameLabel.SetBinding(Label.TextProperty, "Name");
- return new ViewCell
- {
- View = new StackLayout
- {
- Padding = new Thickness(0, 5),
- Children =
- {
- new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Spacing = 0,
- Children =
- {
- nameLabel,
- }
- }
- }
- }
- };
- })
- };
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest ctlTest = (ControlTest)e.Item;
- if (ctlTest.Name.Equals(dataTest[0]))
- {
- simpleLayout.Scale = 0.5;
- }
- else if (ctlTest.Name.Equals(dataTest[1]))
- {
- simpleLayout.Scale = 1.0;
- }
- else
- {
- simpleLayout.Scale = 2.0;
- }
- };
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- simpleLayout,
- _listview,
- },
- BackgroundColor = Color.Navy
- },
- Title = title,
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, 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.Threading.Tasks;
-using NUnit.Framework;
-using NUnit.Framework.TUnit;
-using Xamarin.Forms;
-using System.Collections.Generic;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.ScrollView test")]
- public class ScrollViewTests
- {
- private static TestPage _testPage = TestPage.GetInstance();
- private static ScrollView _scrollView;
- private static Button _button1, _button2, _button3;
- private static ListView _listView;
-
- [SetUp]
- public void Init()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Preconditions for each TEST");
- }
-
- [TearDown]
- public void Destroy()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Postconditions for each TEST");
- }
-
- private static void CreateScrollViewPage(string scrollView)
- {
- List<String> mLstStr = new List<String>();
- for(int i=1; i<=50; i++)
- {
- mLstStr.Add("Item "+i);
- }
-
- _listView = new ListView
- {
- ItemsSource = mLstStr,
- };
- _button1 = new Button()
- {
- Text= "Scroll To Start",
- };
- _button2 = new Button()
- {
- Text = "Scroll To Center",
- };
- _button3 = new Button()
- {
- Text = "Scroll To End",
- };
- var layoutButton = new StackLayout()
- {
- Orientation = StackOrientation.Vertical,
- Children =
- {
- _button1, _button2, _button3
- }
- };
- var layout = new StackLayout()
- {
- IsVisible = true,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- Children=
- {
- _listView,
- layoutButton
- }
- };
-
- _scrollView = new ScrollView()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- Orientation = ScrollOrientation.Vertical,
- Content = layout,
- };
- _button1.Clicked += (sender, o) =>
- {
- _scrollView.ScrollToAsync(_listView, ScrollToPosition.Start, true);
- };
- _button2.Clicked += (sender, o) =>
- {
- _scrollView.ScrollToAsync(_listView, ScrollToPosition.Center, true);
- //Console.WriteLine("[TUnit] : ScrollToPosition.Center");
- };
- _button3.Clicked += (sender, o) =>
- {
- _scrollView.ScrollToAsync(_listView, ScrollToPosition.End, true);
- };
-
- var stackLayout = new StackLayout()
- {
- IsVisible = true,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- };
- stackLayout.Children.Add(_scrollView);
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = stackLayout,
- Title=scrollView,
- });
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check whether the method ScrollToAsync is readable or not.")]
- [Property("SPEC", "Xamarin.Forms.ScrollView.ScrollToAsync M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- [Property("COVPARAM", "Xamarin.Forms.Element, Xamarin.Forms.ScrollToPosition, bool")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click button after new page shown and check")]
- [Step(3, "Confirm False or True")]
- [Postcondition(1, "NA")]
- public async Task ScrollToAsync_CHECK()
- {
- CreateScrollViewPage("Test: ScrollToAsync");
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _button1.Clicked -= (sender, o) =>
- {
- };
- _button2.Clicked -= (sender, o) =>
- {
- };
- _button3.Clicked -= (sender, o) =>
- {
- };
- }
- }
-}
-
-
-
+++ /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 NUnit.Framework;
-using NUnit.Framework.TUnit;
-using Xamarin.Forms;
-using System.Collections.Generic;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.SearchBar test")]
- public class SearchBarTests
- {
- private static TestPage _testPage = TestPage.GetInstance();
- private static SearchBar _searchBar;
-
- class ControlTest
- {
- public ControlTest(string name)
- {
- this.Name = name;
- }
-
- public string Name { private set; get; }
- };
-
- [SetUp]
- public void Init()
- {
- if (ManualTest.IsWearable())
- {
- _testPage.UnlockUIButton();
- Assert.Pass("Not supported on this profile");
- }
- else
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Preconditions for each TEST");
- }
- }
-
- [TearDown]
- public void Destroy()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Postconditions for each TEST");
- }
-
- private static void CreateSearchBarPage(string searchBar)
- {
- var resultsLabel = new Label
- {
- Text = "Result will appear here.",
- VerticalOptions = LayoutOptions.FillAndExpand,
- };
-
- _searchBar = new SearchBar
- {
- Placeholder = "Enter search term",
- SearchCommand = new Command(() => { resultsLabel.Text = "Result: " + _searchBar.Text + " is what you asked for."; })
- };
-
- var page = new ContentPage
- {
- Title = searchBar,
- Content = new StackLayout
- {
- VerticalOptions = LayoutOptions.Start,
- Children = {
- new Label {
- HorizontalTextAlignment = TextAlignment.Center,
- Text = "SearchBar",
- },
- _searchBar,
- new ScrollView
- {
- Content = new StackLayout {
- Children=
- {
- resultsLabel
- }
- },
- VerticalOptions = LayoutOptions.FillAndExpand
- }
- },
- Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5)
- }
- };
- _testPage.ExecuteTC(page);
- }
-
- private static void onSearchButtonPressed(object sender, EventArgs e)
- {
- _testPage.getNavigationPage().PopAsync();
- Assert.True(true);
- ManualTest.Confirm();
- }
-
- private static void onTextChanged(object sender, EventArgs e)
- {
- _testPage.getNavigationPage().PopAsync();
- Assert.True(true);
- ManualTest.Confirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Handle event SearchButtonPressed SearchBar.")]
- [Property("SPEC", "Xamarin.Forms.SearchBar.SearchButtonPressed M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")]
- [Step(1, "Click run TC")]
- [Step(2, "Type some string in search bar")]
- [Step(3, "Click search button in virtual keyboard")]
- [Step(4, "Testcase result will show automatically")]
- [Postcondition(1, "NA")]
- public async Task SearchButtonPressed_CHECK()
- {
- if (Device.Idiom == TargetIdiom.Phone)
- {
- // did find searchButton
- CreateSearchBarPage("Test: SearchButtonPressed");
- _searchBar.SearchButtonPressed += onSearchButtonPressed;
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _searchBar.SearchButtonPressed -= onSearchButtonPressed;
- }
- else
- {
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether TextChanged event is envoked or not.")]
- [Property("SPEC", "Xamarin.Forms.SearchBar.TextChanged E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Type some string in search bar")]
- [Step(3, "Testcase result will show automatically")]
- [Postcondition(1, "NA")]
- public async Task TextChanged_SearchBar_EVENT()
- {
- SearchBar srBar = new SearchBar();
- var page = new ContentPage
- {
- Content = new StackLayout
- {
- Children = {
- srBar
- }
- }
- };
- _testPage.ExecuteTC(page);
-
- srBar.TextChanged += onTextChanged;
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- srBar.TextChanged -= onTextChanged;
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Text is displayed in SearchBar or not.")]
- [Property("SPEC", "Xamarin.Forms.SearchBar.Text A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")]
- [Step(1, "Click run TC")]
- [Step(2, "Pass If 'Hi' is displayed in searchBar and type any string in searchbar otherwise Fail")]
- [Postcondition(1, "NA")]
- public async Task Text_SearchBar_UIBH()
- {
- if (Device.Idiom == TargetIdiom.Phone)
- {
- SearchBar srBar = new SearchBar();
- var page = new ContentPage
- {
- Content = new StackLayout
- {
- Children = {
- srBar
- }
- }
- };
- _testPage.ExecuteTC(page);
-
- srBar.Text = "Hi";
- await ManualTest.WaitForConfirm();
- }
- else
- {
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether TextColor is displayed in SearchBar or not.")]
- [Property("SPEC", "Xamarin.Forms.SearchBar.TextColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click on searchbar and type something")]
- [Step(3, "Click on (Green) or (Blue) or (Red)")]
- [Step(4, "Pass If TextColor changes accordingly otherwise Fail")]
- [Postcondition(1, "NA")]
- public async Task TextColor_SearchBar_UIBH()
- {
- SearchBar srBar = new SearchBar();
-
- String[] dataTest = { "", "", "" };
- dataTest[0] = "Green";
- dataTest[1] = "Blue";
- dataTest[2] = "Red";
- var text = "Select a TextColor";
- var title = "TextColor Test";
- List<ControlTest> controlTest = new List<ControlTest>
- {
- new ControlTest(dataTest[0]),
- new ControlTest(dataTest[1]),
- new ControlTest(dataTest[2])
- };
- var _listview = new ListView
- {
- RowHeight = 100,
- ItemsSource = controlTest,
- ItemTemplate = new DataTemplate(() =>
- {
- Label nameLabel = new Label()
- {
- Margin = new Thickness(300, 0, 0, 0),
- TextColor = Color.Black,
- HorizontalOptions = LayoutOptions.Center,
- };
- nameLabel.SetBinding(Label.TextProperty, "Name");
- return new ViewCell
- {
- View = new StackLayout
- {
- Padding = new Thickness(0, 5),
- Orientation = StackOrientation.Horizontal,
- Children =
- {
- new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Spacing = 0,
- Children =
- {
- nameLabel,
- }
- }
- }
- }
- };
- })
- };
-
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest ctlTest = (ControlTest)e.Item;
- if (ctlTest.Name.Equals(dataTest[0]))
- {
- srBar.TextColor = Color.Green;
- }
- else if (ctlTest.Name.Equals(dataTest[1]))
- {
- srBar.TextColor = Color.Blue;
- }
- else
- {
- srBar.TextColor = Color.Red;
- }
- };
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- srBar,
- new Label
- {
- Text=text,
- TextColor=Color.White,
- HorizontalOptions = LayoutOptions.Center
- },
- _listview,
- },
- BackgroundColor = Color.Gray
- },
- Title = title,
- };
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Placeholder is displayed in SearchBar or not.")]
- [Property("SPEC", "Xamarin.Forms.SearchBar.Placeholder A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Pass If 'Placeholder Text' is displayed in searchBar when it is empty otherwise Fail")]
- [Postcondition(1, "NA")]
- public async Task Placeholder_SearchBar_UIBH()
- {
- if (Device.Idiom == TargetIdiom.TV)
- {
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
-
- SearchBar srBar = new SearchBar();
- var page = new ContentPage
- {
- Content = new StackLayout
- {
- Children = {
- srBar
- }
- }
- };
- _testPage.ExecuteTC(page);
-
- srBar.Placeholder = "Placeholder Text";
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether PlaceholderColor is displayed in SearchBar or not.")]
- [Property("SPEC", "Xamarin.Forms.SearchBar.PlaceholderColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click on (Green) or (Blue) or (Red)")]
- [Step(3, "Pass If 'Placeholder Text' is displayed in searchBar when it is empty with specific color otherwise Fail")]
- [Postcondition(1, "NA")]
- public async Task PlaceholderColor_SearchBar_UIBH()
- {
- SearchBar srBar = new SearchBar();
- srBar.Placeholder = "Placeholder Text";
- srBar.PlaceholderColor = Color.Green;
-
- String[] dataTest = { "", "", "" };
- dataTest[0] = "Green";
- dataTest[1] = "Blue";
- dataTest[2] = "Red";
- var text = "Select a PlaceholderColor";
- var title = "PlaceholderColor Test";
- List<ControlTest> controlTest = new List<ControlTest>
- {
- new ControlTest(dataTest[0]),
- new ControlTest(dataTest[1]),
- new ControlTest(dataTest[2])
- };
- var _listview = new ListView
- {
- RowHeight = 100,
- ItemsSource = controlTest,
- ItemTemplate = new DataTemplate(() =>
- {
- Label nameLabel = new Label()
- {
- Margin = new Thickness(300, 0, 0, 0),
- TextColor = Color.Black,
- HorizontalOptions = LayoutOptions.Center,
- };
- nameLabel.SetBinding(Label.TextProperty, "Name");
- return new ViewCell
- {
- View = new StackLayout
- {
- Padding = new Thickness(0, 5),
- Orientation = StackOrientation.Horizontal,
- Children =
- {
- new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Spacing = 0,
- Children =
- {
- nameLabel,
- }
- }
- }
- }
- };
- })
- };
-
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest ctlTest = (ControlTest)e.Item;
- if (ctlTest.Name.Equals(dataTest[0]))
- {
- srBar.PlaceholderColor = Color.Green;
- }
- else if (ctlTest.Name.Equals(dataTest[1]))
- {
- srBar.PlaceholderColor = Color.Blue;
- }
- else
- {
- srBar.PlaceholderColor = Color.Red;
- }
- };
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- srBar,
- new Label
- {
- Text=text,
- TextColor=Color.White,
- HorizontalOptions = LayoutOptions.Center
- },
- _listview,
- },
- BackgroundColor = Color.Gray
- },
- Title = title,
- };
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether FontSize is displayed properly in SearchBar or not.")]
- [Property("SPEC", "Xamarin.Forms.SearchBar.FontSize A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click on searchbar and type something")]
- [Step(3, "Click on (20) or (25) or (30)")]
- [Step(4, "Pass If FontSize changes accordingly otherwise Fail")]
- [Postcondition(1, "NA")]
- public async Task FontSize_SearchBar_UIBH()
- {
- SearchBar srBar = new SearchBar();
- srBar.Text = "Hi";
-
- String[] dataTest = { "", "", "" };
- dataTest[0] = "20";
- dataTest[1] = "25";
- dataTest[2] = "30";
- var text = "Select a FontSize";
- var title = "FontSize Test";
- List<ControlTest> controlTest = new List<ControlTest>
- {
- new ControlTest(dataTest[0]),
- new ControlTest(dataTest[1]),
- new ControlTest(dataTest[2])
- };
- var _listview = new ListView
- {
- RowHeight = 100,
- ItemsSource = controlTest,
- ItemTemplate = new DataTemplate(() =>
- {
- Label nameLabel = new Label()
- {
- Margin = new Thickness(300, 0, 0, 0),
- TextColor = Color.Black,
- HorizontalOptions = LayoutOptions.Center,
- };
- nameLabel.SetBinding(Label.TextProperty, "Name");
- return new ViewCell
- {
- View = new StackLayout
- {
- Padding = new Thickness(0, 5),
- Orientation = StackOrientation.Horizontal,
- Children =
- {
- new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Spacing = 0,
- Children =
- {
- nameLabel,
- }
- }
- }
- }
- };
- })
- };
-
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest ctlTest = (ControlTest)e.Item;
- if (ctlTest.Name.Equals(dataTest[0]))
- {
- srBar.FontSize = 20.00;
- }
- else if (ctlTest.Name.Equals(dataTest[1]))
- {
- srBar.FontSize = 25.00;
- }
- else
- {
- srBar.FontSize = 30.00;
- }
- };
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- srBar,
- new Label
- {
- Text=text,
- TextColor=Color.White,
- HorizontalOptions = LayoutOptions.Center
- },
- _listview,
- },
- BackgroundColor = Color.Gray
- },
- Title = title,
- };
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether FontAttributes is displayed properly in SearchBar or not.")]
- [Property("SPEC", "Xamarin.Forms.SearchBar.FontAttributes A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click on searchbar and type something")]
- [Step(3, "Click on (None) or (Bold) or (Italic)")]
- [Step(4, "Pass If Text FontAttributes changes accordingly otherwise Fail")]
- [Postcondition(1, "NA")]
- public async Task FontAttributes_SearchBar_UIBH()
- {
- SearchBar srBar = new SearchBar();
- srBar.Text = "Hi";
-
- String[] dataTest = { "", "", "" };
- dataTest[0] = "None";
- dataTest[1] = "Bold";
- dataTest[2] = "Italic";
- var text = "Select a FontAttributes";
- var title = "FontAttributes Test";
- List<ControlTest> controlTest = new List<ControlTest>
- {
- new ControlTest(dataTest[0]),
- new ControlTest(dataTest[1]),
- new ControlTest(dataTest[2])
- };
- var _listview = new ListView
- {
- RowHeight = 100,
- ItemsSource = controlTest,
- ItemTemplate = new DataTemplate(() =>
- {
- Label nameLabel = new Label()
- {
- Margin = new Thickness(300, 0, 0, 0),
- TextColor = Color.Black,
- HorizontalOptions = LayoutOptions.Center,
- };
- nameLabel.SetBinding(Label.TextProperty, "Name");
- return new ViewCell
- {
- View = new StackLayout
- {
- Padding = new Thickness(0, 5),
- Orientation = StackOrientation.Horizontal,
- Children =
- {
- new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Spacing = 0,
- Children =
- {
- nameLabel,
- }
- }
- }
- }
- };
- })
- };
-
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest ctlTest = (ControlTest)e.Item;
- if (ctlTest.Name.Equals("None"))
- {
- srBar.FontAttributes = FontAttributes.None;
- }
- else if (ctlTest.Name.Equals("Bold"))
- {
- srBar.FontAttributes = FontAttributes.Bold;
- }
- else
- {
- srBar.FontAttributes = FontAttributes.Italic;
- }
- };
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- srBar,
- new Label
- {
- Text=text,
- TextColor=Color.White,
- HorizontalOptions = LayoutOptions.Center
- },
- _listview,
- },
- BackgroundColor = Color.Gray
- },
- Title = title,
- };
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether FontFamily is displayed properly in SearchBar or not.")]
- [Property("SPEC", "Xamarin.Forms.SearchBar.FontFamily A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "Several fonts are not supported on TV product")]
- [Step(1, "Click run TC")]
- [Step(2, "Click on searchbar and type something")]
- [Step(3, "Click on (Times New Roman) or (Sans) or (Sans Bold)")]
- [Step(4, "Pass If Text FontFamily changes accordingly otherwise Fail")]
- [Postcondition(1, "NA")]
- public async Task FontFamily_SearchBar_UIBH()
- {
- if (Device.Idiom == TargetIdiom.TV)
- {
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
-
- SearchBar srBar = new SearchBar();
- srBar.Text = "Hi";
-
- String[] dataTest = { "", "", "" };
- dataTest[0] = "Times New Roman";
- dataTest[1] = "Sans";
- dataTest[2] = "Sans Bold";
- var text = "Select a FontFamily";
- var title = "FontFamily Test";
- List<ControlTest> controlTest = new List<ControlTest>
- {
- new ControlTest(dataTest[0]),
- new ControlTest(dataTest[1]),
- new ControlTest(dataTest[2])
- };
- var _listview = new ListView
- {
- RowHeight = 100,
- ItemsSource = controlTest,
- ItemTemplate = new DataTemplate(() =>
- {
- Label nameLabel = new Label()
- {
- Margin = new Thickness(300, 0, 0, 0),
- TextColor = Color.Black,
- HorizontalOptions = LayoutOptions.Center,
- };
- nameLabel.SetBinding(Label.TextProperty, "Name");
- return new ViewCell
- {
- View = new StackLayout
- {
- Padding = new Thickness(0, 5),
- Orientation = StackOrientation.Horizontal,
- Children =
- {
- new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Spacing = 0,
- Children =
- {
- nameLabel,
- }
- }
- }
- }
- };
- })
- };
-
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest ctlTest = (ControlTest)e.Item;
- if (ctlTest.Name.Equals(dataTest[0]))
- {
- srBar.FontFamily = "Times New Roman:style=Regular";
- }
- else if (ctlTest.Name.Equals(dataTest[1]))
- {
- srBar.FontFamily = "Sans:style=Regular";
- }
- else
- {
- srBar.FontFamily = "Sans:style=Bold";
- }
- };
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- srBar,
- new Label
- {
- Text=text,
- TextColor=Color.White,
- HorizontalOptions = LayoutOptions.Center
- },
- _listview,
- },
- BackgroundColor = Color.Gray
- },
- Title = title,
- };
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether FontFamily is displayed properly in SearchBar or not.")]
- [Property("SPEC", "Xamarin.Forms.SearchBar.FontFamily A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click on searchbar and type something")]
- [Step(3, "Click on (Center) or (End) or (Start)")]
- [Step(4, "Pass If TextAlignment changes accordingly otherwise Fail")]
- [Postcondition(1, "NA")]
- public async Task HorizontalTextAlignment_SearchBar_UIBH()
- {
- SearchBar srBar = new SearchBar();
- srBar.Text = "Hi";
-
- String[] dataTest = { "", "", "" };
- dataTest[0] = "Center";
- dataTest[1] = "End";
- dataTest[2] = "Start";
- var text = "Select a TextAlignment";
- var title = "HorizontalTextAlignment Test";
- List<ControlTest> controlTest = new List<ControlTest>
- {
- new ControlTest(dataTest[0]),
- new ControlTest(dataTest[1]),
- new ControlTest(dataTest[2])
- };
- var _listview = new ListView
- {
- RowHeight = 100,
- ItemsSource = controlTest,
- ItemTemplate = new DataTemplate(() =>
- {
- Label nameLabel = new Label()
- {
- Margin = new Thickness(300, 0, 0, 0),
- TextColor = Color.Black,
- HorizontalOptions = LayoutOptions.Center,
- };
- nameLabel.SetBinding(Label.TextProperty, "Name");
- return new ViewCell
- {
- View = new StackLayout
- {
- Padding = new Thickness(0, 5),
- Orientation = StackOrientation.Horizontal,
- Children =
- {
- new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Spacing = 0,
- Children =
- {
- nameLabel,
- }
- }
- }
- }
- };
- })
- };
-
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest ctlTest = (ControlTest)e.Item;
- if (ctlTest.Name.Equals(dataTest[0]))
- {
- srBar.HorizontalTextAlignment = TextAlignment.Center;
- }
- else if (ctlTest.Name.Equals(dataTest[1]))
- {
- srBar.HorizontalTextAlignment = TextAlignment.End;
- }
- else
- {
- srBar.HorizontalTextAlignment = TextAlignment.Start;
- }
- };
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- srBar,
- new Label
- {
- Text=text,
- TextColor=Color.White,
- HorizontalOptions = LayoutOptions.Center
- },
- _listview,
- },
- BackgroundColor = Color.Gray
- },
- Title = title,
- };
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether FontSize is displayed properly in SearchBar or not.")]
- [Property("SPEC", "Xamarin.Forms.SearchBar.FontSize A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")]
- [Step(1, "Click run TC")]
- [Step(2, "Click on searchbar and type something")]
- [Step(3, "Click on (Green) or (Blue) or (Red)")]
- [Step(4, "Pass If CancelButtonColor changes accordingly otherwise Fail")]
- [Postcondition(1, "NA")]
- public async Task CancelButtonColor_SearchBar_UIBH()
- {
- if (Device.Idiom == TargetIdiom.Phone)
- {
- SearchBar srBar = new SearchBar();
-
- String[] dataTest = { "", "", "" };
- dataTest[0] = "Green";
- dataTest[1] = "Blue";
- dataTest[2] = "Red";
- var text = "Select a CancelButtonColor";
- var title = "CancelButtonColor Test";
- List<ControlTest> controlTest = new List<ControlTest>
- {
- new ControlTest(dataTest[0]),
- new ControlTest(dataTest[1]),
- new ControlTest(dataTest[2])
- };
- var _listview = new ListView
- {
- RowHeight = 100,
- ItemsSource = controlTest,
- ItemTemplate = new DataTemplate(() =>
- {
- Label nameLabel = new Label()
- {
- Margin = new Thickness(300, 0, 0, 0),
- TextColor = Color.Black,
- HorizontalOptions = LayoutOptions.Center,
- };
- nameLabel.SetBinding(Label.TextProperty, "Name");
- return new ViewCell
- {
- View = new StackLayout
- {
- Padding = new Thickness(0, 5),
- Orientation = StackOrientation.Horizontal,
- Children =
- {
- new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Spacing = 0,
- Children =
- {
- nameLabel,
- }
- }
- }
- }
- };
- })
- };
-
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest ctlTest = (ControlTest)e.Item;
- if (ctlTest.Name.Equals(dataTest[0]))
- {
- srBar.CancelButtonColor = Color.Green;
- }
- else if (ctlTest.Name.Equals(dataTest[1]))
- {
- srBar.CancelButtonColor = Color.Blue;
- }
- else
- {
- srBar.CancelButtonColor = Color.Red;
- }
- };
-
- ContentPage page = new ContentPage
- {
- Content = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Fill,
- VerticalOptions = LayoutOptions.Fill,
- Children =
- {
- srBar,
- new Label
- {
- Text=text,
- TextColor=Color.White,
- HorizontalOptions = LayoutOptions.Center
- },
- _listview,
- },
- BackgroundColor = Color.Gray
- },
- Title = title,
- };
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
- else
- {
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Handle event SearchButtonPressed SearchBar.")]
- [Property("SPEC", "Xamarin.Forms.SearchBar.SearchButtonPressed A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")]
- [Step(1, "Click run TC")]
- [Step(2, "Type some string in search bar")]
- [Step(3, "Click search button in virtual keyboard")]
- [Step(4, "Pass if Search result shows below SearchBar otherwise Fail")]
- [Postcondition(1, "NA")]
- public async Task SearchCommand_SearchBar_UIBH()
- {
- if (Device.Idiom == TargetIdiom.Phone)
- {
- CreateSearchBarPage("Test: SearchCommand");
- await ManualTest.WaitForConfirm();
- }
- else
- {
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System.Threading.Tasks;
-using System.Collections.Generic;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class SliderTests
- {
- private static ListView _listview;
- private static Slider _slider1, _slider2, _slider3;
- private static Label _label1, _label2;
- private static TestPage _testPage = TestPage.GetInstance();
-
- class ControlTest
- {
- public ControlTest(string name)
- {
- this.Name = name;
- }
-
- public string Name { private set; get; }
- };
-
- [SetUp]
- public void SetUp()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Slider CLASS: Setup---------------------------------");
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Slider CLASS: Teardown---------------------------------");
- _slider1 = null;
- _slider2 = null;
- _slider3 = null;
- _label1 = null;
- _label2 = null;
- }
-
- private static void OnValueChanged(object sender, EventArgs e)
- {
- Assert.True(true);
- _label1.IsVisible = true;
- _label1.Text = "Value Changed Event Called.";
- ManualTest.Confirm();
- }
-
- private static void OnValueChangedShowValue(object sender, EventArgs e)
- {
- var val = (int)_slider1.Value;
- _label1.Text = "Slider Value: " + val.ToString();
- }
-
- private static void OnValueChangedShowValueMax(object sender, EventArgs e)
- {
- _label2.IsVisible = true;
- var val1 = (int)_slider1.Maximum;
- _label2.Text = "Changed Max Value: " + val1.ToString();
- var val = (int)_slider1.Value;
- _label1.Text = "Slider Value: " + val.ToString();
- }
-
- private static void OnValueChangedShowValueMin(object sender, EventArgs e)
- {
- _label2.IsVisible = true;
- var val1 = (int)_slider1.Minimum;
- _label2.Text = "Changed Min Value: " + val1.ToString();
- var val = (int)_slider1.Value;
- _label1.Text = "Slider Value: " + val.ToString();
- }
-
- private static void CreateSlider(string Text)
- {
- LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "CreateSlider");
-
- _slider1 = new Slider()
- {
- IsVisible = false,
- Minimum = 0.00,
- Maximum = 40.00,
- Value = 30.00,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Scale = 1.0
- };
-
- _label1 = new Label()
- {
- IsVisible = false,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- TextColor = new Color(255, 0, 0)
- };
- _label2 = new Label()
- {
- IsVisible = false,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- TextColor = new Color(0, 255, 0)
- };
- }
-
- public void CreatePageTestToSlider(String txtDisplay, String title, String[] dataTest)
- {
- _slider2 = new Slider
- {
- HorizontalOptions = LayoutOptions.Center,
- WidthRequest = 350,
- HeightRequest = 100,
- IsEnabled = true,
- };
- Label labelDisplay = new Label
- {
- Text = txtDisplay,
- TextColor = Color.Red,
- HorizontalOptions = LayoutOptions.Center
- };
- List<ControlTest> controlTest = new List<ControlTest>
- {
- new ControlTest(dataTest[0]),
- new ControlTest(dataTest[1]),
- new ControlTest(dataTest[2])
- };
-
- _listview = new ListView
- {
- RowHeight = 100,
- ItemsSource = controlTest,
- ItemTemplate = new DataTemplate(() =>
- {
- Label nameLabel = new Label()
- {
- TextColor = Color.Black,
- BackgroundColor = Color.White,
- HorizontalOptions = LayoutOptions.Center,
- };
- nameLabel.SetBinding(Label.TextProperty, "Name");
- return new ViewCell
- {
- View = new StackLayout
- {
- Padding = new Thickness(0, 5),
- Children =
- {
- new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Spacing = 0,
- Children =
- {
- nameLabel,
- }
- }
- }
- }
- };
- })
- };
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- _slider2,
- _listview,
- },
- BackgroundColor = Color.Blue,
- },
- Title = title
- });
- }
-
- [Test]
- [Category("P1")]
- [Description("Sets or gets the maximum value for the slider.")]
- [Property("SPEC", "Xamarin.Forms.Slider.Maximum A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Check if the Maximum value is 50.")]
- [Step(3, "If after sliding right maximum value is 50 then pass.")]
- [Postcondition(1, "N/A")]
- public async Task Maximum_Slider_UIBH()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
- CreateSlider("Slider Maximum Value Test!");
- _slider1.IsVisible = true;
- _label1.IsVisible = true;
- _label2.IsVisible = true;
- _label1.Text = "Maximum value is 50 here.";
- _label2.Text = "Slider Value: " + _slider1.Value.ToString();
- _slider1.Maximum = 50.00;
- _slider1.ValueChanged += OnValueChangedShowValue;
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _label1,_label2,_slider1
- }
- },
- Title = "Test: Source",
- BackgroundColor = Color.White
- };
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Sets or gets the minimum value for the slider.")]
- [Property("SPEC", "Xamarin.Forms.Slider.Minimum A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Check if the Minimum value is 10.")]
- [Postcondition(1, "NA")]
- public async Task Minimum_Slider_UIBH()
- {
- CreateSlider("Slider Minimum Value Test!");
- _slider1.IsVisible = true;
- _label1.IsVisible = true;
- _label2.IsVisible = true;
- _label1.Text = "Minimum value is 10 here.";
- _label2.Text = "Slider Value: " + _slider1.Value.ToString();
- _slider1.Minimum = 10.00;
- _slider1.ValueChanged += OnValueChangedShowValue;
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _label1,_label2,_slider1
- }
- },
- Title = "Test: Source",
- BackgroundColor = Color.White
- };
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Sets or gets the value of the slider displays.")]
- [Property("SPEC", "Xamarin.Forms.Slider.Value A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Check if the value is 20.")]
- [Postcondition(1, "NA")]
- public async Task Value_UIBH()
- {
- CreateSlider("Slider Value Test!");
- _slider1.IsVisible = true;
- _label1.IsVisible = true;
- _label1.HeightRequest = 100;
- _label1.Text = "Value is 20 here. Slider position will set to middle.";
- _slider1.Value = 20.00;
- _slider1.ValueChanged += OnValueChangedShowValue;
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _label1,_label2,_slider1
- }
- },
- Title = "Test: Source",
- BackgroundColor = Color.White
- };
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Whenever the slider value is changed by using the thumb.")]
- [Property("SPEC", "Xamarin.Forms.Slider.ValueChanged E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Start and then stop dragging the slider.")]
- [Step(3, "if Value Change event called then TC will Pass automatically.")]
- [Postcondition(1, "NA")]
- public async Task ValueChanged_Slider_CB()
- {
- /* TEST CODE */
- CreateSlider("ValueChanged Test!");
- _slider1.IsVisible = true;
- _label1.IsVisible = false;
- _slider1.ValueChanged += OnValueChanged;
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _label1,_slider1
- }
- },
- Title = "Test: Source",
- BackgroundColor = Color.White
- };
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
-
- _slider1.ValueChanged -= OnValueChanged;
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ValueProperty's bound or not.")]
- [Property("SPEC", "Xamarin.Forms.Slider.ValueProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Check if dragging slider change the value.")]
- [Postcondition(1, "NA")]
- public async Task ValueProperty_UIBH()
- {
- CreateSlider("Slider ValueProperty Test!");
- _slider1.IsVisible = true;
- _label1.IsVisible = true;
-
- _label1.SetBinding(Label.TextProperty, new Binding("Value", stringFormat: "Slider Value : {0}", source: _slider1));
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _label1,
- _slider1,
- }
- },
- Title = "Test: Source",
- BackgroundColor = Color.White
- };
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether MaximumProperty's bound or not.")]
- [Property("SPEC", "Xamarin.Forms.Slider.MaximumProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Check if first slider change the Max value of slider after binding with second slider.")]
- [Step(3, "Check if first slider Max value change from 40 to 10 after binding with second slider's Max value. Max value of first slider doesn't change corresponding to second slider value property")]
- [Postcondition(1, "NA")]
- public async Task MaximumProperty_UIBH()
- {
- CreateSlider("Slider ValueProperty Test!");
- _slider1.IsVisible = true;
- _label1.IsVisible = true;
- _label2.IsVisible = false;
- _label1.Text = "Maximum value is 40 before binding.";
- Slider slider2 = new Slider
- {
- Value = 10.00,
- Minimum = 0,
- Maximum = 10.00,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- };
-
- _slider1.BindingContext = slider2;
- _slider1.SetBinding(Slider.MaximumProperty, "Maximum");
- _slider1.ValueChanged += OnValueChangedShowValueMax;
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _label1,_slider1,_label2,
- new Label
- {
- Text = "Second slider maximum Value is 10",
- TextColor = Color.Red
- },
- slider2
- }
- },
- Title = "Test: Source",
- BackgroundColor = Color.White
- };
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether MinimumProperty's bound or not.")]
- [Property("SPEC", "Xamarin.Forms.Slider.MinimumProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Check if first slider change the Min value of slider after binding with second slider.")]
- [Step(3, "Check if first slider Min value change from 0 to 3 after binding with second slider's Min value. Min value of first slider doesn't change corresponding to second slider value property")]
- [Postcondition(1, "NA")]
- public async Task MinimumProperty_UIBH()
- {
- CreateSlider("Slider ValueProperty Test!");
- _slider1.IsVisible = true;
- _label1.IsVisible = true;
- _label2.IsVisible = false;
- _label1.Text = "Minimum value is 0 before binding.";
- Slider slider3 = new Slider
- {
- Value = 5,
- Minimum = 0,
- Maximum = 10.00,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- };
- slider3.Minimum = 3;
-
- _slider1.BindingContext = slider3;
- _slider1.SetBinding(Slider.MinimumProperty, "Minimum");
- _slider1.ValueChanged += OnValueChangedShowValueMin;
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _label1,_slider1,_label2,
- new Label
- {
- Text = "Second slider minimum Value is 3",
- TextColor = Color.Red
- },
- slider3
- }
- },
- Title = "Test: Source",
- BackgroundColor = Color.White
- };
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: IsVisible UILK")]
- [Property("SPEC", "Xamarin.Forms.Slider.IsVisible A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click slider after new page shown and check")]
- [Step(3, "Click item of Listview")]
- [Step(4, "Pass If IsVisible of Slider changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task IsVisible_Slider_UILK()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "Visible";
- dataTest[1] = "Invisible";
- dataTest[2] = "Visible";
- var text = "Select a IsVisible test";
- var title = "IsVisible Test";
- CreatePageTestToSlider(text, title, dataTest);
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[1]))
- {
- _slider2.IsVisible = false;
- }
- else
- {
- _slider2.IsVisible = true;
- }
- };
- await ManualTest.WaitForConfirm();
-
- /* POSTCONDITION 1480
- * Remove event handler 1481
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: IsEnabled UILK")]
- [Property("SPEC", "Xamarin.Forms.Slider.IsEnabled A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click slider after new page shown and check")]
- [Step(3, "Click item of Listview")]
- [Step(4, "Pass If IsEnabled of Slider changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task IsEnabled_Slider_UILK()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "Enable";
- dataTest[1] = "Disable";
- dataTest[2] = "Enable";
- var text = "Select a IsEnabled test";
- var title = "IsEnabled Test";
- CreatePageTestToSlider(text, title, dataTest);
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[1]))
- {
- _slider2.IsEnabled = false;
- }
- else
- {
- _slider2.IsEnabled = true;
- }
- };
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Scale UILK")]
- [Property("SPEC", "Xamarin.Forms.Slider.Scale A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click slider after new page shown and check")]
- [Step(3, "Click item of Listview")]
- [Step(4, "Pass If Scale of Slider changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task Scale_Slider_UILK()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "0.5";
- dataTest[1] = "1.0";
- dataTest[2] = "2.0";
- var text = "Select a Scale test";
- var title = "Scale Test";
- CreatePageTestToSlider(text, title, dataTest);
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[0]))
- {
- _slider2.Scale = 0.5;
- }
- else if (controlTest.Name.Equals(dataTest[1]))
- {
- _slider2.Scale = 1.0;
- }
- else
- {
- _slider2.Scale = 2.0;
- }
- };
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Rotation UILK")]
- [Property("SPEC", "Xamarin.Forms.Slider.Rotation A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click slider after new page shown and check")]
- [Step(3, "Click item of Listview")]
- [Step(4, "Pass If Rotation of Slider changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task Rotation_Slider_UILK()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "50";
- dataTest[1] = "90";
- dataTest[2] = "180";
- var text = "Select a Rotation test";
- var title = "Rotation Test";
- CreatePageTestToSlider(text, title, dataTest);
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[0]))
- {
- _slider2.Rotation = 50;
- }
- else if (controlTest.Name.Equals(dataTest[1]))
- {
- _slider2.Rotation = 90;
- }
- else
- {
- _slider2.Rotation = 180;
- }
- };
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Margin UILK")]
- [Property("SPEC", "Xamarin.Forms.Slider.Margin A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click slider after new page shown and check")]
- [Step(3, "Click item of Listview")]
- [Step(4, "Pass If Margin of slider changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task Margin_Slider_UILK()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "MarginTop: 50";
- dataTest[1] = "MarginTop: 100";
- dataTest[2] = "MarginTop: 150";
- var text = "Select a Margin test";
- var title = "Margin Test";
- CreatePageTestToSlider(text, title, dataTest);
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[0]))
- {
- _slider2.Margin = new Thickness(0, 50, 0, 0);
- }
- else if (controlTest.Name.Equals(dataTest[1]))
- {
- _slider2.Margin = new Thickness(0, 100, 0, 0);
- }
- else
- {
- _slider2.Margin = new Thickness(0, 150, 0, 0);
- }
- };
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Slider look")]
- [Property("SPEC", "Xamarin.Forms.Slider Opacity")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Seek Opacity Slider after observe")]
- [Step(3, "Pass If Opacity of Slider changed otherwise false")]
- [Postcondition(1, "NA")]
- public async Task Slider_Opacity_LOOK()
- {
- _slider3 = new Slider()
- {
- HorizontalOptions = LayoutOptions.Center,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 80,
- WidthRequest = 220,
- };
- var sliderOpacity = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.BlueViolet,
- Maximum = 1,
- Minimum = 0,
- Value = 1
- };
-
- _slider3.BindingContext = sliderOpacity;
- _slider3.SetBinding(Slider.OpacityProperty, "Value");
-
- var mainUI = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.White,
- Padding = new Thickness()
- {
- Top = 20,
- Bottom = 50,
- },
- Spacing = 25,
- Children =
- {
- _slider3,
- new StackLayout() {
- Orientation = StackOrientation.Horizontal,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Padding = new Thickness() {
- Left = 20,
- Right = 20,
- },
- Children =
- {
- new Label()
- {
- Text = "Opacity: ",
- },
- sliderOpacity
- }
- },
- }
- };
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = mainUI,
- Title = "Opacity Slider Test"
- });
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Slider look")]
- [Property("SPEC", "Xamarin.Forms.Slider Width")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Seek Silder for Width after observe")]
- [Step(3, "Pass If Width of Slider changed otherwise false")]
- [Postcondition(1, "NA")]
- public async Task Slider_Width_CHANGE_SIZE()
- {
- _slider3 = new Slider()
- {
- HorizontalOptions = LayoutOptions.Center,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 80,
- WidthRequest = 120
- };
-
- var sliderHorizontal = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.Pink,
- Maximum = 500,
- Minimum = 120
- };
-
- sliderHorizontal.ValueChanged += (o, e) =>
- {
- _slider3.WidthRequest = sliderHorizontal.Value;
- };
-
- var mainUI = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.White,
- Padding = new Thickness()
- {
- Top = 20,
- Bottom = 20,
- },
- Spacing = 25,
- Children =
- {
- _slider3,
- new StackLayout() {
- Orientation = StackOrientation.Horizontal,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Padding = new Thickness() {
- Left = 20,
- Right = 20,
- },
- Children =
- {
- new Label()
- {
- Text = "Width: ",
- },
- sliderHorizontal
- }
- },
- }
- };
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = mainUI,
- Title = "Size Slider Test"
- });
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Slider look")]
- [Property("SPEC", "Xamarin.Forms.Slider.BackgroundColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Select a Color after observe BackgroundColor of Slider is changed")]
- [Step(3, "Pass If BackgroundColor of Slider changed otherwise false")]
- [Postcondition(1, "NA")]
- public async Task BackgroundColor_Slider_COLOR_CHANGE()
- {
- _slider3 = new Slider()
- {
- HorizontalOptions = LayoutOptions.Center,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 80,
- WidthRequest = 120
- };
-
- var imageRed = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.Red,
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "RED",
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center,
- }
- }
- };
-
- var imageGreen = new StackLayout()
- {
- BackgroundColor = Color.Green,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "GREEN",
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center,
- }
- }
- };
-
- var imageGray = new StackLayout()
- {
- BackgroundColor = Color.Gray,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "GRAY",
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center,
- }
- }
- };
-
- var tapGestureRecognizerRed = new TapGestureRecognizer();
- tapGestureRecognizerRed.Tapped += async (s, e) =>
- {
- _slider3.BackgroundColor = Color.Red;
- await Task.Delay(2000);
- };
- imageRed.GestureRecognizers.Add(tapGestureRecognizerRed);
-
- var tapGestureRecognizerGreen = new TapGestureRecognizer();
- tapGestureRecognizerGreen.Tapped += async (s, e) =>
- {
- _slider3.BackgroundColor = Color.Green;
- await Task.Delay(2000);
- };
- imageGreen.GestureRecognizers.Add(tapGestureRecognizerGreen);
-
- var tapGestureRecognizerGray = new TapGestureRecognizer();
- tapGestureRecognizerGray.Tapped += async (s, e) =>
- {
- _slider3.BackgroundColor = Color.Gray;
- await Task.Delay(2000);
- };
- imageGray.GestureRecognizers.Add(tapGestureRecognizerGray);
-
- var mainUI = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.White,
-
- Children =
- {
- _slider3,
- new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 180,
- Orientation = StackOrientation.Horizontal,
- Spacing = 10,
- Padding = new Thickness()
- {
- Left = 20,
- Right = 20
- },
-
- Children =
- {
- imageRed,
- imageGreen,
- imageGray
- }
- }
- }
- };
-
- if (ManualTest.IsWearable())
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Not supported on this profile");
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
- else
- {
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = mainUI,
- Title = "BackgoundColor Test"
- });
- }
-
- await ManualTest.WaitForConfirm();
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System.Threading.Tasks;
-using System.Collections.Generic;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class StackLayoutTests
- {
- private static Label _horizontalTitle, _verticalTitle;
- private static ListView _listview;
- private static StackLayout _controlStackLayout, _horizontalStackLayout, _verticalStackLayout, _simpleStackLayout, _stackLayout3, _stackLayout4;
- private static Button _spacePlus, _spaceMinus, _horizontalButton1, _horizontalButton2, _verticalButton1, _verticalButton2, _focusButton, _button;
- private static TestPage _testPage = TestPage.GetInstance();
-
- class ControlTest
- {
- public ControlTest(string name)
- {
- this.Name = name;
- }
-
- public string Name { private set; get; }
- };
-
- [SetUp]
- public void SetUp()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "StackLayout CLASS: Setup---------------------------------");
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "StackLayout CLASS: Teardown---------------------------------");
- _stackLayout3 = null;
- _stackLayout4 = null;
- _simpleStackLayout = null;
- _verticalStackLayout = null;
- _horizontalStackLayout = null;
- _controlStackLayout = null;
- }
-
- private static void CreateStackLayout(string entryText)
- {
- LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "CreateStackLayout");
- _horizontalTitle = new Label()
- {
- TextColor = new Color(0, 0, 255)
- };
- _verticalTitle = new Label()
- {
- TextColor = new Color(0, 0, 255)
- };
- _horizontalButton1 = new Button()
- {
- Text = "Button1",
- TextColor = new Color(255, 255, 255)
- };
- _horizontalButton2 = new Button()
- {
- Text = "Button2",
- TextColor = new Color(255, 255, 255)
- };
- _verticalButton1 = new Button()
- {
- Text = "Button1",
- TextColor = new Color(255, 255, 255)
- };
- _verticalButton2 = new Button()
- {
- Text = "Button2",
- TextColor = new Color(255, 255, 255)
- };
- _focusButton = new Button()
- {
- Text = "Button for focus",
- TextColor = new Color(255, 255, 255)
- };
- _horizontalStackLayout = new StackLayout()
- {
- IsVisible = false,
- Orientation = StackOrientation.Horizontal,
- Children =
- {
- _horizontalButton1,_horizontalButton2
- },
- Spacing = 20,
- };
- _verticalStackLayout = new StackLayout()
- {
- IsVisible = false,
- Orientation = StackOrientation.Vertical,
- Children =
- {
- _verticalButton1,_verticalButton2,
- },
- Spacing = 20,
- };
- _spacePlus = new Button()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- Text = "Spacing+",
- TextColor = new Color(255, 255, 255)
- };
- _spaceMinus = new Button()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- Text = "Spacing-",
- TextColor = new Color(255, 255, 255),
- };
- _controlStackLayout = new StackLayout()
- {
- IsVisible = false,
- VerticalOptions = LayoutOptions.EndAndExpand,
- Orientation = StackOrientation.Horizontal,
- Children =
- {
- _spacePlus,_spaceMinus
- },
- Spacing = 100
- };
- }
-
- //support function
- public void CreatePageTestToStackLayout(String txtDisplay, String title, String[] dataTest)
- {
- _button = new Button
- {
- Text = "Click Me !",
- HorizontalOptions = LayoutOptions.Center,
- Font = Font.SystemFontOfSize(NamedSize.Medium),
- WidthRequest = 350,
- };
-
- _simpleStackLayout = new StackLayout
- {
- HorizontalOptions = LayoutOptions.Center,
- WidthRequest = 550,
- BackgroundColor = Color.Green,
- IsEnabled = true,
- Children =
- {
- _button
- },
- };
-
- List<ControlTest> controlTest = new List<ControlTest>
- {
- new ControlTest(dataTest[0]),
- new ControlTest(dataTest[1]),
- new ControlTest(dataTest[2])
- };
- _listview = new ListView
- {
- RowHeight = 100,
- ItemsSource = controlTest,
- ItemTemplate = new DataTemplate(() =>
- {
- Label nameLabel = new Label()
- {
- TextColor = Color.Black,
- BackgroundColor = Color.White,
- HorizontalOptions = LayoutOptions.Center,
- };
- nameLabel.SetBinding(Label.TextProperty, "Name");
- return new ViewCell
- {
- View = new StackLayout
- {
- Padding = new Thickness(0, 5),
- Children =
- {
- new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Spacing = 0,
- Children =
- {
- nameLabel,
- }
- }
- }
- }
- };
- })
- };
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- _simpleStackLayout,
- _listview,
- },
- BackgroundColor = Color.Blue,
- },
- Title = title
- });
- }
-
- [Test]
- [Category("P1")]
- [Description("Gets or sets the value which indicates the direction which child views are positioned.")]
- [Property("SPEC", "Xamarin.Forms.StackLayout.Orientation A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click Run TC")]
- [Step(2, "Check orientation horizontal and vertical")]
- [Step(3, "Confirm pass or fail, If you can see 4 buttons")]
- [Postcondition(1, "NA")]
- public async Task Orientation_StackLayout_UIBH()
- {
- /* TEST CODE */
- CreateStackLayout("StackLayout Orientation Test!");
- _horizontalStackLayout.IsVisible = true;
- _verticalStackLayout.IsVisible = true;
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _horizontalStackLayout, _verticalStackLayout
- }
- },
- Title = "Test: Source",
- BackgroundColor = Color.Blue
- };
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Gets or sets a value which indicates the amount of space between each children.")]
- [Property("SPEC", "Xamarin.Forms.StackLayout.Spacing A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click Run TC and click Spacing+/Spacing- button")]
- [Step(2, "Check item spacing")]
- [Step(3, "Confirm pass or fail")]
- [Postcondition(1, "NA")]
- public async Task Spacing_StackLayout_BHBH()
- {
- /* TEST CODE */
- CreateStackLayout("StackLayout Orientation Test!");
- _horizontalStackLayout.IsVisible = true;
- _horizontalStackLayout.Spacing = 0;
- _controlStackLayout.IsVisible = true;
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _horizontalStackLayout, _controlStackLayout
- }
- },
- Title = "Test: Source",
- BackgroundColor = Color.White
- };
- _testPage.ExecuteTC(page);
- _spacePlus.Clicked += (object sender, EventArgs e) =>
- {
- _horizontalStackLayout.Spacing += 10;
- };
- _spaceMinus.Clicked += (object sender, EventArgs e) =>
- {
- if (_horizontalStackLayout.Spacing != 0)
- {
- _horizontalStackLayout.Spacing -= 10;
- }
- };
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: IsEnabled UILK")]
- [Property("SPEC", "Xamarin.Forms.StackLayout.IsEnabled A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(3, "Pass If IsEnabled of Button changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task IsEnabled_StackLayout_UILK()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "Enable";
- dataTest[1] = "Disable";
- dataTest[2] = "Enable";
- var text = "Select a IsEnabled test";
- var title = "IsEnabled Test";
- CreatePageTestToStackLayout(text, title, dataTest);
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[1]))
- {
- _button.IsEnabled = false;
- }
- else
- {
- _button.IsEnabled = true;
- }
- };
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: IsVisible UILK")]
- [Property("SPEC", "Xamarin.Forms.StackLayout.IsVisible A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(3, "Pass If IsVisible of Slider changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task IsVisible_StackLayout_UILK()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "Visible";
- dataTest[1] = "Invisible";
- dataTest[2] = "Visible";
- var text = "Select a IsVisible test";
- var title = "IsVisible Test";
- CreatePageTestToStackLayout(text, title, dataTest);
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[1]))
- {
- _simpleStackLayout.IsVisible = false;
- }
- else
- {
- _simpleStackLayout.IsVisible = true;
- }
- };
- await ManualTest.WaitForConfirm();
-
- /* POSTCONDITION 1480
- * Remove event handler 1481
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Scale UILK")]
- [Property("SPEC", "Xamarin.Forms.StackLayout.Scale A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(3, "Pass If Scale of StackLayout changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task Scale_StackLayout_UILK()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "0.5";
- dataTest[1] = "1.0";
- dataTest[2] = "2.0";
- var text = "Select a Scale test";
- var title = "Scale Test";
- CreatePageTestToStackLayout(text, title, dataTest);
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[0]))
- {
- _simpleStackLayout.Scale = 0.5;
- }
- else if (controlTest.Name.Equals(dataTest[1]))
- {
- _simpleStackLayout.Scale = 1.0;
- }
- else
- {
- _simpleStackLayout.Scale = 2.0;
- }
- };
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Rotation UILK")]
- [Property("SPEC", "Xamarin.Forms.StackLayout.Rotation A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(3, "Pass If Rotation of StackLayout changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task Rotation_StackLayout_UILK()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "50";
- dataTest[1] = "90";
- dataTest[2] = "180";
- var text = "Select a Rotation test";
- var title = "Rotation Test";
- CreatePageTestToStackLayout(text, title, dataTest);
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[0]))
- {
- _simpleStackLayout.Rotation = 50;
- }
- else if (controlTest.Name.Equals(dataTest[1]))
- {
- _simpleStackLayout.Rotation = 90;
- }
- else
- {
- _simpleStackLayout.Rotation = 180;
- }
- };
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Margin UILK")]
- [Property("SPEC", "Xamarin.Forms.StackLayout.Margin A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(3, "Pass If Margin of StackLayout changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task Margin_StackLayout_UILK()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "MarginTop: 50";
- dataTest[1] = "MarginTop: 100";
- dataTest[2] = "MarginTop: 150";
- var text = "Select a Margin test";
- var title = "Margin Test";
- CreatePageTestToStackLayout(text, title, dataTest);
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[0]))
- {
- _simpleStackLayout.Margin = new Thickness(0, 50, 0, 0);
- }
- else if (controlTest.Name.Equals(dataTest[1]))
- {
- _simpleStackLayout.Margin = new Thickness(0, 100, 0, 0);
- }
- else
- {
- _simpleStackLayout.Margin = new Thickness(0, 150, 0, 0);
- }
- };
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: StackLayout look")]
- [Property("SPEC", "Xamarin.Forms.StackLayout Opacity")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Seek Opacity Slider after observe")]
- [Step(3, "Pass If Opacity of StackLayout changed otherwise false")]
- [Postcondition(1, "NA")]
- public async Task Opacity_StackLayout_LOOK()
- {
- _stackLayout3 = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.Center,
- WidthRequest = 550,
- HeightRequest = 100,
- BackgroundColor = Color.Blue,
- IsEnabled = true,
- };
- var sliderOpacity = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.BlueViolet,
- Maximum = 1,
- Minimum = 0,
- Value = 1
- };
-
- _stackLayout3.BindingContext = sliderOpacity;
- _stackLayout3.SetBinding(StackLayout.OpacityProperty, "Value");
-
- var mainUI = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.White,
- Spacing = 25,
- Children =
- {
- _stackLayout3,
- new StackLayout() {
- Orientation = StackOrientation.Horizontal,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- new Label()
- {
- Text = "Opacity: ",
- },
- sliderOpacity
- }
- },
- }
- };
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = mainUI,
- Title = "Opacity StackLayout Test"
- });
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: StackLayout look")]
- [Property("SPEC", "Xamarin.Forms.StackLayout WidthAndHeight")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Seek Silder for Width and Height after observe")]
- [Step(3, "Pass If Height and Width of StackLayout changed otherwise false")]
- [Postcondition(1, "NA")]
- public async Task WidthAndHeight_StackLayout_CHANGE_SIZE()
- {
- _stackLayout4 = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.Center,
- WidthRequest = 450,
- HeightRequest = 100,
- BackgroundColor = Color.Blue,
- IsEnabled = true,
- };
- var sliderHorizontal = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.Pink,
- Maximum = 500,
- Minimum = 100,
- Value = 100
- };
- var sliderVertical = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.Pink,
- Maximum = 500,
- Minimum = 100,
- Value = 100
- };
-
- sliderHorizontal.ValueChanged += (o, e) =>
- {
- _stackLayout4.WidthRequest = sliderHorizontal.Value;
- };
-
- sliderVertical.ValueChanged += (o, e) =>
- {
- _stackLayout4.HeightRequest = sliderVertical.Value;
- };
-
- var mainUI = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.White,
- Children =
- {
- _stackLayout4,
- new StackLayout() {
- Orientation = StackOrientation.Horizontal,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- new Label()
- {
- Text = "Width: ",
- },
- sliderHorizontal
- }
- },
- new StackLayout() {
- Orientation = StackOrientation.Horizontal,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- new Label()
- {
- Text = "Height: ",
- },
- sliderVertical
- }
- }
- }
- };
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = mainUI,
- Title = "Size StackLayout Test"
- });
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: StackLayout look")]
- [Property("SPEC", "Xamarin.Forms.StackLayout.BackgroundColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Select a Color after observe BackgroundColor of StackLayout is changed")]
- [Step(3, "Pass If BackgroundColor of StackLayout changed otherwise false")]
- [Postcondition(1, "NA")]
- public async Task BackgroundColor_StackLayout_COLOR_CHANGE()
- {
- _stackLayout4 = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.Center,
- WidthRequest = 450,
- HeightRequest = 100,
- BackgroundColor = Color.HotPink,
- IsEnabled = true,
- };
-
- var imageRed = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.Red,
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "RED",
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center,
- }
- }
- };
-
- var imageGreen = new StackLayout()
- {
- BackgroundColor = Color.Green,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "GREEN",
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center,
- }
- }
- };
-
- var imageGray = new StackLayout()
- {
- BackgroundColor = Color.Gray,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "GRAY",
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center,
- }
- }
- };
-
- var tapGestureRecognizerRed = new TapGestureRecognizer();
- tapGestureRecognizerRed.Tapped += async (s, e) =>
- {
- _stackLayout4.BackgroundColor = Color.Red;
- await Task.Delay(2000);
- };
- imageRed.GestureRecognizers.Add(tapGestureRecognizerRed);
-
- var tapGestureRecognizerGreen = new TapGestureRecognizer();
- tapGestureRecognizerGreen.Tapped += async (s, e) =>
- {
- _stackLayout4.BackgroundColor = Color.Green;
- await Task.Delay(2000);
- };
- imageGreen.GestureRecognizers.Add(tapGestureRecognizerGreen);
-
- var tapGestureRecognizerGray = new TapGestureRecognizer();
- tapGestureRecognizerGray.Tapped += async (s, e) =>
- {
- _stackLayout4.BackgroundColor = Color.Gray;
- await Task.Delay(2000);
- };
- imageGray.GestureRecognizers.Add(tapGestureRecognizerGray);
-
- var mainUI = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.White,
- Children =
- {
- _stackLayout4,
- new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 180,
- Orientation = StackOrientation.Horizontal,
- Children =
- {
- imageRed,
- imageGreen,
- imageGray
- }
- }
- }
- };
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = mainUI,
- Title = "BackgoundColor Test"
- });
- await ManualTest.WaitForConfirm();
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System.Threading.Tasks;
-using System.Collections.Generic;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class StepperTests
- {
- private static ListView _listview;
- private static Stepper _stepper1, _stepper2, _stepper3;
- private static Label _label1, _label2;
- private static TestPage _testPage = TestPage.GetInstance();
-
- class ControlTest
- {
- public ControlTest(string name)
- {
- this.Name = name;
- }
-
- public string Name { private set; get; }
- };
-
- [SetUp]
- public void SetUp()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Stepper CLASS: Setup---------------------------------");
- if (Device.Idiom != TargetIdiom.Phone)
- {
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Stepper CLASS: Teardown---------------------------------");
- _stepper1 = null;
- _stepper2 = null;
- _label1 = null;
- _label2 = null;
- }
-
- private static void OnValueChangedShowValue(object sender, EventArgs e)
- {
- var val = (int)_stepper1.Value;
- _label2.Text = "Stepper current Value: " + val.ToString();
- }
-
- //support function
- private static void CreateStepper(string Text)
- {
- LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "CreateStepper");
-
- _stepper1 = new Stepper()
- {
- IsVisible = false,
- Value = 10,
- Minimum = 0,
- Maximum = 10,
- Increment = 1.0,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Scale = 1.0
- };
-
- _label1 = new Label()
- {
- IsVisible = false,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- TextColor = new Color(255, 0, 0)
- };
- _label2 = new Label()
- {
- IsVisible = false,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- TextColor = new Color(0, 255, 0)
- };
- }
-
- public void CreatePageTestToStepper(String txtDisplay, String title, String[] dataTest)
- {
- _stepper2 = new Stepper
- {
- Margin = new Thickness(0, 250, 0, 0),
- //Text = "This is Slider test",
- HorizontalOptions = LayoutOptions.Center,
- //Font = Font.SystemFontOfSize(NamedSize.Medium),
- WidthRequest = 350,
- HeightRequest = 100,
- Value = 5,
- Minimum = 0,
- Maximum = 10,
- Increment = 0.1,
- IsEnabled = true,
- };
- Label labelDisplay = new Label
- {
- Margin = new Thickness(0, 200, 0, 0),
- Text = txtDisplay,
- TextColor = Color.Red,
- Font = Font.SystemFontOfSize(NamedSize.Large),
- HorizontalOptions = LayoutOptions.Center
- };
- List<ControlTest> controlTest = new List<ControlTest>
- {
- new ControlTest(dataTest[0]),
- new ControlTest(dataTest[1]),
- new ControlTest(dataTest[2])
- };
- _listview = new ListView
- {
- RowHeight = 100,
- ItemsSource = controlTest,
- ItemTemplate = new DataTemplate(() =>
- {
- Label nameLabel = new Label()
- {
- Margin = new Thickness(300, 0, 0, 0),
- TextColor = Color.Black,
- HorizontalOptions = LayoutOptions.Center,
- };
- nameLabel.SetBinding(Label.TextProperty, "Name");
- return new ViewCell
- {
- View = new StackLayout
- {
- Padding = new Thickness(0, 5),
- Orientation = StackOrientation.Horizontal,
- Children =
- {
- new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Spacing = 0,
- Children =
- {
- nameLabel,
- }
- }
- }
- }
- };
- })
- };
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- _stepper2,
- labelDisplay,
- _listview,
- },
- BackgroundColor = Color.Blue,
- },
- Title = title
- });
- }
-
- [Test]
- [Category("P1")]
- [Description("Sets or gets the Increment value for the stepper.")]
- [Property("SPEC", "Xamarin.Forms.Stepper.Increment A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")]
- [Step(1, "Click run TC")]
- [Step(2, "Check if the Increment value is 2.")]
- [Step(3, "If after stepping right the increment value is 2 then Pass.")]
- [Postcondition(1, "N/A")]
- public async Task Increment_Stepper_UIBH()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
- CreateStepper("Stepper Increment Value Test!");
- _stepper1.IsVisible = true;
- _label1.IsVisible = true;
- _label2.IsVisible = true;
- _label1.Text = "Default Increment value is 2 here.";
- _label2.Text = "Stepper current Increment Value: " + _stepper1.Value.ToString();
- _stepper1.Maximum = 20;
- _stepper1.Increment = 2;
- _stepper1.ValueChanged += OnValueChangedShowValue;
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _label1,_label2,_stepper1
- }
- },
- Title = "Test: Source",
- BackgroundColor = Color.White,
- };
- _testPage.ExecuteTC(page);
-
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Sets or gets the maximum value for the stepper.")]
- [Property("SPEC", "Xamarin.Forms.Stepper.Maximum A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")]
- [Step(1, "Click run TC")]
- [Step(2, "Check if the Maximum value is 20.")]
- [Step(3, "If after stepping right maximum value is 20 then pass.")]
- [Postcondition(1, "N/A")]
- public async Task Maximum_Stepper_UIBH()
- {
- /*PRE CONDITION
- *
- */
- //TEST CODE
- CreateStepper("Stepper Maximum Value Test!");
- _stepper1.IsVisible = true;
- _label1.IsVisible = true;
- _label2.IsVisible = true;
- _label1.Text = "Maximum value is 20 here.";
- _label2.Text = "Stepper current Value: " + _stepper1.Value.ToString();
- _stepper1.Maximum = 20.00;
- _stepper1.ValueChanged += OnValueChangedShowValue;
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _label1,_label2,_stepper1
- }
- },
- Title = "Test: Source",
- BackgroundColor = Color.White,
- };
- _testPage.ExecuteTC(page);
-
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Sets or gets the minimum value for the stepper.")]
- [Property("SPEC", "Xamarin.Forms.Stepper.Minimum A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")]
- [Step(1, "Click run TC")]
- [Step(2, "Check if the Minimum value is 5.")]
- [Postcondition(1, "NA")]
- public async Task Minimum_Stepper_UIBH()
- {
- CreateStepper("Stepper Minimum Value Test!");
- _stepper1.IsVisible = true;
- _label1.IsVisible = true;
- _label2.IsVisible = true;
- _label1.Text = "Minimum value is 5 here.";
- _label2.Text = "Stepper Value: " + _stepper1.Value.ToString();
- _stepper1.Minimum = 5.00;
- _stepper1.ValueChanged += OnValueChangedShowValue;
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _label1,_label2,_stepper1
- }
- },
- Title = "Test: Source",
- BackgroundColor = Color.White,
- };
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Sets or gets the current value of the stepper displays.")]
- [Property("SPEC", "Xamarin.Forms.Stepper.Value A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")]
- [Step(1, "Click run TC")]
- [Step(2, "Check if the value is 5.")]
- [Postcondition(1, "NA")]
- public async Task Value_UIBH()
- {
- CreateStepper("Stepper Value Test!");
- _stepper1.IsVisible = true;
- _label1.IsVisible = true;
- _label1.HeightRequest = 100;
- _label1.Text = "Value is 5 here. Stepper position will set to middle.";
- _stepper1.Value = 5.00;
- _stepper1.ValueChanged += OnValueChangedShowValue;
-
- var page = new ContentPage()
- {
- Content = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _label1,_label2,_stepper1
- }
- },
- Title = "Test: Source",
- BackgroundColor = Color.White,
- };
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: IsVisible UILK")]
- [Property("SPEC", "Xamarin.Forms.Stepper.IsVisible A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")]
- [Step(1, "Click run TC")]
- [Step(2, "Click stepper after new page shown and check")]
- [Step(3, "Click item of Listview")]
- [Step(4, "Pass If IsVisible of stepper changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task IsVisible_Stepper_UILK()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "Visible";
- dataTest[1] = "Invisible";
- dataTest[2] = "Visible";
- var text = "Select a IsVisible test";
- var title = "IsVisible Test";
- CreatePageTestToStepper(text, title, dataTest);
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[1]))
- {
- _stepper2.IsVisible = false;
- }
- else
- {
- _stepper2.IsVisible = true;
- }
- };
- await ManualTest.WaitForConfirm();
-
- /* POSTCONDITION 1480
- * Remove event handler 1481
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: IsEnabled UIBH")]
- [Property("SPEC", "Xamarin.Forms.Stepper.IsEnabled A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")]
- [Step(1, "Click run TC")]
- [Step(2, "Click stepper after new page shown and check")]
- [Step(3, "Click item of Listview")]
- [Step(4, "Pass If IsEnabled of stepper changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task IsEnabled_Stepper_UIBH()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "Enable";
- dataTest[1] = "Disable";
- dataTest[2] = "Enable";
- var text = "Select a IsEnabled test";
- var title = "IsEnabled Test";
- CreatePageTestToStepper(text, title, dataTest);
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[1]))
- {
- _stepper2.IsEnabled = false;
- }
- else
- {
- _stepper2.IsEnabled = true;
- }
- };
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Scale UILK")]
- [Property("SPEC", "Xamarin.Forms.Stepper.Scale A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")]
- [Step(1, "Click run TC")]
- [Step(2, "Click stepper after new page shown and check")]
- [Step(3, "Click item of Listview")]
- [Step(4, "Pass If Scale of stepper changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task Scale_Stepper_UILK()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "0.5";
- dataTest[1] = "1.0";
- dataTest[2] = "2.0";
- var text = "Select a Scale test";
- var title = "Scale Test";
- CreatePageTestToStepper(text, title, dataTest);
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[0]))
- {
- _stepper2.Scale = 0.5;
- }
- else if (controlTest.Name.Equals(dataTest[1]))
- {
- _stepper2.Scale = 1.0;
- }
- else
- {
- _stepper2.Scale = 2.0;
- }
- };
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Rotation UILK")]
- [Property("SPEC", "Xamarin.Forms.Stepper.Rotation A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")]
- [Step(1, "Click run TC")]
- [Step(2, "Click stepper after new page shown and check")]
- [Step(3, "Click item of Listview")]
- [Step(4, "Pass If Rotation of Stepper changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task Rotation_Stepper_UILK()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "50";
- dataTest[1] = "90";
- dataTest[2] = "180";
- var text = "Select a Rotation test";
- var title = "Rotation Test";
- CreatePageTestToStepper(text, title, dataTest);
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[0]))
- {
- _stepper2.Rotation = 50;
- }
- else if (controlTest.Name.Equals(dataTest[1]))
- {
- _stepper2.Rotation = 90;
- }
- else
- {
- _stepper2.Rotation = 180;
- }
- };
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Margin UILK")]
- [Property("SPEC", "Xamarin.Forms.Stepper.Margin A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")]
- [Step(1, "Click run TC")]
- [Step(2, "Click stepper after new page shown and check")]
- [Step(3, "Click item of Listview")]
- [Step(4, "Pass If Margin of stepper changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task Margin_Stepper_UILK()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "MarginTop: 50";
- dataTest[1] = "MarginTop: 100";
- dataTest[2] = "MarginTop: 150";
- var text = "Select a Margin test";
- var title = "Margin Test";
- CreatePageTestToStepper(text, title, dataTest);
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[0]))
- {
- _stepper2.Margin = new Thickness(0, 50, 0, 0);
- }
- else if (controlTest.Name.Equals(dataTest[1]))
- {
- _stepper2.Margin = new Thickness(0, 100, 0, 0);
- }
- else
- {
- _stepper2.Margin = new Thickness(0, 150, 0, 0);
- }
- };
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Stepper look")]
- [Property("SPEC", "Xamarin.Forms.Stepper Opacity")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")]
- [Step(1, "Click run TC")]
- [Step(2, "Seek Opacity Stepper after observe")]
- [Step(3, "Pass If Opacity of Stepper changed otherwise false")]
- [Postcondition(1, "NA")]
- public async Task Stepper_Opacity_LOOK()
- {
- _stepper3 = new Stepper()
- {
- HorizontalOptions = LayoutOptions.Center,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 80,
- WidthRequest = 220,
- };
- var stepperOpacity = new Stepper()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.BlueViolet,
- Maximum = 1,
- Minimum = 0,
- Value = 1,
- Increment = 0.1
- };
-
- _stepper3.BindingContext = stepperOpacity;
- _stepper3.SetBinding(Stepper.OpacityProperty, "Value");
-
- var mainUI = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.White,
- Padding = new Thickness()
- {
- Top = 20,
- Bottom = 50,
- },
- Spacing = 25,
- Children =
- {
- _stepper3,
- new StackLayout() {
- Orientation = StackOrientation.Horizontal,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Padding = new Thickness() {
- Left = 20,
- Right = 20,
- },
- Children =
- {
- new Label()
- {
- Text = "Opacity: ",
- Font = Font.SystemFontOfSize(NamedSize.Large)
- },
- stepperOpacity
- }
- },
- }
- };
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = mainUI,
- Title = "Opacity Slider Test"
- });
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Stepper look")]
- [Property("SPEC", "Xamarin.Forms.Stepper Width")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")]
- [Step(1, "Click run TC")]
- [Step(2, "Chagne the value of slider for observing the width of Stepper")]
- [Step(3, "Pass If Width of stepper changed otherwise false")]
- [Postcondition(1, "NA")]
- public async Task Stepper_Width_CHANGE_SIZE()
- {
- _stepper3 = new Stepper()
- {
- HorizontalOptions = LayoutOptions.Center,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 80,
- WidthRequest = 120,
- };
-
- var sliderHorizontal = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.Pink,
- Maximum = 500,
- Minimum = (Device.Idiom == TargetIdiom.Phone) ? 320 : 120,
- Value = (Device.Idiom == TargetIdiom.Phone) ? 320 : 120,
- };
-
- sliderHorizontal.ValueChanged += (o, e) =>
- {
- _stepper3.WidthRequest = sliderHorizontal.Value;
- };
-
- var mainUI = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.White,
- Padding = new Thickness()
- {
- Top = 20,
- Bottom = 20,
- },
- Spacing = 25,
- Children =
- {
- _stepper3,
- new StackLayout() {
- Orientation = StackOrientation.Horizontal,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Padding = new Thickness() {
- Left = 20,
- Right = 20,
- },
- Children =
- {
- new Label()
- {
- Text = "Width: ",
- Font = Font.SystemFontOfSize(NamedSize.Large)
- },
- sliderHorizontal
- }
- },
- }
- };
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = mainUI,
- Title = "Size Stepper Test"
- });
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Stepper look")]
- [Property("SPEC", "Xamarin.Forms.Stepper.BackgroundColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")]
- [Step(1, "Click run TC")]
- [Step(2, "Select a Color after observe BackgroundColor of Stepper is changed")]
- [Step(3, "Pass If BackgroundColor of Stepper changed otherwise false")]
- [Postcondition(1, "NA")]
- public async Task BackgroundColor_Stepper_COLOR_CHANGE()
- {
- _stepper3 = new Stepper()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 80,
- WidthRequest = 120,
- };
-
- var imageRed = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.Red,
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "RED",
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center,
- Font = Font.BoldSystemFontOfSize(NamedSize.Large)
- }
- }
- };
-
- var imageGreen = new StackLayout()
- {
- BackgroundColor = Color.Green,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "GREEN",
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center,
- Font = Font.BoldSystemFontOfSize(NamedSize.Large)
- }
- }
- };
-
- var imageGray = new StackLayout()
- {
- BackgroundColor = Color.Gray,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "GRAY",
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center,
- Font = Font.BoldSystemFontOfSize(NamedSize.Large)
- }
- }
- };
-
- var tapGestureRecognizerRed = new TapGestureRecognizer();
- tapGestureRecognizerRed.Tapped += async (s, e) =>
- {
- _stepper3.BackgroundColor = Color.Red;
- await Task.Delay(2000);
- };
- imageRed.GestureRecognizers.Add(tapGestureRecognizerRed);
-
- var tapGestureRecognizerGreen = new TapGestureRecognizer();
- tapGestureRecognizerGreen.Tapped += async (s, e) =>
- {
- _stepper3.BackgroundColor = Color.Green;
- await Task.Delay(2000);
- };
- imageGreen.GestureRecognizers.Add(tapGestureRecognizerGreen);
-
- var tapGestureRecognizerGray = new TapGestureRecognizer();
- tapGestureRecognizerGray.Tapped += async (s, e) =>
- {
- _stepper3.BackgroundColor = Color.Gray;
- await Task.Delay(2000);
- };
- imageGray.GestureRecognizers.Add(tapGestureRecognizerGray);
-
- var mainUI = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.White,
-
- Children =
- {
- _stepper3,
- new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 180,
- Orientation = StackOrientation.Horizontal,
- Spacing = 10,
- Padding = new Thickness()
- {
- Left = 20,
- Right = 20
- },
-
- Children =
- {
- imageRed,
- imageGreen,
- imageGray
- }
- }
- }
- };
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = mainUI,
- Title = "BackgoundColor Test"
- });
- await ManualTest.WaitForConfirm();
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System.Threading.Tasks;
-using XamarinApplication.Tizen;
-using System.Collections.Generic;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class SwitchTests
- {
- private static TestPage _testPage = TestPage.GetInstance();
- private static Label _label;
- private static Switch _switch, _switch1, _switch2, _switch3, _switch4;
- private static ListView _listview;
- private string _appResourcePath = Program.Current.DirectoryInfo.Resource;
-
- class ControlTest
- {
- public ControlTest(string name)
- {
- this.Name = name;
- }
-
- public string Name { private set; get; }
- };
-
- [SetUp]
- public void SetUp()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Switch CLASS: Setup---------------------------------");
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Switch CLASS: Teardown---------------------------------");
- _switch = null;
- _switch1 = null;
- _switch2 = null;
- _switch3 = null;
- _switch4 = null;
- _label = null;
- }
-
- /*-------supporting functions------*/
-
- private static void CreateSwitchTest(String title)
- {
- bool checkValue = false;
- var label2 = new Label
- {
- Text = " IsToggled: "
- };
- _label = new Label
- {
- Text = checkValue.ToString(),
- TextColor = Color.Black,
- BackgroundColor = Color.White
- };
- _switch = new Switch
- {
- HorizontalOptions = LayoutOptions.Center,
- VerticalOptions = LayoutOptions.CenterAndExpand
- };
- var layout = new StackLayout
- {
- Orientation = StackOrientation.Vertical,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- IsVisible = true,
- Children = {
- new StackLayout {
- Orientation = StackOrientation.Horizontal,
- Children = { label2, _label }
- },
- _switch,
- }
- };
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- layout
- },
- },
- Title = title
- });
- }
-
- public void CreatePageTestToSwitch(String txtDisplay, String title, String[] dataTest)
- {
- _switch1 = new Switch
- {
- HorizontalOptions = LayoutOptions.Center,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- WidthRequest = 350,
- IsEnabled = true
- };
-
- List<ControlTest> controlTest = new List<ControlTest>
- {
- new ControlTest(dataTest[0]),
- new ControlTest(dataTest[1]),
- };
-
- _listview = new ListView
- {
- RowHeight = 100,
- ItemsSource = controlTest,
- ItemTemplate = new DataTemplate(() =>
- {
- Label nameLabel = new Label()
- {
- TextColor = Color.Black,
- BackgroundColor = Color.White,
- HorizontalOptions = LayoutOptions.Center,
- };
- nameLabel.SetBinding(Label.TextProperty, "Name");
- return new ViewCell
- {
- View = new StackLayout
- {
- Padding = new Thickness(0, 5),
- Children =
- {
- new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Spacing = 0,
- Children =
- {
- nameLabel,
- }
- }
- }
- }
- };
- })
- };
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- _switch1,
- _listview,
- },
- BackgroundColor = Color.Blue,
- },
- Title = title
- });
- }
-
- private static void OnToggledCB(object sender, EventArgs e)
- {
- _label.Text = _switch.IsToggled.ToString();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Handle event Toggled Switch")]
- [Property("SPEC", "Xamarin.Forms.Switch.IsToggled A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Check for Toggled of Switch")]
- [Step(3, "Click back button")]
- [Postcondition(1, "NA")]
- public async Task IsToggled_UIBH()
- {
- CreateSwitchTest("Switch Toggled Test");
- _switch.Toggled += OnToggledCB;
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: IsVisible UILK")]
- [Property("SPEC", "Xamarin.Forms.Switch.IsVisible A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(4, "Pass If IsVisible of Switch changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task IsVisible_Switch_UILK()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "Visible";
- dataTest[1] = "Invisible";
- dataTest[2] = "Visible";
- var text = "Select a IsVisible test";
- var title = "IsVisible Test";
- CreatePageTestToSwitch(text, title, dataTest);
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[1]))
- {
- _switch1.IsVisible = false;
- }
- else
- {
- _switch1.IsVisible = true;
- }
- };
- await ManualTest.WaitForConfirm();
-
- /* POSTCONDITION 1480
- * Remove event handler 1481
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: IsEnabled UILK")]
- [Property("SPEC", "Xamarin.Forms.Switch.IsEnabled A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(3, "Pass If IsEnabled of Switch changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task IsEnabled_Switch_UILK()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "Enable";
- dataTest[1] = "Disable";
- dataTest[2] = "Enable";
- var text = "Scroll below listview, and select Enable or Disable";
- var title = "IsEnabled Test";
- CreatePageTestToSwitch(text, title, dataTest);
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[1]))
- {
- _switch1.IsEnabled = false;
- }
- else
- {
- _switch1.IsEnabled = true;
- }
- };
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Scale UILK")]
- [Property("SPEC", "Xamarin.Forms.Switch.Scale A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(3, "Pass If Scale of Switch changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task Scale_Switch_UILK()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "0.5";
- dataTest[1] = "1.0";
- dataTest[2] = "0.5";
- var text = "Select a Scale test";
- var title = "Scale Test";
- CreatePageTestToSwitch(text, title, dataTest);
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[0]))
- {
- _switch1.Scale = 0.5;
- }
- else if (controlTest.Name.Equals(dataTest[1]))
- {
- _switch1.Scale = 1.0;
- }
- else
- {
- _switch1.Scale = 0.5;
- }
- };
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Rotation UILK")]
- [Property("SPEC", "Xamarin.Forms.Switch.Rotation A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(3, "Pass If Rotation of Switch changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task Rotation_Switch_UILK()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "0";
- dataTest[1] = "180";
- dataTest[2] = "0";
- var text = "Select a Rotation test";
- var title = "Rotation Test";
- CreatePageTestToSwitch(text, title, dataTest);
- _switch1.Rotation = 180;
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[0]))
- {
- _switch1.Rotation = 0;
- }
- else if (controlTest.Name.Equals(dataTest[1]))
- {
- _switch1.Rotation = 180;
- }
- else
- {
- _switch1.Rotation = 0;
- }
- };
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Margin UILK")]
- [Property("SPEC", "Xamarin.Forms.Switch.Margin A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(3, "Pass If Margin of switch changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task Margin_Switch_UILK()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "MarginTop: 50";
- dataTest[1] = "MarginTop: 100";
- dataTest[2] = "MarginTop: 150";
- var text = "Select a Margin test";
- var title = "Margin Test";
- CreatePageTestToSwitch(text, title, dataTest);
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[0]))
- {
- _switch1.Margin = new Thickness(0, 50, 0, 0);
- }
- else if (controlTest.Name.Equals(dataTest[1]))
- {
- _switch1.Margin = new Thickness(0, 100, 0, 0);
- }
- else
- {
- _switch1.Margin = new Thickness(0, 150, 0, 0);
- }
- };
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Switch look")]
- [Property("SPEC", "Xamarin.Forms.Switch Opacity")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Seek Opacity Switch after observe")]
- [Step(3, "Pass If Opacity of Switch changed otherwise false")]
- [Postcondition(1, "NA")]
- public async Task Opacity_Switch_LOOK()
- {
- _switch3 = new Switch()
- {
- HorizontalOptions = LayoutOptions.Center,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- BackgroundColor = Color.Pink,
- HeightRequest = 80,
- WidthRequest = 80,
- };
- var sliderOpacity = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.BlueViolet,
- Maximum = 1,
- Minimum = 0,
- Value = 1
- };
-
- _switch3.BindingContext = sliderOpacity;
- _switch3.SetBinding(Switch.OpacityProperty, "Value");
-
- var mainUI = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- Spacing = 25,
- Children =
- {
- _switch3,
- new StackLayout() {
- Orientation = StackOrientation.Horizontal,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- new Label()
- {
- Text = "Opacity: ",
- },
- sliderOpacity
- }
- },
- }
- };
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = mainUI,
- Title = "Opacity Slider Test"
- });
- await ManualTest.WaitForConfirm();
- }
-
- //[Test]
- //[Category("P1")]
- //[Description("Test: Switch look")]
- //[Property("SPEC", "Xamarin.Forms.Switch WidthAndHeight")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "PRW")]
- //[Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- //[Precondition(1, "NA")]
- //[Step(1, "Click run TC")]
- //[Step(2, "Seek Switch for Width and Height after observe")]
- //[Step(3, "Pass If Height and Width of Switch changed otherwise false")]
- //[Postcondition(1, "NA")]
- //public async Task WidthAndHeight_Switch_CHANGE_SIZE()
- //{
- // _switch2 = new Switch()
- // {
- // Margin = new Thickness(0, 250, 0, 0),
- // HorizontalOptions = LayoutOptions.Center,
- // WidthRequest = 450,
- // HeightRequest = 250,
- // BackgroundColor = Color.Blue,
- // IsEnabled = true,
- // };
-
- // var sliderHorizontal = new Slider()
- // {
- // HorizontalOptions = LayoutOptions.FillAndExpand,
- // BackgroundColor = Color.Pink,
- // Maximum = 500,
- // Minimum = 120
- // };
-
- // var sliderVertical = new Slider()
- // {
- // HorizontalOptions = LayoutOptions.FillAndExpand,
- // BackgroundColor = Color.Pink,
- // Maximum = 500,
- // Minimum = 80
- // };
-
- // sliderHorizontal.ValueChanged += (o, e) =>
- // {
- // _switch2.WidthRequest = sliderHorizontal.Value;
- // };
-
- // sliderVertical.ValueChanged += (o, e) =>
- // {
- // _switch2.HeightRequest = sliderVertical.Value;
- // };
-
- // var mainUI = new StackLayout()
- // {
- // HorizontalOptions = LayoutOptions.FillAndExpand,
- // VerticalOptions = LayoutOptions.FillAndExpand,
- // BackgroundColor = Color.White,
- // Padding = new Thickness()
- // {
- // Top = 20,
- // Bottom = 20,
- // },
- // Spacing = 25,
- // Children =
- // {
- // _switch2,
- // new StackLayout() {
- // Orientation = StackOrientation.Horizontal,
- // HorizontalOptions = LayoutOptions.FillAndExpand,
- // Padding = new Thickness() {
- // Left = 20,
- // Right = 20,
- // },
- // Children =
- // {
- // new Label()
- // {
- // Text = "Width: ",
- // Font = Font.SystemFontOfSize(NamedSize.Large)
- // },
- // sliderHorizontal
- // }
- // },
- // new StackLayout() {
- // Orientation = StackOrientation.Horizontal,
- // HorizontalOptions = LayoutOptions.FillAndExpand,
- // Padding = new Thickness() {
- // Left = 20,
- // Right = 20,
- // },
- // Children =
- // {
- // new Label()
- // {
- // Text = "Height: ",
- // Font = Font.SystemFontOfSize(NamedSize.Large)
- // },
- // sliderVertical
- // }
- // }
- // }
- // };
- // _testPage.ExecuteTC(new ContentPage()
- // {
- // Content = mainUI,
- // Title = "Size Switch Test"
- // });
- // await ManualTest.WaitForConfirm();
- //}
-
- [Test]
- [Category("P1")]
- [Description("Test: Switch look")]
- [Property("SPEC", "Xamarin.Forms.Switch.BackgroundColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Select a Color after observe BackgroundColor of Switch is changed")]
- [Step(3, "Pass If BackgroundColor of Switch changed otherwise false")]
- [Postcondition(1, "NA")]
- public async Task BackgroundColor_Switch_COLOR_CHANGE()
- {
- _switch4 = new Switch()
- {
- HorizontalOptions = LayoutOptions.Center,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 80,
- WidthRequest = 120
- };
-
- var imageRed = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.Red,
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "RED",
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center,
- }
- }
- };
-
- var imageGreen = new StackLayout()
- {
- BackgroundColor = Color.Green,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "GREEN",
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center,
- }
- }
- };
-
- var imageGray = new StackLayout()
- {
- BackgroundColor = Color.Gray,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "GRAY",
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center,
- }
- }
- };
-
- var tapGestureRecognizerRed = new TapGestureRecognizer();
- tapGestureRecognizerRed.Tapped += async (s, e) =>
- {
- _switch4.BackgroundColor = Color.Red;
- await Task.Delay(2000);
- };
- imageRed.GestureRecognizers.Add(tapGestureRecognizerRed);
-
- var tapGestureRecognizerGreen = new TapGestureRecognizer();
- tapGestureRecognizerGreen.Tapped += async (s, e) =>
- {
- _switch4.BackgroundColor = Color.Green;
- await Task.Delay(2000);
- };
- imageGreen.GestureRecognizers.Add(tapGestureRecognizerGreen);
-
- var tapGestureRecognizerGray = new TapGestureRecognizer();
- tapGestureRecognizerGray.Tapped += async (s, e) =>
- {
- _switch4.BackgroundColor = Color.Gray;
- await Task.Delay(2000);
- };
- imageGray.GestureRecognizers.Add(tapGestureRecognizerGray);
-
- var mainUI = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.White,
- Children =
- {
- _switch4,
- new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 180,
- Orientation = StackOrientation.Horizontal,
- Spacing = 10,
- Padding = new Thickness()
- {
- Left = 20,
- Right = 20
- },
- Children =
- {
- imageRed,
- imageGreen,
- imageGray
- }
- }
- }
- };
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = mainUI,
- Title = "BackgoundColor Test"
- });
- await ManualTest.WaitForConfirm();
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System.Threading.Tasks;
-using XamarinApplication.Tizen;
-using System.Collections.Generic;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class SwitchCellTests
- {
- private static TestPage _testPage = TestPage.GetInstance();
- private static ListView _listview;
- private static SwitchCell _switchCell1, _switchCell2, _switchCell3, _switchCell14;
-
- class ControlTest
- {
- public ControlTest(string name)
- {
- this.Name = name;
- }
-
- public string Name { private set; get; }
- };
-
- [SetUp]
- public void SetUp()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "SwitchCell CLASS: Setup---------------------------------");
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "SwitchCell CLASS: Teardown---------------------------------");
- }
-
- private static void CreateSwitchCellTest(String title)
- {
- var label2 = new Label
- {
- Text = " Switch Cell"
- };
- _switchCell1 = new SwitchCell
- {
- Text = "Switch Cell On"
- };
-
- _switchCell2 = new SwitchCell
- {
- Text = "Switch Cell Off"
- };
- TableView tableView = new TableView
- {
- Intent = TableIntent.Form,
- Root = new TableRoot
- {
- new TableSection
- {
- _switchCell1,_switchCell2
- }
- }
- };
-
- var layout = new StackLayout
- {
- Orientation = StackOrientation.Vertical,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- IsVisible = true,
- Children = {
- new StackLayout {
- Orientation = StackOrientation.Horizontal,
- Padding = new Thickness () {
- Bottom = 50,
- },
- Children = { label2 }
- },
- tableView,
- }
- };
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- layout
- },
- BackgroundColor = Color.Crimson,
- },
- Title = title
- });
- }
-
- public void CreatePageTestToSwitchCell(String txtDisplay, String title, String[] dataTest)
- {
- _switchCell14 = new SwitchCell
- {
- Text = "Switch Cell"
- };
-
- TableView tableView = new TableView
- {
- Intent = TableIntent.Form,
- Root = new TableRoot
- {
- new TableSection
- {
- _switchCell14
- }
- }
- };
-
- List<ControlTest> controlTest = new List<ControlTest>
- {
- new ControlTest(dataTest[0]),
- new ControlTest(dataTest[1]),
- new ControlTest(dataTest[2])
- };
-
- _listview = new ListView
- {
- RowHeight = 100,
- ItemsSource = controlTest,
- ItemTemplate = new DataTemplate(() =>
- {
- Label nameLabel = new Label()
- {
- TextColor = Color.Black,
- BackgroundColor = Color.White,
- HorizontalOptions = LayoutOptions.Center,
- };
- nameLabel.SetBinding(Label.TextProperty, "Name");
- return new ViewCell
- {
- View = new StackLayout
- {
- Padding = new Thickness(0, 5),
- Children =
- {
- new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Spacing = 0,
- Children =
- {
- nameLabel,
- }
- }
- }
- }
- };
- })
- };
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- tableView,
- _listview,
- },
- BackgroundColor = Color.Blue,
- },
- Title = title
- });
- }
-
- [Test]
- [Category("P1")]
- [Description("Gets or sets the state of the switch.")]
- [Property("SPEC", "Xamarin.Forms.SwitchCell.On A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click Run TC")]
- [Step(2, "Check if the switch is on and off states in respective switch cells.")]
- [Step(3, "Confirm pass or fail")]
- [Postcondition(1, "NA")]
- public async Task ON_SwitchCell_UILK()
- {
- /* TEST CODE */
- CreateSwitchCellTest("Switch Cell On Off Test");
- _switchCell1.On = true;
- _switchCell2.On = false;
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Gets or sets the text displayed next to the switch.")]
- [Property("SPEC", "Xamarin.Forms.SwitchCell. A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click Run TC")]
- [Step(2, "Check if the swicth cell has text \" SRBD \".")]
- [Step(3, "Confirm pass or fail")]
- [Postcondition(1, "NA")]
- public async Task Text_SwitchCell_UIBH()
- {
- /* TEST CODE */
- _switchCell3 = new SwitchCell();
- var label2 = new Label
- {
- Text = " Switch Cell"
- };
- TableView tableView = new TableView
- {
- Intent = TableIntent.Form,
- Root = new TableRoot
- {
- new TableSection
- {
- _switchCell3
- }
- }
- };
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- label2,tableView
- },
- BackgroundColor = Color.White,
- },
- Title = "Switch Cell Text Test"
- });
- _switchCell3.Text = "SRBD";
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: IsEnabled UILK")]
- [Property("SPEC", "Xamarin.Forms.SwitchCell.IsEnabled A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(4, "Pass If IsEnabled of Switch Cell changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task IsEnabled_SwitchCell_UILK()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "Enable";
- dataTest[1] = "Disable";
- dataTest[2] = "Enable";
- var text = "Scroll below listview, and select Enable or Disable";
- var title = "IsEnabled Test";
- CreatePageTestToSwitchCell(text, title, dataTest);
-
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[1]))
- {
- _switchCell14.IsEnabled = false;
- }
- else
- {
- _switchCell14.IsEnabled = true;
- }
- };
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- //[Test]
- //[Category("P1")]
- //[Description("Test: SwitchCell look")]
- //[Property("SPEC", "Xamarin.Forms.SwitchCell Height")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "PRW")]
- //[Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- //[Precondition(1, "NA")]
- //[Step(1, "Click run TC")]
- //[Step(2, "Seek SwitchCell for Height after observe")]
- //[Step(3, "Pass If Height of SwitchCell changed otherwise false")]
- //[Postcondition(1, "NA")]
- //public async Task SwitchCell_Height_CHANGE_SIZE()
- //{
- // _switchCell14 = new SwitchCell()
- // {
- // Text = "Switch Cell",
- // Height = 10
- // };
- // TableView tableView = new TableView
- // {
- // Intent = TableIntent.Form,
- // Root = new TableRoot
- // {
- // new TableSection
- // {
- // _switchCell14
- // }
- // }
- // };
-
- // var sliderVertical = new Slider()
- // {
- // HorizontalOptions = LayoutOptions.FillAndExpand,
- // BackgroundColor = Color.Pink,
- // Maximum = 500,
- // Minimum = 80
- // };
-
- // sliderVertical.ValueChanged += (o, e) =>
- // {
- // _switchCell14.Height = sliderVertical.Value;
- // };
-
- // var mainUI = new StackLayout()
- // {
- // HorizontalOptions = LayoutOptions.FillAndExpand,
- // VerticalOptions = LayoutOptions.FillAndExpand,
- // BackgroundColor = Color.Green,
- // Padding = new Thickness()
- // {
- // Top = 20,
- // Bottom = 20,
- // },
- // Spacing = 25,
- // Children =
- // {
- // tableView,
- // new StackLayout() {
- // Orientation = StackOrientation.Horizontal,
- // HorizontalOptions = LayoutOptions.FillAndExpand,
- // Padding = new Thickness() {
- // Left = 20,
- // Right = 20,
- // },
- // Children =
- // {
- // new Label()
- // {
- // Text = "Height: ",
- // Font = Font.SystemFontOfSize(NamedSize.Large)
- // },
- // sliderVertical
- // }
- // },
-
- // }
- // };
- // _testPage.ExecuteTC(new ContentPage()
- // {
- // Content = mainUI,
- // Title = "Size Switch Cell Test"
- // });
- // await ManualTest.WaitForConfirm();
- //}
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System.Threading.Tasks;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class TabbedPageTests
- {
- private static TestPage _testPage = TestPage.GetInstance();
- private static NavigationPage _navigationPage = TestPage.GetInstance().getNavigationPage();
- private static Boolean isParentSet;
-
- class TabbedPageDemoPage : TabbedPage
- {
- public TabbedPageDemoPage()
- {
- this.Title = "TabbedPage";
- this.Children.Add(new ContentPage
- {
- Title = "Blue",
- Content = new BoxView
- {
- Color = Color.Blue,
- HeightRequest = 100f,
- VerticalOptions = LayoutOptions.Center
- },
- });
- this.Children.Add(new ContentPage
- {
- Title = "Blue and Red",
- Content = new StackLayout
- {
- Children = {
- new BoxView { Color = Color.Blue },
- new BoxView { Color = Color.Red}
- },
- HeightRequest = 100f,
- }
- });
- }
-
- protected override void OnParentSet()
- {
- if (isParentSet)
- {
- Assert.True(true);
- ManualTest.Confirm();
- }
- base.OnParentSet();
- }
- }
-
- [SetUp]
- public void Setup()
- {
- if (Device.Idiom == TargetIdiom.Phone || Device.Idiom == TargetIdiom.TV)
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "TabbedPageTests --------------- Setup()");
- }
- else
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Not supported on this profile");
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("TabbedPageTests --------------- TearDown()");
- }
-
- // Exclude this TC due to Tizen Limit
- //[Test]
- [Category("P1")]
- [Description("Check whether tabbed page bar background color can be changed.")]
- [Property("SPEC", "Xamarin.Forms.TabbedPage.BarBackgroundColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Check if tabbed page bar background (background color of 'Blue' and 'Blue and Red' tab) is yellow.")]
- [Step(3, "Click BACK button: Click Pass if bar background color is yellow or mark fail.")]
- [Postcondition(1, "NA")]
- public async Task BarBackgroundColor_UILK()
- {
- /*TEST CODE*/
- TabbedPageDemoPage tabbedPageDemoPage = new TabbedPageDemoPage();
- tabbedPageDemoPage.BarBackgroundColor = Color.Yellow;
-
- _testPage.ExecuteTC(tabbedPageDemoPage);
- await ManualTest.WaitForConfirm();
- }
-
- // Exclude this TC due to Tizen Limit
- //[Test]
- [Category("P1")]
- [Description("Check whether tabbed page bar text color can be changed.")]
- [Property("SPEC", "Xamarin.Forms.TabbedPage.BarTextColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Check if tabbed page bar text color (text color of 'Blue' and 'Blue and Red') is red.")]
- [Step(3, "Click BACK button: Click Pass if bar text color is red or mark fail.")]
- [Postcondition(1, "NA")]
- public async Task BarTextColor_UILK()
- {
- /*TEST CODE*/
- TabbedPageDemoPage tabbedPageDemoPage = new TabbedPageDemoPage();
- tabbedPageDemoPage.BarTextColor = Color.Red;
-
- _testPage.ExecuteTC(tabbedPageDemoPage);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether onparentset is called when parent is set.")]
- [Property("SPEC", "Xamarin.Forms.TabbedPage.OnParentSet M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click BACK button: TC will pass automatically or mark fail.")]
- [Postcondition(1, "NA")]
- public async Task OnParentSet_UIBH()
- {
- /* TEST CODE */
- TabbedPageDemoPage tabbedPageDemoPage = new TabbedPageDemoPage();
- tabbedPageDemoPage.Parent = _navigationPage;
- isParentSet = true;
-
- _testPage.ExecuteTC(tabbedPageDemoPage);
- await ManualTest.WaitForConfirm();
- isParentSet = false;
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System.Threading.Tasks;
-using System.Collections.Generic;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class TableViewTests
- {
- private static TestPage _testPage = TestPage.GetInstance();
- private static ListView _listview;
- private static Slider _slider1;
- private static Button _button1, _button2;
- private static Label _label1, _label2, _label3;
- private static TableView _tableView1, _tableView2, _tableView3, _tableView4, _tableView5, _tableView6, _tableView7, _tableView8, _tableView9;
-
- class ControlTest
- {
- public ControlTest(string name)
- {
- this.Name = name;
- }
-
- public string Name { private set; get; }
- };
-
- class customTableViewClass : TableView
- {
- public bool IsBindingContextChanged = false;
-
- protected override void OnBindingContextChanged()
- {
- Assert.IsTrue(true);
- ManualTest.Confirm();
- }
-
- protected override SizeRequest OnSizeRequest(double widthConstraint, double heightConstraint)
- {
- Assert.IsTrue(true);
- ManualTest.Confirm();
- return base.OnSizeRequest(widthConstraint, heightConstraint);
- }
-
- protected override void OnModelChanged()
- {
- Assert.IsTrue(true);
- ManualTest.Confirm();
- base.OnModelChanged();
- }
- };
-
- [SetUp]
- public void SetUp()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "TableView CLASS: Setup---------------------------------");
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "TableView CLASS: Teardown---------------------------------");
- _tableView1 = null;
- _tableView2 = null;
- _tableView3 = null;
- _tableView4 = null;
- _tableView5 = null;
- _tableView6 = null;
- _tableView7 = null;
- _tableView8 = null;
- _tableView9 = null;
- }
-
- private static void OnRowHeightChange(object sender, EventArgs e)
- {
- _tableView7.RowHeight = (int)_slider1.Value;
- }
-
- private static void CreateTableView(String title)
- {
- var label2 = new Label
- {
- Text = " Table View"
- };
-
- _tableView1 = new TableView
- {
- Intent = TableIntent.Form,
- Root = new TableRoot("Table View Form") {
- new TableSection ("Section 1 Title") {
- new TextCell {
- Text = "TextCell Text",
- Detail = "TextCell Detail"
- },
- new EntryCell {
- Label = "EntryCell:",
- Placeholder = "default keyboard",
- Keyboard = Keyboard.Default
- }
- },
- new TableSection ("Section 2 Title") {
- new EntryCell {
- Label = "Another EntryCell:",
- Placeholder = "phone keyboard",
- Keyboard = Keyboard.Telephone
- },
- new SwitchCell {
- Text = "SwitchCell:"
- }
- }
- }
- };
-
- _tableView2 = new TableView
- {
- Intent = TableIntent.Menu,
- Root = new TableRoot("Table View Menu") {
- new TableSection ("Section 1 Title") {
- new TextCell {
- Text = "Label",
- },
- },
- new TableSection ("Section 2 Title") {
- new TextCell {
- Text = "Image",
- },
- }
- }
- };
-
- var layout = new StackLayout
- {
- Orientation = StackOrientation.Vertical,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- IsVisible = true,
- Children = {
- _tableView1,
- _tableView2
- }
- };
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- layout
- },
- BackgroundColor = Color.White,
- },
- Title = title
- });
- }
-
- public void CreatePageTestToTableView(String txtDisplay, String title, String[] dataTest)
- {
- _tableView4 = new TableView
- {
- Intent = TableIntent.Form,
- Root = new TableRoot("Table View Form") {
- new TableSection ("Section 1 Title") {
- new TextCell {
- Text = "TextCell Text",
- Detail = "TextCell Detail"
- },
- },
- },
- HorizontalOptions = LayoutOptions.Center,
- WidthRequest = 250,
- HeightRequest = 100,
- IsEnabled = true,
- };
-
- List<ControlTest> controlTest = new List<ControlTest>
- {
- new ControlTest(dataTest[0]),
- new ControlTest(dataTest[1]),
- new ControlTest(dataTest[2])
- };
- _listview = new ListView
- {
- RowHeight = 100,
- ItemsSource = controlTest,
- ItemTemplate = new DataTemplate(() =>
- {
- Label nameLabel = new Label()
- {
- TextColor = Color.Black,
- BackgroundColor = Color.White,
- HorizontalOptions = LayoutOptions.Center,
- };
- nameLabel.SetBinding(Label.TextProperty, "Name");
- return new ViewCell
- {
- View = new StackLayout
- {
- Padding = new Thickness(0, 5),
- Children =
- {
- new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Spacing = 0,
- Children =
- {
- nameLabel,
- }
- }
- }
- }
- };
- })
- };
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- _listview,
- _tableView4,
- },
- BackgroundColor = Color.Blue,
- },
- Title = title
- });
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: TableView look")]
- [Property("SPEC", "Xamarin.Forms.TableView")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click Run TC")]
- [Step(2, "Check if the table view UI is visible.")]
- [Step(3, "Confirm pass or fail")]
- [Postcondition(1, "NA")]
- public async Task TableView_LOOK_UILK()
- {
- /* TEST CODE */
- CreateTableView("Table View Test");
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: TableView Intent")]
- [Property("SPEC", "Xamarin.Forms.TableView Intent")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click Run TC")]
- [Step(2, "Check if the table view UI is visible.")]
- [Step(3, "Confirm pass or fail")]
- [Postcondition(1, "NA")]
- public async Task Intent_TableView_UILK()
- {
- /* TEST CODE */
- _label1 = new Label
- {
- Text = "Image "
- };
-
- _label2 = new Label
- {
- Text = "Data"
- };
-
- _label3 = new Label
- {
- Text = "Name"
- };
-
- _tableView6 = new TableView
- {
- Intent = TableIntent.Settings,
- Root = new TableRoot("Table View Form") {
- new TableSection ("Section 1 Title") {
- new TextCell
- {
- Text = "Image"
- },
- new TextCell
- {
- Text = "Data"
- },
- new TextCell
- {
- Text = "Name"
- },
- new TextCell
- {
- Text = "Data"
- },
- new TextCell
- {
- Text = "Data"
- }
- },
- new TableSection ("Section 2 Title")
- {
- new TextCell
- {
- Text = "Image"
- },
- new TextCell
- {
- Text = "Data"
- },
- new TextCell
- {
- Text = "Name"
- },
- new TextCell
- {
- Text = "Data"
- },
- new TextCell
- {
- Text = "Data"
- }
- }
- },
- };
- _tableView6.Intent = TableIntent.Form;
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- _tableView6
- },
- BackgroundColor = Color.Blue,
- },
- });
-
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Gets or sets the root of the table.")]
- [Property("SPEC", "Xamarin.Forms.TableView root")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click Run TC")]
- [Step(2, "Check if the table view UI is visible.")]
- [Step(3, "Check if the table view has a root and Root1 is visible.")]
- [Step(4, "Confirm pass or fail")]
- [Postcondition(1, "NA")]
- public async Task Root_TableView_UILK()
- {
- /* TEST CODE */
- _label2 = new Label
- {
- Text = "Table View Root ",
- };
-
- var root = new TableRoot("Table View Form ") {
- new TableSection ("Root 1") {
- new TextCell {
- Text = "TextCell Text",
- Detail = "TextCell Detail"
- },
- new EntryCell {
- Label = "EntryCell:",
- Placeholder = "default keyboard",
- Keyboard = Keyboard.Default
- }
- },
- };
-
- _tableView7 = new TableView
- {
- Intent = TableIntent.Form,
- HorizontalOptions = LayoutOptions.Center,
- WidthRequest = 500,
- HeightRequest = 300,
- IsEnabled = true,
- Root = root
- };
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- _label2, _tableView7
- },
- BackgroundColor = Color.Blue,
- },
- });
-
- await ManualTest.WaitForConfirm();
- }
-
- // Exclude this TC due to Tizen Limit
- //[Test]
- [Category("P1")]
- [Description("The height of the items in the list.")]
- [Property("SPEC", "Xamarin.Forms.TableView RowHeight")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click Run TC")]
- [Step(2, "Check if the table view UI is visible.")]
- [Step(3, "Click the button to set row height.")]
- [Step(4, "If the row height increase press pass otherwise fail")]
- [Postcondition(1, "NA")]
- public async Task RowHeight_TableView_UILK()
- {
- /* TEST CODE */
- _label2 = new Label
- {
- Text = "Row Height Test ",
- HorizontalTextAlignment = TextAlignment.Center
- };
-
- var root = new TableRoot("Table View Form ") {
- new TableSection ("Root 1") {
- new TextCell {
- Text = "Root 1 TextCell 1 Text",
- Detail = "TextCell Detail"
- },
- new TextCell {
- Text = "Root 1 TextCell 2 Text",
- Detail = "TextCell Detail"
- },
- new TextCell {
- Text = "Root 1 TextCell 3 Text",
- Detail = "TextCell Detail"
- }
- }
- };
-
- _tableView5 = new TableView
- {
- Intent = TableIntent.Form,
- HorizontalOptions = LayoutOptions.Center,
- WidthRequest = 400,
- HeightRequest = 300,
- RowHeight = 10,
- IsEnabled = true,
- HasUnevenRows = false,
- Root = root,
- };
-
- _button1 = new Button()
- {
- Text = "Tap to set table view row height 30",
- TextColor = new Color(255, 255, 255)
- };
-
- _button1.Clicked += (object sender, EventArgs e) =>
- {
- _tableView5.RowHeight = 30;
- };
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- _label2,_button1, _tableView5
- },
- BackgroundColor = Color.Blue,
- },
- });
-
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Gets or sets a value of HasUnevenRows property of TableView.")]
- [Property("SPEC", "Xamarin.Forms.TableView RowHeight")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click Run TC")]
- [Step(2, "Click the button.")]
- [Step(3, "Check if the label text shows true.")]
- [Step(4, "Confirm pass or fail")]
- [Postcondition(1, "NA")]
- public async Task HasUnevenRows_TableView_UIBH()
- {
- /* TEST CODE */
- _label2 = new Label
- {
- Text = "HasUnevenRows Test ",
- HorizontalTextAlignment = TextAlignment.Center,
- TextColor = Color.White
- };
-
- var root = new TableRoot("Table View Form ") {
- new TableSection ("Root 1") {
- new TextCell {
- Text = "Root 1 TextCell1 Text",
- Detail = "TextCell Detail"
- },
- new TextCell {
- Text = "Root 1 TextCell2 Text",
- Detail = "TextCell Detail"
- },
- new TextCell {
- Text = "Root 1 TextCell3 Text",
- Detail = "TextCell Detail"
- }
- }
- };
-
- _tableView7 = new TableView
- {
- Intent = TableIntent.Form,
- HorizontalOptions = LayoutOptions.Center,
- WidthRequest = 500,
- HeightRequest = 300,
- RowHeight = 10,
- IsEnabled = true,
- HasUnevenRows = true,
- Root = root
- };
- _button1 = new Button()
- {
- Text = "Tap to see HasUnevenRows is True",
- TextColor = new Color(255, 255, 255)
- };
-
- _button1.Clicked += (object sender, EventArgs e) =>
- {
- _label2.Text = _tableView7.HasUnevenRows.ToString();
- };
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- _label2,_button1, _tableView7,
- },
- BackgroundColor = Color.Blue,
- },
- });
-
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Method is called when the binding context changes.")]
- [Property("SPEC", "Xamarin.Forms.TableView OnBindingContextChanged")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click Run TC")]
- [Step(2, "Check if 2 table view UI is visible.")]
- [Step(3, "Click the button to change the binding context.")]
- [Step(4, "Check if height of 2nd table view is set to 1st table view.")]
- [Step(5, "Check if the label above the button is changed.")]
- [Step(6, "Press back button : TC will pass automatically otherwise mark Fail.")]
- [Postcondition(1, "NA")]
- public async Task OnBindingContextChanged_TableView_UIBH()
- {
- /* TEST CODE */
- _label2 = new Label
- {
- Text = "OnBindingContextChanged Test.",
- HorizontalTextAlignment = TextAlignment.Center,
- TextColor = Color.White
- };
-
- var root1 = new TableRoot("Table View Form ") {
- new TableSection ("Root 1") {
- new TextCell {
- Text = "TextCell Text",
- Detail = "TextCell Detail"
- },
- new EntryCell {
- Label = "EntryCell:",
- Placeholder = "default keyboard",
- Keyboard = Keyboard.Default
- },
- new TextCell {
- Text = "TextCell Text",
- Detail = "TextCell Detail"
- }
- },
- };
-
- var root2 = new TableRoot("Table View Form ") {
- new TableSection ("Root 2") {
- new TextCell {
- Text = "TextCell Text",
- Detail = "TextCell Detail"
- },
- new EntryCell {
- Label = "EntryCell:",
- Placeholder = "default keyboard",
- Keyboard = Keyboard.Default
- }
- },
- };
- customTableViewClass _customTableView1 = new customTableViewClass
- {
- Intent = TableIntent.Form,
- HorizontalOptions = LayoutOptions.Center,
- WidthRequest = 500,
- HeightRequest = 300,
- IsEnabled = true,
- Root = root1,
- HasUnevenRows = true
- };
-
- customTableViewClass _customTableView2 = new customTableViewClass
- {
- Intent = TableIntent.Form,
- HorizontalOptions = LayoutOptions.Center,
- WidthRequest = 500,
- HeightRequest = 500,
- IsEnabled = true,
- Root = root2,
- HasUnevenRows = false
- };
-
- _button2 = new Button()
- {
- Text = "Click the button",
- TextColor = new Color(255, 255, 255)
- };
-
- _button2.Clicked += (object sender, EventArgs e) =>
- {
- _customTableView1.BindingContext = _customTableView2;
- _customTableView1.SetBinding(TableView.HeightRequestProperty, "HeightRequest");
- _label2.Text = "Height of 2nd table view is set to 1st table view";
- };
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- _label2,_button2,_customTableView1,_customTableView2
- },
- BackgroundColor = Color.Blue,
- },
- });
-
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Method is called when a size request is made.")]
- [Property("SPEC", "Xamarin.Forms.TableView OnSizeRequest")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click Run TC")]
- [Step(2, "Check if table view UI is visible.")]
- [Step(3, "Click the button to change size.")]
- [Step(4, "Press back button : TC will pass automatically otherwise mark Fail.")]
- [Postcondition(1, "NA")]
- public async Task OnSizeRequest_TableView_UIBH()
- {
- /* TEST CODE */
- _label2 = new Label
- {
- Text = "OnSizeRequest Test.",
- HorizontalTextAlignment = TextAlignment.Center,
- TextColor = Color.White
- };
-
- var root1 = new TableRoot("Table View Form ") {
- new TableSection ("Root 1") {
- new TextCell {
- Text = "TextCell Text",
- Detail = "TextCell Detail"
- },
- new EntryCell {
- Label = "EntryCell:",
- Placeholder = "default keyboard",
- Keyboard = Keyboard.Default
- },
- new TextCell {
- Text = "TextCell Text",
- Detail = "TextCell Detail"
- }
- },
- };
-
- var root2 = new TableRoot("Table View Form ") {
- new TableSection ("Root 2") {
- new TextCell {
- Text = "TextCell Text",
- Detail = "TextCell Detail"
- },
- new EntryCell {
- Label = "EntryCell:",
- Placeholder = "default keyboard",
- Keyboard = Keyboard.Default
- }
- },
- };
- customTableViewClass _customTableView3 = new customTableViewClass
- {
- Intent = TableIntent.Form,
- HorizontalOptions = LayoutOptions.Center,
- WidthRequest = 500,
- HeightRequest = 300,
- IsEnabled = true,
- Root = root1,
- HasUnevenRows = true
- };
-
- _button2 = new Button()
- {
- Text = "Click this button",
- TextColor = Color.White
- };
-
- _button2.Clicked += (object sender, EventArgs e) =>
- {
- _customTableView3.HeightRequest = 400.0;
- _customTableView3.WidthRequest = 600.0;
- };
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- _label2,_button2,_customTableView3
- },
- BackgroundColor = Color.Blue,
- },
- });
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Method is called when the model changes.")]
- [Property("SPEC", "Xamarin.Forms.TableView OnModelChanged")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click Run TC")]
- [Step(2, "Check if table view UI is visible.")]
- [Step(3, "Click the button to change model.")]
- [Step(4, "Press back button : TC will pass automatically otherwise mark Fail.")]
- [Postcondition(1, "NA")]
- public async Task OnModelChanged_TableView_UIBH()
- {
- /* TEST CODE */
- _label2 = new Label
- {
- Text = "OnModelChanged Test.",
- HorizontalTextAlignment = TextAlignment.Center,
- TextColor = Color.White
- };
-
- var root1 = new TableRoot("Table View Form ") {
- new TableSection ("Root 1") {
- new TextCell {
- Text = "TextCell Text",
- Detail = "TextCell Detail"
- },
- new EntryCell {
- Label = "EntryCell:",
- Placeholder = "default keyboard",
- Keyboard = Keyboard.Default
- },
- new TextCell {
- Text = "TextCell Text",
- Detail = "TextCell Detail"
- }
- },
- };
-
- var root2 = new TableRoot("Table View Form ") {
- new TableSection ("Root 2") {
- new TextCell {
- Text = "TextCell Text",
- Detail = "TextCell Detail"
- },
- new EntryCell {
- Label = "EntryCell:",
- Placeholder = "default keyboard",
- Keyboard = Keyboard.Default
- }
- },
- };
- customTableViewClass _customTableView4 = new customTableViewClass
- {
- Intent = TableIntent.Form,
- HorizontalOptions = LayoutOptions.Center,
- WidthRequest = 500,
- HeightRequest = 300,
- IsEnabled = true,
- Root = root1,
- HasUnevenRows = true
- };
-
- _button2 = new Button()
- {
- Text = "Click this button",
- TextColor = Color.White
- };
-
- _button2.Clicked += (object sender, EventArgs e) =>
- {
- _customTableView4.Root = root2;
- };
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- _label2,_button2,_customTableView4
- },
- BackgroundColor = Color.Blue,
- },
- });
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: TableView look")]
- [Property("SPEC", "Xamarin.Forms.TableView Opacity")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Seek Opacity TableView after observe")]
- [Step(3, "Pass If Opacity of TableView changed otherwise false")]
- [Postcondition(1, "NA")]
- public async Task Opacity_TableView_LOOK()
- {
- _tableView3 = new TableView()
- {
- Intent = TableIntent.Form,
- Root = new TableRoot("Table View Form") {
- new TableSection ("Section 1 Title") {
- new TextCell {
- Text = "TextCell Text",
- Detail = "TextCell Detail"
- },
- },
- new TableSection ("Section 2 Title") {
- new EntryCell {
- Label = "Another EntryCell:",
- Placeholder = "phone keyboard",
- Keyboard = Keyboard.Telephone
- },
- }
- },
- WidthRequest = 550,
- HeightRequest = 100,
- BackgroundColor = Color.HotPink,
- IsEnabled = true,
- };
- var sliderOpacity = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.BlueViolet,
- Maximum = 1,
- Minimum = 0,
- Value = 1
- };
-
- _tableView3.BindingContext = sliderOpacity;
- _tableView3.SetBinding(TableView.OpacityProperty, "Value");
-
- var mainUI = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.White,
- Padding = new Thickness()
- {
- Top = 20,
- Bottom = 50,
- },
- Spacing = 25,
- Children =
- {
- _tableView3,
- new StackLayout() {
- Orientation = StackOrientation.Horizontal,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- new Label()
- {
- Text = "Opacity: "
- },
- sliderOpacity
- }
- },
- }
- };
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = mainUI,
- Title = "Opacity StackLayout Test"
- });
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: TableView look")]
- [Property("SPEC", "Xamarin.Forms.TableView Width")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "Behavior about width of TableView is depends on UX of TV product")]
- [Step(1, "Click run TC")]
- [Step(2, "Seek TableView for Width after observe")]
- [Step(3, "Pass If Width changed otherwise Fail")]
- [Postcondition(1, "NA")]
- public async Task Width_TableView_CHANGE_SIZE()
- {
- if (Device.Idiom == TargetIdiom.TV)
- {
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
-
- _tableView3 = new TableView()
- {
- Intent = TableIntent.Form,
- Root = new TableRoot("Table View Form") {
- new TableSection ("Section 1 Title") {
- new TextCell {
- Text = "TextCell Text",
- Detail = "TextCell Detail",
- }
- },
- },
- HorizontalOptions = LayoutOptions.Center,
- WidthRequest = 450,
- HeightRequest = 250,
- BackgroundColor = Color.HotPink,
- IsEnabled = true,
- };
-
- var sliderHorizontal = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.Pink,
- Maximum = 500,
- Minimum = 120
- };
-
- sliderHorizontal.ValueChanged += (o, e) =>
- {
- _tableView3.WidthRequest = sliderHorizontal.Value;
- };
-
- var mainUI = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.White,
- Padding = new Thickness()
- {
- Top = 20,
- Bottom = 20,
- },
- Spacing = 25,
- Children =
- {
- _tableView3,
- new StackLayout() {
- Orientation = StackOrientation.Horizontal,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Padding = new Thickness() {
- Left = 20,
- Right = 20,
- },
- Children =
- {
- new Label()
- {
- Text = "Width: "
- },
- sliderHorizontal
- }
- },
- }
- };
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = mainUI,
- Title = "Size Table View Test"
- });
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: IsVisible UILK")]
- [Property("SPEC", "Xamarin.Forms.TableView.IsVisible A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(3, "Pass If IsVisible of TableView changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task IsVisible_TableView_UILK()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "Visible";
- dataTest[1] = "Invisible";
- dataTest[2] = "Visible";
- var text = "Select a IsVisible test";
- var title = "IsVisible Test";
- CreatePageTestToTableView(text, title, dataTest);
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[1]))
- {
- _tableView4.IsVisible = false;
- }
- else
- {
- _tableView4.IsVisible = true;
- }
- };
- await ManualTest.WaitForConfirm();
-
- /* POSTCONDITION 1480
- * Remove event handler 1481
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: IsEnabled UILK")]
- [Property("SPEC", "Xamarin.Forms.TableView.IsEnabled A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(3, "Pass If IsEnabled of TableView changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task IsEnabled_TableView_UILK()
- {
- if (Device.Idiom == TargetIdiom.Unsupported)
- {
- _testPage.UnlockUIButton();
- Assert.Pass("Not supported");
- }
-
- String[] dataTest = { "", "", "" };
- dataTest[0] = "Enable";
- dataTest[1] = "Disable";
- dataTest[2] = "Enable";
- var text = "Select a IsEnabled test";
- var title = "IsEnabled Test";
- CreatePageTestToTableView(text, title, dataTest);
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[1]))
- {
- _tableView4.IsEnabled = false;
- }
- else
- {
- _tableView4.IsEnabled = true;
- }
- };
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Scale UILK")]
- [Property("SPEC", "Xamarin.Forms.TableView.Scale A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(3, "Pass If Scale of TableView changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task Scale_TableView_UILK()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "0.5";
- dataTest[1] = "1.0";
- dataTest[2] = "2.0";
- var text = "Select a Scale test";
- var title = "Scale Test";
- CreatePageTestToTableView(text, title, dataTest);
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[0]))
- {
- _tableView4.Scale = 0.5;
- }
- else if (controlTest.Name.Equals(dataTest[1]))
- {
- _tableView4.Scale = 1.0;
- }
- else
- {
- _tableView4.Scale = 2.0;
- }
- };
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Rotation UILK")]
- [Property("SPEC", "Xamarin.Forms.TableView.Rotation A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(3, "Pass If Rotation of TableView changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task Rotation_TableView_UILK()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "50";
- dataTest[1] = "90";
- dataTest[2] = "180";
- var text = "Select a Rotation test";
- var title = "Rotation Test";
- CreatePageTestToTableView(text, title, dataTest);
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[0]))
- {
- _tableView4.Rotation = 50;
- }
- else if (controlTest.Name.Equals(dataTest[1]))
- {
- _tableView4.Rotation = 90;
- }
- else
- {
- _tableView4.Rotation = 180;
- }
- };
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Margin UILK")]
- [Property("SPEC", "Xamarin.Forms.TableView.Margin A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(3, "Pass If Margin of TableView changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task Margin_TableView_UILK()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "MarginTop: 50";
- dataTest[1] = "MarginTop: 100";
- dataTest[2] = "MarginTop: 150";
- var text = "Select a Margin test";
- var title = "Margin Test";
- CreatePageTestToTableView(text, title, dataTest);
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[0]))
- {
- _tableView4.Margin = new Thickness(0, 50, 0, 0);
- }
- else if (controlTest.Name.Equals(dataTest[1]))
- {
- _tableView4.Margin = new Thickness(0, 100, 0, 0);
- }
- else
- {
- _tableView4.Margin = new Thickness(0, 150, 0, 0);
- }
- };
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: TableView look")]
- [Property("SPEC", "Xamarin.Forms.TableView.BackgroundColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Select a Color after observe BackgroundColor of TableView is changed")]
- [Step(3, "Pass If BackgroundColor of TableView changed otherwise false")]
- [Postcondition(1, "NA")]
- public async Task BackgroundColor_TableView_COLOR_CHANGE()
- {
- _tableView5 = new TableView
- {
- Intent = TableIntent.Form,
- Root = new TableRoot("Table View Form") {
- new TableSection ("Section 1 Title") {
- new TextCell
- {
- Text = "Image"
- },
- new TextCell
- {
- Text = "Data"
- },
- new TextCell
- {
- Text = "Name"
- },
- new TextCell
- {
- Text = "Data"
- },
- new TextCell
- {
- Text = "Data"
- }
- },
- new TableSection ("Section 2 Title")
- {
- new TextCell
- {
- Text = "Image"
- },
- new TextCell
- {
- Text = "Data"
- },
- new TextCell
- {
- Text = "Name"
- },
- new TextCell
- {
- Text = "Data"
- },
- new TextCell
- {
- Text = "Data"
- }
- }
- },
- HorizontalOptions = LayoutOptions.Center,
- WidthRequest = 350,
- HeightRequest = 200,
- IsEnabled = true,
- };
-
- var imageRed = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.Red,
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "RED",
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center
- }
- }
- };
-
- var imageGreen = new StackLayout()
- {
- BackgroundColor = Color.Green,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "GREEN",
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center
- }
- }
- };
-
- var imageGray = new StackLayout()
- {
- BackgroundColor = Color.Gray,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "GRAY",
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center
- }
- }
- };
-
- var tapGestureRecognizerRed = new TapGestureRecognizer();
- tapGestureRecognizerRed.Tapped += async (s, e) =>
- {
- _tableView5.BackgroundColor = Color.Red;
- await Task.Delay(2000);
- };
- imageRed.GestureRecognizers.Add(tapGestureRecognizerRed);
-
- var tapGestureRecognizerGreen = new TapGestureRecognizer();
- tapGestureRecognizerGreen.Tapped += async (s, e) =>
- {
- _tableView5.BackgroundColor = Color.Green;
- await Task.Delay(2000);
- };
- imageGreen.GestureRecognizers.Add(tapGestureRecognizerGreen);
-
- var tapGestureRecognizerGray = new TapGestureRecognizer();
- tapGestureRecognizerGray.Tapped += async (s, e) =>
- {
- _tableView5.BackgroundColor = Color.Gray;
- await Task.Delay(2000);
- };
- imageGray.GestureRecognizers.Add(tapGestureRecognizerGray);
-
- var mainUI = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.White,
-
- Children =
- {
- _tableView5,
- new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 180,
- Orientation = StackOrientation.Horizontal,
- Spacing = 10,
- Padding = new Thickness()
- {
- Left = 20,
- Right = 20
- },
-
- Children =
- {
- imageRed,
- imageGreen,
- imageGray
- }
- }
- }
- };
-
- if (ManualTest.IsWearable())
- {
- Console.WriteLine("Not supported on this profile");
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
- else
- {
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = mainUI,
- Title = "BackgoundColor Test"
- });
- await ManualTest.WaitForConfirm();
- }
- }
- }
-}
+++ /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 NUnit.Framework;
-using NUnit.Framework.TUnit;
-using Xamarin.Forms;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.TapGestureRecognizer test")]
- public class TapGestureRecognizerTests
- {
- private static TestPage _testPage = TestPage.GetInstance();
- private static TapGestureRecognizer _tapGestureRecognizer;
-
- [SetUp]
- public void Init()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Preconditions for each TEST");
- }
-
- [TearDown]
- public void Destroy()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Postconditions for each TEST");
- }
-
- private static void CreateTapGestureRecognizerPage(string tapGestureRecognizer)
- {
- _tapGestureRecognizer = new TapGestureRecognizer();
- var layout = new StackLayout()
- {
- IsVisible = true,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- new Label()
- {
- Text="Tap to page",
- HorizontalOptions=LayoutOptions.Center,
- }
- }
- };
- layout.GestureRecognizers.Add(_tapGestureRecognizer);
- var page = new ContentPage
- {
- Title = tapGestureRecognizer,
- Content = layout,
- };
- _testPage.ExecuteTC(page);
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Handle event tapped")]
- [Property("SPEC", "Xamarin.Forms.TapGestureRecognizer.Tapped E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Tap after new page shown")]
- [Step(3, "Testcase result will show automatically")]
- [Postcondition(1, "NA")]
- public async Task Tapped_EVENT()
- {
- _tapGestureRecognizer = new TapGestureRecognizer();
- var label = new Label
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- Text = "Click",
- TextColor = Color.Black,
- BackgroundColor = Color.White
- };
- label.GestureRecognizers.Add(_tapGestureRecognizer);
- _tapGestureRecognizer.Tapped += onTapped;
-
- _testPage.ExecuteTC(new StackLayout
- {
- Children =
- {
- label
- }
- });
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _tapGestureRecognizer.Tapped -= onTapped;
- }
-
- private static void onTapped(object sender, EventArgs e)
- {
- Assert.True(true);
- ManualTest.Confirm();
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System.Threading.Tasks;
-using XamarinApplication.Tizen;
-using System.Collections.Generic;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class TextCellTests
- {
- private static TestPage _testPage = TestPage.GetInstance();
- private static ListView _listview;
- private static Label _label1, _label2, _label3, _label4;
- private static TextCell _textCell1, _textCell2;
- private static TableView _tableView1, _tableView2, _tableView3, _tableView4, _tableView5, _tableView6, _tableView7, _tableView8, _tableView9;
-
- class ControlTest
- {
- public ControlTest(string name)
- {
- this.Name = name;
- }
-
- public string Name { private set; get; }
- };
-
- [SetUp]
- public void SetUp()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "TextCell CLASS: Setup---------------------------------");
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "TextCell CLASS: Teardown---------------------------------");
- }
-
- //support function
- public void CreatePageTestToTextCell(String txtDisplay, String title, String[] dataTest)
- {
- _textCell1 = new TextCell
- {
- Text = "Text Cell 1",
- TextColor = Color.Red
- };
-
- _textCell2 = new TextCell
- {
- Text = "Text Cell 2",
- TextColor = Color.Green
- };
-
- _tableView2 = new TableView
- {
- Intent = TableIntent.Settings,
- BackgroundColor = Color.Green,
- Root = new TableRoot("Table View Form") {
- new TableSection ("Section 1 Title") {
- _textCell1
- },
- new TableSection ("Section 2 Title")
- {
- _textCell2
- },
- }
- };
-
- List<ControlTest> controlTest = new List<ControlTest>
- {
- new ControlTest(dataTest[0]),
- new ControlTest(dataTest[1]),
- new ControlTest(dataTest[2])
- };
-
- _listview = new ListView
- {
- RowHeight = 100,
- ItemsSource = controlTest,
- ItemTemplate = new DataTemplate(() =>
- {
- Label nameLabel = new Label()
- {
- Margin = new Thickness(100, 0, 0, 0),
- TextColor = Color.Black,
- BackgroundColor = Color.White,
- HorizontalOptions = LayoutOptions.Center,
- };
- nameLabel.SetBinding(Label.TextProperty, "Name");
- return new ViewCell
- {
- View = new StackLayout
- {
- Padding = new Thickness(0, 5),
- Orientation = StackOrientation.Horizontal,
- Children =
- {
- new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Spacing = 0,
- Children =
- {
- nameLabel,
- }
- }
- }
- }
- };
- })
- };
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- _tableView2,
- _listview,
- },
- BackgroundColor = Color.Blue,
- },
- Title = title
- });
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: TextCell Look")]
- [Property("SPEC", "Xamarin.Forms.TextCell")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click Run TC")]
- [Step(2, "Check if the Text Cell 1 in Table View with Text Color Red.")]
- [Step(3, "Confirm pass or fail")]
- [Postcondition(1, "NA")]
- public async Task TextCell_LOOK_UILK()
- {
- /* TEST CODE */
- _textCell1 = new TextCell
- {
- Text = "Text Cell 1",
- TextColor = Color.Red
- };
-
- _tableView1 = new TableView
- {
- Intent = TableIntent.Settings,
- Root = new TableRoot("Table View Form") {
- new TableSection ("Section 1 Title") {
- _textCell1
- }
- }
- };
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- _tableView1
- },
- BackgroundColor = Color.White,
- },
- });
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Gets or sets the secondary text to be displayed in the TextCell.")]
- [Property("SPEC", "Xamarin.Forms.TextCell Detail")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")]
- [Step(1, "Click Run TC")]
- [Step(2, "Check if the secondary text is visible under \"Text Cell 1\" ")]
- [Step(3, "Confirm pass or fail")]
- [Postcondition(1, "NA")]
- public async Task TextCell_Detail_UILK()
- {
- /* TEST CODE */
- if (Device.Idiom == TargetIdiom.Phone)
- {
- _textCell1 = new TextCell
- {
- Text = "Text Cell 1",
- TextColor = Color.Red
- };
-
- _tableView1 = new TableView
- {
- Intent = TableIntent.Settings,
- Root = new TableRoot("Table View Form") {
- new TableSection ("Section 1 Title") {
- _textCell1
- }
- }
- };
-
- _textCell1.Detail = "This is secondary text";
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- _tableView1
- },
- BackgroundColor = Color.White,
- },
- });
- await ManualTest.WaitForConfirm();
- }
- else
- {
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Gets or sets the color to render the secondary text.")]
- [Property("SPEC", "Xamarin.Forms.TextCell Detail")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")]
- [Step(1, "Click Run TC")]
- [Step(2, "Check if the secondary text color is Green.")]
- [Step(3, "Confirm pass or fail")]
- [Postcondition(1, "NA")]
- public async Task TextCell_DetailColor_UILK()
- {
- /* TEST CODE */
- if (Device.Idiom == TargetIdiom.Phone)
- {
- _textCell1 = new TextCell
- {
- Text = "Text Cell 1",
- TextColor = Color.Red
- };
-
- _tableView1 = new TableView
- {
- Intent = TableIntent.Settings,
- Root = new TableRoot("Table View Form") {
- new TableSection ("Section 1 Title") {
- _textCell1
- }
- }
- };
-
- _textCell1.Detail = "This is secondary text";
- _textCell1.DetailColor = Color.Green;
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- _tableView1
- },
- BackgroundColor = Color.White,
- },
- });
- await ManualTest.WaitForConfirm();
- }
- else
- {
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Gets or sets the primary text to be displayed.")]
- [Property("SPEC", "Xamarin.Forms.TextCell Text")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click Run TC")]
- [Step(2, "Check The primary text of Text Cell is Primary Text.")]
- [Step(3, "Confirm pass or fail")]
- [Postcondition(1, "NA")]
- public async Task TextCell_Text_UILK()
- {
- /* TEST CODE */
- _textCell1 = new TextCell
- {
- Text = "Text Cell 1",
- TextColor = Color.Red
- };
-
- _tableView1 = new TableView
- {
- Intent = TableIntent.Settings,
- Root = new TableRoot("Table View Form") {
- new TableSection ("Section 1 Title") {
- _textCell1
- }
- }
- };
-
- _textCell1.Text = "Primary Text";
- _textCell1.Detail = "This is secondary text";
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- _tableView1
- },
- BackgroundColor = Color.White,
- },
- });
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Gets or sets the color to render the primary text.")]
- [Property("SPEC", "Xamarin.Forms.TextCell TextColor")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click Run TC")]
- [Step(2, "Check if clicking the image button changes the text color.")]
- [Step(3, "Confirm pass or fail")]
- [Postcondition(1, "NA")]
- public async Task TextCell_TextColor_UILK()
- {
- _textCell1 = new TextCell
- {
- Text = "Tap this text.",
- TextColor = Color.Black
- };
-
- _tableView3 = new TableView
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Intent = TableIntent.Settings,
- Root = new TableRoot("Table View Form") {
- new TableSection ("Section 1 Title") {
- _textCell1
- }
- }
- };
-
- var imageRed = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.Red,
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "RED",
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center,
- }
- }
- };
-
- var imageGreen = new StackLayout()
- {
- BackgroundColor = Color.Green,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "GREEN",
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center,
- }
- }
- };
-
- var imageGray = new StackLayout()
- {
- BackgroundColor = Color.Gray,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "GRAY",
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center,
- }
- }
- };
-
- var tapGestureRecognizerRed = new TapGestureRecognizer();
- tapGestureRecognizerRed.Tapped += async (s, e) =>
- {
- _textCell1.TextColor = Color.Red;
- await Task.Delay(2000);
- };
- imageRed.GestureRecognizers.Add(tapGestureRecognizerRed);
-
- var tapGestureRecognizerGreen = new TapGestureRecognizer();
- tapGestureRecognizerGreen.Tapped += async (s, e) =>
- {
- _textCell1.TextColor = Color.Green;
- await Task.Delay(2000);
- };
- imageGreen.GestureRecognizers.Add(tapGestureRecognizerGreen);
-
- var tapGestureRecognizerGray = new TapGestureRecognizer();
- tapGestureRecognizerGray.Tapped += async (s, e) =>
- {
- _textCell1.TextColor = Color.Gray;
- await Task.Delay(2000);
- };
- imageGray.GestureRecognizers.Add(tapGestureRecognizerGray);
-
- var mainUI = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.White,
- Children =
- {
- _tableView3,
- new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 180,
- Orientation = StackOrientation.Horizontal,
- Spacing = 10,
- Padding = new Thickness()
- {
- Left = 20,
- Right = 20
- },
-
- Children =
- {
- imageRed,
- imageGreen,
- imageGray
- }
- }
- }
- };
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = mainUI,
- });
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Gets or sets the ICommand to be executed when the TextCell is tapped.")]
- [Property("SPEC", "Xamarin.Forms.TextCell Command")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click Run TC")]
- [Step(2, "Check after tapping the text in text cell the text is changed.")]
- [Step(3, "Confirm pass or fail")]
- [Postcondition(1, "NA")]
- public async Task TextCell_Command_UILK()
- {
- /* TEST CODE */
- _textCell1 = new TextCell
- {
- Text = "Tap this text.",
- };
-
- var _textCell0 = new TextCell
- {
- Text = "dummy for space",
- };
-
- _tableView1 = new TableView
- {
- Intent = TableIntent.Settings,
- Root = new TableRoot("Table View Form") {
- new TableSection ("Section 1 Title") {
- _textCell0,
- _textCell1
- }
- }
- };
-
- _textCell1.Command = new Command(() =>
- {
- _textCell1.Text = "Text tapped Command Executed.";
- _textCell1.TextColor = Color.Purple;
- });
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- _tableView1
- },
- BackgroundColor = Color.White,
- },
- });
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Gets or sets the parameter passed when invoking the Command.")]
- [Property("SPEC", "Xamarin.Forms.TextCell CommandParameter")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click Run TC")]
- [Step(2, "Check after tapping the text in text cell the text is SRBD.")]
- [Step(3, "Confirm pass or fail")]
- [Postcondition(1, "NA")]
- public async Task TextCell_CommandParameter_UILK()
- {
- /* TEST CODE */
- _textCell1 = new TextCell
- {
- Text = "Tap this text.",
- };
-
- var _textCell0 = new TextCell
- {
- Text = "dummy for space",
- };
-
- _tableView1 = new TableView
- {
- Intent = TableIntent.Settings,
- Root = new TableRoot("Table View Form") {
- new TableSection ("Section 1 Title") {
- _textCell0,
- _textCell1
- }
- }
- };
-
- _textCell1.CommandParameter = "SRBD";
- _textCell1.Command = new Command(() => { _textCell1.Text = (string)_textCell1.CommandParameter; });
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- _tableView1
- },
- BackgroundColor = Color.White,
- },
- });
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: IsEnabled UILK")]
- [Property("SPEC", "Xamarin.Forms.TextCell.IsEnabled A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(4, "Pass If IsEnabled of 'Text Cell 1' changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task IsEnabled_TextCell_UILK()
- {
- if (Device.Idiom == TargetIdiom.Unsupported)
- {
- _testPage.UnlockUIButton();
- Assert.Pass("Not supported");
- }
-
- String[] dataTest = { "", "", "" };
- dataTest[0] = "Enable";
- dataTest[1] = "Disable";
- dataTest[2] = "Enable";
- var text = "Scroll below listview, and select Enable or Disable";
- var title = "IsEnabled Test";
- CreatePageTestToTextCell(text, title, dataTest);
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[1]))
- {
- _textCell1.IsEnabled = false;
- }
- else
- {
- _textCell1.IsEnabled = true;
- }
- };
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, 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 NUnit.Framework;
-using NUnit.Framework.TUnit;
-using System.Threading.Tasks;
-using XamarinApplication.Tizen;
-using System.Collections.Generic;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class TimePickerTests
- {
- private static TestPage _testPage = TestPage.GetInstance();
- private static ListView _listview;
- private static TimePicker _timePicker1, _timePicker2, _timePicker3, _timePicker4, _timePicker5;
-
- class ControlTest
- {
- public ControlTest(string name)
- {
- this.Name = name;
- }
-
- public string Name { private set; get; }
- };
-
- [SetUp]
- public void SetUp()
- {
- if (Device.Idiom == TargetIdiom.Phone || Device.Idiom == TargetIdiom.TV)
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "TimePicker CLASS: Setup---------------------------------");
- }
- else
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Not supported on this profile");
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "TimePicker CLASS: Teardown---------------------------------");
- _timePicker1 = null;
- _timePicker2 = null;
- _timePicker3 = null;
- _timePicker4 = null;
- _timePicker5 = null;
- }
-
- public void CreatePageTestToTimePicker(String txtDisplay, String title, String[] dataTest)
- {
- _timePicker2 = new TimePicker
- {
- Margin = new Thickness(100, 200, 100, 0),
- HorizontalOptions = LayoutOptions.Center,
- Time = new TimeSpan(17, 0, 0),
- WidthRequest = 350,
- HeightRequest = 100,
- IsEnabled = true
- };
-
- Label labelDisplay = new Label
- {
- Margin = new Thickness(0, 200, 0, 0),
- Text = txtDisplay,
- TextColor = Color.Red,
- Font = Font.SystemFontOfSize(NamedSize.Large),
- HorizontalOptions = LayoutOptions.Center
- };
- List<ControlTest> controlTest = new List<ControlTest>
- {
- new ControlTest(dataTest[0]),
- new ControlTest(dataTest[1]),
- new ControlTest(dataTest[2])
- };
-
- _listview = new ListView
- {
- RowHeight = 100,
- ItemsSource = controlTest,
- ItemTemplate = new DataTemplate(() =>
- {
- Label nameLabel = new Label()
- {
- Margin = new Thickness(300, 0, 0, 0),
- TextColor = Color.Black,
- HorizontalOptions = LayoutOptions.Center,
- };
- nameLabel.SetBinding(Label.TextProperty, "Name");
- return new ViewCell
- {
- View = new StackLayout
- {
- Padding = new Thickness(0, 5),
- Orientation = StackOrientation.Horizontal,
- Children =
- {
- new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Spacing = 0,
- Children =
- {
- nameLabel,
- }
- }
- }
- }
- };
- })
- };
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- _timePicker2,
- labelDisplay,
- _listview,
- },
- BackgroundColor = Color.Blue,
- },
- Title = title
- });
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: TimePicker Look")]
- [Property("SPEC", "Xamarin.Forms.TimePicker")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click Run TC")]
- [Step(2, "Check if TimePicker is visible with black text.")]
- [Step(3, "Confirm pass or fail")]
- [Postcondition(1, "NA")]
- public async Task TimePicker_LOOK_UILK()
- {
- /* TEST CODE */
- _timePicker1 = new TimePicker
- {
- Margin = new Thickness(100, 200, 100, 0),
- Time = new TimeSpan(17, 0, 0),
- TextColor = Color.Black
- };
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- _timePicker1
- },
- BackgroundColor = Color.White,
- },
- });
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Gets or sets the text color of time picker.")]
- [Property("SPEC", "Xamarin.Forms.TimePicker.TextColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click Run TC")]
- [Step(2, "Check if Time Picker text color is red.")]
- [Step(3, "Confirm pass or fail")]
- [Postcondition(1, "NA")]
- public async Task TimePicker_TextColor_UILK()
- {
- /* TEST CODE */
- _timePicker1 = new TimePicker
- {
- Margin = new Thickness(100, 200, 100, 0),
- Time = new TimeSpan(17, 0, 0),
- };
-
- _timePicker1.TextColor = Color.Red;
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- _timePicker1
- },
- BackgroundColor = Color.White,
- },
- });
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("The format of the time to display to the user.")]
- [Property("SPEC", "Xamarin.Forms.TimePicker Format")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click Run TC")]
- [Step(2, "Check the format of time picker is HH:MM.")]
- [Step(3, "Confirm pass or fail")]
- [Postcondition(1, "NA")]
- public async Task TimePicker_Format_UILK()
- {
- /* TEST CODE */
- _timePicker1 = new TimePicker
- {
- Margin = new Thickness(100, 200, 100, 0),
- Time = new TimeSpan(17, 0, 0),
- TextColor = Color.Black
- };
-
- _timePicker1.Format = "HH:mm";
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- _timePicker1
- },
- BackgroundColor = Color.White,
- },
- });
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Gets or sets the displayed time of Time Picker.")]
- [Property("SPEC", "Xamarin.Forms.TimePicker Time")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click Run TC")]
- [Step(2, "Check the Time of time picker is 6:00 PM.")]
- [Step(3, "Confirm pass or fail")]
- [Postcondition(1, "NA")]
- public async Task TimePicker_Time_UILK()
- {
- /* TEST CODE */
- _timePicker1 = new TimePicker
- {
- Margin = new Thickness(100, 200, 100, 0),
- TextColor = Color.Black
- };
-
- _timePicker1.Time = new TimeSpan(18, 0, 0);
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- _timePicker1
- },
- BackgroundColor = Color.White,
- },
- });
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: IsVisible UILK")]
- [Property("SPEC", "Xamarin.Forms.TimePicker.IsVisible A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(3, "Pass If IsVisible of TimePicker changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task IsVisible_TimePicker_UILK()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "Visible";
- dataTest[1] = "Invisible";
- //dataTest[2] = "Visible";
- var text = "Select a IsVisible test";
- var title = "IsVisible Test";
- CreatePageTestToTimePicker(text, title, dataTest);
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[1]))
- {
- _timePicker2.IsVisible = false;
- }
- else
- {
- _timePicker2.IsVisible = true;
- }
- };
- await ManualTest.WaitForConfirm();
-
- /* POSTCONDITION 1480
- * Remove event handler 1481
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: IsEnabled UILK")]
- [Property("SPEC", "Xamarin.Forms.TimePicker.IsEnabled A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(3, "Pass If IsEnabled of TimePicker changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task IsEnabled_TimePicker_UILK()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "Enable";
- dataTest[1] = "Disable";
- var text = "Select a IsEnabled test";
- var title = "IsEnabled Test";
- CreatePageTestToTimePicker(text, title, dataTest);
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[1]))
- {
- _timePicker2.IsEnabled = false;
- }
- else
- {
- _timePicker2.IsEnabled = true;
- }
- };
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Scale UILK")]
- [Property("SPEC", "Xamarin.Forms.TimePicker.Scale A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(3, "Pass If Scale of TimePicker changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task Scale_TimePicker_UILK()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "0.5";
- dataTest[1] = "1.0";
- dataTest[2] = "2.0";
- var text = "Select a Scale test";
- var title = "Scale Test";
- CreatePageTestToTimePicker(text, title, dataTest);
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[0]))
- {
- _timePicker2.Scale = 0.5;
- }
- else if (controlTest.Name.Equals(dataTest[1]))
- {
- _timePicker2.Scale = 1.0;
- }
- else
- {
- _timePicker2.Scale = 2.0;
- }
- };
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Rotation UILK")]
- [Property("SPEC", "Xamarin.Forms.TimePicker.Rotation A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(3, "Pass If Rotation of TimePicker changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task Rotation_TimePicker_UILK()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "50";
- dataTest[1] = "90";
- dataTest[2] = "180";
- var text = "Select a Rotation test";
- var title = "Rotation Test";
- CreatePageTestToTimePicker(text, title, dataTest);
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[0]))
- {
- _timePicker2.Rotation = 50;
- }
- else if (controlTest.Name.Equals(dataTest[1]))
- {
- _timePicker2.Rotation = 90;
- }
- else
- {
- _timePicker2.Rotation = 180;
- }
- };
- await ManualTest.WaitForConfirm();
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Margin UILK")]
- [Property("SPEC", "Xamarin.Forms.TimePicker.Margin A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(3, "Pass If Margin of TimePicker changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task Margin_TimePicker_UILK()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "MarginTop: 50";
- dataTest[1] = "MarginTop: 100";
- dataTest[2] = "MarginTop: 150";
- var text = "Select a Margin test";
- var title = "Margin Test";
- CreatePageTestToTimePicker(text, title, dataTest);
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[0]))
- {
- _timePicker2.Margin = new Thickness(0, 50, 0, 0);
- }
- else if (controlTest.Name.Equals(dataTest[1]))
- {
- _timePicker2.Margin = new Thickness(0, 100, 0, 0);
- }
- else
- {
- _timePicker2.Margin = new Thickness(0, 150, 0, 0);
- }
- };
- await ManualTest.WaitForConfirm();
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, e) =>
- {
- };
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Slider look")]
- [Property("SPEC", "Xamarin.Forms.TimePicker Opacity")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Seek Opacity Slider after observe")]
- [Step(3, "Pass If Opacity of TimePicker changed otherwise false")]
- [Postcondition(1, "NA")]
- public async Task Opacity_TimePicker_LOOK()
- {
- _timePicker3 = new TimePicker
- {
- Margin = new Thickness(100, 200, 100, 0),
- Time = new TimeSpan(17, 0, 0),
- TextColor = Color.Black
- };
-
- var sliderOpacity = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.BlueViolet,
- Maximum = 1,
- Minimum = 0,
- Value = 1
- };
-
- _timePicker3.BindingContext = sliderOpacity;
- _timePicker3.SetBinding(TimePicker.OpacityProperty, "Value");
-
- var mainUI = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.White,
- Padding = new Thickness()
- {
- Top = 20,
- Bottom = 50,
- },
- Spacing = 25,
- Children =
- {
- _timePicker3,
- new StackLayout() {
- Orientation = StackOrientation.Horizontal,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Padding = new Thickness() {
- Left = 20,
- Right = 20,
- },
- Children =
- {
- new Label()
- {
- Text = "Opacity: ",
- Font = Font.SystemFontOfSize(NamedSize.Large)
- },
- sliderOpacity
- }
- },
- }
- };
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = mainUI,
- Title = "Opacity Slider Test"
- });
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: TimePicker look")]
- [Property("SPEC", "Tizen.UI.TimePicker.Height A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Seek Silder for Height after observe")]
- [Step(3, "Pass If Height of TimePicker changed otherwise false")]
- [Postcondition(1, "NA")]
- public async Task Height_TimePicker_CHANGE_SIZE()
- {
- _timePicker4 = new TimePicker
- {
- Margin = new Thickness(100, 200, 100, 0),
- Time = new TimeSpan(17, 0, 0),
- TextColor = Color.Black
- };
-
- var sliderVertical = new Slider()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.Pink,
- Maximum = 500,
- Minimum = 80
- };
-
- sliderVertical.ValueChanged += (o, e) =>
- {
- _timePicker4.HeightRequest = sliderVertical.Value;
- };
-
- var mainUI = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.White,
- Padding = new Thickness()
- {
- Top = 20,
- Bottom = 20,
- },
- Spacing = 25,
- Children =
- {
- _timePicker4,
- new StackLayout() {
- Orientation = StackOrientation.Horizontal,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Padding = new Thickness() {
- Left = 20,
- Right = 20,
- },
- Children =
- {
- new Label()
- {
- Text = "Height: ",
- Font = Font.SystemFontOfSize(NamedSize.Large)
- },
- sliderVertical
- }
- }
- }
- };
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = mainUI,
- Title = "Size Time Picker Test"
- });
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: TimePicker look")]
- [Property("SPEC", "Xamarin.Forms.TimePicker.BackgroundColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "When you test on TV, you should click TimePicker after changing color.")]
- [Step(1, "Click run TC")]
- [Step(2, "Select a Color after observe BackgroundColor of TimePicker is changed")]
- [Step(3, "Pass If BackgroundColor of TimePicker changed otherwise false")]
- [Postcondition(1, "NA")]
- public async Task BackgroundColor_TimePicker_COLOR_CHANGE()
- {
- _timePicker5 = new TimePicker
- {
- Margin = new Thickness(100, 200, 100, 0),
- Time = new TimeSpan(17, 0, 0),
- TextColor = Color.Black
- };
-
- var imageRed = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.Red,
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "RED",
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center,
- Font = Font.BoldSystemFontOfSize(NamedSize.Large)
- }
- }
- };
-
- var imageGreen = new StackLayout()
- {
- BackgroundColor = Color.Green,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "GREEN",
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center,
- Font = Font.BoldSystemFontOfSize(NamedSize.Large)
- }
- }
- };
-
- var imageGray = new StackLayout()
- {
- BackgroundColor = Color.Gray,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- new Label()
- {
- VerticalOptions = LayoutOptions.Center,
- Text = "GRAY",
- HorizontalTextAlignment = TextAlignment.Center,
- VerticalTextAlignment = TextAlignment.Center,
- Font = Font.BoldSystemFontOfSize(NamedSize.Large)
- }
- }
- };
-
- var tapGestureRecognizerRed = new TapGestureRecognizer();
- tapGestureRecognizerRed.Tapped += async (s, e) =>
- {
- _timePicker5.BackgroundColor = Color.Red;
- await Task.Delay(2000);
- };
- imageRed.GestureRecognizers.Add(tapGestureRecognizerRed);
-
- var tapGestureRecognizerGreen = new TapGestureRecognizer();
- tapGestureRecognizerGreen.Tapped += async (s, e) =>
- {
- _timePicker5.BackgroundColor = Color.Green;
- await Task.Delay(2000);
- };
- imageGreen.GestureRecognizers.Add(tapGestureRecognizerGreen);
-
- var tapGestureRecognizerGray = new TapGestureRecognizer();
- tapGestureRecognizerGray.Tapped += async (s, e) =>
- {
- _timePicker5.BackgroundColor = Color.Gray;
- await Task.Delay(2000);
- };
- imageGray.GestureRecognizers.Add(tapGestureRecognizerGray);
-
- var mainUI = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.White,
-
- Children =
- {
- _timePicker5,
- new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 180,
- Orientation = StackOrientation.Horizontal,
- Spacing = 10,
- Padding = new Thickness()
- {
- Left = 20,
- Right = 20
- },
- Children =
- {
- imageRed,
- imageGreen,
- imageGray
- }
- }
- }
- };
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = mainUI,
- Title = "BackgoundColor Test"
- });
- await ManualTest.WaitForConfirm();
- }
- }
-}
+++ /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.Threading.Tasks;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.ToolbarItem test")]
- public class ToolbarItemTests
- {
- private static ToolbarItem _toolbarItem;
- private static TestPage _testPage = TestPage.GetInstance();
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("ToolbarItemTests --------------- SetUp()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("ToolbarItemTests --------------- TearDown()");
- }
-
- private static void CreateToolbarItem(string toolbarItemText)
- {
- _toolbarItem = new ToolbarItem()
- {
- Name = toolbarItemText
- };
-
- var page = new ContentPage()
- {
- ToolbarItems =
- {
- _toolbarItem
- },
- };
- _testPage.ExecuteTC(page);
- }
-
- private static void OnActivated(object sender, EventArgs e)
- {
- // If your test is fail, you should set Assert.True(false , "msg");
- Assert.True(true);
- // ManualTest.Confirm() API will terminate WaitForConfirm() method, and will execute rest of the code.
- ManualTest.Confirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Activated event is invoked or not")]
- [Property("SPEC", "Xamarin.Forms.ToolbarItem.Activated E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")]
- [Step(1, "Click the ToolbarItem")]
- [Step(2, "Press backbutton")]
- [Step(3, "Testcase result will show automatically")]
- [Postcondition(1, "NA")]
- public async Task Activated_EVENT()
- {
- if (Device.Idiom == TargetIdiom.Phone)
- {
- CreateToolbarItem("Click Me.");
- _toolbarItem.Activated += OnActivated;
- // Waits for user confirmation.
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _toolbarItem.Activated -= OnActivated;
- }
- else
- {
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System.Threading.Tasks;
-using XamarinApplication.Tizen;
-using System.Collections.Generic;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class ViewCellTests
- {
- private static TestPage _testPage = TestPage.GetInstance();
- private static ListView _listview;
- private static ViewCell _viewCell1, _viewCell2;
- private static TableView _tableView1;
- private static Label _tappedText;
-
- class ControlTest
- {
- public ControlTest(string name)
- {
- this.Name = name;
- }
-
- public string Name { private set; get; }
- };
-
- [SetUp]
- public void SetUp()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "TimePicker CLASS: Setup---------------------------------");
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "TimePicker CLASS: Teardown---------------------------------");
- _viewCell1 = null;
- _viewCell2 = null;
- _tableView1 = null;
- }
-
- public void CreatePageTestToViewCell(String txtDisplay, String title, String[] dataTest)
- {
- Label viewCellLebel = new Label()
- {
- Margin = new Thickness(300, 0, 0, 0),
- TextColor = Color.Black,
- HorizontalOptions = LayoutOptions.Center,
- Text = "View Cell"
- };
-
- _viewCell2 = new ViewCell
- {
- View = new Button
- {
- Margin = new Thickness(100, 100, 100, 0),
- Text = "click me"
- }
- };
-
- _tableView1 = new TableView
- {
- Intent = TableIntent.Form,
- Root = new TableRoot("Table View Form") {
- new TableSection ("Table View - ViewCell") {
- _viewCell2
- }
- },
- Margin = new Thickness(0, 100, 0, 0),
- HorizontalOptions = LayoutOptions.Center,
- WidthRequest = 400,
- HeightRequest = 200,
- IsEnabled = true,
- };
-
- Label labelDisplay = new Label
- {
- Margin = new Thickness(0, 200, 0, 0),
- Text = txtDisplay,
- TextColor = Color.Red,
- Font = Font.SystemFontOfSize(NamedSize.Large),
- HorizontalOptions = LayoutOptions.Center
- };
-
- List<ControlTest> controlTest = new List<ControlTest>
- {
- new ControlTest(dataTest[0]),
- new ControlTest(dataTest[1])
- };
-
- _listview = new ListView
- {
- RowHeight = 100,
- ItemsSource = controlTest,
- ItemTemplate = new DataTemplate(() =>
- {
- Label nameLabel = new Label()
- {
- Margin = new Thickness(300, 0, 0, 0),
- TextColor = Color.Black,
- HorizontalOptions = LayoutOptions.Center,
- };
- nameLabel.SetBinding(Label.TextProperty, "Name");
- return new ViewCell
- {
- View = new StackLayout
- {
- Padding = new Thickness(0, 5),
- Orientation = StackOrientation.Horizontal,
- Children =
- {
- new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Spacing = 0,
- Children =
- {
- nameLabel,
- }
- }
- }
- }
- };
- })
- };
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- _tableView1,
- _tappedText,
- labelDisplay,
- _listview,
- },
- BackgroundColor = Color.Blue,
- },
- Title = title
- });
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: ViewCell Look")]
- [Property("SPEC", "Xamarin.Forms.ViewCell")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click Run TC")]
- [Step(2, "Check if ViewCell is visible with text \"View Cell\".")]
- [Step(3, "Confirm pass or fail")]
- [Postcondition(1, "NA")]
- public async Task ViewCell_LOOK_UILK()
- {
- /* TEST CODE */
- Label viewCellLebel = new Label()
- {
- TextColor = Color.Black,
- HorizontalOptions = LayoutOptions.Center,
- Text = "View Cell"
- };
-
- _viewCell1 = new ViewCell
- {
- View = new StackLayout
- {
- Padding = new Thickness(0, 5),
- Orientation = StackOrientation.Horizontal,
- Children =
- {
- new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Spacing = 0,
- Children =
- {
- viewCellLebel
- }
- }
- }
- },
- Height = 100,
- IsEnabled = true
- };
- _testPage.ExecuteTC(new ContentPage()
- {
- Title = "ViewCell Test",
- Content = new StackLayout
- {
- Children =
- {
- _viewCell1.View
- },
- BackgroundColor = Color.White,
- },
- });
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Gets or sets the View representing the content of the ViewCell.")]
- [Property("SPEC", "Xamarin.Forms.ViewCell View")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click Run TC")]
- [Step(2, "Check if slider view and 'Slider View Set' text are set to view cell.")]
- [Step(3, "Confirm pass or fail")]
- [Postcondition(1, "NA")]
- public async Task ViewCell_View_UILK()
- {
- /* TEST CODE */
- Label viewCellLebel = new Label()
- {
- Margin = new Thickness(100, 100, 100, 0),
- TextColor = Color.Black,
- HorizontalOptions = LayoutOptions.Center,
- Text = "Slider View Set"
- };
- _viewCell1 = new ViewCell();
- var viewSlider = new Slider
- {
- HorizontalOptions = LayoutOptions.Center,
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HeightRequest = 80,
- WidthRequest = 320
- };
- _viewCell1.View = viewSlider;
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- viewCellLebel,
- _viewCell1.View
- },
- BackgroundColor = Color.White,
- },
- });
- await ManualTest.WaitForConfirm();
- }
-
- // Need to FIX
- // [Test]
- [Category("P1")]
- [Description("Test: IsEnabled UILK")]
- [Property("SPEC", "Xamarin.Forms.ViewCell.IsEnabled A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click item of Listview")]
- [Step(3, "Pass If IsEnabled of ViewCell changed otherwise False")]
- [Postcondition(1, "NA")]
- public async Task IsEnabled_ViewCell_UILK()
- {
- /*TEST CODE*/
- String[] dataTest = { "", "", "" };
- dataTest[0] = "Enable";
- dataTest[1] = "Disable";
- var text = "Select a IsEnabled test";
- var title = "IsEnabled Test";
- CreatePageTestToViewCell(text, title, dataTest);
- _listview.ItemTapped += (o, e) =>
- {
- ControlTest controlTest = (ControlTest)e.Item;
- if (controlTest.Name.Equals(dataTest[1]))
- {
- _viewCell2.IsEnabled = false;
- }
- else
- {
- _viewCell2.IsEnabled = true;
- }
- };
- await ManualTest.WaitForConfirm();
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _listview.ItemTapped -= (o, 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.Threading.Tasks;
-using NUnit.Framework;
-using NUnit.Framework.TUnit;
-using Xamarin.Forms;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.VisualElement test")]
- public class VisualElementTests
- {
- private static TestPage _testPage = TestPage.GetInstance();
- private static subVisualElement _visualElement;
-
- [SetUp]
- public void Init()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Preconditions for each TEST");
- _visualElement = new subVisualElement();
- }
-
- [TearDown]
- public void Destroy()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Postconditions for each TEST");
- _visualElement = null;
- }
-
- private static void CreateButton(string buttonText)
- {
- LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "CreateButton");
-
- var layout = new StackLayout()
- {
- IsVisible = true,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- };
-
- _visualElement = new subVisualElement()
- {
- Text = buttonText,
- VerticalOptions = LayoutOptions.Center,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- };
-
- layout.Children.Add(_visualElement);
- _testPage.ExecuteTC(layout);
- }
-
- private static void OnFocused(object sender, EventArgs e)
- {
- // If your test is fail, you should set Assert.True(false , "msg");
- Assert.True(true);
- // ManualTest.Confirm() API will terminate WaitForConfirm() method, and will execute rest of the code.
- ManualTest.Confirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether VisualElement is focus or not.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.Focus M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click button")]
- [Step(3, "Testcase result will show automatically")]
- [Postcondition(1, "NA")]
- public async Task Focus_CHECK()
- {
- Button button = new Button();
- var layout = new StackLayout()
- {
- IsVisible = true,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- };
-
- button.Text = "Click";
- layout.Children.Add(_visualElement);
- layout.Children.Add(button);
- _testPage.ExecuteTC(layout);
-
- button.Clicked += (o, i) =>
- {
- _visualElement.Focus();
- };
-
- _visualElement.Focused += OnFocused;
- // Waits for user confirmation.
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _visualElement.Focused -= OnFocused;
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Handle event Focused to an object of VisualElement.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.Focused E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click button")]
- [Step(3, "Testcase result will show automatically")]
- [Postcondition(1, "NA")]
- public async Task Focused_CB()
- {
- CreateButton("Click");
- _visualElement.Focused += OnFocused;
- // Waits for user confirmation.
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _visualElement.Focused -= OnFocused;
- }
-
- private static void Create2Button(string buttonText)
- {
- LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "CreateButton");
-
- var layout = new StackLayout()
- {
- IsVisible = true,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- Orientation = StackOrientation.Horizontal
- };
-
- _visualElement = new subVisualElement()
- {
- Text = buttonText,
- VerticalOptions = LayoutOptions.Center,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- };
- Button btn2 = new Button()
- {
- Text = "UnFocused",
- VerticalOptions = LayoutOptions.Center,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- };
- layout.Children.Add(_visualElement);
- layout.Children.Add(btn2);
- _testPage.ExecuteTC(layout);
- }
-
- private static void OnUnFocused(object sender, EventArgs e)
- {
- // If your test is fail, you should set Assert.True(false , "msg");
- Assert.True(true);
- // ManualTest.Confirm() API will terminate WaitForConfirm() method, and will execute rest of the code.
- ManualTest.Confirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: Handle event UnFocused to an object of VisualElement.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.Unfocused E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click First")]
- [Step(3, "Click UnFocused")]
- [Step(4, "Testcase result will show automatically")]
- [Postcondition(1, "NA")]
- public async Task Unfocused_CB()
- {
- Create2Button("First");
- _visualElement.Unfocused += OnUnFocused;
- // Waits for user confirmation.
- await ManualTest.WaitForConfirm();
-
- /*
- * POSTCONDITION
- * Remove event handler
- */
- _visualElement.Unfocused -= OnUnFocused;
- }
- }
-
- public class subVisualElement : Button
- {
- public subVisualElement() : base()
- {
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System.Threading.Tasks;
-using System.Collections.Generic;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class WebViewTests
- {
- private static WebView _webView1, _webView2;
- private static ListView _listView1;
- private static Button _button1, _button2;
- private static Label _label1, _label2;
- private static TestPage _testPage = TestPage.GetInstance();
-
- class customwebViewClass : WebView
- {
- protected override void OnBindingContextChanged()
- {
- Assert.IsTrue(true);
- ManualTest.Confirm();
- }
-
- protected override void OnPropertyChanged(string propertyName)
- {
- Assert.IsTrue(true);
- ManualTest.Confirm();
- base.OnPropertyChanged(propertyName);
- }
- };
-
- [SetUp]
- public void SetUp()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "WebView CLASS: Setup---------------------------------");
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "WebView CLASS: Teardown---------------------------------");
- _webView1 = null;
- _webView2 = null;
- _button1 = null;
- _button2 = null;
- _label1 = null;
- _label2 = null;
- }
-
- private static void OnNavigated(object sender, EventArgs e)
- {
- Assert.True(true);
- _label1.HorizontalTextAlignment = TextAlignment.Center;
- _label1.TextColor = Color.DarkBlue;
- _label1.Text = "Navigated Event Called.";
- ManualTest.Confirm();
- }
-
- private static void OnNavigationStart(object sender, EventArgs e)
- {
- Assert.True(true);
- _label1.HorizontalTextAlignment = TextAlignment.Center;
- _label1.TextColor = Color.DarkBlue;
- _label1.Text = "Navigating Event Called.";
- ManualTest.Confirm();
- }
-
- private static void CreateWebView(String title)
- {
- _webView1 = new WebView
- {
- Source = new UrlWebViewSource
- {
- Url = "https://www.tizen.org/about/about-linux-foundation",
- },
- VerticalOptions = LayoutOptions.FillAndExpand
- };
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- _webView1
- },
- },
- Title = title
- });
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: WebView look")]
- [Property("SPEC", "Xamarin.Forms.WebView C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UILK")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click Run TC")]
- [Step(2, "Check if the WebView UI is visible.")]
- [Step(3, "Confirm pass or fail")]
- [Postcondition(1, "NA")]
- public async Task WebView_LOOK_UILK()
- {
- /* TEST CODE */
- CreateWebView("Web View UI Test");
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Sets and gets the WebViewSource object that represents the location of WebView.")]
- [Property("SPEC", "Xamarin.Forms.WebView.Source A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "Must have functional internet connection in device or emulator.")]
- [Step(1, "Click Run TC")]
- [Step(2, "Check if the Web View UI is visible.")]
- [Step(3, "Click the button to go to tizen official website.")]
- [Step(4, "Confirm pass or fail")]
- [Postcondition(1, "NA")]
- public async Task Source_WebView_UILK()
- {
- _label1 = new Label
- {
- Text = "Source Test.",
- HorizontalTextAlignment = TextAlignment.Center,
- TextColor = Color.Black
- };
-
- _webView2 = new WebView
- {
- Source = new UrlWebViewSource
- {
- Url = "http://blog.xamarin.com/",
- },
- VerticalOptions = LayoutOptions.FillAndExpand
- };
-
- _button1 = new Button()
- {
- Text = "Click this button to go Tizen Official Site",
- };
-
- _button1.Clicked += (object sender, EventArgs e) =>
- {
- _webView2.Source = "https://www.tizen.org/";
- };
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- _label1,_button1,_webView2,
- },
- }
- });
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Gets a value that indicates whether the user can navigate to previous pages.")]
- [Property("SPEC", "Xamarin.Forms.WebView.CanGoBack A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "Must have functional internet connection in device or emulator.")]
- [Step(1, "Click Run TC")]
- [Step(2, "Check if tizen official page is visible.")]
- [Step(3, "Click Menu -> ABOUT of the page.")]
- [Step(4, "Click the button above the page.")]
- [Step(5, "Check if button text is true.")]
- [Step(6, "Press back button and Confirm pass or fail.")]
- [Postcondition(1, "NA")]
- public async Task CanGoBack_WebView_UIBH()
- {
- _webView2 = new WebView
- {
- Source = new UrlWebViewSource
- {
- Url = "https://www.tizen.org",
- },
- VerticalOptions = LayoutOptions.FillAndExpand
- };
-
- _button1 = new Button()
- {
- Text = "Click this button to check CanGoBack.",
- };
-
- _button1.Clicked += (object sender, EventArgs e) =>
- {
- _button1.Text = _webView2.CanGoBack.ToString();
- };
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- _button1,_webView2,
- },
- }
- });
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Gets a value that indicates whether the user can navigate forward.")]
- [Property("SPEC", "Xamarin.Forms.WebView.CanGoForward A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "Must have functional internet connection in device or emulator.")]
- [Step(1, "Click Run TC")]
- [Step(2, "Check if tizen official visible.")]
- [Step(3, "Click Menu -> ABOUT of the page.")]
- [Step(4, "Click Go Back Button.")]
- [Step(5, "Click CanGoForward Button.")]
- [Step(6, "Confirm PASS if the button text is changed to true otherwise FAIL.")]
- [Postcondition(1, "NA")]
- public async Task CanGoForward_WebView_UIBH()
- {
- _webView2 = new WebView
- {
- Source = new UrlWebViewSource
- {
- Url = "https://www.tizen.org",
- },
- VerticalOptions = LayoutOptions.FillAndExpand
- };
-
- _button1 = new Button()
- {
- Text = "CanGoForward.",
- };
-
- _button2 = new Button()
- {
- Text = "Go Back.",
- };
-
- _button1.Clicked += (object sender, EventArgs e) =>
- {
- _button1.Text = _webView2.CanGoForward.ToString();
- };
-
- _button2.Clicked += (object sender, EventArgs e) =>
- {
- _webView2.GoBack();
- };
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- _button1,_button2,_webView2,
- }
- }
- });
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Navigates to the previous page.")]
- [Property("SPEC", "Xamarin.Forms.WebView.GoBack M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "Must have functional internet connection in device or emulator.")]
- [Step(1, "Click Run TC")]
- [Step(2, "Check if tizen official visible.")]
- [Step(3, "Click Menu -> ABOUT of the page.")]
- [Step(4, "Click Go Back Button.")]
- [Step(5, "Confirm PASS if ABOUT page is changed to HOME page of tizen otherwise FAIL.")]
- [Postcondition(1, "NA")]
- public async Task GoBack_WebView_UIBH()
- {
- _webView2 = new WebView
- {
- Source = new UrlWebViewSource
- {
- Url = "https://www.tizen.org",
- },
- VerticalOptions = LayoutOptions.FillAndExpand
- };
-
- _button2 = new Button()
- {
- Text = "Go Back.",
- };
-
- _button2.Clicked += (object sender, EventArgs e) =>
- {
- _webView2.GoBack();
- };
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- _button2,_webView2,
- },
- }
- });
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Navigates to the next page in the list of visited pages.")]
- [Property("SPEC", "Xamarin.Forms.WebView.GoForward M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "Must have functional internet connection in device or emulator.")]
- [Step(1, "Click Run TC")]
- [Step(2, "Check if tizen official visible.")]
- [Step(3, "Click Menu -> ABOUT of the page.")]
- [Step(4, "Click Go Back Button.")]
- [Step(4, "Click Go Forward Button.")]
- [Step(5, "Confirm PASS if Home page is changed to ABOUT page of tizen otherwise FAIL.")]
- [Postcondition(1, "NA")]
- public async Task GoForward_WebView_UIBH()
- {
- _webView2 = new WebView
- {
- Source = new UrlWebViewSource
- {
- Url = "https://www.tizen.org",
- },
- VerticalOptions = LayoutOptions.FillAndExpand
- };
-
- _button1 = new Button()
- {
- Text = "Go Forward.",
- };
-
- _button2 = new Button()
- {
- Text = "Go Back.",
- };
-
- _button1.Clicked += (object sender, EventArgs e) =>
- {
- _webView2.GoForward();
- };
-
- _button2.Clicked += (object sender, EventArgs e) =>
- {
- _webView2.GoBack();
- };
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- _button1,_button2,_webView2,
- }
- }
- });
- await ManualTest.WaitForConfirm();
- }
-
- // Need to TC logic
- //[Test]
- [Category("P1")]
- [Description("The method is called when binding context is changed.")]
- [Property("SPEC", "Xamarin.Forms.WebView.OnBindingContextChanged M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "Must have functional internet connection in device or emulator.")]
- [Step(1, "Click Run TC")]
- [Step(2, "Check if xamarin and tizen official site is visible respectively.")]
- [Step(3, "Click the button to change binding context.")]
- [Step(4, "Check if the button text is changed.")]
- [Step(5, "TC will PASS automatically if binding context changed otherwise press FAIL.")]
- [Postcondition(1, "NA")]
- public async Task OnBindingContextChanged_WebView_UIBH()
- {
- _label2 = new Label
- {
- Text = "OnBindingContextChanged Test.",
- HorizontalTextAlignment = TextAlignment.Center,
- TextColor = Color.White
- };
-
- customwebViewClass _customwebView1 = new customwebViewClass
- {
- Source = new UrlWebViewSource
- {
- Url = "https://www.xamarin.com/",
- },
- VerticalOptions = LayoutOptions.FillAndExpand
- };
-
- customwebViewClass _customwebView2 = new customwebViewClass
- {
- Source = new UrlWebViewSource
- {
- Url = "https://www.tizen.org",
- },
- VerticalOptions = LayoutOptions.FillAndExpand
- };
-
- _button1 = new Button()
- {
- Text = "Click to change binding context.",
- };
-
- _button1.Clicked += (object sender, EventArgs e) =>
- {
- _customwebView1.BindingContext = _customwebView2;
- _customwebView2.SetBinding(WebView.BindingContextProperty, "BindingContext");
- _button1.Text = "Binding Context Changed";
- };
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- _button1,_customwebView1,_customwebView2
- }
- }
- });
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Method is called when WebView Source is changed")]
- [Property("SPEC", "Xamarin.Forms.WebView.OnPropertyChanged M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "UIBH")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "Must have functional internet connection in device or emulator.")]
- [Step(1, "Click Run TC")]
- [Step(2, "Check if xamarin and tizen official site is visible respectively.")]
- [Step(3, "Click the button to change source.")]
- [Step(4, "Check if xamarin official site is visible in webview.")]
- [Step(5, "TC will PASS automatically if source is changed otherwise press FAIL.")]
- [Postcondition(1, "NA")]
- public async Task OnPropertyChanged_WebView_UIBH()
- {
- _label2 = new Label
- {
- Text = "OnPropertyChanged Test.",
- HorizontalTextAlignment = TextAlignment.Center,
- TextColor = Color.White
- };
-
- customwebViewClass _customwebView3 = new customwebViewClass
- {
- Source = new UrlWebViewSource
- {
- Url = "https://www.tizen.org",
- },
- VerticalOptions = LayoutOptions.FillAndExpand
- };
-
- _button1 = new Button()
- {
- Text = "Click to change source.",
- };
-
- _button1.Clicked += (object sender, EventArgs e) =>
- {
- _customwebView3.Source = "https://www.xamarin.com/";
- };
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- _button1,_customwebView3
- },
- }
- });
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Navigated is raised after navigation completes.")]
- [Property("SPEC", "Xamarin.Forms.WebView.Navigated E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "Must have functional internet connection in device or emulator.")]
- [Step(1, "Click run TC")]
- [Step(2, "Click the button Click to start navigate.")]
- [Step(3, "Check if tizen official site is visible after sometime.")]
- [Step(4, "Check if the Text above the button is changed to Navigated Event Called.")]
- [Step(5, "If navigated event raised then TC will PASS automatically otherwise press FAIL.")]
- [Postcondition(1, "NA")]
- public async Task Navigated_WebView_UIBH()
- {
- /* TEST CODE */
- _webView2 = new WebView
- {
- VerticalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.Blue,
- HeightRequest = 400,
- WidthRequest = 500
- };
-
- _label1 = new Label
- {
- Text = "Event not called",
- HorizontalTextAlignment = TextAlignment.Center,
- WidthRequest = 100,
- HeightRequest = 40
- };
- _webView2.Navigated += OnNavigated;
-
- _button1 = new Button()
- {
- Text = "Click to start navigate.",
- };
-
- _button1.Clicked += (object sender, EventArgs e) =>
- {
- _webView2.Source = "https://www.tizen.org";
- };
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- _label1,_button1,_webView2
- }
- }
- });
- await ManualTest.WaitForConfirm();
- _webView2.Navigated -= OnNavigated;
- }
-
- [Test]
- [Category("P1")]
- [Description("Navigating is raised when navigation starts.")]
- [Property("SPEC", "Xamarin.Forms.WebView.Navigating E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "Must have functional internet connection in device or emulator.")]
- [Step(1, "Click run TC")]
- [Step(2, "Click the button Start Navigating.")]
- [Step(3, "Check if xamarin official site is visible after sometime.")]
- [Step(4, "Check if the Text above the button is changed to Navigating Event Called.")]
- [Step(5, "If Navigating event raised then TC will PASS automatically otherwise press FAIL.")]
- [Postcondition(1, "NA")]
- public async Task Navigating_WebView_UIBH()
- {
- /* TEST CODE */
- _webView2 = new WebView
- {
- VerticalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = Color.Blue,
- HeightRequest = 400,
- WidthRequest = 500
- };
-
- _label1 = new Label
- {
- Text = "Navigating Event not called",
- HorizontalTextAlignment = TextAlignment.Center,
- TextColor = Color.Black,
- WidthRequest = 100,
- HeightRequest = 40
- };
- _webView2.Navigating += OnNavigationStart;
-
- _button1 = new Button()
- {
- Text = "Start Navigating.",
- };
-
- _button1.Clicked += (object sender, EventArgs e) =>
- {
- _webView2.Source = "https://www.xamarin.com/";
- };
-
- _testPage.ExecuteTC(new ContentPage()
- {
- Content = new StackLayout
- {
- Children =
- {
- _label1,_button1,_webView2
- }
- }
- });
- await ManualTest.WaitForConfirm();
- _webView2.Navigating -= OnNavigationStart;
- }
- }
-}
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<manifest package="Tizen.XamarinForms.Manual.Tests" version="1.0.0" api-version="6" xmlns="http://tizen.org/ns/packages">
- <profile name="common" />
- <ui-application appid="Tizen.XamarinForms.Manual.Tests" exec="Tizen.XamarinForms.Manual.Tests.dll" multiple="false" taskmanage="true" splash-screen-display="true" type="dotnet" launch_mode="single">
- <icon>Tizen.XamarinForms.Manual.Tests.png</icon>
- <label>Tizen.XamarinForms.Manual.Tests</label>
- </ui-application>
- <shortcut-list />
- <privileges>
- <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
- <privilege>http://tizen.org/privilege/internet</privilege>
- </privileges>
-</manifest>
+++ /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.Platform.Tizen.Forms.Init(app);
- app.Run(args);
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-<Project Sdk="Microsoft.NET.Sdk">
-
- <!-- Property Group for .NET Core Project -->
- <PropertyGroup>
- <OutputType>Exe</OutputType>
- <TargetFramework>tizen60</TargetFramework>
- </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>
- <PackageReference Include="Tizen.NET.Sdk" Version="$(TizenNETSdkVersion)" />
- </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.XamarinForms1.Tests", "Tizen.XamarinForms1.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 System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Xamarin.Forms;
-using Xamarin.Forms.Platform.Tizen;
-using XamarinForTizen.Tizen.common;
-
-[assembly: ResolutionGroupName("Samsung")]
-[assembly: ExportEffect(typeof(MockEffect), "MockEffect")]
-namespace XamarinForTizen.Tizen.common
-{
- class MockEffect : PlatformEffect
- {
-
- protected override void OnAttached()
- {
- Container.Color = ElmSharp.Color.Red;
- }
-
- protected override void OnDetached()
- {
-
- }
- }
-}
\ 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 NUnit.Framework;
-using NUnit.Framework.TUnit;
-using XamarinForTizen.Tizen;
-using System.Threading.Tasks;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class AbsoluteLayoutTests
- {
- private AbsoluteLayout _mAbsoluteLayout;
- private static bool _flagLayoutChildren, _flagOnChildAdded, _flagOnChildRemoved, _flagOnSizeRequest;
- internal class SubAbsoluteLayout : AbsoluteLayout
- {
- protected override void LayoutChildren(double x, double y, double width, double height)
- {
- _flagLayoutChildren = true;
- base.LayoutChildren(x, y, width, height);
- }
-
- protected override void OnChildAdded(Element child)
- {
- _flagOnChildAdded = true;
- base.OnChildAdded(child);
- }
-
- protected override void OnChildRemoved(Element child)
- {
- _flagOnChildRemoved = true;
- base.OnChildRemoved(child);
- }
-
- protected override SizeRequest OnSizeRequest(double widthConstraint, double heightConstraint)
- {
- _flagOnSizeRequest = true;
- return base.OnSizeRequest(widthConstraint, heightConstraint);
- }
- }
-
- [SetUp]
- public void SetUp()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "AbsoluteLayout CLASS: Setup---------------------------------");
- _mAbsoluteLayout = new AbsoluteLayout();
- _flagLayoutChildren = _flagOnChildAdded = _flagOnChildRemoved = _flagOnSizeRequest = false;
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "AbsoluteLayout CLASS: Teardown---------------------------------");
- _mAbsoluteLayout = null;
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a AbsoluteLayout instance. Check whether object is successfully created or not.")]
- [Property("SPEC", "Xamarin.Forms.AbsoluteLayout.AbsoluteLayout C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void AbsoluteLayout_CONST()
- {
- _mAbsoluteLayout = new AbsoluteLayout();
- Assert.IsNotNull(_mAbsoluteLayout, "Cannot successfully create AbsoluteLayout object");
- }
-
- [Test]
- [Category("P1")]
- [Description("Add child view object to Children property, and check returned collection.")]
- [Property("SPEC", "Xamarin.Forms.AbsoluteLayout.Children A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void Children_PROPERTY_GET()
- {
- /*PRECONDITION*/
- /*
- * Create 2 instance label and button. They are children of AbsoluteLayout.
- */
- Assert.AreEqual(0, _mAbsoluteLayout.Children.Count, "Children should be empty when no children added.");
- var mColor = new Color(0.1, 0.2, 0);
- var mLabel = new Label()
- {
- Text = "My Label",
- FontSize = 20,
- TextColor = mColor
- };
- var mOpacity = 0.3;
- var mButton = new Button()
- {
- Text = "My button",
- Opacity = mOpacity
- };
- /*TEST CODE*/
- _mAbsoluteLayout.Children.Add(mLabel);
- Assert.AreEqual(1, _mAbsoluteLayout.Children.Count, "Children amount of AbsoluteLayout is different 1 value ");
- Assert.AreEqual("My Label", ((Label)_mAbsoluteLayout.Children[0]).Text, "Text property of Label children instance is different from setup value");
- Assert.AreEqual(20, ((Label)_mAbsoluteLayout.Children[0]).FontSize, "FontSize property of Label children instance is different from setup value");
- Assert.AreEqual(mColor, ((Label)_mAbsoluteLayout.Children[0]).TextColor, "TextColor property of Label children instance is different from setup value");
- _mAbsoluteLayout.Children.Add(mButton);
- Assert.AreEqual(2, _mAbsoluteLayout.Children.Count, "Children amount of AbsoluteLayout is different 2 value ");
- Assert.AreEqual("My button", ((Button)_mAbsoluteLayout.Children[1]).Text, "Text property of Button children instance is different from setup value");
- Assert.AreEqual(mOpacity, ((Button)_mAbsoluteLayout.Children[1]).Opacity, "Opacity property of Button children instance is different from setup value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether GetLayoutBounds returns the Rectangle value set by SetLayoutBounds method.")]
- [Property("SPEC", "Xamarin.Forms.AbsoluteLayout.GetLayoutBounds M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void GetLayoutBounds_RECTANGE_VALUE()
- {
- /**PRECONDITION
- * Create a label instance and Rectangle instance, they are prameter for SetLayoutBounds
- **/
- var mColor = new Color(0.1, 0.3, 0.2);
- var mLabel = new Label()
- {
- Text = "My Label",
- FontSize = 20,
- TextColor = mColor
- };
- var mBeforeRectangle = new Rectangle(115, 159, 100, 100);
- /*TEST CODE*/
- AbsoluteLayout.SetLayoutBounds(mLabel, mBeforeRectangle);
- var mAfterRectangle = AbsoluteLayout.GetLayoutBounds(mLabel);
- Assert.AreEqual(mBeforeRectangle, mAfterRectangle, " mBeforeRectangle value is not equal to mAfterRectangle value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Set layout bounds and verify with GetLayoutBounds method.")]
- [Property("SPEC", "Xamarin.Forms.AbsoluteLayout.SetLayoutBounds M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void SetLayoutBounds_RECTANGE_VALUE()
- {
- /** PRECONDITION
- * Create a editor instance and Rectangle instance, they are prameter for SetLayoutBounds
- */
- var mThickness = new Thickness(0, 0, 2, 2);
- var mEditor = new Editor()
- {
- Text = "My Editor",
- Margin = mThickness
- };
- var mBeforeRectangle = new Rectangle(115, 159, 100, 100);
- /**TEST CODE*/
- AbsoluteLayout.SetLayoutBounds(mEditor, mBeforeRectangle);
- var mAfterRectangle = AbsoluteLayout.GetLayoutBounds(mEditor);
- Assert.AreEqual(mBeforeRectangle, mAfterRectangle, " mBeforeRectangle value is not equal to mAfterRectangle value ");
- }
-
- [Test]
- [Category("P1")]
- [Description("SetLayoutFlag with all available enum types, and verify by getting its value.")]
- [Property("SPEC", "Xamarin.Forms.AbsoluteLayout.SetLayoutFlags M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MAE")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void SetLayoutFlags_FLAG_VALUE()
- {
- /**PRE CONDITION
- * Create a Label instance . It's a prameter for using SetLayoutFlags
- */
- var mLabel = new Label()
- {
- Text = "AbsoluteLayout"
- };
- /*TEST CODE*/
- AbsoluteLayout.SetLayoutFlags(mLabel, AbsoluteLayoutFlags.All);
- Assert.AreEqual(AbsoluteLayoutFlags.All, AbsoluteLayout.GetLayoutFlags(mLabel), "Set / get value of Flag All is not correct.");
- AbsoluteLayout.SetLayoutFlags(mLabel, AbsoluteLayoutFlags.HeightProportional);
- Assert.AreEqual(AbsoluteLayoutFlags.HeightProportional, AbsoluteLayout.GetLayoutFlags(mLabel), "Set / get value of Flag HeightProportional is not correct.");
- AbsoluteLayout.SetLayoutFlags(mLabel, AbsoluteLayoutFlags.None);
- Assert.AreEqual(AbsoluteLayoutFlags.None, AbsoluteLayout.GetLayoutFlags(mLabel), "Set / get value of Flag None is not correct.");
- AbsoluteLayout.SetLayoutFlags(mLabel, AbsoluteLayoutFlags.PositionProportional);
- Assert.AreEqual(AbsoluteLayoutFlags.PositionProportional, AbsoluteLayout.GetLayoutFlags(mLabel), "Set / get value of Flag PositionProportional is not correct.");
- AbsoluteLayout.SetLayoutFlags(mLabel, AbsoluteLayoutFlags.SizeProportional);
- Assert.AreEqual(AbsoluteLayoutFlags.SizeProportional, AbsoluteLayout.GetLayoutFlags(mLabel), "Set / get value of Flag SizeProportional is not correct.");
- AbsoluteLayout.SetLayoutFlags(mLabel, AbsoluteLayoutFlags.WidthProportional);
- Assert.AreEqual(AbsoluteLayoutFlags.WidthProportional, AbsoluteLayout.GetLayoutFlags(mLabel), "Set / get value of Flag WidthProportional is not correct.");
- AbsoluteLayout.SetLayoutFlags(mLabel, AbsoluteLayoutFlags.XProportional);
- Assert.AreEqual(AbsoluteLayoutFlags.XProportional, AbsoluteLayout.GetLayoutFlags(mLabel), "Set / get value of Flag XProportional is not correct.");
- AbsoluteLayout.SetLayoutFlags(mLabel, AbsoluteLayoutFlags.YProportional);
- Assert.AreEqual(AbsoluteLayoutFlags.YProportional, AbsoluteLayout.GetLayoutFlags(mLabel), "Set / get value of Flag YProportional is not correct.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Set layout flag, and check if it is correctly getable.")]
- [Property("SPEC", "Xamarin.Forms.AbsoluteLayout.GetLayoutFlags M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MAE")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void GetLayoutFlags_FLAG_VALUE()
- {
- /**PRE CONDITION
- * Create a DatePicker instance . It's a prameter for using SetLayoutFlags
- */
- var mDatePicker = new DatePicker()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.Center,
- Date = new DateTime()
- };
- /**TESTCODE*/
- AbsoluteLayout.SetLayoutFlags(mDatePicker, AbsoluteLayoutFlags.All);
- Assert.AreEqual(AbsoluteLayoutFlags.All, AbsoluteLayout.GetLayoutFlags(mDatePicker), "Set / get value of Flag All is not correct.");
- AbsoluteLayout.SetLayoutFlags(mDatePicker, AbsoluteLayoutFlags.HeightProportional);
- Assert.AreEqual(AbsoluteLayoutFlags.HeightProportional, AbsoluteLayout.GetLayoutFlags(mDatePicker), "Set / get value of Flag HeightProportional is not correct.");
- AbsoluteLayout.SetLayoutFlags(mDatePicker, AbsoluteLayoutFlags.None);
- Assert.AreEqual(AbsoluteLayoutFlags.None, AbsoluteLayout.GetLayoutFlags(mDatePicker), "Set / get value of Flag None is not correct.");
- AbsoluteLayout.SetLayoutFlags(mDatePicker, AbsoluteLayoutFlags.PositionProportional);
- Assert.AreEqual(AbsoluteLayoutFlags.PositionProportional, AbsoluteLayout.GetLayoutFlags(mDatePicker), "Set / get value of Flag PositionProportional is not correct.");
- AbsoluteLayout.SetLayoutFlags(mDatePicker, AbsoluteLayoutFlags.SizeProportional);
- Assert.AreEqual(AbsoluteLayoutFlags.SizeProportional, AbsoluteLayout.GetLayoutFlags(mDatePicker), "Set / get value of Flag SizeProportional is not correct.");
- AbsoluteLayout.SetLayoutFlags(mDatePicker, AbsoluteLayoutFlags.WidthProportional);
- Assert.AreEqual(AbsoluteLayoutFlags.WidthProportional, AbsoluteLayout.GetLayoutFlags(mDatePicker), "Set / get value of Flag WidthProportional is not correct.");
- AbsoluteLayout.SetLayoutFlags(mDatePicker, AbsoluteLayoutFlags.XProportional);
- Assert.AreEqual(AbsoluteLayoutFlags.XProportional, AbsoluteLayout.GetLayoutFlags(mDatePicker), "Set / get value of Flag XProportional is not correct.");
- AbsoluteLayout.SetLayoutFlags(mDatePicker, AbsoluteLayoutFlags.YProportional);
- Assert.AreEqual(AbsoluteLayoutFlags.YProportional, AbsoluteLayout.GetLayoutFlags(mDatePicker), "Set / get value of Flag YProportional is not correct.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether on method works properly or not.")]
- [Property("SPEC", "Xamarin.Forms.AbsoluteLayout.On<T> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void On_METHOD()
- {
- /**TEST CODE**/
- var mAbsoluteLayout = new SubAbsoluteLayout()
- {
- Children =
- {
- new Label() {
- Text = "My Tex",
- FontSize = 12
- },
- new Button()
- {
- Text = "My Button",
- BorderColor = new Color(0,0,0,0)
- }
- }
- };
- var config = mAbsoluteLayout.On<Xamarin.Forms.PlatformConfiguration.Tizen>();
- Assert.IsInstanceOf<IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Tizen, Xamarin.Forms.AbsoluteLayout>>(config, "config is not AbsoluteLayout");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check override method OnChildAdded is invoked when its child is added.")]
- [Property("SPEC", "Xamarin.Forms.AbsoluteLayout.OnChildAdded M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void OnChildAdded_OVERRIDE_METHOD()
- {
- /*PRE CONDITION
- * _flagOnChildAdded flag is initialize false value
- * Create a instance SubAbsoluteLayout
- */
- Assert.False(_flagOnChildAdded, "_flagOnChildAdded should false initial");
- /**TEST CODE**/
- var mAbsoluteLayout = new SubAbsoluteLayout()
- {
- Children =
- {
- new Label() {
- Text = "My Tex",
- FontSize = 12
- },
- new Button()
- {
- Text = "My Button",
- BorderColor = new Color(0,0,0,0)
- }
- }
- };
- Assert.True(_flagOnChildAdded, "OnChildAdded overrided method not invoked.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check override method OnChildRemoved is invoked when its child is removed.")]
- [Property("SPEC", "Xamarin.Forms.AbsoluteLayout.OnChildRemoved M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void OnChildRemoved_OVERRIDE_METHOD()
- {
- /*PRE CONDITION
- * _flagOnChildRemoved flag is initialize false value
- * Create a instance SubAbsoluteLayout
- */
- Assert.False(_flagOnChildRemoved, "_flagOnChildRemoved should false initial");
- /**TEST CODE**/
- var mAbsoluteLayout = new SubAbsoluteLayout()
- {
- Children =
- {
- new Label() {
- Text = "My Tex",
- FontSize = 12
- },
- new Button()
- {
- Text = "My Button",
- BorderColor = new Color(0,0,0,0)
- }
- }
- };
- mAbsoluteLayout.Children.RemoveAt(0);
- Assert.True(_flagOnChildRemoved, "OnChildAdded overrided method not invoked.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check override method OnSizeRequest is invoked when it is measured.")]
- [Property("SPEC", "Xamarin.Forms.AbsoluteLayout.OnSizeRequest M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void OnSizeRequest_OVERRIDE_METHOD()
- {
- /*PRE CONDITION
- * _flagOnSizeRequest flag is initialize false value
- * Create a instance SubAbsoluteLayout
- */
- Assert.False(_flagOnSizeRequest, "_flagOnSizeRequest should false initial");
- /**TEST CODE**/
- var mButton = new Button()
- {
- Text = "My Button",
- BorderColor = new Color(0, 0, 0, 0)
- };
- var mAbsoluteLayout = new SubAbsoluteLayout()
- {
- Children =
- {
- new Label() {
- Text = "My Tex",
- FontSize = 12
- },
- mButton
- }
- };
- mAbsoluteLayout.Measure(100, 200, MeasureFlags.None);
- Assert.True(_flagOnSizeRequest, "OnSizeRequest overrided method not invoked.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check override method LayoutChildren is invoked when it's layout children is changed .")]
- [Property("SPEC", "Xamarin.Forms.AbsoluteLayout.LayoutChildren M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public async Task LayoutChildren_OVERRIDE_METHOD()
- {
- //Assert.True(false, "[NA]Need to check how to use API.");
- /*PRE CONDITION
- * _flagLayoutChildren flag is initialize false value
- * Create a instance SubAbsoluteLayout
- */
- _flagLayoutChildren = false;
- Assert.False(_flagLayoutChildren, "_flagLayoutChildren should false initial");
- /**TEST CODE**/
- Label topLeftLabel;
- var simpleLayout = new SubAbsoluteLayout
- {
- BackgroundColor = Color.Blue.WithLuminosity(0.9),
- VerticalOptions = LayoutOptions.Start,
- HeightRequest = 100
- };
-
- topLeftLabel = new Label
- {
- Text = "Top Left",
- TextColor = Color.Black
- };
-
- SubAbsoluteLayout.SetLayoutBounds(topLeftLabel,
- new Rectangle(0f,
- 0f, SubAbsoluteLayout.AutoSize, SubAbsoluteLayout.AutoSize));
- simpleLayout.Children.Add(topLeftLabel);
- var button = new Button()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Text = "Click me",
- VerticalOptions = LayoutOptions.FillAndExpand
- };
-
- var stack = new StackLayout
- {
- Children = {
- simpleLayout
- }
-
- };
- var page = new ContentPage()
- {
- Padding =
- new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5),
- Content = stack
- };
- await Program.getApp().MainPage.Navigation.PushAsync(page);
- await Task.Delay(1000);
- simpleLayout.HeightRequest += 20;
- Assert.True(_flagLayoutChildren, "LayoutChildren overrided method not invoked.");
-
- /*POST CONDITION*/
- await Program.getApp().MainPage.Navigation.PopToRootAsync();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of LayoutBoundsProperty is correctly readable or not")]
- [Property("SPEC", "Xamarin.Forms.AbsoluteLayout.LayoutBoundsProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void LayoutBoundsProperty_PROPERTY_READ_ONLY()
- {
- /*TEST CODE*/
- var mColor01 = Color.Black;
- var mColor02 = Color.Blue;
- _mAbsoluteLayout.BackgroundColor = mColor01;
- var mAbsoluton = new AbsoluteLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BackgroundColor = mColor02
- };
- var mRectangle01 = new Rectangle(115, 159, 100, 100);
- var mRectangle02 = new Rectangle(0, 1, 50, 60);
- AbsoluteLayout.SetLayoutBounds(_mAbsoluteLayout, mRectangle01);
- AbsoluteLayout.SetLayoutBounds(mAbsoluton, mRectangle02);
- Assert.AreNotEqual(AbsoluteLayout.GetLayoutBounds(_mAbsoluteLayout), AbsoluteLayout.GetLayoutBounds(mAbsoluton), "Rectangle of _mAbsoluteLayout value must be different form Rectangle of mAbsoluton value");
- _mAbsoluteLayout.SetValue(AbsoluteLayout.LayoutBoundsProperty, mRectangle02);
- Assert.AreEqual(AbsoluteLayout.GetLayoutBounds(mAbsoluton), AbsoluteLayout.GetLayoutBounds(_mAbsoluteLayout), "Rectangle of mAbsoluton value & Rectangle of _mAbsoluteLayout value should be same");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of LayoutFlagsProperty is correctly readable or not")]
- [Property("SPEC", "Xamarin.Forms.AbsoluteLayout.LayoutFlagsProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void LayoutFlagsProperty_PROPERTY_READ_ONLY()
- {
- /*TEST CODE*/
- _mAbsoluteLayout.SetValue(AbsoluteLayout.LayoutFlagsProperty, AbsoluteLayoutFlags.All);
- Assert.AreEqual(AbsoluteLayoutFlags.All, AbsoluteLayout.GetLayoutFlags(_mAbsoluteLayout), "Set / get value of Flag All is not correct.");
- _mAbsoluteLayout.SetValue(AbsoluteLayout.LayoutFlagsProperty, AbsoluteLayoutFlags.HeightProportional);
- Assert.AreEqual(AbsoluteLayoutFlags.HeightProportional, AbsoluteLayout.GetLayoutFlags(_mAbsoluteLayout), "Set / get value of Flag HeightProportional is not correct.");
- _mAbsoluteLayout.SetValue(AbsoluteLayout.LayoutFlagsProperty, AbsoluteLayoutFlags.None);
- Assert.AreEqual(AbsoluteLayoutFlags.None, AbsoluteLayout.GetLayoutFlags(_mAbsoluteLayout), "Set / get value of Flag None is not correct.");
- _mAbsoluteLayout.SetValue(AbsoluteLayout.LayoutFlagsProperty, AbsoluteLayoutFlags.PositionProportional);
- Assert.AreEqual(AbsoluteLayoutFlags.PositionProportional, AbsoluteLayout.GetLayoutFlags(_mAbsoluteLayout), "Set / get value of Flag PositionProportional is not correct.");
- _mAbsoluteLayout.SetValue(AbsoluteLayout.LayoutFlagsProperty, AbsoluteLayoutFlags.SizeProportional);
- Assert.AreEqual(AbsoluteLayoutFlags.SizeProportional, AbsoluteLayout.GetLayoutFlags(_mAbsoluteLayout), "Set / get value of Flag SizeProportional is not correct.");
- _mAbsoluteLayout.SetValue(AbsoluteLayout.LayoutFlagsProperty, AbsoluteLayoutFlags.WidthProportional);
- Assert.AreEqual(AbsoluteLayoutFlags.WidthProportional, AbsoluteLayout.GetLayoutFlags(_mAbsoluteLayout), "Set / get value of Flag WidthProportional is not correct.");
- _mAbsoluteLayout.SetValue(AbsoluteLayout.LayoutFlagsProperty, AbsoluteLayoutFlags.XProportional);
- Assert.AreEqual(AbsoluteLayoutFlags.XProportional, AbsoluteLayout.GetLayoutFlags(_mAbsoluteLayout), "Set / get value of Flag XProportional is not correct.");
- _mAbsoluteLayout.SetValue(AbsoluteLayout.LayoutFlagsProperty, AbsoluteLayoutFlags.YProportional);
- Assert.AreEqual(AbsoluteLayoutFlags.YProportional, AbsoluteLayout.GetLayoutFlags(_mAbsoluteLayout), "Set / get value of Flag YProportional is not correct.");
- }
-
- //[Test]
- //[Category("P1")]
- //[Description("check whether AbsoluteLayout's able to auto size or not")]
- //[Property("SPEC", "Xamarin.Forms.AbsoluteLayout.AutoSize A")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //[Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- //public void AutoSize_PROPERTY_GET()
- //{
- // //Assert.True(false, "[NA]Need to check how to use API.");
- // /*PRE CONDITION
- // *
- // */
- // //TEST CODE
- // AbsoluteLayout simpleLayout = new AbsoluteLayout
- // {
- // BackgroundColor = Color.Blue.WithLuminosity(0.9),
- // VerticalOptions = LayoutOptions.FillAndExpand
- // };
-
- // var mBoxview = new BoxView
- // {
- // Color = Color.Red
- // };
- // AbsoluteLayout.SetLayoutFlags(mBoxview,
- // AbsoluteLayoutFlags.PositionProportional);
-
- // AbsoluteLayout.SetLayoutBounds(mBoxview,
- // new Rectangle(0f,
- // 0f,500, 500));
- // Assert.AreEqual(500, AbsoluteLayout.GetLayoutBounds(mBoxview).Height, "Set / get Height value of Bound is not correct.");
- // Assert.AreEqual(500, AbsoluteLayout.GetLayoutBounds(mBoxview).Height, "Set / get Height value of Bound is not correct.");
- //}
- }
-
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.ActivityIndicator Tests")]
- public class ActivityIndicatorTests
- {
- private ActivityIndicator _activityIndicator;
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("ActivityIndicatorTests --------------- Setup()");
- _activityIndicator = new ActivityIndicator();
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("ActivityIndicatorTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create an ActivityIndicator instance.")]
- [Property("SPEC", "Xamarin.Forms.ActivityIndicator.ActivityIndicator C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void ActivityIndicator_INIT()
- {
- /* TEST CODE */
- var activityIndicator = new ActivityIndicator();
- Assert.IsNotNull(activityIndicator, "Object is null after initialize");
- Assert.IsInstanceOf<ActivityIndicator>(activityIndicator);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Color is readable and writable with valid values for color(r,g,b).")]
- [Property("SPEC", "Xamarin.Forms.ActivityIndicator.Color A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Color_READ_WRITE()
- {
- /* TEST CODE */
- _activityIndicator.Color = Color.Red;
- Assert.IsInstanceOf<Color>(_activityIndicator.Color, "Should be instance of Color.");
- Assert.AreEqual(Color.Red, _activityIndicator.Color, "Color doesn't set and get successfully.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property IsRunning is readable and writable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.ActivityIndicator.IsRunning A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void IsRunning_READ_WRITE()
- {
- /* TEST CODE */
- _activityIndicator.IsRunning = true;
- Assert.IsTrue(_activityIndicator.IsRunning,"IsRunning property is not set true");
- _activityIndicator.IsRunning = false;
- Assert.IsFalse(_activityIndicator.IsRunning, "IsRunning property is not set false");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ColorProperty property bound or not")]
- [Property("SPEC", "Xamarin.Forms.ActivityIndicator.ColorProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void ColorProperty_READ_ONLY()
- {
- /* TEST CODE */
- _activityIndicator.Color = Color.Green;
- ActivityIndicator mActivityIndicator = new ActivityIndicator();
- mActivityIndicator.Color = Color.Gray;
- Assert.AreNotEqual(mActivityIndicator.Color, _activityIndicator.Color, "ColorProperty value must be different.");
- _activityIndicator.BindingContext = mActivityIndicator;
- _activityIndicator.SetBinding(ActivityIndicator.ColorProperty, "Color");
- Assert.AreEqual(mActivityIndicator.Color, _activityIndicator.Color, "After binding, value should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether IsRunningProperty property bound or not")]
- [Property("SPEC", "Xamarin.Forms.ActivityIndicator.IsRunningProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void IsRunningProperty_READ_ONLY()
- {
- _activityIndicator.IsRunning = true;
- ActivityIndicator mActivityIndicator = new ActivityIndicator();
- mActivityIndicator.IsRunning = false;
- Assert.AreNotEqual(mActivityIndicator.IsRunning, _activityIndicator.IsRunning, "IsRunningProperty value must be different.");
- _activityIndicator.BindingContext = mActivityIndicator;
- _activityIndicator.SetBinding(ActivityIndicator.IsRunningProperty, "IsRunning");
- Assert.AreEqual(mActivityIndicator.IsRunning, _activityIndicator.IsRunning, "After binding, value should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check return ActivityIndicator configuration")]
- [Property("SPEC", "Xamarin.Forms.ActivityIndicator.On<T> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void On_CONFIGURATION_METHOD()
- {
- /*TEST CODE*/
- var mResouce = new ResourceDictionary();
- _activityIndicator.Resources = mResouce;
- var myConfig = _activityIndicator.On<IConfigPlatform>();
- Assert.IsInstanceOf<IPlatformElementConfiguration<IConfigPlatform, ActivityIndicator>>(myConfig, "Should be an instance of IPlatformElementConfiguration");
- Assert.IsInstanceOf<ActivityIndicator>(myConfig.Element, "Should be an instance of ActivityIndicator");
- Assert.AreEqual(mResouce, myConfig.Element.Resources, "Resources of myConfig.Element value & Resources of _activityIndicator should be to equal");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-using System.Collections;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- class FakeAnimatable : IAnimatable
- {
- public void BatchBegin()
- {
- }
-
- public void BatchCommit()
- {
- }
- }
-
- [TestFixture]
- [Description("Xamarin.Forms.Animation Tests")]
- public class AnimationTests
- {
- private Animation animation;
-
- [SetUp]
- public void SetUp()
- {
- animation = new Animation();
- Console.WriteLine("TSAnimationTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- animation = null;
- Console.WriteLine("TSAnimationTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a Animation object")]
- [Property("SPEC", "Xamarin.Forms.Animation.Animation C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Property("COVPARAM", "")]
- public void Animation_INIT()
- {
- /*TEST CODE*/
- Assert.IsNotNull(animation, "Instance of Animation is null");
- Assert.IsInstanceOf<Animation>(animation, "Is not an instance of Animation");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a Animation object")]
- [Property("SPEC", "Xamarin.Forms.Animation.Animation C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Property("COVPARAM", "Action<double>, Double, Double, Easing, Action")]
- public void Animation_INIT_WITH_ACTION()
- {
- /*TEST CODE*/
- animation = new Animation(null, 0.3, 0.9, null, null);
- Assert.IsNotNull(animation, "Instance of Animation is null");
- Assert.IsInstanceOf<Animation>(animation, "Is not an instance of Animation");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether animation is added or not")]
- [Property("SPEC", "Xamarin.Forms.Animation.Add M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Add_CHECK()
- {
- /*TEST CODE*/
- Animation animationNew = new Animation(null, 0.0, 0.7, null, null);
- animation.Add(0.0, 0.7, animationNew);
- IEnumerator enumerator = animation.GetEnumerator();
- enumerator.MoveNext();
- Assert.IsTrue(enumerator.Current.Equals(animationNew), "Not returning expected Animation object.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether runs animation with the supplied parameters")]
- [Property("SPEC", "Xamarin.Forms.Animation.Commit M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Commit_CHECK_RETURN_VALUE()
- {
- /*TEST CODE*/
- try
- {
- var animatable = new FakeAnimatable();
- animation.Commit(animatable, "Tizen", 12, 200, null, null);
- }
- catch(Exception ex)
- {
- Assert.IsTrue(false, "Exception thrown. Exception messeage: " + ex.Message);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether returns a callback")]
- [Property("SPEC", "Xamarin.Forms.Animation.GetCallback M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void GetCallback_CHECK_RETURN_VALUE()
- {
- /*TEST CODE*/
- Image image = new Image();
- var animation = new Animation(v => image.Scale = v, 1, 2);
- animation.Commit(new FakeAnimatable(), "SimpleAnimation", 16, 2000, Easing.Linear, (v, c) => image.Scale = 1, () => true);
- Assert.IsInstanceOf<Action<double>>(animation.GetCallback(), "Is not an instance of Actione<double> object");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether returns an enumerator that can be used to iterate over the child Animation objects")]
- [Property("SPEC", "Xamarin.Forms.Animation.GetEnumerator M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void GetEnumerator_CHECK_RETURN_VALUE()
- {
- /*TEST CODE*/
- Animation animationNew = new Animation(null, 0.0, 0.7, null, null);
- animation.Add(0.0, 0.7, animationNew);
- var enumerator = animation.GetEnumerator();
- Assert.IsInstanceOf<IEnumerator>(enumerator, "Is not an instance of IEnumerator object");
- enumerator.MoveNext();
- Assert.IsTrue(enumerator.Current.Equals(animationNew), "Not returning expected Animation object.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether adds an Animation object to this Animation")]
- [Property("SPEC", "Xamarin.Forms.Animation.Insert M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Insert_CHECK_RETURN_VALUE()
- {
- /*TEST CODE*/
- Animation animationNew = new Animation(null, 0.0, 0.7, null, null);
- Assert.IsInstanceOf<Animation>(animation.Insert(0.0, 0.7, animationNew), "Not returning an instance of Animation object");
- var enumerator = animation.GetEnumerator();
- enumerator.MoveNext();
- Assert.IsTrue(enumerator.Current.Equals(animationNew), "Not returning expected Animation object.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether adds animation to the children of this Animation object")]
- [Property("SPEC", "Xamarin.Forms.Animation.WithConcurrent M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Property("COVPARAM", "Xamarin.Forms.Animation, double, double")]
- public void WithConcurrent_CHECK_RETURN_VALUE()
- {
- /*TEST CODE*/
- Animation animationNew = new Animation(null, 0.0, 0.7, null, null);
- Assert.IsInstanceOf<Animation>(animation.WithConcurrent(animationNew, 0.0, 0.9), "Not returning an instance of Animation object.");
- var enumerator = animation.GetEnumerator();
- enumerator.MoveNext();
- Assert.IsTrue(enumerator.Current.Equals(animationNew), "Not returning expected Animation object.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether creates a new Animation object with the specified parameters and adds it")]
- [Property("SPEC", "Xamarin.Forms.Animation.WithConcurrent M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Property("COVPARAM", "System.Action<double>, double, double, Xamarin.Forms.Easing, double, double")]
- public void WithConcurrent_CHECK_RETURN_VALUE_ACTION()
- {
- /*TEST CODE*/
- var animationNew = animation.WithConcurrent(null, 0.0, 0.7, null, 0.0, 0.7);
- Assert.IsInstanceOf<Animation>(animationNew, "Is not an instance of Animation object.");
- Assert.IsTrue(animation.Equals(animationNew), "Not returning expected Animation object.");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-using System.Threading.Tasks;
-using System.Collections.Generic;
-using System.Threading;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.AnimationExtensions Tests")]
- public class AnimationExtensionsTests
- {
- class MyTestIAnimatable : IAnimatable
- {
- public void BatchBegin()
- {
- }
- public void BatchCommit()
- {
- }
- }
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("AnimationExtensionsTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("AnimationExtensionsTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P2")]
- [Description("Check whether animate throws exception or not.")]
- [Property("SPEC", "Xamarin.Forms.AnimationExtensions.Animate M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("COVPARAM", "IAnimatable, String, Animation, uint, uint, Easing, Action<double, bool>, Func<bool>")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Animate_CHECK_EXCEPTION_WITH_ANIMATION()
- {
- /* TEST CODE */
- Assert.Throws<ArgumentNullException>(() => AnimationExtensions.Animate(null, "Foo", new Animation(), 12, 250, null, null, null));
- }
-
- [Test]
- [Category("P2")]
- [Description("Check whether animate throws exception or not.")]
- [Property("SPEC", "Xamarin.Forms.AnimationExtensions.Animate M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("COVPARAM", "IAnimatable, String, Action<double>, Double, Double, uint, uint, Easing, Action<double, bool>, Func<bool>")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Animate_CHECK_EXCEPTION()
- {
- /* TEST CODE */
- Assert.Throws<ArgumentNullException>(() => AnimationExtensions.Animate(new MyTestIAnimatable(), "Foo", null, 1.0, 20.0, 12, 250, null, null, null));
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check whether animation starts or not.")]
- [Property("SPEC", "Xamarin.Forms.AnimationExtensions.Animate M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("COVPARAM", "IAnimatable, String, Action<double>, Double, Double, uint, uint, Easing, Action<double, bool>, Func<bool>")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Animate_WITH_ACTION_DOUBLE_PARAM()
- {
- /* TEST CODE */
- bool isRunning = false;
- MyTestIAnimatable mMyTestIAnimatable = new MyTestIAnimatable();
- var image = new Image();
- var animation = new Animation(v => image.Scale = v, 1, 2);
- animation.Commit(mMyTestIAnimatable, "SimpleAnimation", 16, 2000, Easing.Linear, (v, c) => image.Scale = 1, () => true);
- String handle = "new handle";
- double a = 1.3;
- AnimationExtensions.Animate(mMyTestIAnimatable, handle, v => a = v, 1.0, 20.0, 12, 250, Easing.BounceOut, null, null);
- isRunning = AnimationExtensions.AnimationIsRunning(mMyTestIAnimatable, handle);
- Thread.Sleep(5000);
- Assert.IsTrue(isRunning, "Animation should starts properly.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether animation starts or not.")]
- [Property("SPEC", "Xamarin.Forms.AnimationExtensions.Animate M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("COVPARAM", "IAnimatable, String, Action<double>, uint, uint, Easing, Action<double, bool>, Func<bool>")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Animate_WITH_ACTION_PARAM()
- {
- /* TEST CODE */
- bool isRunning = false;
- MyTestIAnimatable mMyTestIAnimatable = new MyTestIAnimatable();
- var image = new Image();
- var animation = new Animation(v => image.Scale = v, 1, 2);
- animation.Commit(mMyTestIAnimatable, "SimpleAnimation", 16, 2000, Easing.Linear, (v, c) => image.Scale = 1, () => true);
- String handle = "new handle";
- double a = 1.2;
- AnimationExtensions.Animate(mMyTestIAnimatable, handle, v => a = v, 16, 200, Easing.BounceIn, (v, c) => image.Scale = 1, () => true);
- isRunning = AnimationExtensions.AnimationIsRunning(mMyTestIAnimatable, handle);
- Thread.Sleep(2000);
- Assert.IsTrue(isRunning, "Animation should starts properly.");
- //Assert.IsTrue(false, "[NA] Need to check.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether animation starts or not.")]
- [Property("SPEC", "Xamarin.Forms.AnimationExtensions.Animate M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("COVPARAM", "IAnimatable, String, Animation, uint, uint, Easing, Action<double, bool>, Func<bool>")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Animate_WITH_ANIMATION_PARAM()
- {
- /* TEST CODE */
- bool isRunning = false;
- MyTestIAnimatable mMyTestIAnimatable = new MyTestIAnimatable();
- var image = new Image();
- var animation = new Animation(v => image.Scale = v, 1, 2);
- animation.Commit(mMyTestIAnimatable, "SimpleAnimation", 16, 2000, Easing.Linear, (v, c) => image.Scale = 1, () => true);
- String handle = "new handle";
- AnimationExtensions.Animate(mMyTestIAnimatable, handle, animation, 16, 200, Easing.BounceIn, (v, c) => image.Scale = 1, () => true);
- isRunning = AnimationExtensions.AnimationIsRunning(mMyTestIAnimatable, handle);
- Thread.Sleep(2000);
- Assert.IsTrue(isRunning, "Animation should starts properly.");
- //Assert.IsTrue(false, "[NA] Need to check.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether AnimateKinetic sets the specified parameters.")]
- [Property("SPEC", "Xamarin.Forms.AnimationExtensions.AnimateKinetic M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void AnimateKinetic_CHECK_STATUS()
- {
- /* TEST CODE */
- var view = new WebView();
- var resultList = new List<Tuple<double, double>>();
- view.AnimateKinetic(
- name: "Kinetics",
- callback: (distance, velocity) =>
- {
- resultList.Add(new Tuple<double, double>(distance, velocity));
- return true;
- },
- velocity: 100,
- drag: 1,
- finished: null);
-
- Assert.IsNotNull(resultList, "Object should not be null.");
- int checkValue = 100;
- int dragStep = 16;
-
- foreach (var item in resultList)
- {
- checkValue -= dragStep;
- Assert.AreEqual(checkValue, item.Item2, "Values should be equal.");
- Assert.AreEqual(checkValue * dragStep, item.Item1, "Values should be equal.");
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check return value of AnimationIsRunning.")]
- [Property("SPEC", "Xamarin.Forms.AnimationExtensions.AnimationIsRunning M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void AnimationIsRunning_CHECK_RETURN()
- {
- /* TEST CODE */
- bool isRunning = false;
- MyTestIAnimatable mMyTestIAnimatable = new MyTestIAnimatable();
- var image = new Image();
- var animation = new Animation(v => image.Scale = v, 1, 2);
- animation.Commit(mMyTestIAnimatable, "SimpleAnimation", 16, 2000, Easing.Linear, (v, c) => image.Scale = 1, () => true);
- String handle = "new handle";
- AnimationExtensions.Animate(mMyTestIAnimatable, handle, animation, 16, 250, Easing.CubicIn, null, null);
- isRunning = AnimationExtensions.AnimationIsRunning(mMyTestIAnimatable, handle);
- Thread.Sleep(2000);
- Assert.IsTrue(isRunning, "Return value should be true.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check return value of AbortAnimation.")]
- [Property("SPEC", "Xamarin.Forms.AnimationExtensions.AbortAnimation M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void AbortAnimation_CHECK_RETURN()
- {
- /* TEST CODE */
- bool isRunning = false;
- bool abort = false;
- String handle = "start";
- MyTestIAnimatable mMyTestIAnimatable = new MyTestIAnimatable();
- abort = AnimationExtensions.AbortAnimation(mMyTestIAnimatable, handle);
- Assert.IsFalse(abort, "abort should false'");
- var image = new Image();
- var animation = new Animation(v => image.Scale = v, 1, 2);
- animation.Commit(mMyTestIAnimatable, "SimpleAnimation", 16, 2000, Easing.Linear, (v, c) => image.Scale = 1, () => true);
- AnimationExtensions.Animate(mMyTestIAnimatable, handle, animation, 12, 250, null, null, null);
- isRunning = AnimationExtensions.AnimationIsRunning(mMyTestIAnimatable, handle);
- Assert.IsTrue(isRunning, "Animation should starts properly.");
- abort = AnimationExtensions.AbortAnimation(mMyTestIAnimatable, handle);
- Thread.Sleep(2000);
- Assert.IsTrue(abort, "Animation should stops properly.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check return type of Interpolate.")]
- [Property("SPEC", "Xamarin.Forms.AnimationExtensions.Interpolate M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Interpolate_CHECK_RETURN()
- {
- /* TEST CODE */
- Assert.IsInstanceOf<Func<double, double>>(AnimationExtensions.Interpolate(0.1, 1.0, 0.0, false), "Should be instance of Func<double, double>.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check return type of Interpolate.")]
- [Property("SPEC", "Xamarin.Forms.AnimationExtensions.Animate<T> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Animate_TEMPLATE()
- {
- /* TEST CODE */
- bool isRunning = false;
- MyTestIAnimatable mMyTestIAnimatable = new MyTestIAnimatable();
- var image = new Image();
- var animation = new Animation(v => image.Scale = v, 1, 2);
- animation.Commit(mMyTestIAnimatable, "SimpleAnimation", 16, 2000, Easing.Linear, (v, c) => image.Scale = 1, () => true);
- String handle = "new handle";
- double a = 1.2;
- AnimationExtensions.Animate<Image>(mMyTestIAnimatable, handle, v => image = image, v => a = image.Scale, 16, 255, Easing.Linear, null, null);
- isRunning = AnimationExtensions.AnimationIsRunning(mMyTestIAnimatable, handle);
- Thread.Sleep(2000);
- Assert.IsTrue(isRunning, "Animation should starts properly.");
- }
- }
-}
+++ /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 XamarinForTizen.Tizen;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class AppLinkEntryTests
- {
- private AppLinkEntry _appLinkEntry;
- private string _appResourcePath = Program.Current.DirectoryInfo.Resource;
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("T_appLinkEntry --------------- Setup()");
- _appLinkEntry = new AppLinkEntry();
- }
-
- [TearDown]
- public void TearDown()
- {
- _appLinkEntry = null;
- Console.WriteLine("TSAppLinkEntry --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create an instance of AppLinkEntry.")]
- [Property("SPEC", "Xamarin.Forms.AppLinkEntry.AppLinkEntry C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void AppLinkEntry_INIT()
- {
- /*TEST CODE*/
- var appLinkEntry = new AppLinkEntry();
- Assert.IsNotNull(appLinkEntry, "AppLinkEntry should be not NULL");
- Assert.IsInstanceOf<AppLinkEntry>(appLinkEntry, "appLinkEntry is not instance of AppLinkEntry.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property AppLinkUri is readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.AppLinkEntry.AppLinkUri A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void AppLinkUri_READ_WRITE()
- {
- /*TEST CODE*/
- var uri = new Uri("http://foo.com");
- _appLinkEntry.AppLinkUri = uri;
- Assert.AreEqual(_appLinkEntry.AppLinkUri, uri, "AppLinkUri property should be equal");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property Description is readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.AppLinkEntry.Description A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Description_READ_WRITE()
- {
- /*TEST CODE*/
- string str = "razin";
- _appLinkEntry.Description = str;
- Assert.AreEqual(_appLinkEntry.Description,str, "Description property should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property IsLinkActive is readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.AppLinkEntry.IsLinkActive A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void IsLinkActive_READ_WRITE()
- {
- /*TEST CODE*/
- _appLinkEntry.IsLinkActive = true;
- Assert.IsTrue(_appLinkEntry.IsLinkActive, "IsLinkActive property should set true.");
-
- _appLinkEntry.IsLinkActive = false;
- Assert.IsFalse(_appLinkEntry.IsLinkActive, "IsLinkActive property should set false.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property KeyValues is readable.")]
- [Property("SPEC", "Xamarin.Forms.AppLinkEntry.KeyValues A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void KeyValues_READ_ONLY()
- {
- /*TEST CODE*/
- var getProperty = _appLinkEntry.KeyValues;
- Assert.IsNotNull(getProperty, "getProperty should be not NULL");
- Assert.IsInstanceOf<System.Collections.IDictionary>(getProperty, "getProperty should be an instance of Size type.");
- }
-
-
- [Test]
- [Category("P1")]
- [Description("Check KeyValues property's behavior.")]
- [Property("SPEC", "Xamarin.Forms.AppLinkEntry.KeyValues A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void KeyValues_CHECK_STATUS()
- {
- /*TEST CODE*/
- var getProperty = _appLinkEntry.KeyValues;
- getProperty.Add("contentType", "GalleryPage");
- getProperty.Add("companyName", "Xamarin");
- Assert.AreEqual(getProperty.Count, 2, "KeyValues count should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property Thumbnail is readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.AppLinkEntry.Thumbnail A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Thumbnail_READ_WRITE()
- {
- /*TEST CODE*/
- ImageSource imgSource = ImageSource.FromFile(_appResourcePath + "TED/thumbnail/a.jpg");
- _appLinkEntry.Thumbnail = imgSource;
- Assert.AreEqual(_appLinkEntry.Thumbnail, imgSource, "Thumbnail property should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property Title is readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.AppLinkEntry.Title A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Title_READ_WRITE()
- {
- /*TEST CODE*/
- string title ="SRBD" ;
- _appLinkEntry.Title = title;
- Assert.AreEqual(_appLinkEntry.Title, title, "Title property should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether AppLinkUriProperty is bound or not")]
- [Property("SPEC", "Xamarin.Forms.AppLinkEntry.AppLinkUriProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void AppLinkUriProperty_CHECK_BINDABLE()
- {
- /*TEST CODE*/
- var uri1 = new Uri("http://foo.com");
- var uri2 = new Uri("http://Roo.com");
- _appLinkEntry.AppLinkUri = uri1;
- AppLinkEntry bindingObject = new AppLinkEntry();
- bindingObject.AppLinkUri = uri2;
- Assert.AreNotEqual(_appLinkEntry.AppLinkUri, bindingObject.AppLinkUri, "AppLinkUri of AppLinkEntry value must be different from bindingObject value.");
- _appLinkEntry.BindingContext = bindingObject;
- _appLinkEntry.SetBinding(AppLinkEntry.AppLinkUriProperty, "AppLinkUri");
- Assert.AreEqual(_appLinkEntry.AppLinkUri, bindingObject.AppLinkUri, "AppLinkUri of bindingObject value & AppLinkUri of AppLinkEntry value should be same.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether DescriptionProperty is bound or not.")]
- [Property("SPEC", "Xamarin.Forms.AppLinkEntry.DescriptionProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void DescriptionProperty_CHECK_BINDABLE()
- {
- /*TEST CODE*/
- string strDescription1 = "String1";
- string strDescription2 = "String2";
- _appLinkEntry.Description = strDescription1;
- AppLinkEntry bindingObject = new AppLinkEntry();
- bindingObject.Description = strDescription2;
- Assert.AreNotEqual(_appLinkEntry.Description, bindingObject.Description, "Description of AppLinkEntry value must be different from bindingObject value.");
- _appLinkEntry.BindingContext = bindingObject;
- _appLinkEntry.SetBinding(AppLinkEntry.DescriptionProperty, "Description");
- Assert.AreEqual(_appLinkEntry.Description, bindingObject.Description, "Description of bindingObject value & Description of AppLinkEntry value should be same.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether IsLinkActiveProperty is bound or not.")]
- [Property("SPEC", "Xamarin.Forms.AppLinkEntry.IsLinkActiveProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void IsLinkActiveProperty_CHECK_BINDABLE()
- {
- /*TEST CODE*/
- bool firstIsLinkActive = false;
- bool secondIsLinkActive = true;
- _appLinkEntry.IsLinkActive = firstIsLinkActive;
- AppLinkEntry bindingObject = new AppLinkEntry();
- bindingObject.IsLinkActive = secondIsLinkActive;
- Assert.AreNotEqual(_appLinkEntry.IsLinkActive, bindingObject.IsLinkActive, "IsLinkActive of AppLinkEntry value must be different from bindingObject value.");
- _appLinkEntry.BindingContext = bindingObject;
- _appLinkEntry.SetBinding(AppLinkEntry.IsLinkActiveProperty, "IsLinkActive");
- Assert.AreEqual(_appLinkEntry.IsLinkActive, bindingObject.IsLinkActive, "IsLinkActive of bindingObject value & IsLinkActive of AppLinkEntry value should be same.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ThumbnailProperty is bound or not.")]
- [Property("SPEC", "Xamarin.Forms.AppLinkEntry.ThumbnailProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void ThumbnailProperty_CHECK_BINDABLE()
- {
- /*TEST CODE*/
- ImageSource firstImgSource = ImageSource.FromFile(_appResourcePath + "TED/thumbnail/a.jpg");
- ImageSource secondImgSource = ImageSource.FromFile(_appResourcePath + "TED/thumbnail/b.jpg");
- _appLinkEntry.Thumbnail = firstImgSource;
- AppLinkEntry bindingObject = new AppLinkEntry();
- bindingObject.Thumbnail = secondImgSource;
- Assert.AreNotEqual(_appLinkEntry.Thumbnail, bindingObject.Thumbnail, "Thumbnail of AppLinkEntry value must be different from bindingObject value.");
- _appLinkEntry.BindingContext = bindingObject;
- _appLinkEntry.SetBinding(AppLinkEntry.ThumbnailProperty, "Thumbnail");
- Assert.AreEqual(_appLinkEntry.Thumbnail, bindingObject.Thumbnail, "Thumbnail of bindingObject value & Thumbnail of AppLinkEntry value should be same.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether TitleProperty is bound or not")]
- [Property("SPEC", "Xamarin.Forms.AppLinkEntry.TitleProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void TitleProperty_CHECK_BINDABLE()
- {
- /*TEST CODE*/
- string firstTitle = "FirstTitle";
- string secondTitle = "SecondTitle";
- _appLinkEntry.Title = firstTitle;
- AppLinkEntry bindingObject = new AppLinkEntry();
- bindingObject.Title = secondTitle;
- Assert.AreNotEqual(_appLinkEntry.Title, bindingObject.Title, "Title of AppLinkEntry value must be different from bindingObject value.");
- _appLinkEntry.BindingContext = bindingObject;
- _appLinkEntry.SetBinding(AppLinkEntry.TitleProperty, "Title");
- Assert.AreEqual(_appLinkEntry.Title, bindingObject.Title, "Title of bindingObject value & Title of AppLinkEntry value should be same.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check return type of FromUri.")]
- [Property("SPEC", "Xamarin.Forms.AppLinkEntry.FromUri M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void FromUri_CHECK_RETURN_TYPE()
- {
- var uri = new Uri("http://foo.com");
- var entry = AppLinkEntry.FromUri(uri);
- Assert.IsInstanceOf<AppLinkEntry>(entry, "entry is not instance of AppLinkEntry.");
- Assert.AreEqual(uri, entry.AppLinkUri, "FromUri method return type is not AppLinkEntry.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check return type of ToString.")]
- [Property("SPEC", "Xamarin.Forms.AppLinkEntry.ToString M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void ToString_CHECK_RETURN_TYPE()
- {
- var str = "http://foo.com";
- var uri = new Uri(str);
- var entry = new AppLinkEntry { AppLinkUri = uri };
- Assert.AreEqual(uri.ToString(), entry.ToString(), "ToString method return type is not String.");
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class ApplicationTests
- {
- Application _application = null;
- internal class subApplication : Application
- {
- protected override void OnStart()
- {
- base.OnStart();
- }
- protected override void OnResume()
- {
- base.OnResume();
- }
-
- protected override void OnSleep()
- {
- base.OnSleep();
- }
- }
-
- [SetUp]
- public void setUp()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Application CLASS: Setup---------------------------------");
- _application = new subApplication();
- }
-
- [TearDown]
- public void tearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Application CLASS: Teardown---------------------------------");
- _application = null;
- }
-
- [Test]
- [Category("P1")]
- [Description("Create an Application instance. Check whether object is successfully created or not.")]
- [Property("SPEC", "Xamarin.Forms.Application.Application C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void Application_CONST()
- {
- _application = new subApplication();
- Assert.IsInstanceOf<Application>(_application, "_application is an intance of Application");
- Assert.IsNotNull(_application, "Can't successfully create Application object.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether current application same initialization application or not")]
- [Property("SPEC", "Xamarin.Forms.Application.Current A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void Current_PROPERTY_GET()
- {
- /*TESTCODE*/
- Assert.AreEqual(_application, Application.Current, "Current application instance is not identical with newly created application instance.");
- Assert.AreEqual(_application.Id, Application.Current.Id, "Id property of current application instance is different from initialization application");
- Assert.AreEqual(_application.StyleId, Application.Current.StyleId, "StyleId property of current application instance is different from initialization application");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether set & get MainPage for application instance is correct or not")]
- [Property("SPEC", "Xamarin.Forms.Application.MainPage A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void MainPage_PROPERTY_SET_GET()
- {
- /*PRECONDITION
- * create a page instance and setup for application
- */
- var mPage = new ContentPage()
- {
- BackgroundColor = new Color(0.1, 0.2, 0.3),
- Opacity = 0.5
- };
- /*TEST CODE*/
- _application.MainPage = mPage;
- Assert.AreEqual(mPage, _application.MainPage, "set/get MainPage value isn't same");
- Assert.AreEqual(mPage.BackgroundColor, _application.MainPage.BackgroundColor, "BackgroundColor property page is different");
- Assert.AreEqual(mPage.Opacity, _application.MainPage.Opacity, "Opcaity property page is different");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check return Application configuration")]
- [Property("SPEC", "Xamarin.Forms.Application.On<T> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void On_CONFIGURATION_METHOD()
- {
- /*TEST CODE*/
- var mResouce = new ResourceDictionary();
- _application.Resources = mResouce;
- var myConfig = _application.On<IConfigPlatform>();
- Assert.IsInstanceOf<IPlatformElementConfiguration<IConfigPlatform, Application>>(myConfig, "myConfig should be a instance of IPlatformElementConfiguration");
- Assert.IsInstanceOf<Application>(myConfig.Element, "myConfig.Element should be a instance of Application");
- Assert.AreEqual(mResouce, myConfig.Element.Resources, "Resources of myConfig.Element value & Resources of _application should be to equal");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check whether get AppLinks property of application is correct or not")]
- [Property("SPEC", "Xamarin.Forms.Application.AppLinks A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void AppLinks_PROPERTY_GET()
- {
- Assert.True(false, "[NA] Need to check how to use the API");
- /*TESTCODE*/
- //LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "*******TanTan ="+Program._myapp.AppLinks);
- //Assert.IsInstanceOf<IAppLinks>(Application.Current.AppLinks, "AppLinks property of Current.AppLinks don't must a intance of IAppLinks");
- //Assert.AreEqual(_application.AppLinks, Application.Current.AppLinks, "AppLinks property of current application instance is different from initialization application");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get Properties of application is correct or not")]
- [Property("SPEC", "Xamarin.Forms.Application.Properties A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void Properties_PROPERTY_GET()
- {
- /*PRECONDITION
- */
- var mPage = new ContentPage()
- {
- BackgroundColor = new Color(0.1, 0.2, 0.3),
- Opacity = 0.5
- };
- /*TEST CODE*/
- _application.MainPage = mPage;
- Assert.AreEqual(_application.Properties, Application.Current.Properties, "Properties of current application instance is different from initialization application");
- Assert.AreEqual(_application.Properties.Count, Application.Current.Properties.Count, "Count property of Properties instance is different from initialization application");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether set/get Resources of application is correct or not")]
- [Property("SPEC", "Xamarin.Forms.Application.Resources A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void Resources_PROPERTY_SET_GET()
- {
- /*PRECONDITION
- * create a resource for application
- */
-
- /*TEST CODE*/
- ResourceDictionary mResoure = new ResourceDictionary();
- mResoure.Add("Key", "Value");
- _application.Resources = mResoure;
- Assert.AreEqual(mResoure, _application.Resources, "getting value of Resources property is different from setting value");
- Assert.AreEqual(mResoure.Keys, _application.Resources.Keys, "getting Keys value of Resources property is different from setting value");
- Assert.AreEqual(mResoure.Values, _application.Resources.Values, "getting Keys value of Resources property is different from setting value");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check asynchronously persists the Xamarin.Forms.Application.Properties dictionary for the application object")]
- [Property("SPEC", "Xamarin.Forms.Application.SavePropertiesAsync M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void SavePropertiesAsync_METHOD()
- {
- Assert.True(false, "[NA] Need to check how to use the API");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check whether ModalPopped events can be invoked or not when a view has been popped modally.")]
- [Property("SPEC", "Xamarin.Forms.Application.ModalPopped E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void ModalPopped_CHECK_EVENT()
- {
- /*TEST CODE*/
- Assert.True(false, "[NA]Manual TC.");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check whether ModalPopping events can be invoked or not when a view has been popping modally.")]
- [Property("SPEC", "Xamarin.Forms.Application.ModalPopping E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void ModalPopping_CHECK_EVENT()
- {
- /*TEST CODE*/
- Assert.True(false, "[NA]Manual TC.");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check whether ModalPushed events can be invoked or not when a view has been pushed modally.")]
- [Property("SPEC", "Xamarin.Forms.Application.ModalPushed E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void ModalPushed_CHECK_EVENT()
- {
- /*TEST CODE*/
- Assert.True(false, "[NA]Manual TC.");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check whether ModalPushing events can be invoked or not when a view has been pushing modally.")]
- [Property("SPEC", "Xamarin.Forms.Application.ModalPushing E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void ModalPushing_CHECK_EVENT()
- {
- /*TEST CODE*/
- Assert.True(false, "[NA]Manual TC.");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check whether OnAppLinkRequestReceived method can be invoked or not when a applink is requested")]
- [Property("SPEC", "Xamarin.Forms.Application.OnAppLinkRequestReceived M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void OnAppLinkRequestReceived_OVERRIDE_METHOD()
- {
- /*TEST CODE*/
- Assert.True(false, "[NA]Manual TC.");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check whether OnStart method can be invoked or not when a application is opened")]
- [Property("SPEC", "Xamarin.Forms.Application.OnStart M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void OnStart_OVERRIDE_METHOD()
- {
- /*TEST CODE*/
- Assert.True(false, "[NA]Manual TC.");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check whether OnResume method can be invoked or not when a application is resumed")]
- [Property("SPEC", "Xamarin.Forms.Application.OnResume M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void OnResume_OVERRIDE_METHOD()
- {
- /*TEST CODE*/
- Assert.True(false, "[NA]Manual TC.");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check whether OnSleep method can be invoked or not when a application is sleeped")]
- [Property("SPEC", "Xamarin.Forms.Application.OnSleep M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void OnSleep_OVERRIDE_METHOD()
- {
- /*TEST CODE*/
- Assert.True(false, "[NA]Manual TC.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether InvalidOperationException is thrown when parent is set.")]
- [Property("SPEC", "Xamarin.Forms.Application.OnParentSet M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void OnParentSet_OVERRIDE_METHOD()
- {
- /*TEST CODE*/
- subApplication subApplication = new subApplication();
- try
- {
- var listView = new ListView();
- subApplication.Parent = listView;
- Assert.IsTrue(false, "Expected InvalidOperationException but no exception was thrown.");
- }
- catch (Exception ex)
- {
- Assert.IsTrue(ex is InvalidOperationException, "Expected InvalidOperationException but returned some other exception.");
- }
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.BackButtonPressedEventArgs test")]
- public class BackButtonPressedEventArgsTests
- {
- [SetUp]
- public void Setup()
- {
- Console.WriteLine("BackButtonPressedEventArgsTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("BackButtonPressedEventArgsTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create an BackButtonPressedEventArgs object.")]
- [Property("SPEC", "Xamarin.Forms.BackButtonPressedEventArgs.BackButtonPressedEventArgs C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void BackButtonPressedEventArgs_INIT()
- {
- /* TEST CODE */
- BackButtonPressedEventArgs backButtonPressedEventArgs = new BackButtonPressedEventArgs();
- Assert.IsNotNull(backButtonPressedEventArgs, "BackButtonPressedEventArgs Instance is null");
- Assert.IsInstanceOf<BackButtonPressedEventArgs>(backButtonPressedEventArgs, "Should be an instance of BackButtonPressedEventArgs type.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Handled Property is writeable and readable.")]
- [Property("SPEC", "Xamarin.Forms.BackButtonPressedEventArgs.Handled A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Handled_READ_WRITE()
- {
- /* TEST CODE */
- BackButtonPressedEventArgs backButtonPressedEventArgs = new BackButtonPressedEventArgs();
- backButtonPressedEventArgs.Handled = true;
- Assert.IsTrue(backButtonPressedEventArgs.Handled, "Expected true but returned false.");
-
- backButtonPressedEventArgs.Handled = false;
- Assert.IsFalse(backButtonPressedEventArgs.Handled, "Expected false but returned true.");
- }
- }
-}
+++ /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 Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class BaseMenuItemTests
- {
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("BaseMenuItem --------------- SetUp()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("BaseMenuItem --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a BaseMenuItem instance. Check whether object is successfully created or not")]
- [Property("SPEC", "Xamarin.Forms.BaseMenuItem.BaseMenuItem C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void BaseMenuItem_INIT()
- {
- /* TEST CODE */
- var baseMenuItem = new MenuItem();
- Assert.IsNotNull(baseMenuItem, "Creating a BaseMenuItem object failed. It is set to null");
- }
- }
-}
+++ /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 Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.Behavior test")]
- public class BehaviorTests
- {
- internal class MockBehavior<T> : Behavior<T> where T : BindableObject
- {
- public bool attached;
- public bool detached;
-
- protected override void OnAttachedTo(BindableObject bindable)
- {
- base.OnAttachedTo(bindable);
- attached = true;
- AssociatedObject = bindable;
- }
-
- protected override void OnDetachingFrom(BindableObject bindable)
- {
- detached = true;
- base.OnDetachingFrom(bindable);
- AssociatedObject = null;
- }
-
- public BindableObject AssociatedObject { get; set; }
- }
-
- [SetUp]
- public void Setup()
- {
- Console.WriteLine("BehaviorTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("BehaviorTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the value for AssociatedType.")]
- [Property("SPEC", "Xamarin.Forms.Behavior.AssociatedType A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void AssociatedType_READ_ONLY()
- {
- var behavior = new MockBehavior<Entry>();
- var style = new Style(typeof(Entry))
- {
- Setters = {
- new Setter {Property = Entry.TextProperty, Value = "foo"},
- },
- Triggers = {
- new Trigger (typeof (VisualElement)) {Property = Entry.IsPasswordProperty, Value=true, Setters = {
- new Setter {Property = VisualElement.ScaleProperty, Value = 2d},
- }}
- },
- Behaviors = {
- behavior,
- }
- };
-
- var entry = new Entry { Style = style };
- Assert.IsInstanceOf<Entry>(behavior.AssociatedObject, "AssociatedObject not returning Entry type.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if overriding this method to implement the behaviors is possible.")]
- [Property("SPEC", "Xamarin.Forms.Behavior.OnAttachedTo M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void OnAttachedTo_CHECK()
- {
- var behavior = new MockBehavior<Entry>();
- var style = new Style(typeof(Entry))
- {
- Setters = {
- new Setter {Property = Entry.TextProperty, Value = "foo"},
- },
- Triggers = {
- new Trigger (typeof (VisualElement)) {Property = Entry.IsPasswordProperty, Value=true, Setters = {
- new Setter {Property = VisualElement.ScaleProperty, Value = 2d},
- }}
- },
- Behaviors = {
- behavior,
- }
- };
-
- var entry = new Entry { Style = style };
- Assert.IsTrue(behavior.attached,"Expected true but returning false.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create if overriding this method to remove the behaviors from bindable is possible.")]
- [Property("SPEC", "Xamarin.Forms.Behavior.OnDetachingFrom M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void OnDetachingFrom_CHECK()
- {
- var behavior = new MockBehavior<Entry>();
- var style = new Style(typeof(Entry))
- {
- Setters = {
- new Setter {Property = Entry.TextProperty, Value = "foo"},
- },
- Triggers = {
- new Trigger (typeof (VisualElement)) {Property = Entry.IsPasswordProperty, Value=true, Setters = {
- new Setter {Property = VisualElement.ScaleProperty, Value = 2d},
- }}
- },
- Behaviors = {
- behavior,
- }
- };
-
- var entry = new Entry { Style = style };
- Assert.IsTrue(behavior.attached, "Expected true but returning false.");
- entry.Style = null;
- Assert.IsTrue(behavior.detached, "Expected true but returning false.");
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System.Collections.Generic;
-using System;
-
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.Behavior test")]
- public class BehaviorTemplateTest
- {
- private static bool _flagOnAttachedTo, _flagOnDetachingFrom, _flagOnAttachedToT, _flagOnDetachingFromT;
- private static Entry _flagEntry;
- internal class SubBehavior: Behavior<Entry>
- {
- public SubBehavior() : base()
- {
-
- }
- protected override void OnAttachedTo(BindableObject bindable)
- {
- _flagOnAttachedTo = true;
- base.OnAttachedTo(bindable);
- }
- protected override void OnDetachingFrom(BindableObject bindable)
- {
- base.OnDetachingFrom(bindable);
- _flagOnDetachingFrom = true;
- }
- protected override void OnAttachedTo(Entry bindable)
- {
- base.OnAttachedTo(bindable);
- _flagOnAttachedToT = true;
- _flagEntry = bindable;
- }
- protected override void OnDetachingFrom(Entry bindable)
- {
- base.OnDetachingFrom(bindable);
- _flagOnDetachingFromT = true;
- _flagEntry = bindable;
- }
-
- }
-
- private static SubBehavior _behavior;
-
- [SetUp]
- public void Setup()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Behavior: Setup---------------------------------");
- _flagOnAttachedToT= _flagOnDetachingFromT=_flagOnAttachedTo = _flagOnDetachingFrom = false;
- _behavior = new SubBehavior();
- _flagEntry = null;
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Behavior: Teardown------------------------------");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a Behavior<> instance. Check whether object is successfully created or not.")]
- [Property("SPEC", "Xamarin.Forms.Behavior<T>.Behavior C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Ngo Van Hai, hai.nv3@samsung.com")]
- public void Behavior_INIT()
- {
- /*TEST CODE*/
- SubBehavior behavior = new SubBehavior();
- Assert.NotNull(behavior, "create a Behavior<> is fail");
- }
-
- [Test]
- [Category("P1")]
- [Description("Invoke Attached behavior. Check whether _flagOnAttachedTo value changed to true.")]
- [Property("SPEC", "Xamarin.Forms.Behavior<T>.OnAttachedTo M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Ngo Van Hai, hai.nv3@samsung.com")]
- [Property("COVPARAM", "Xamarin.Forms.BindableObject")]
- public void OnAttachedTo_METHOD()
- {
- /*TEST CODE*/
- var entry = new Entry()
- {
- Placeholder = "Test OnAttachedTo"
- };
- entry.Behaviors.Add(_behavior);
- Assert.IsTrue(_flagOnAttachedTo, "_flagOnAttachedTo should be return true after Attached behavior");
- }
-
- [Test]
- [Category("P1")]
- [Description("Invoke Attached behavior. Check whether _flagOnAttachedToT value changed to true.")]
- [Property("SPEC", "Xamarin.Forms.Behavior<T>.OnAttachedTo M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Ngo Van Hai, hai.nv3@samsung.com")]
- [Property("COVPARAM", "T")]
- public void OnAttachedTo_METHOD_T()
- {
- /*TEST CODE*/
- var entry = new Entry()
- {
- Placeholder = "Test OnAttachedTo Entry"
- };
- entry.Behaviors.Add(_behavior);
- Assert.IsTrue(_flagOnAttachedToT, "_flagOnAttachedToT should be return true after Attached behavior");
- Assert.AreEqual(entry,_flagEntry);
- }
-
- [Test]
- [Category("P1")]
- [Description("Invoke Detaching behavior. Check whether _flagOnDetachingFrom value changed to true.")]
- [Property("SPEC", "Xamarin.Forms.Behavior<T>.OnDetachingFrom M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Ngo Van Hai, hai.nv3@samsung.com")]
- [Property("COVPARAM", "Xamarin.Forms.BindableObject")]
- public void OnDetachingFrom_METHOD()
- {
- /*TEST CODE*/
- var entry = new Entry()
- {
- Placeholder = "Test OnDetachingFrom"
- };
- entry.Behaviors.Add(_behavior);
- entry.Behaviors.Remove(_behavior);
- Assert.IsTrue(_flagOnDetachingFrom, "_flagOnDetachingFrom should be return true after Detaching behavior");
- }
-
- [Test]
- [Category("P1")]
- [Description("Invoke Detaching behavior. Check whether _flagOnDetachingFrom value changed to true.")]
- [Property("SPEC", "Xamarin.Forms.Behavior<T>.OnDetachingFrom M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Ngo Van Hai, hai.nv3@samsung.com")]
- [Property("COVPARAM", "T")]
- public void OnDetachingFrom_METHOD_T()
- {
- /*TEST CODE*/
- var entry = new Entry()
- {
- Placeholder = "Test OnDetachingFrom Entry"
- };
- entry.Behaviors.Add(_behavior);
- entry.Behaviors.Remove(_behavior);
- Assert.IsTrue(_flagOnDetachingFromT, "_flagOnDetachingFromT should be return true after Detaching behavior");
- Assert.AreEqual(entry,_flagEntry);
- }
-
- }
-}
+++ /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 System.Runtime.CompilerServices;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- public class CustomBindableObject : BindableObject
- {
- public bool _flagOnBindingContextChanged { get; set; }
- public bool _flagOnPropertyChanged { get; set; }
- public bool _flagOnPropertyChanging { get; set; }
-
- public static readonly BindableProperty TextProperty = BindableProperty.Create<CustomBindableObject, string>(
- b => b.Text, "default", BindingMode.TwoWay);
-
- public string Text
- {
- get { return (string)GetValue(TextProperty); }
- set { SetValue(TextProperty, value); }
- }
-
- public CustomBindableObject() : base()
- {
- ;
- }
-
- protected override void OnBindingContextChanged()
- {
- base.OnBindingContextChanged();
- _flagOnBindingContextChanged = true;
- }
-
- protected override void OnPropertyChanged([CallerMemberName] string propertyName = null)
- {
- base.OnPropertyChanged(propertyName);
- _flagOnPropertyChanged = true;
- }
-
- protected override void OnPropertyChanging([CallerMemberName] string propertyName = null)
- {
- base.OnPropertyChanging(propertyName);
- _flagOnPropertyChanging = true;
-
- }
- }
-
- [TypeConverter(typeof(ToBarConverter))]
- internal class Bar
- {
-
- }
-
- internal class Baz
- {
-
- }
-
- internal class MockBindable : StackLayout
- {
- public static readonly BindableProperty TextProperty = BindableProperty.Create<MockBindable, string>(
- b => b.Text, "default", BindingMode.TwoWay);
-
- public string Text
- {
- get { return (string)GetValue(TextProperty); }
- set { SetValue(TextProperty, value); }
- }
-
- public string Foo { get; set; }
-
- public int TargetInt { get; set; }
-
- public readonly BindableProperty BarProperty =
- BindableProperty.Create<MockBindable, Bar>(w => w.Bar, default(Bar));
-
- public Bar Bar
- {
- get { return (Bar)GetValue(BarProperty); }
- set { SetValue(BarProperty, value); }
- }
-
- public readonly BindableProperty BazProperty =
- BindableProperty.Create<MockBindable, Baz>(w => w.Baz, default(Baz));
-
- [TypeConverter(typeof(ToBazConverter))]
- public Baz Baz
- {
- get { return (Baz)GetValue(BazProperty); }
- set { SetValue(BazProperty, value); }
- }
-
- public readonly BindableProperty QuxProperty =
- BindableProperty.Create<MockBindable, Baz>(w => w.Qux, default(Baz));
-
- public Baz Qux
- {
- get { return (Baz)GetValue(QuxProperty); }
- set { SetValue(QuxProperty, value); }
- }
-
- public void ApplyBindings()
- {
- base.ApplyBindings();
- }
-
- public void UnapplyBindings()
- {
-
- base.UnapplyBindings();
- }
- }
-
- internal class ToBarConverter : TypeConverter
- {
- public override object ConvertFrom(System.Globalization.CultureInfo culture, object value)
- {
- return new Bar();
- }
- }
-
- internal class ToBazConverter : TypeConverter
- {
- public override object ConvertFrom(System.Globalization.CultureInfo culture, object value)
- {
- return new Baz();
- }
- }
-
- [TestFixture]
- [Description("Xamarin.Forms.BindableObject Tests")]
- public class BindableObjectTests
- {
- public CustomBindableObject _customBindableObject;
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("BindableObjectTests --------------- Setup()");
- _customBindableObject = new CustomBindableObject();
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("BindableObjectTests --------------- TearDown()");
- }
-
- private void TestGetValueDefault(BindableProperty property)
- {
- var mock = new MockBindable();
- object value = mock.GetValue(property);
- Assert.AreEqual(property.DefaultValue, value, "Should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a new BindableObject instance.")]
- [Property("SPEC", "Xamarin.Forms.BindableObject.BindableObject C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void BindableObject_INIT()
- {
- /* TEST CODE */
- CustomBindableObject bindableObject = new CustomBindableObject();
-
- Assert.IsNotNull(bindableObject, "Object should be not null after initialize");
- Assert.IsInstanceOf<BindableObject>(bindableObject, "Should be an instance of BindableObject.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the BindingContextProperty property is readable.")]
- [Property("SPEC", "Xamarin.Forms.BindableObject.BindingContextProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void BindingContextProperty_READ()
- {
- /* TEST CODE */
- var label = new Label();
- var view = new StackLayout { Children = { label } };
-
- view.BindingContext = new { item0 = "Foo", item1 = "Bar" };
- label.SetBinding(BindableObject.BindingContextProperty, "item0");
- label.SetBinding(Label.TextProperty, new Binding("."));
-
- Assert.AreEqual(label.BindingContext, label.GetValue(BindableObject.BindingContextProperty), "Should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether BindingContext property is biandable or not.")]
- [Property("SPEC", "Xamarin.Forms.BindableObject.BindingContext A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void BindingContext_READ_WRITE()
- {
- /* TEST CODE */
- var mock = new MockBindable();
- Assert.IsNull(mock.BindingContext, "Should be null.");
-
- object obj = new object();
- mock.BindingContext = obj;
- Assert.AreSame(obj, mock.BindingContext, "Should be same.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of ClearValue.")]
- [Property("SPEC", "Xamarin.Forms.BindableObject.ClearValue M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Property("COVPARAM", "Xamarin.Forms.BindableProperty")]
- public void ClearValue_CHECK_RETURN()
- {
- /* TEST CODE */
- const string value = "foo";
- var mock = new MockBindable();
- mock.SetValue(MockBindable.TextProperty, value);
- Assert.AreEqual(value, mock.GetValue(MockBindable.TextProperty), "Set and Get doesn't work successfully.");
-
- mock.ClearValue(MockBindable.TextProperty);
- TestGetValueDefault(MockBindable.TextProperty);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of ClearValue.")]
- [Property("SPEC", "Xamarin.Forms.BindableObject.ClearValue M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Property("COVPARAM", "Xamarin.Forms.BindablePropertyKey")]
- public void ClearValue_PROPERTYKEY_CHECK_RETURN()
- {
- /* TEST CODE */
- var bindablePropertyKey = BindableProperty.CreateReadOnly<MockBindable, string>(w => w.Foo, "DefaultValue");
- var bindableProperty = bindablePropertyKey.BindableProperty;
- var bindable = new MockBindable();
- Assert.AreEqual("DefaultValue", bindable.GetValue(bindableProperty), "Should be equal.");
-
- bindable.SetValue(bindablePropertyKey, "Bar");
- Assert.AreEqual("Bar", bindable.GetValue(bindableProperty), "Should be equal.");
-
- bindable.ClearValue(bindablePropertyKey);
- Assert.AreEqual("DefaultValue", bindable.GetValue(bindableProperty), "Should be DefaultValue, after ClearValue.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of GetValue.")]
- [Property("SPEC", "Xamarin.Forms.BindableObject.GetValue M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void GetValue_CHECK_RETURN()
- {
- /* TEST CODE */
- var nulldefault = BindableProperty.Create<MockBindable, string>(w => w.Foo, null);
- TestGetValueDefault(nulldefault);
-
- var foodefault = BindableProperty.Create<MockBindable, string>(w => w.Foo, "Foo");
- TestGetValueDefault(foodefault);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of RemoveBinding.")]
- [Property("SPEC", "Xamarin.Forms.BindableObject.RemoveBinding M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void RemoveBinding_CHECK_RETURN()
- {
- /* TEST CODE */
- var label = new Label();
- label.BindingContext = new { foo = "Foo", bar = "Bar" };
- label.SetBinding(Label.TextProperty, new Binding("foo"));
- Assert.AreEqual("Foo", label.Text, "After Binding, Value should be equal.");
-
- try
- {
- label.RemoveBinding(Label.TextProperty);
- }
- catch (Exception ex)
- {
- Assert.True(false, "Should not throw any exception while RemoveBinding, but has thrown with the message : " + ex.ToString());
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of SetBinding.")]
- [Property("SPEC", "Xamarin.Forms.BindableObject.SetBinding M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void SetBinding_CHECK_RETURN()
- {
- /* TEST CODE */
- var label = new Label();
- label.BindingContext = new { foo = "Foo", bar = "Bar" };
- label.SetBinding(Label.TextProperty, new Binding("foo"));
-
- Assert.AreEqual("Foo", label.Text, "After Binding, Value should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of SetValue.")]
- [Property("SPEC", "Xamarin.Forms.BindableObject.SetValue M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Property("COVPARAM", "Xamarin.Forms.BindableProperty, object")]
- public void SetValue_CHECK_RETURN()
- {
- /* TEST CODE */
- const string value = "foo";
- var mock = new MockBindable();
- mock.SetValue(MockBindable.TextProperty, value);
-
- Assert.AreEqual(value, mock.GetValue(MockBindable.TextProperty), "Set and Get doesn't work successfully.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of SetValue.")]
- [Property("SPEC", "Xamarin.Forms.BindableObject.SetValue M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Property("COVPARAM", "Xamarin.Forms.BindablePropertyKey, object")]
- public void SetValue_PROPERTYKEY_CHECK_RETURN()
- {
- /* TEST CODE */
- var bindablePropertyKey = BindableProperty.CreateReadOnly<MockBindable, string>(w => w.Foo, "DefaultValue");
- var bindableProperty = bindablePropertyKey.BindableProperty;
- var bindable = new MockBindable();
- Assert.AreEqual("DefaultValue", bindable.GetValue(bindableProperty), "Should be equal.");
-
- bindable.SetValue(bindablePropertyKey, "Bar");
-
- Assert.AreEqual("Bar", bindable.GetValue(bindableProperty), "Should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether BindingContextChanged Event is raised when a property is changed.")]
- [Property("SPEC", "Xamarin.Forms.BindableObject.BindingContextChanged E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void BindingContextChanged_EVENT()
- {
- /* TEST CODE */
- bool flagBindingContextChanged = false;
- var mock = new MockBindable();
- mock.BindingContextChanged += (sender, args) => flagBindingContextChanged = true;
-
- mock.BindingContext = new object();
-
- Assert.IsTrue(flagBindingContextChanged, "Event value changed should be handled.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether PropertyChanged Event is raised when a property is changed.")]
- [Property("SPEC", "Xamarin.Forms.BindableObject.PropertyChanged E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void PropertyChanged_EVENT()
- {
- /* TEST CODE */
- const string value = "foo";
- bool flagPropertyChanged = false;
-
- var mock = new MockBindable();
- mock.PropertyChanged += (sender, args) =>
- {
- Assert.AreEqual(MockBindable.TextProperty.PropertyName, args.PropertyName);
- Assert.AreEqual(value, mock.GetValue(MockBindable.TextProperty));
- flagPropertyChanged = true;
- };
-
- mock.SetValue(MockBindable.TextProperty, value);
-
- Assert.IsTrue(flagPropertyChanged, "Event value changed should be handled.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether PropertyChanging Event is raised when a property is changed.")]
- [Property("SPEC", "Xamarin.Forms.BindableObject.PropertyChanging E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void PropertyChanging_EVENT()
- {
- /* TEST CODE */
- var mock = new MockBindable();
- bool flagPropertyChanging = false;
-
- mock.PropertyChanging += (sender, args) =>
- {
- Assert.AreEqual(MockBindable.TextProperty.PropertyName, args.PropertyName);
- Assert.AreEqual(MockBindable.TextProperty.DefaultValue, mock.GetValue(MockBindable.TextProperty));
- flagPropertyChanging = true;
- };
-
- mock.SetValue(MockBindable.TextProperty, "foo");
-
- Assert.IsTrue(flagPropertyChanging, "Event value changed should be handled.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OnBindingContextChanged Invoke or not.")]
- [Property("SPEC", "Xamarin.Forms.BindableObject.OnBindingContextChanged M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void OnBindingContextChanged_INVOKE_CHECK()
- {
- /* TEST CODE */
- var customBindableObject = new CustomBindableObject();
- customBindableObject._flagOnBindingContextChanged = false;
- customBindableObject.BindingContext = new object();
- Assert.IsTrue(customBindableObject._flagOnBindingContextChanged, "OnBindingContextChanged does not invoked.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OnPropertyChanged Invoke or not.")]
- [Property("SPEC", "Xamarin.Forms.BindableObject.OnPropertyChanged M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void OnPropertyChanged_INVOKE_CHECK()
- {
- /* TEST CODE */
- var customBindableObject = new CustomBindableObject();
- customBindableObject._flagOnPropertyChanged = false;
-
- const string value = "foo";
- customBindableObject.SetValue(CustomBindableObject.TextProperty, value);
-
- Assert.IsTrue(customBindableObject._flagOnPropertyChanged, "OnPropertyChanged does not invoked.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OnPropertyChanging Invoke or not.")]
- [Property("SPEC", "Xamarin.Forms.BindableObject.OnPropertyChanging M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void OnPropertyChanging_INVOKE_CHECK()
- {
- /* TEST CODE */
- var customBindableObject = new CustomBindableObject();
- customBindableObject._flagOnPropertyChanging = false;
-
- const string value = "foo";
- customBindableObject.SetValue(CustomBindableObject.TextProperty, value);
-
- Assert.IsTrue(customBindableObject._flagOnPropertyChanging, "OnPropertyChanging does not invoked.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check ApplyBindings return value.")]
- [Property("SPEC", "Xamarin.Forms.BindableObject.ApplyBindings M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void ApplyBindings_CHECK_RETURN()
- {
- /* TEST CODE */
-
- var mock = new MockBindable();
- bool isCalled = false;
- mock.BindingContext = new { foo = "Foo", bar = "Bar" };
- Binding binding = new Binding("foo"); // Binding is an inherited class of BindingBase class.
- mock.SetBinding(MockBindable.TextProperty, binding);
-
- /*
- * ApplyBindings Set the IsApplied as true.
- * IsApplied is an internal property of BindingBase class.
- */
-
- mock.ApplyBindings();
- try
- {
- /*
- * Mode property of BindingBase first called ThrowIfApplied method before the set the Mode.
- * ThrowIfApplied check that is the IsApplied property is true or false.
- * If IsApplied property is false then do nothing. just return.
- * If IsApplied property is true then it throw InvalidOperationException.
- */
- binding.Mode = BindingMode.OneWayToSource;
- }
- catch(InvalidOperationException IOEx)
- {
- /*
- * If InvalidOperationException raises then ApplyBindings Pass.
- */
- isCalled = true;
- }
-
- Assert.True(isCalled, "ApplyBindings is not successfully called.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check UnapplyBindings return value.")]
- [Property("SPEC", "Xamarin.Forms.BindableObject.UnapplyBindings M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void UnapplyBindings_CHECK_RETURN()
- {
- /* TEST CODE */
- var mock = new MockBindable();
- bool isCalledApplyBindings = false;
- bool isCalledUnapplyBindings = false;
- mock.BindingContext = new { foo = "Foo", bar = "Bar" };
- Binding binding = new Binding("foo"); // Binding is an inherited class of BindingBase class.
- mock.SetBinding(MockBindable.TextProperty, binding);
-
- /*
- * ApplyBindings Set the IsApplied as true.
- * IsApplied is an internal property of BindingBase class.
- */
-
- mock.ApplyBindings();
- try
- {
- /*
- * Mode property of BindingBase first called ThrowIfApplied method before the set the Mode.
- * ThrowIfApplied check that is the IsApplied property is true or false.
- * If IsApplied property is false then do nothing. just return.
- * If IsApplied property is true then it throw InvalidOperationException.
- */
- binding.Mode = BindingMode.OneWayToSource;
- }
- catch (InvalidOperationException IOEx)
- {
- /*
- * If InvalidOperationException raises then ApplyBindings successfully set the IsApplied as true.
- */
- isCalledApplyBindings = true;
- }
-
- /*
- * UnapplyBindings Set the IsApplied as false.
- * IsApplied is an internal property of BindingBase class.
- */
-
- mock.UnapplyBindings();
- try
- {
- /*
- * Mode property of BindingBase first called ThrowIfApplied method before the set the Mode.
- * ThrowIfApplied check that is the IsApplied property is true or false.
- * If IsApplied property is false then do nothing. just return.
- * If IsApplied property is true then it throw InvalidOperationException.
- */
- binding.Mode = BindingMode.OneWayToSource;
- /*
- * If this line execute then no InvalidOperationException has been raised.
- * Which means UnapplyBindings successfully set the IsApplied property as false.
- * So UnapplyBindings pass.
- */
- isCalledUnapplyBindings = true;
- }
- catch (InvalidOperationException IOEx)
- {
- isCalledUnapplyBindings = false;
- }
-
- Assert.True(isCalledApplyBindings, "ApplyBindings is not successfully called.");
- Assert.True(isCalledUnapplyBindings, "UnapplyBindings is not successfully called.");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check SetInheritedBindingContext return value.")]
- [Property("SPEC", "Xamarin.Forms.BindableObject.SetInheritedBindingContext M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void SetInheritedBindingContext_CHECK_RETURN()
- {
- /* TEST CODE */
- Assert.True(false, "[NA] Need to check API behavior");
- }
- }
-}
+++ /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;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class BindableObjectExtensionsTests
- {
- [SetUp]
- public void Setup()
- {
- Console.WriteLine("BindableObjectExtensionsTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("BindableObjectExtensionsTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Creates and applies a binding to a property")]
- [Property("SPEC", "Xamarin.Forms.BindableObjectExtensions.SetBinding M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void SetBinding_CHECK_NO_EXCEPTION()
- {
- /* TEST CODE */
- Label label = new Label()
- {
- Text = "BindableObjectExtensions"
- };
- VisualElement visualElement = new ContentPage();
- var mFirstHeightRequestProperty = 22.00;
- visualElement.HeightRequest = mFirstHeightRequestProperty;
-
- try
- {
- BindableObjectExtensions.SetBinding(label, VisualElement.HeightRequestProperty, "Tizen");
- Assert.IsTrue(true, "Set Binding shoud not throw exception.");
- }
- catch (Exception ex)
- {
- Assert.IsTrue(false, "Set Binding shoud not throw exception. Exception: " + ex.Message);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Creates and applies a binding to a property")]
- [Property("SPEC", "Xamarin.Forms.BindableObjectExtensions.SetBinding M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MEX")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void SetBinding_CHECK_EXCEPTION_WITH_NULL_PARAM()
- {
- /* TEST CODE */
- VisualElement visualElement = new ContentPage();
- var mFirstHeightRequestProperty = 22.00;
- visualElement.HeightRequest = mFirstHeightRequestProperty;
-
- try
- {
- BindableObjectExtensions.SetBinding(null, VisualElement.HeightRequestProperty, "Tizen");
- }
- catch (Exception ex)
- {
- Assert.IsInstanceOf<ArgumentNullException>(ex, "ArgumentNullException should be thrown.");
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Creates and applies a binding to a property")]
- [Property("SPEC", "Xamarin.Forms.BindableObjectExtensions.SetBinding M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void SetBinding_CHECK_NO_EXCEPTION_WITH_BINDINGMODE()
- {
- /* TEST CODE */
- Label label = new Label()
- {
- Text = "BindableObjectExtensions"
- };
- VisualElement visualElement = new ContentPage();
- var mFirstHeightRequestProperty = 22.00;
- visualElement.HeightRequest = mFirstHeightRequestProperty;
-
- try
- {
- BindableObjectExtensions.SetBinding(label, VisualElement.HeightRequestProperty, "Tizen", BindingMode.Default, null, null);
- }
- catch (Exception ex)
- {
- Assert.IsTrue(false, "SetBinding shoud not throw exception. Exception: " + ex.Message);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Creates and applies a binding to a property")]
- [Property("SPEC", "Xamarin.Forms.BindableObjectExtensions.SetBinding M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MEX")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void SetBinding_CHECK_EXCEPTION_WITH_NULL_PARAM_WITH_BINDINGMODE()
- {
- /* TEST CODE */
- VisualElement visualElement = new ContentPage();
- var mFirstHeightRequestProperty = 22.00;
- visualElement.HeightRequest = mFirstHeightRequestProperty;
-
- try
- {
- BindableObjectExtensions.SetBinding(null, VisualElement.HeightRequestProperty, "Tizen", BindingMode.Default, null, null);
- }
- catch (Exception ex)
- {
- Assert.IsInstanceOf<ArgumentNullException>(ex, "ArgumentNullException should be thrown.");
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Creates and applies a binding from an expression.")]
- [Property("SPEC", "Xamarin.Forms.BindableObjectExtensions.SetBinding<TSource> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MEX")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void SetBinding_CHECK_NO_EXCEPTION_WITH_EXPRESSION()
- {
- /* TEST CODE */
- Label label = new Label()
- {
- Text = "BindableObjectExtensions"
- };
- VisualElement visualElement = new ContentPage();
- var mFirstHeightRequestProperty = 22.00;
- visualElement.HeightRequest = mFirstHeightRequestProperty;
-
- try
- {
- BindableObjectExtensions.SetBinding<Button>(label, VisualElement.HeightRequestProperty, b => b.Text, BindingMode.Default);
- }
- catch (Exception ex)
- {
- Assert.IsInstanceOf<ArgumentNullException>(ex, "ArgumentNullException should not be thrown.");
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Creates and applies a binding to a property")]
- [Property("SPEC", "Xamarin.Forms.BindableObjectExtensions.SetBinding M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MEX")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void SetBinding_CHECK_EXCEPTION_WITH_NULL_PARAM_WITH_EXPRESSION()
- {
- /* TEST CODE */
- Label label = new Label()
- {
- Text = "BindableObjectExtensions"
- };
- VisualElement visualElement = new ContentPage();
- var mFirstHeightRequestProperty = 22.00;
- visualElement.HeightRequest = mFirstHeightRequestProperty;
-
- try
- {
- BindableObjectExtensions.SetBinding<Button>(null, VisualElement.HeightRequestProperty, b => b.Text, BindingMode.Default);
- }
- catch (Exception ex)
- {
- Assert.IsInstanceOf<ArgumentNullException>(ex, "ArgumentNullException should be thrown.");
- }
- }
- }
-}
+++ /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;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class BindablePropertyTests
- {
- [SetUp]
- public void Setup()
- {
- Console.WriteLine("BindablePropertyTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("BindablePropertyTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the type declaring the BindableProperty.")]
- [Property("SPEC", "Xamarin.Forms.BindableProperty.DeclaringType A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void DeclaringType_READ_ONLY()
- {
- /* TEST CODE */
- BindableProperty bindableProperty = BindableProperty.Create("Tizen", typeof(string), typeof(string), "TizenNew", BindingMode.Default, null, null,
- null, null, null);
- Assert.IsInstanceOf<Type>(bindableProperty.DeclaringType, "Should be instance of Type.");
- Assert.AreEqual(bindableProperty.DeclaringType, typeof(string), "Not returning expected type.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the value for BindingMode.")]
- [Property("SPEC", "Xamarin.Forms.BindableProperty.DefaultBindingMode A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void DefaultBindingMode_READ_ONLY()
- {
- /* TEST CODE */
- BindableProperty bindableProperty = BindableProperty.Create("Tizen", typeof(string), typeof(string), "TizenNew", BindingMode.TwoWay, null, null,
- null, null, null);
- Assert.IsInstanceOf<BindingMode>(bindableProperty.DefaultBindingMode, "Should be instance of BindingMode.");
- Assert.AreEqual(bindableProperty.DefaultBindingMode, BindingMode.TwoWay, "Not returning expected Value.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the value for BindableProperty.")]
- [Property("SPEC", "Xamarin.Forms.BindableProperty.DefaultValue A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void DefaultValue_READ_ONLY()
- {
- /* TEST CODE */
- BindableProperty bindableProperty = BindableProperty.Create("Tizen", typeof(string), typeof(string), "TizenNew", BindingMode.TwoWay, null, null,
- null, null, null);
- Assert.IsInstanceOf<Object>(bindableProperty.DefaultValue, "Should be instance of Object.");
- Assert.AreEqual(bindableProperty.DefaultValue, "TizenNew", "Not returning expected Value.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if BindableProperty is created form a BindablePropertyKey.")]
- [Property("SPEC", "Xamarin.Forms.BindableProperty.IsReadOnly A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void IsReadOnly_READ_ONLY()
- {
- /* TEST CODE */
- BindableProperty bindableProperty = BindableProperty.Create("Tizen", typeof(string), typeof(string), "TizenNew", BindingMode.TwoWay, null, null,
- null, null, null);
- Assert.IsInstanceOf<Boolean>(bindableProperty.IsReadOnly, "Should be instance of Boolean.");
- Assert.IsFalse(bindableProperty.IsReadOnly, "BindableProperty should not be readonly.");
-
- BindableProperty secondBindableProperty = VisualElement.HeightProperty;
- Assert.IsInstanceOf<Boolean>(secondBindableProperty.IsReadOnly, "Should be instance of Boolean.");
- Assert.IsTrue(secondBindableProperty.IsReadOnly, "BindableProperty should be readonly.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the property name.")]
- [Property("SPEC", "Xamarin.Forms.BindableProperty.PropertyName A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void PropertyName_READ_ONLY()
- {
- /* TEST CODE */
- BindableProperty bindableProperty = BindableProperty.Create("Tizen", typeof(string), typeof(string), "TizenNew", BindingMode.TwoWay, null, null,
- null, null, null);
- Assert.IsInstanceOf<String>(bindableProperty.PropertyName, "Should be instance of String.");
- Assert.AreEqual(bindableProperty.PropertyName, "Tizen", "Not returning proper value.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the type of the BindableProperty.")]
- [Property("SPEC", "Xamarin.Forms.BindableProperty.ReturnType A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void ReturnType_READ_ONLY()
- {
- /* TEST CODE */
- BindableProperty bindableProperty = BindableProperty.Create("Tizen", typeof(string), typeof(string), "TizenNew", BindingMode.TwoWay, null, null,
- null, null, null);
- Assert.IsInstanceOf<Type>(bindableProperty.ReturnType, "Should be instance of Type.");
- Assert.AreEqual(bindableProperty.ReturnType, typeof(string), "Not returning proper Value.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Creates a new instance of the BindableProperty class.")]
- [Property("SPEC", "Xamarin.Forms.BindableProperty.Create M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Create_CHECK_INSTANCE_CREATE_DEFAULT_VALUE_DELEGATE()
- {
- /* TEST CODE */
- var bindableProperty = BindableProperty.Create("Tizen", typeof(string), typeof(string), "TizenNew", BindingMode.TwoWay, null, null,
- null, null, null);
- Assert.IsNotNull(bindableProperty, "Instance is null");
- Assert.IsInstanceOf<BindableProperty>(bindableProperty, "Should be instance of BindableProperty.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Creates a new instance of the BindableProperty class.")]
- [Property("SPEC", "Xamarin.Forms.BindableProperty.Create M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Create_CHECK_INSTANCE_STRING()
- {
- /* TEST CODE */
- var bindableProperty = BindableProperty.Create("Tizen", typeof(string), typeof(string), "TizenNew", BindingMode.TwoWay, null, null,
- null, null);
- Assert.IsNotNull(bindableProperty, "BindableProperty instance is null");
- Assert.IsInstanceOf<BindableProperty>(bindableProperty, "Should be instance of BindableProperty.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Creates a new instance of the BindableProperty class.")]
- [Property("SPEC", "Xamarin.Forms.BindableProperty.Create<TDeclarer,TPropertyType> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Create_CHECK_INSTANCE_EXPRESSION()
- {
- /* TEST CODE */
- var bindableProperty = BindableProperty.Create<Button, string>(b => b.Text, null, BindingMode.TwoWay);
- Assert.IsNotNull(bindableProperty, "BindableProperty instance is null");
- Assert.IsInstanceOf<BindableProperty>(bindableProperty, "Should be instance of BindableProperty.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Creates a new instance of the BindableProperty class.")]
- [Property("SPEC", "Xamarin.Forms.BindableProperty.Create<TDeclarer,TPropertyType> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Create_CHECK_INSTANCE_EXPRESSION_CREATE_DEFAULT_VALUE_DELEGATE()
- {
- /* TEST CODE */
- BindableProperty.ValidateValueDelegate<string> validateValueDelegate = (b, v) => true;
- BindableProperty.BindingPropertyChangedDelegate<string> changedDelegate = (b, ov, nv) => { };
- BindableProperty.BindingPropertyChangingDelegate<string> changingDelegate = (b, ov, nv) => { };
- BindableProperty.CoerceValueDelegate<string> coerceValueDelegate = (bindable, value) => value;
-
- var bindableProperty = BindableProperty.Create<Button, string>(b => b.Text, null, BindingMode.TwoWay, validateValueDelegate, changedDelegate, changingDelegate, coerceValueDelegate);
- Assert.IsNotNull(bindableProperty, "BindableProperty instance is null");
- Assert.IsInstanceOf<BindableProperty>(bindableProperty, "Should be instance of BindableProperty.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Creates a new instance of the BindableProperty class for an attached property.")]
- [Property("SPEC", "Xamarin.Forms.BindableProperty.CreateAttached M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void CreateAttached_CHECK_INSTANCE_CREATE_DEFAULT_VALUE_DELEGATE()
- {
- /* TEST CODE */
- var bindableProperty = BindableProperty.CreateAttached("Tizen", typeof(string), typeof(string), "TizenNew");
- Assert.IsNotNull(bindableProperty, "BindableProperty instance is null");
- Assert.IsInstanceOf<BindableProperty>(bindableProperty, "Should be instance of BindableProperty.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Creates a new instance of the BindableProperty class for an attached property.")]
- [Property("SPEC", "Xamarin.Forms.BindableProperty.CreateAttached M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void CreateAttached_CHECK_INSTANCE_STRING()
- {
- /* TEST CODE */
- BindableProperty.ValidateValueDelegate validateValueDelegate = (b, v) => true;
- BindableProperty.BindingPropertyChangedDelegate changedDelegate = (b, ov, nv) => { };
- BindableProperty.BindingPropertyChangingDelegate changingDelegate = (b, ov, nv) => { };
- BindableProperty.CoerceValueDelegate coerceValueDelegate = (bindable, value) => value;
-
- var bindableProperty = BindableProperty.CreateAttached("Tizen", typeof(string), typeof(string), "TizenNew", BindingMode.TwoWay, validateValueDelegate, changedDelegate, changingDelegate, coerceValueDelegate);
- Assert.IsNotNull(bindableProperty, "BindableProperty instance is null");
- Assert.IsInstanceOf<BindableProperty>(bindableProperty, "Should be instance of BindableProperty.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Creates a new instance of the BindableProperty class for an attached property.")]
- [Property("SPEC", "Xamarin.Forms.BindableProperty.CreateAttached<TDeclarer,TPropertyType> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void CreateAttached_CHECK_INSTANCE_EXPRESSION()
- {
- /* TEST CODE */
- var bindableProperty = BindableProperty.CreateAttached<Button, object>(b => b.GetValue(VisualElement.HeightProperty), "Tizen", BindingMode.TwoWay);
- Assert.IsNotNull(bindableProperty, "BindableProperty instance is null");
- Assert.IsInstanceOf<BindableProperty>(bindableProperty, "Should be instance of BindableProperty.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Creates a new instance of the BindableProperty class for an attached property.")]
- [Property("SPEC", "Xamarin.Forms.BindableProperty.CreateAttached<TDeclarer,TPropertyType> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void CreateAttached_CHECK_INSTANCE_EXPRESSION_CREATE_DEFAULT_VALUE_DELEGATE()
- {
- /* TEST CODE */
- BindableProperty.ValidateValueDelegate<object> validateValueDelegate = (b, v) => true;
- BindableProperty.BindingPropertyChangedDelegate<object> changedDelegate = (b, ov, nv) => { };
- BindableProperty.BindingPropertyChangingDelegate<object> changingDelegate = (b, ov, nv) => { };
- BindableProperty.CoerceValueDelegate<object> coerceValueDelegate = (bindable, value) => value;
-
- var bindableProperty = BindableProperty.CreateAttached<Button, object>(b => b.GetValue(VisualElement.HeightProperty), "Tizen", BindingMode.TwoWay, validateValueDelegate, changedDelegate, changingDelegate, coerceValueDelegate, null);
- Assert.IsNotNull(bindableProperty, "BindableProperty instance is null");
- Assert.IsInstanceOf<BindableProperty>(bindableProperty, "Should be instance of BindableProperty.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Creates a new instance of the BindableProperty class for attached read-only properties.")]
- [Property("SPEC", "Xamarin.Forms.BindableProperty.CreateAttachedReadOnly M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void CreateAttachedReadOnly_CHECK_INSTANCE_CREATE_DEFAULT_VALUE_DELEGATE()
- {
- /* TEST CODE */
- var bindableProperty = BindableProperty.CreateAttachedReadOnly("Tizen", typeof(string), typeof(string), "TizenNew", BindingMode.TwoWay);
- Assert.IsNotNull(bindableProperty, "BindableProperty instance is null");
- Assert.IsInstanceOf<BindablePropertyKey>(bindableProperty, "Should be instance of BindableProperty.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Creates a new instance of the BindableProperty class for attached read-only properties.")]
- [Property("SPEC", "Xamarin.Forms.BindableProperty.CreateAttachedReadOnly M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void CreateAttachedReadOnly_CHECK_INSTANCE_STRING()
- {
- /* TEST CODE */
- BindableProperty.ValidateValueDelegate validateValueDelegate = (b, v) => true;
- BindableProperty.BindingPropertyChangedDelegate changedDelegate = (b, ov, nv) => { };
- BindableProperty.BindingPropertyChangingDelegate changingDelegate = (b, ov, nv) => { };
- BindableProperty.CoerceValueDelegate coerceValueDelegate = (bindable, value) => value;
-
- var bindableProperty = BindableProperty.CreateAttachedReadOnly("Tizen", typeof(string), typeof(string), "TizenNew", BindingMode.TwoWay, validateValueDelegate, changedDelegate, changingDelegate, coerceValueDelegate);
- Assert.IsNotNull(bindableProperty, "BindableProperty instance is null");
- Assert.IsInstanceOf<BindablePropertyKey>(bindableProperty, "Should be instance of BindableProperty.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Creates a new instance of the BindableProperty class for attached read-only properties.")]
- [Property("SPEC", "Xamarin.Forms.BindableProperty.CreateAttachedReadOnly<TDeclarer,TPropertyType> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void CreateAttachedReadOnly_CHECK_INSTANCE_EXPRESSION()
- {
- /* TEST CODE */
- BindableProperty.ValidateValueDelegate<object> validateValueDelegate = (b, v) => true;
- BindableProperty.BindingPropertyChangedDelegate<object> changedDelegate = (b, ov, nv) => { };
- BindableProperty.BindingPropertyChangingDelegate<object> changingDelegate = (b, ov, nv) => { };
- BindableProperty.CoerceValueDelegate<object> coerceValueDelegate = (bindable, value) => value;
-
- var bindableProperty = BindableProperty.CreateAttachedReadOnly<Button, object>(b => b.GetValue(VisualElement.HeightProperty), "Tizen", BindingMode.TwoWay, validateValueDelegate, changedDelegate, changingDelegate, coerceValueDelegate);
- Assert.IsNotNull(bindableProperty, "BindableProperty instance is null");
- Assert.IsInstanceOf<BindablePropertyKey>(bindableProperty, "Should be instance of BindableProperty.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Creates a new instance of the BindableProperty class for attached read-only properties.")]
- [Property("SPEC", "Xamarin.Forms.BindableProperty.CreateAttachedReadOnly<TDeclarer,TPropertyType> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void CreateAttachedReadOnly_CHECK_INSTANCE_EXPRESSION_CREATE_DEFAULT_VALUE_DELEGATE()
- {
- /* TEST CODE */
- var bindableProperty = BindableProperty.CreateAttachedReadOnly<Button, object>(b => b.GetValue(VisualElement.HeightProperty), "Tizen", BindingMode.TwoWay);
- Assert.IsNotNull(bindableProperty, "BindableProperty instance is null");
- Assert.IsInstanceOf<BindablePropertyKey>(bindableProperty, "Should be instance of BindableProperty.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Creates a new instance of the BindablePropertyKey class.")]
- [Property("SPEC", "Xamarin.Forms.BindableProperty.CreateReadOnly M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void CreateReadOnly_CHECK_INSTANCE_CREATE_DEFAULT_VALUE_DELEGATE()
- {
- /* TEST CODE */
- var bindableProperty = BindableProperty.CreateReadOnly("Tizen", typeof(string), typeof(string), "TizenNew", BindingMode.TwoWay);
- Assert.IsNotNull(bindableProperty, "BindableProperty instance is null");
- Assert.IsInstanceOf<BindablePropertyKey>(bindableProperty, "Should be instance of BindableProperty.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Creates a new instance of the BindablePropertyKey class.")]
- [Property("SPEC", "Xamarin.Forms.BindableProperty.CreateReadOnly M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void CreateReadOnly_CHECK_INSTANCE_STRING()
- {
- /* TEST CODE */
- BindableProperty.ValidateValueDelegate validateValueDelegate = (b, v) => true;
- BindableProperty.BindingPropertyChangedDelegate changedDelegate = (b, ov, nv) => { };
- BindableProperty.BindingPropertyChangingDelegate changingDelegate = (b, ov, nv) => { };
- BindableProperty.CoerceValueDelegate coerceValueDelegate = (bindable, value) => value;
-
- var bindableProperty = BindableProperty.CreateReadOnly("Tizen", typeof(string), typeof(string), "TizenNew", BindingMode.TwoWay, validateValueDelegate, changedDelegate, changingDelegate, coerceValueDelegate);
- Assert.IsNotNull(bindableProperty, "BindableProperty instance is null");
- Assert.IsInstanceOf<BindablePropertyKey>(bindableProperty, "Should be instance of BindableProperty.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Creates a new instance of the BindablePropertyKey class.")]
- [Property("SPEC", "Xamarin.Forms.BindableProperty.CreateReadOnly<TDeclarer,TPropertyType> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void CreateReadOnly_CHECK_INSTANCE_EXPRESSION()
- {
- /* TEST CODE */
- BindableProperty.ValidateValueDelegate<string> validateValueDelegate = (b, v) => true;
- BindableProperty.BindingPropertyChangedDelegate<string> changedDelegate = (b, ov, nv) => { };
- BindableProperty.BindingPropertyChangingDelegate<string> changingDelegate = (b, ov, nv) => { };
- BindableProperty.CoerceValueDelegate<string> coerceValueDelegate = (bindable, value) => value;
-
- var bindableProperty = BindableProperty.CreateReadOnly<Button, string>(b => b.Text, "Tizen", BindingMode.TwoWay, validateValueDelegate, changedDelegate, changingDelegate, coerceValueDelegate);
- Assert.IsNotNull(bindableProperty, "BindableProperty instance is null");
- Assert.IsInstanceOf<BindablePropertyKey>(bindableProperty, "Should be instance of BindableProperty.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Creates a new instance of the BindablePropertyKey class.")]
- [Property("SPEC", "Xamarin.Forms.BindableProperty.CreateReadOnly<TDeclarer,TPropertyType> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void CreateReadOnly_CHECK_INSTANCE_EXPRESSION_CREATE_DEFAULT_VALUE_DELEGATE()
- {
- /* TEST CODE */
- var bindableProperty = BindableProperty.CreateReadOnly<Button, string>(b => b.Text, "Tizen", BindingMode.TwoWay);
- Assert.IsNotNull(bindableProperty, "BindableProperty instance is null");
- Assert.IsInstanceOf<BindablePropertyKey>(bindableProperty, "Should be instance of BindableProperty.");
- }
- }
-}
+++ /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;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class BindablePropertyConverterTests
- {
- [SetUp]
- public void Setup()
- {
- Console.WriteLine("BindablePropertyConverterTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("BindablePropertyConverterTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Creates a BindablePropertyConverter with default values")]
- [Property("SPEC", "Xamarin.Forms.BindablePropertyConverter.BindablePropertyConverter C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void BindablePropertyConverter_INIT()
- {
- /* TEST CODE */
- BindablePropertyConverter bindablePropertyConverter = new BindablePropertyConverter();
- Assert.IsNotNull(bindablePropertyConverter, "Instance BindablePropertyConverter is null");
- Assert.IsInstanceOf<BindablePropertyConverter>(bindablePropertyConverter);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of ConvertFromInvariantString.")]
- [Property("SPEC", "Xamarin.Forms.BindablePropertyConverter.ConvertFromInvariantString M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void ConvertFromInvariantString_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- BindablePropertyConverter bindablePropertyConverter = new BindablePropertyConverter();
- var returnValue = bindablePropertyConverter.ConvertFromInvariantString("VisualElement.Height");
- Assert.IsNotNull(returnValue, "ConvertFromInvariantString is returning NULL.");
- Assert.IsInstanceOf<BindableProperty>(returnValue, "Should be an instance of BindableProperty 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 System;
-using NUnit.Framework;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class BindablePropertyKeyTests
- {
- [SetUp]
- public void Setup()
- {
- Console.WriteLine("BindablePropertyKeyTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("BindablePropertyKeyTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the BindableProperty's get value.")]
- [Property("SPEC", "Xamarin.Forms.BindablePropertyKey.BindableProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void BindableProperty_READ_ONLY()
- {
- /* TEST CODE */
- BindablePropertyKey bindablePropertyKey = BindableProperty.CreateReadOnly<Button, string>(b => b.Text, "DefaultValue");
- Assert.IsNotNull(bindablePropertyKey, "Object instance is null.");
- Assert.IsInstanceOf<BindableProperty>(bindablePropertyKey.BindableProperty, "Should be instance of BindablePropertyKey.");
- }
- }
-}
+++ /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 System.Globalization;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class BindingTests
- {
- [SetUp]
- public void Setup()
- {
- Console.WriteLine("BindingTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("BindingTests --------------- TearDown()");
- }
-
- public class CustomColor
- {
-
- public CustomColor(Color color)
- {
- FColor = color;
- }
-
- public Color FColor
- {
- get;
- set;
- }
- }
-
- class CustomIValueConverter : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- if (value is Color)
- return new CustomColor((Color)value);
- return value;
- }
-
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- if (value is CustomColor)
- return ((CustomColor)value).FColor;
- return value;
-
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a new instance of the Binding class.")]
- [Property("SPEC", "Xamarin.Forms.Binding.Binding C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Binding_INIT_WITH_NO_PARAM()
- {
- /* TEST CODE */
- Binding binding = new Binding("Tizen", BindingMode.TwoWay);
- Assert.IsNotNull(binding, "Instance of Binding is null");
- Assert.IsInstanceOf<Binding>(binding, "Instance should be of Binding type.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a new instance of the Binding class.")]
- [Property("SPEC", "Xamarin.Forms.Binding.Binding C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Property("COVPARAM", "string, Xamarin.Forms.BindingMode, Xamarin.Forms.IValueConverter, object, string, object")]
- public void Binding_INIT_WITH_STRING()
- {
- /* TEST CODE */
- Binding binding = new Binding("Tizen", BindingMode.TwoWay, null, "TizenNew", "TizenXamaring");
- Assert.IsNotNull(binding, "Instance of Binding is null");
- Assert.IsInstanceOf<Binding>(binding, "Instance should be of Binding type.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a new instance of the Binding class.")]
- [Property("SPEC", "Xamarin.Forms.Binding.Binding C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Property("COVPARAM", "string, Xamarin.Forms.BindingMode, Xamarin.Forms.IValueConverter, object, string, object")]
- public void Binding_INIT_WITH_OBJECT()
- {
- /* TEST CODE */
- Binding binding = new Binding("Tizen", BindingMode.TwoWay, null, "TizenNew", "TizenXamaring", "Xamarin");
- Assert.IsNotNull(binding, "Instance of Binding is null");
- Assert.IsInstanceOf<Binding>(binding, "Instance should be of Binding type.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Sets or gets the converter to be used for this binding.")]
- [Property("SPEC", "Xamarin.Forms.Binding.Converter A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Converter_READ_WRITE()
- {
- /* TEST CODE */
- Binding binding = new Binding("Tizen", BindingMode.TwoWay);
- CustomIValueConverter customIValueConverter = new CustomIValueConverter();
- binding.Converter = customIValueConverter;
- Assert.IsNotNull(binding, "Instance of Binding is null");
- Assert.IsInstanceOf<CustomIValueConverter>(binding.Converter, "Not an instance of CustomIValueConverter.");
- Assert.AreEqual(binding.Converter, customIValueConverter, "Set and get values are not equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ConverterParameter Property is writeable and readable.")]
- [Property("SPEC", "Xamarin.Forms.Binding.ConverterParameter A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void ConverterParameter_READ_WRITE()
- {
- /* TEST CODE */
- Label label = new Label();
- label.Text = "Tizen";
- Binding binding = new Binding("Tizen", BindingMode.TwoWay);
- binding.ConverterParameter = label;
- Assert.IsNotNull(binding, "Instance of Binding is null");
- Assert.IsInstanceOf<Label>(binding.ConverterParameter, "Instance should be of Label type.");
- Assert.AreEqual(binding.ConverterParameter, label, "Set and get values are not equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Path Property is writeable and readable.")]
- [Property("SPEC", "Xamarin.Forms.Binding.Path A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Path_READ_WRITE()
- {
- /* TEST CODE */
- Binding binding = new Binding("Tizen", BindingMode.TwoWay);
- binding.Path = "Tizen";
- Assert.IsNotNull(binding, "Instance of Binding is null");
- Assert.IsInstanceOf<String>(binding.Path, "Not an instance of String.");
- Assert.AreEqual(binding.Path, "Tizen", "Set and get values are not equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Source Property is writeable and readable.")]
- [Property("SPEC", "Xamarin.Forms.Binding.Source A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Source_READ_WRITE()
- {
- /* TEST CODE */
- Label label = new Label();
- label.Text = "Tizen";
- Binding binding = new Binding("Tizen", BindingMode.TwoWay);
- binding.Source = label;
- Assert.IsNotNull(binding, "Instance of Binding is null");
- Assert.IsInstanceOf<Label>(binding.Source, "Not an instance of Label.");
- Assert.AreEqual(binding.Source, label, "Set and get values are not equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a binding from an expression, instead of a property name.")]
- [Property("SPEC", "Xamarin.Forms.Binding.Create<TSource> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Create_CHECK_INSTANCE()
- {
- /* TEST CODE */
- Binding binding = Binding.Create<Button>(b => b.Text, BindingMode.TwoWay, null, "Tizen", "TizenNew");
- Assert.IsNotNull(binding, "Binding instance is null");
- Assert.IsInstanceOf<Binding>(binding, "Should be instance of BindableProperty.");
- }
- }
-}
+++ /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;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
-
- internal class CustomLabel: Label
- {
- public new void ApplyBindings()
- {
- base.ApplyBindings();
- }
-
- public new void UnapplyBindings()
- {
- base.UnapplyBindings();
- }
- }
- [TestFixture]
- public class BindingBaseTests
- {
- private static BindingBase bindingBase;
- [SetUp]
- public void Setup()
- {
- bindingBase = new Binding();
- Console.WriteLine("BindingBaseTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- bindingBase = null;
- Console.WriteLine("BindingBaseTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Mode Property is writeable and readable.")]
- [Property("SPEC", "Xamarin.Forms.BindingBase.Mode A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRE")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Mode_READ_WRITE()
- {
- /* TEST CODE */
- bindingBase.Mode = BindingMode.Default;
- Assert.IsNotNull(bindingBase, "Instance of BindingBase is null.");
- Assert.IsInstanceOf<BindingBase>(bindingBase, "Instance is not BindingBase Type.");
- Assert.AreEqual(bindingBase.Mode, BindingMode.Default, "Not returning BindingMode Default.");
-
- bindingBase.Mode = BindingMode.OneWay;
- Assert.AreEqual(bindingBase.Mode, BindingMode.OneWay, "Not returning BindingMode OneWay.");
-
- bindingBase.Mode = BindingMode.OneWayToSource;
- Assert.AreEqual(bindingBase.Mode, BindingMode.OneWayToSource, "Not returning BindingMode OneWayToSource.");
-
- bindingBase.Mode = BindingMode.TwoWay;
- Assert.AreEqual(bindingBase.Mode, BindingMode.TwoWay, "Not returning BindingMode TwoWay.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether StringFormat Property is writeable and readable.")]
- [Property("SPEC", "Xamarin.Forms.BindingBase.StringFormat A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void StringFormat_READ_WRITE()
- {
- /* TEST CODE */
- bindingBase.StringFormat = "Tizen";
- Assert.IsNotNull(bindingBase, "Instance of Binding is null");
- Assert.IsInstanceOf<BindingBase>(bindingBase, "Instance is not BindingBase Type.");
- Assert.AreEqual(bindingBase.StringFormat, "Tizen", "Not returning expected String.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Stops the synchronization on the collection.")]
- [Property("SPEC", "Xamarin.Forms.BindingBase.DisableCollectionSynchronization M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void DisableCollectionSynchronization_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- string[] nameArray = new[] { "foo", "bar" };
- object context = new object();
- CollectionSynchronizationCallback callback = (collection, o, method, access) => { };
- BindingBase.EnableCollectionSynchronization(nameArray, context, callback);
-
- try
- {
- BindingBase.DisableCollectionSynchronization(nameArray);
- }
- catch (Exception ex)
- {
- Assert.IsTrue(false, "DisableCollectionSynchronization should not return any exception. Exception: " + ex.Message);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Starts synchronization on the collection.")]
- [Property("SPEC", "Xamarin.Forms.BindingBase.EnableCollectionSynchronization M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void EnableCollectionSynchronization_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- string[] nameArray = new[] { "foo", "bar" };
- object context = new object();
- CollectionSynchronizationCallback callback = (collection, o, method, access) => { };
-
- try
- {
- BindingBase.EnableCollectionSynchronization(nameArray, context, callback);
- }
- catch (Exception ex)
- {
- Assert.IsTrue(false, "EnableCollectionSynchronization should not return any exception. Exception: " + ex.Message);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if throws an InvalidOperationException if the binding has been applied.")]
- [Property("SPEC", "Xamarin.Forms.BindingBase.ThrowIfApplied M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void ThrowIfApplied_CHECK()
- {
- /* TEST CODE */
- try
- {
- var label = new CustomLabel();
- label.BindingContext = new { foo = "Foo", bar = "Bar" };
- Binding binding = new Binding("foo");
- label.SetBinding(Label.TextProperty, binding);
- binding.Mode = BindingMode.OneWay;
- label.ApplyBindings();
- Assert.IsTrue(false, "Binding not applied.");
- }
- catch (Exception ex)
- {
- Assert.IsTrue(ex is InvalidOperationException, "Expected InvalidOperationException but returned some other exception.");
- }
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.BindingCondition Tests")]
- public class BindingConditionTests
- {
- private BindingCondition _bindingCondition;
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("BindingConditionTests --------------- Setup()");
- _bindingCondition = new BindingCondition();
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("BindingConditionTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create an BindingCondition instance.")]
- [Property("SPEC", "Xamarin.Forms.BindingCondition.BindingCondition C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void BindingCondition_INIT()
- {
- /* TEST CODE */
- var bindingCondition = new BindingCondition();
- Assert.IsNotNull(bindingCondition, "Object is null after initialize");
- Assert.IsInstanceOf<BindingCondition>(bindingCondition);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Binding is readable and writable with valid values for Binding")]
- [Property("SPEC", "Xamarin.Forms.BindingCondition.Binding A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi , ef.razi@samsung.com")]
- public void Binding_READ_WRITE()
- {
- /* TEST CODE */
- _bindingCondition.Binding = new Binding("Default",BindingMode.Default,null,null,null);
- Assert.AreEqual(BindingMode.Default, _bindingCondition.Binding.Mode);
-
- _bindingCondition.Binding = new Binding("OneWay", BindingMode.OneWay, null, null, null);
- Assert.AreEqual(BindingMode.OneWay, _bindingCondition.Binding.Mode);
-
- _bindingCondition.Binding = new Binding("OneWayToSource", BindingMode.OneWayToSource, null, null, null);
- Assert.AreEqual(BindingMode.OneWayToSource, _bindingCondition.Binding.Mode);
-
- _bindingCondition.Binding = new Binding("TwoWay", BindingMode.TwoWay, null, null, null);
- Assert.AreEqual(BindingMode.TwoWay, _bindingCondition.Binding.Mode);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Value is readable and writable with objects")]
- [Property("SPEC", "Xamarin.Forms.BindingCondition.Value A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi , ef.razi@samsung.com")]
- public void Value_READ_WRITE()
- {
- /* TEST CODE */
- _bindingCondition.Value = "BindingCondition";
- Assert.IsNotNull(_bindingCondition.Value);
- Assert.AreEqual("BindingCondition", (String)_bindingCondition.Value);
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.BindingTypeConverter Tests")]
- class BindingTypeConverterTests
- {
- private BindingTypeConverter _bindingTypeConverter;
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("BindingTypeConverterTests --------------- Setup()");
- _bindingTypeConverter = new BindingTypeConverter();
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("BindingTypeConverterTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create an BindingTypeConverter instance.")]
- [Property("SPEC", "Xamarin.Forms.BindingTypeConverter.BindingTypeConverter C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void BindingTypeConverter_INIT()
- {
- /* TEST CODE */
- var bindingTypeConverter = new BindingTypeConverter();
- Assert.IsNotNull(bindingTypeConverter, "Object is null after initialize");
- Assert.IsInstanceOf<BindingTypeConverter>(bindingTypeConverter, "Instance should be BindingTypeConverter type.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Converts a property path to a binding.")]
- [Property("SPEC", "Xamarin.Forms.BindingTypeConverter.ConvertFromInvariantString M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void ConvertFromInvariantString_CHECK_RETURN()
- {
- /* TEST CODE */
- var binding = _bindingTypeConverter.ConvertFromInvariantString("Path");
- Assert.IsInstanceOf<Binding>(binding, "Object need to Binding type");
- Assert.AreEqual("Path", ((Binding)binding).Path,"Binding Path missmatch");
- Assert.AreEqual(BindingMode.Default, ((Binding)binding).Mode,"Binding mode should be Default");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.BoundsConstraint Tests")]
- class BoundsConstraintTests
- {
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("BoundsConstraintTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("BoundsConstraintTests --------------- TearDown()");
- }
-
- Rectangle getRet()
- {
- return new Rectangle();
- }
-
- [Test]
- [Category("P1")]
- [Description("Returns a BoundsConstraint object that contains the compiled version of expression and is relative to either parents or the views referred to in expression.")]
- [Property("SPEC", "Xamarin.Forms.BoundsConstraint.FromExpression M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void FromExpression_CHECK_RETURN()
- {
- /* TEST CODE */
- System.Collections.Generic.List<View> viewList = new System.Collections.Generic.List<View>();
- viewList.Add(new BoxView());
- viewList.Add(new ContentView());
- System.Collections.Generic.IEnumerable<View> views = viewList;
-
- Rectangle re = new Rectangle();
- var boundsConstraint = BoundsConstraint.FromExpression(()=>re, views);
- Assert.IsInstanceOf<BoundsConstraint>(boundsConstraint, "Object need to BoundsConstraint 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 System;
-using Xamarin.Forms;
-using NUnit.Framework;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.BoundsTypeConverter Tests")]
- class BoundsTypeConverterTests
- {
- private BoundsTypeConverter _boundsTypeConverter;
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("BoundsTypeConverterTests --------------- Setup()");
- _boundsTypeConverter = new BoundsTypeConverter();
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("BoundsTypeConverterTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create an BoundsTypeConverter instance.")]
- [Property("SPEC", "Xamarin.Forms.BoundsTypeConverter.BoundsTypeConverter C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void BoundsTypeConverter_INIT()
- {
- /* TEST CODE */
- var boundsTypeConverter = new BoundsTypeConverter();
- Assert.IsNotNull(boundsTypeConverter, "Object is null after initialize");
- Assert.IsInstanceOf<BoundsTypeConverter>(boundsTypeConverter);
- }
-
- //[Test]
- [Category("P1")]
- [Description("Returns a Boolean value that indicates whether this BindingTypeConverter can convert sourceType to Binding.")]
- [Property("SPEC", "Xamarin.Forms.BoundsTypeConverter.CanConvertFrom M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void CanConvertFrom_CHECK_RETURN()
- {
- /* TEST CODE */
-
- bool canConvert = _boundsTypeConverter.CanConvertFrom(typeof(String));
- Assert.IsTrue(canConvert);
- }
-
-
- [Test]
- [Category("P1")]
- [Description("Converts a property path to a binding.")]
- [Property("SPEC", "Xamarin.Forms.BoundsTypeConverter.ConvertFromInvariantString M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void ConvertFromInvariantString_CHECK_RETURN()
- {
- /* TEST CODE */
- var rect = _boundsTypeConverter.ConvertFromInvariantString("2.0,3.0,5.5,3.5");
-
- Assert.IsInstanceOf<Rectangle>(rect, "Object need to Binding type");
- Assert.AreEqual(2.0, ((Rectangle)rect).X, "X position missmatch");
- Assert.AreEqual(3.0, ((Rectangle)rect).Y, "Y position missmatch");
- Assert.AreEqual(5.5, ((Rectangle)rect).Width, "Width missmatch");
- Assert.AreEqual(3.5, ((Rectangle)rect).Height, "Height missmatch");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- public class CustomBoxView : BoxView
- {
- public Boolean _flagIsOnSizeRequest = false;
- protected override SizeRequest OnSizeRequest(double widthConstraint, double heightConstraint)
- {
- _flagIsOnSizeRequest = true;
- return base.OnSizeRequest(widthConstraint, heightConstraint);
- }
- }
-
- [TestFixture]
- [Description("Xamarin.Forms.BoxView Tests")]
- public class BoxViewTests
- {
- private BoxView _boxView;
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("BoxViewTests --------------- Setup()");
- _boxView = new BoxView();
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("BoxViewTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a BoxView instance.")]
- [Property("SPEC", "Xamarin.Forms.BoxView.BoxView C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void BoxView_INIT()
- {
- /* TEST CODE */
- var boxView = new BoxView();
- Assert.IsNotNull(boxView, "Object is null after initialize");
- Assert.IsInstanceOf<BoxView>(boxView);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Color is readable and writable with valid values for color(r,g,b).")]
- [Property("SPEC", "Xamarin.Forms.BoxView.Color A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Color_READ_WRITE()
- {
- /* TEST CODE */
- _boxView.Color = Color.Red;
- Assert.IsInstanceOf<Color>(_boxView.Color, "Should be instance of Color.");
- Assert.AreEqual(Color.Red, _boxView.Color, "Color doesn't set and get successfully.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ColorProperty property bound or not")]
- [Property("SPEC", "Xamarin.Forms.BoxView.ColorProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void ColorProperty_READ_ONLY()
- {
- /* TEST CODE */
- _boxView.Color = Color.Green;
- BoxView mBoxview = new BoxView();
- mBoxview.Color = Color.Gray;
- Assert.AreNotEqual(mBoxview.Color, _boxView.Color, "ColorProperty value must be different.");
- _boxView.BindingContext = mBoxview;
- _boxView.SetBinding(BoxView.ColorProperty, "Color");
- Assert.AreEqual(mBoxview.Color, _boxView.Color, "After binding, value should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OnSizeRequest is invoked or not.")]
- [Property("SPEC", "Xamarin.Forms.BoxView.OnSizeRequest M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void OnSizeRequest_CHECK_RETURN()
- {
- /*TEST CODE*/
- CustomBoxView customBoxView = new CustomBoxView();
- customBoxView.GetSizeRequest(double.PositiveInfinity, double.PositiveInfinity);
- Assert.IsTrue(customBoxView._flagIsOnSizeRequest, "OnSizeRequest method didn't invoke.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check return BoxView configuration")]
- [Property("SPEC", "Xamarin.Forms.BoxView.On<T> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void On_CONFIGURATION_METHOD()
- {
- /*TEST CODE*/
- var mResouce = new ResourceDictionary();
- _boxView.Resources = mResouce;
- var myConfig = _boxView.On<IConfigPlatform>();
- Assert.IsInstanceOf<IPlatformElementConfiguration<IConfigPlatform, BoxView>>(myConfig, "Should be an instance of IPlatformElementConfiguration");
- Assert.IsInstanceOf<BoxView>(myConfig.Element, "Should be an instance of BoxView");
- Assert.AreEqual(mResouce, myConfig.Element.Resources, "Resources of myConfig.Element value & Resources of _boxView should be to equal");
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class ButtonContentLayoutTests
- {
-
- [SetUp]
- public void SetUp()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "ButtonContentLayout CLASS: Setup---------------------------------");
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "ButtonContentLayout CLASS: Teardown---------------------------------");
- }
-
- [Test]
- [Category("P1")]
- [Description("Creates a new Button and ButtonContentLayout with the specified position and spacing.")]
- [Property("SPEC", "Xamarin.Forms.Button.ButtonContentLayout.ButtonContentLayout C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void ButtonContentLayout_INIT()
- {
- /* TEST CODE */
- var buttonContentLayout = new Button.ButtonContentLayout(Button.ButtonContentLayout.ImagePosition.Bottom, 5.0);
- Assert.IsNotNull(buttonContentLayout, "Object is null after initialize");
- Assert.IsInstanceOf<Button.ButtonContentLayout>(buttonContentLayout);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the enumeration values that is set in time of Button Content Layout creation.")]
- [Property("SPEC", "Xamarin.Forms.Button.ButtonContentLayout.Position A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Position_READ_ONLY()
- {
- /* TEST CODE */
- var positionBottom = new Button.ButtonContentLayout(Button.ButtonContentLayout.ImagePosition.Bottom, 5.0);
- Assert.IsNotNull(positionBottom, "Object is null after initialize");
- Assert.AreEqual(positionBottom.Position, Button.ButtonContentLayout.ImagePosition.Bottom, "Image position of positionBottom should be Bottom.");
-
- var positionLeft = new Button.ButtonContentLayout(Button.ButtonContentLayout.ImagePosition.Left, 5.0);
- Assert.IsNotNull(positionLeft, "Object is null after initialize");
- Assert.AreEqual(positionLeft.Position, Button.ButtonContentLayout.ImagePosition.Left, "Image position of positionBottom should be Left.");
-
- var positionRight = new Button.ButtonContentLayout(Button.ButtonContentLayout.ImagePosition.Right, 5.0);
- Assert.IsNotNull(positionRight, "Object is null after initialize");
- Assert.AreEqual(positionRight.Position, Button.ButtonContentLayout.ImagePosition.Right, "Image position of positionBottom should be Right.");
-
- var positionTop = new Button.ButtonContentLayout(Button.ButtonContentLayout.ImagePosition.Top, 5.0);
- Assert.IsNotNull(positionTop, "Object is null after initialize");
- Assert.AreEqual(positionTop.Position, Button.ButtonContentLayout.ImagePosition.Top, "Image position of positionBottom should be Top.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Gets the spacing to use between the image and text.")]
- [Property("SPEC", "Xamarin.Forms.Button.ButtonContentLayout.Spacing A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Spacing_READ_ONLY()
- {
- /* TEST CODE */
- var spacing = new Button.ButtonContentLayout(Button.ButtonContentLayout.ImagePosition.Bottom, 5.0);
- Assert.IsNotNull(spacing, "Object is null after initialize");
- Assert.AreEqual(spacing.Spacing, 5.0, "Image spacing of spacing should be 5.0.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if returns a string represention of this Button+ButtonContentLayout object.")]
- [Property("SPEC", "Xamarin.Forms.Button.ButtonContentLayout.ToString M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void ToString_CHECK_RETURN_TYPE()
- {
- var uri = "Image Position = Bottom, Spacing = 5";
- var buttonContentLayout = new Button.ButtonContentLayout(Button.ButtonContentLayout.ImagePosition.Bottom, 5);
- Assert.AreEqual(uri.ToString(), buttonContentLayout.ToString(), "ToString method return type is not returning expected value.");
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class ButtonContentTypeConverterTests
- {
- [SetUp]
- public void SetUp()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "ButtonContentTypeConverter CLASS: Setup---------------------------------");
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "ButtonContentTypeConverter CLASS: Teardown---------------------------------");
- }
-
- [Test]
- [Category("P1")]
- [Description("Creates a new ButtonContentLayout object.")]
- [Property("SPEC", "Xamarin.Forms.Button.ButtonContentTypeConverter.ButtonContentTypeConverter C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void ButtonContentTypeConverter_INIT()
- {
- /* TEST CODE */
- var buttonContentTypeConverter = new Button.ButtonContentTypeConverter();
- Assert.IsNotNull(buttonContentTypeConverter, "Object is null after initialize");
- Assert.IsInstanceOf<Button.ButtonContentTypeConverter>(buttonContentTypeConverter);
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class ButtonTests
- {
- Button _button;
- static bool _flagOnBindingContext, _flagOnPropertyChanging;
- internal class subButton : Button
- {
- protected override void OnBindingContextChanged()
- {
- base.OnBindingContextChanged();
- _flagOnBindingContext = true;
- }
-
- protected override void OnPropertyChanging(string propertyName = null)
- {
- base.OnPropertyChanging(propertyName);
- _flagOnPropertyChanging = true;
- }
- }
- [SetUp]
- public void SetUp()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Button CLASS: Setup---------------------------------");
- _button = new Button();
- _flagOnBindingContext = _flagOnPropertyChanging = false;
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Button CLASS: Teardown---------------------------------");
- _button = null;
- }
-
- [Test]
- [Category("P1")]
- [Description(" Create a Button instance. Check whether object is successfully created or not.")]
- [Property("SPEC", "Xamarin.Forms.Button.Button C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void Button_CONST()
- {
- /*TEST CODE*/
- _button = new Button();
- Assert.IsNotNull(_button, "Can't create success object Button");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of BorderColor are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.Button.BorderColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void BorderColor_PROPERTY_SET_GET()
- {
- /*TEST CODE*/
- var mColorTest01 = Color.FromRgb(123, 245, 255);
- var mColorTest02 = Color.FromRgb(255, 255, 0);
- _button.BorderColor = mColorTest01;
- Assert.AreEqual(mColorTest01, _button.BorderColor, "Retrieved BorderColor value is not equal to the set value.");
- Assert.AreEqual(mColorTest01.R, _button.BorderColor.R, "Retrieved R property of BorderColor object should be equal to the set value.");
- Assert.AreEqual(mColorTest01.G, _button.BorderColor.G, "Retrieved G property of BorderColor object should be equal to the set value.");
- Assert.AreEqual(mColorTest01.B, _button.BorderColor.B, "Retrieved B property of BorderColor object should be equal to the set value.");
- _button.BorderColor = mColorTest02;
- Assert.AreEqual(mColorTest02, _button.BorderColor, "BorderColor getting value is not equal to setting value");
- Assert.AreEqual(mColorTest02.R, _button.BorderColor.R, "Retrieved R property of BorderColor object should be equal to the set value.");
- Assert.AreEqual(mColorTest02.G, _button.BorderColor.G, "Retrieved G property of BorderColor object should be equal to the set value.");
- Assert.AreEqual(mColorTest02.B, _button.BorderColor.B, "Retrieved B property of BorderColor object should be equal to the set value.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of BorderRadius are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.Button.BorderRadius A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void BorderRadius_PROPERTY_SET_GET()
- {
- /*TEST CODE*/
- var mRadius01 = 2;
- var mRadius02 = 102;
- _button.BorderRadius = mRadius01;
- Assert.AreEqual(mRadius01, _button.BorderRadius, "Retrieved BorderRadius value is not equal to set value");
- _button.BorderRadius = mRadius02;
- Assert.AreEqual(mRadius02, _button.BorderRadius, "Retrieved BorderRadius value is not equal to set value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of BorderWidth are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.Button.BorderWidth A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void BorderWidth_PROPERTY_SET_GET()
- {
- /*TEST CODE*/
- var mBorderWith01 = 0.2;
- var mBorderWith02 = 1.6;
- _button.BorderWidth = mBorderWith01;
- Assert.AreEqual(mBorderWith01, _button.BorderWidth, "Retrieved BorderWidth value is not equal to set value");
- _button.BorderWidth = mBorderWith02;
- Assert.AreEqual(mBorderWith02, _button.BorderWidth, "Retrieved BorderWidth value is not equal to set value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of Command are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.Button.Command A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void Command_PROPERTY_SET_GET()
- {
- /*TEST CODE*/
- var mCommand01 = new Command<String>((s) => { });
- var mCommand02 = new Command(() => { });
- _button.Command = mCommand01;
- Assert.AreEqual(mCommand01, _button.Command, "Retrieved Command value is not equal to set value");
- _button.Command = mCommand02;
- Assert.AreNotEqual(mCommand01, _button.Command, "mCommand01 value must be different from cunrrent command");
- Assert.AreEqual(mCommand02, _button.Command, "Retrieved Command value is not equal to set value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of CommandParameter are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.Button.CommandParameter A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void CommandParameter_PROPERTY_SET_GET()
- {
- /*TEST CODE*/
- var mLabel = new Label()
- {
- TextColor = new Color(0.1, 0.2, 0.3)
- };
- var mButton = new Button()
- {
- Text = "MyButton"
- };
- _button.CommandParameter = mLabel;
- Assert.AreEqual(mLabel, _button.CommandParameter, "Retrieved CommandParameter value is not equal to set value");
- Assert.AreEqual(mLabel.TextColor, ((Label)_button.CommandParameter).TextColor, "TextColor property of Label get value is not equal to set value");
- _button.CommandParameter = mButton;
- Assert.AreNotEqual(mLabel, _button.CommandParameter, "mLabel value must be different from cunrrent CommandParameter");
- Assert.AreEqual(mButton, _button.CommandParameter, "Retrieved CommandParameter value is not equal to set value");
- Assert.AreEqual(mButton.Text, ((Button)_button.CommandParameter).Text, "Retrieved Text property of Button get value is not equal to set value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of ContentLayout are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.Button.ContentLayout A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void ContentLayout_PROPERTY_SET_GET()
- {
- /*TEST CODE*/
- var mButtonContentLayout01 = new Button.ButtonContentLayout(Button.ButtonContentLayout.ImagePosition.Left, 0.5);
- var mButtonContentLayout02 = new Button.ButtonContentLayout(Button.ButtonContentLayout.ImagePosition.Top, 0.1);
- _button.ContentLayout = mButtonContentLayout01;
- Assert.AreEqual(mButtonContentLayout01, _button.ContentLayout, "Retrieved ContentLayout should be equal to set value");
- Assert.AreEqual(mButtonContentLayout01.Position, _button.ContentLayout.Position, "Retrieved Position property of ContentLayout value should be equal to set value");
- Assert.AreEqual(mButtonContentLayout01.Spacing, _button.ContentLayout.Spacing, "Retrieved Spacing property of ContentLayout value should be equal to set value");
- _button.ContentLayout = mButtonContentLayout02;
- Assert.AreNotEqual(mButtonContentLayout01, _button.CommandParameter, "mButtonContentLayout01 value should be different from cunrrent ContentLayout");
- Assert.AreEqual(mButtonContentLayout02, _button.ContentLayout, "Retrieved ContentLayout value should be equal to set value");
- Assert.AreEqual(mButtonContentLayout02.Position, _button.ContentLayout.Position, "Retrieved Position property of ContentLayout value should be equal to set value");
- Assert.AreEqual(mButtonContentLayout02.Spacing, _button.ContentLayout.Spacing, "Retrieved Spacing property of ContentLayout get value should be equal to set value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of Font are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.Button.Font A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void Font_PROPERTY_SET_GET()
- {
- /*TEST CODE*/
- var mFont1 = new Font();
- mFont1.WithAttributes(FontAttributes.Bold);
- mFont1.WithSize(20);
- var mFont2 = new Font();
- mFont2.WithAttributes(FontAttributes.Italic);
- mFont2.WithSize(12);
- _button.Font = mFont1;
- Assert.AreEqual(mFont1, _button.Font, "Retrieved Font should be equal to set value");
- Assert.AreEqual(mFont1.FontAttributes, _button.Font.FontAttributes, "Retrieved FontAttributes property of Font value should be equal to set value");
- Assert.AreEqual(mFont1.FontSize, _button.Font.FontSize, "Retrieved FontSize property of Font value should be equal to set value");
- _button.Font = mFont2;
- Assert.AreEqual(mFont2, _button.Font, "Retrieved Font value should be equal to set value");
- Assert.AreEqual(mFont2.FontAttributes, _button.Font.FontAttributes, "Retrieved FontAttributes property of Font value should be equal to set value");
- Assert.AreEqual(mFont2.FontSize, _button.Font.FontSize, "Retrieved FontSize property of Font value should be equal to set value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of FontAttributes are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.Button.FontAttributes A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void FontAttributes_PROPERTY_SET_GET()
- {
- /*TEST CODE*/
- _button.FontAttributes = FontAttributes.Bold;
- Assert.AreEqual(FontAttributes.Bold, _button.FontAttributes, "Retrieved Bold type of FontAttributes should be equal to set value");
- _button.FontAttributes = FontAttributes.None;
- Assert.AreEqual(FontAttributes.None, _button.FontAttributes, "Retrieved None type of FontAttributes should be equal to set value");
- _button.FontAttributes = FontAttributes.Italic;
- Assert.AreEqual(FontAttributes.Italic, _button.FontAttributes, "Retrieved Italic type of FontAttributes should be equal to set value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of FontFamily are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.Button.FontFamily A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void FontFamily_PROPERTY_SET_GET()
- {
- /*TEST CODE*/
- var mFontFamily1 = "Font1";
- var mFontFamily2 = "Font2";
- _button.FontFamily = mFontFamily1;
- Assert.AreEqual(mFontFamily1, _button.FontFamily, "Retrieved FontFamily should be equal to set value");
- _button.FontFamily = mFontFamily2;
- Assert.AreEqual(mFontFamily2, _button.FontFamily, "Retrieved FontFamily should be equal to set value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of FontSize are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.Button.FontSize A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void FontSize_PROPERTY_SET_GET()
- {
- /*TEST CODE*/
- var mFistFontSize = 11.0;
- var mSecondFontSize = 23.5;
- _button.FontSize = mFistFontSize;
- Assert.AreEqual(mFistFontSize, _button.FontSize, "Retrieved FontSize should be equal to set value");
- _button.FontSize = mSecondFontSize;
- Assert.AreEqual(mSecondFontSize, _button.FontSize, "Retrieved FontSize should be equal to set value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of Image are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.Button.Image A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void Image_PROPERTY_SET_GET()
- {
- /*TEST CODE*/
- var mLabel = new Label()
- {
- Text = "hello"
- };
-
- var mEditText = new Editor()
- {
- Text = "EDITOR"
- };
-
- var mFirstString = "FirstString";
- var mSecondString = "var mFirsString";
- var mFistImage = new FileImageSource()
- {
- BindingContext = mLabel,
- File = mFirstString
- };
- var mSecondImage = new FileImageSource()
- {
- BindingContext = mEditText,
- File = mSecondString
- };
- _button.Image = mFistImage;
- Assert.AreEqual(mFistImage, _button.Image, "Retrieved Image should be equal to set value");
- Assert.AreEqual(mFistImage.BindingContext, _button.Image.BindingContext, "Retrieved BindingContext property of Image should be equal to set value");
- Assert.AreEqual(mFistImage.File, _button.Image.File, "Retrieved File property of Image should be equal to set value");
- _button.Image = mSecondImage;
- Assert.AreEqual(mSecondImage, _button.Image, "Retrieved Image should be equal to set value");
- Assert.AreEqual(mSecondImage.BindingContext, _button.Image.BindingContext, "Retrieved BindingContext property of Image should be equal to set value");
- Assert.AreEqual(mSecondImage.File, _button.Image.File, "Retrieved File property of Image should be equal to set value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of TextColor are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.Button.TextColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void TextColor_PROPERTY_SET_GET()
- {
- /*TEST CODE*/
- var mFistTextColor = Color.FromRgb(0.125, 0.113, 0.145);
- var mSecondTextColor = Color.FromRgb(0.255, 0, 0.255);
- _button.TextColor = mFistTextColor;
- Assert.AreEqual(mFistTextColor, _button.TextColor, "Retrieved TextColor should be equal to set value");
- Assert.AreEqual(mFistTextColor.R, _button.TextColor.R, "Retrieved R property of TextColor should be equal to set value");
- Assert.AreEqual(mFistTextColor.G, _button.TextColor.G, "Retrieved G property of TextColor should be equal to set value");
- Assert.AreEqual(mFistTextColor.B, _button.TextColor.B, "Retrieved G property of TextColor should be equal to set value");
- _button.TextColor = mSecondTextColor;
- Assert.AreEqual(mSecondTextColor, _button.TextColor, "Retrieved Text should be equal to set value");
- Assert.AreEqual(mSecondTextColor.R, _button.TextColor.R, "Retrieved R property of TextColor should be equal to set value");
- Assert.AreEqual(mSecondTextColor.G, _button.TextColor.G, "Retrieved G property of TextColor should be equal to set value");
- Assert.AreEqual(mSecondTextColor.B, _button.TextColor.B, "Retrieved G property of TextColor should be equal to set value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of Text are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.Button.Text A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void Text_PROPERTY_SET_GET()
- {
- /*TEST CODE*/
- var mFistText = "FistText";
- var mSecondText = "SecondText";
- _button.Text = mFistText;
- Assert.AreEqual(mFistText, _button.Text, "Retrieved Text should be equal to set value");
- _button.Text = mSecondText;
- Assert.AreEqual(mSecondText, _button.Text, "Retrieved Text should be equal to set value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether TextProperty(BindableProperty) is working correctly or not")]
- [Property("SPEC", "Xamarin.Forms.Button.TextProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void TextProperty_PROPERTY_READ_ONLY()
- {
- /*TEST CODE*/
- _button.Text = "Test 01";
- _button.HorizontalOptions = LayoutOptions.FillAndExpand;
- Label mLabel = new Label()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Text = "Test 02"
- };
- Assert.AreNotEqual(mLabel.Text, _button.Text, "Text of button value must be different form Text of label value");
- _button.BindingContext = mLabel;
- _button.SetBinding(Button.TextProperty, "Text");
- new ContentPage
- {
- Content = new StackLayout()
- {
- Orientation = StackOrientation.Vertical,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _button,
- mLabel
- }
- }
- };
- Assert.AreEqual(mLabel.Text, _button.Text, "Text of button value & Text of label value should be same");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether BorderColorProperty(BindableProperty) is working correctly or not")]
- [Property("SPEC", "Xamarin.Forms.Button.BorderColorProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void BorderColorProperty_PROPERTY_READ_ONLY()
- {
- /*TEST CODE*/
- var mColorBorderFistButton = Color.FromRgb(0.223, 0.114, 0.245);
- var mColorBorderSeconButton = Color.FromRgb(0.113, 0.124, 0.111);
- _button.BorderColor = mColorBorderFistButton;
- _button.HorizontalOptions = LayoutOptions.FillAndExpand;
- Button mButton = new Button()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BorderColor = mColorBorderSeconButton
- };
- Assert.AreNotEqual(_button.BorderColor, mButton.BorderColor, "BorderColor of _button & mButton should be not equal");
- _button.BindingContext = mButton;
- _button.SetBinding(Button.BorderColorProperty, "BorderColor");
- new ContentPage
- {
- Content = new StackLayout()
- {
- Orientation = StackOrientation.Vertical,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _button,
- mButton
- }
- }
- };
- Assert.AreEqual(mButton.BorderColor, _button.BorderColor, "BorderColor of _button & mButton value should be same");
- Assert.AreEqual(0.113, Math.Round(_button.BorderColor.R, 3), "R BorderColor of _button & mButton value should be same");
- Assert.AreEqual(0.111, Math.Round(_button.BorderColor.B, 3), "B BorderColor of _button & mButton value should be same");
- Assert.AreEqual(0.124, Math.Round(_button.BorderColor.G, 3), "G BorderColor of _button & mButton value should be same");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether BorderRadiusProperty(BindableProperty) is working correctly or not")]
- [Property("SPEC", "Xamarin.Forms.Button.BorderRadiusProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void BorderRadiusProperty_PROPERTY_READ_ONLY()
- {
- /*TEST CODE*/
- var mFirstRadiusButton = 12;
- var mSecondRadiusButton = 20;
- _button.BorderRadius = mFirstRadiusButton;
- _button.HorizontalOptions = LayoutOptions.FillAndExpand;
- Button mButton = new Button()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BorderRadius = mSecondRadiusButton
- };
- Assert.AreNotEqual(mButton.BorderRadius, _button.BorderRadius, "BorderRadius of _button value must be different form BorderRadius of mButton value");
- _button.BindingContext = mButton;
- _button.SetBinding(Button.BorderRadiusProperty, "BorderRadius");
- new ContentPage
- {
- Content = new StackLayout()
- {
- Orientation = StackOrientation.Vertical,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _button,
- mButton
- }
- }
- };
- Assert.AreEqual(mButton.BorderRadius, _button.BorderRadius, "BorderRadius of mButton value & BorderRadius of _button value should be same");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether BorderWidthProperty(BindableProperty) is working correctly or not")]
- [Property("SPEC", "Xamarin.Forms.Button.BorderWidthProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void BorderWidthProperty_PROPERTY_READ_ONLY()
- {
- /*TEST CODE*/
- var mFirstBorderWidth = 0.1;
- var mSecondBorderWidth = 0.3;
- _button.BorderWidth = mFirstBorderWidth;
- _button.HorizontalOptions = LayoutOptions.FillAndExpand;
- Button mButton = new Button()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- BorderWidth = mSecondBorderWidth
- };
- Assert.AreNotEqual(mButton.BorderWidth, _button.BorderWidth, "BorderWidth of _button value must be different form BorderWidth of mButton value");
- _button.BindingContext = mButton;
- _button.SetBinding(Button.BorderWidthProperty, "BorderWidth");
- new ContentPage
- {
- Content = new StackLayout()
- {
- Orientation = StackOrientation.Vertical,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- _button,
- mButton
- }
- }
- };
- Assert.AreEqual(mButton.BorderWidth, _button.BorderWidth, "BorderWidth of mButton value & BorderWidth of _button value should be same");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether CommandParameterProperty(BindableProperty) is working correctly or not")]
- [Property("SPEC", "Xamarin.Forms.Button.CommandParameterProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void CommandParameterProperty_PROPERTY_READ_ONLY()
- {
- /*TEST CODE*/
- var mFirstCommandParameter = "mFirstCommandParameter";
- var mSecondCommandParameter = "mSecondCommandParameter";
- _button.CommandParameter = mFirstCommandParameter;
- _button.HorizontalOptions = LayoutOptions.FillAndExpand;
- Button mButton = new Button()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- CommandParameter = mSecondCommandParameter
- };
- Assert.AreNotEqual(mButton.CommandParameter, _button.CommandParameter, "CommandParameter of _button value must be different form CommandParameter of mButton value");
- _button.BindingContext = mButton;
- _button.SetBinding(Button.CommandParameterProperty, "CommandParameter");
- Assert.AreEqual(mButton.CommandParameter, _button.CommandParameter, "CommandParameter of mButton value & CommandParameter of _button value should be same");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether CommandProperty(BindableProperty) is working correctly or not")]
- [Property("SPEC", "Xamarin.Forms.Button.CommandProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void CommandProperty_PROPERTY_READ_ONLY()
- {
- /*TEST CODE*/
- var mFirstCommand = new Command(() => { });
- var mSecondCommand = new Command<String>((s) => { });
- _button.Command = mFirstCommand;
- _button.HorizontalOptions = LayoutOptions.FillAndExpand;
- Button mButton = new Button()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Command = mSecondCommand
- };
- Assert.AreNotEqual(mButton.Command, _button.Command, "Command of _button value must be different form Command of mButton value");
- _button.BindingContext = mButton;
- _button.SetBinding(Button.CommandProperty, "Command");
- Assert.AreEqual(mButton.Command, _button.Command, "Command of mButton value & Command of _button value should be same");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ContentLayoutProperty(BindableProperty) is working correctly or not")]
- [Property("SPEC", "Xamarin.Forms.Button.ContentLayoutProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void ContentLayoutProperty_PROPERTY_READ_ONLY()
- {
- /*TEST CODE*/
- var mFirstContentLayout = new Button.ButtonContentLayout(Button.ButtonContentLayout.ImagePosition.Left, 0.5);
- var mSecondFirstContentLayout = new Button.ButtonContentLayout(Button.ButtonContentLayout.ImagePosition.Top, 0.1);
- _button.ContentLayout = mFirstContentLayout;
- _button.HorizontalOptions = LayoutOptions.FillAndExpand;
- Button mButton = new Button()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- ContentLayout = mSecondFirstContentLayout
- };
- Assert.AreNotEqual(mButton.ContentLayout, _button.ContentLayout, "ContentLayout of _button value must be different form ContentLayout of mButton value");
- _button.BindingContext = mButton;
- _button.SetBinding(Button.ContentLayoutProperty, "ContentLayout");
- Assert.AreEqual(mButton.ContentLayout, _button.ContentLayout, "ContentLayout of mButton value & ContentLayout of _button value value must same");
- Assert.AreEqual(mButton.ContentLayout.Position, _button.ContentLayout.Position, "ContentLayout.Position of mButton value & ContentLayout.Position of _button value should be same");
- Assert.AreEqual(mButton.ContentLayout.Spacing, _button.ContentLayout.Spacing, "ContentLayout.Spacing of mButton value & ContentLayout.Spacing of _button value should be same");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether FontAttributesProperty(BindableProperty) is working correctly or not")]
- [Property("SPEC", "Xamarin.Forms.Button.FontAttributesProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void FontAttributesProperty_PROPERTY_READ_ONLY()
- {
- /*TEST CODE*/
- var mFirstFontAttributes = FontAttributes.Bold;
- var mSecondFontAttributes = FontAttributes.Italic;
- _button.FontAttributes = mFirstFontAttributes;
- _button.HorizontalOptions = LayoutOptions.FillAndExpand;
- Label mLabel = new Label()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- FontAttributes = mSecondFontAttributes
- };
- Assert.AreNotEqual(mLabel.FontAttributes, _button.FontAttributes, "FontAttributes of _button value must be different form FontAttributes of mLabel value");
- _button.BindingContext = mLabel;
- _button.SetBinding(Button.FontAttributesProperty, "FontAttributes");
- Assert.AreEqual(mLabel.FontAttributes, _button.FontAttributes, "FontAttributes of mLabel value & FontAttributes of _button value should be same");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether FontFamilyProperty(BindableProperty) is working correctly or not")]
- [Property("SPEC", "Xamarin.Forms.Button.FontFamilyProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void FontFamilyProperty_PROPERTY_READ_ONLY()
- {
- /*TEST CODE*/
- var mFirstFontFamilyProperty = "mFirstFontFamilyProperty";
- var mSecondFontFamilyProperty = "mSecondFontFamilyProperty";
- _button.FontFamily = mFirstFontFamilyProperty;
- _button.HorizontalOptions = LayoutOptions.FillAndExpand;
- Label mLabel = new Label()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- FontFamily = mSecondFontFamilyProperty
- };
- Assert.AreNotEqual(mLabel.FontFamily, _button.FontAttributes, "FontFamily of _button value must be different form FontFamily of mLabel value");
- _button.BindingContext = mLabel;
- _button.SetBinding(Button.FontFamilyProperty, "FontFamily");
- Assert.AreEqual(mLabel.FontFamily, _button.FontFamily, "FontFamily of mLabel value & FontFamily of _button value should be same");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether FontProperty(BindableProperty) is working correctly or not")]
- [Property("SPEC", "Xamarin.Forms.Button.FontProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void FontProperty_PROPERTY_READ_ONLY()
- {
- /*TEST CODE*/
- _button.Font = Font.BoldSystemFontOfSize(2.0);
- _button.HorizontalOptions = LayoutOptions.FillAndExpand;
- Label mLabel = new Label()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Font = Font.BoldSystemFontOfSize(3.0)
- };
- Assert.AreNotEqual(mLabel.Font, _button.Font, "Font of _button value must be different form Font of mLabel value");
- _button.BindingContext = mLabel;
- _button.SetBinding(Button.FontProperty, "Font");
- Assert.AreEqual(mLabel.Font, _button.Font, "Font of mLabel value & Font of _button value should be same");
- Assert.AreEqual(mLabel.Font.FontAttributes, _button.Font.FontAttributes, "Font.FontAttributes of mLabel value & Font.FontAttributes of _button value should be same");
- Assert.AreEqual(mLabel.Font.FontSize, _button.Font.FontSize, "Font.FontSize of mLabel value & Font.FontSize of _button value should be same");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether FontSizeProperty(BindableProperty) is working correctly or not")]
- [Property("SPEC", "Xamarin.Forms.Button.FontSizeProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void FontSizeProperty_PROPERTY_READ_ONLY()
- {
- /*TEST CODE*/
- var mFirstFontSizeProperty = 22;
- var mSecondFontSizeProperty = 6;
- _button.FontSize = mFirstFontSizeProperty;
- _button.HorizontalOptions = LayoutOptions.FillAndExpand;
- Label mLabel = new Label()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- FontSize = mSecondFontSizeProperty
- };
- Assert.AreNotEqual(mLabel.FontSize, _button.FontSize, "FontFamily of _button value must be different form FontSize of mLabel value");
- _button.BindingContext = mLabel;
- _button.SetBinding(Button.FontSizeProperty, "FontSize");
- Assert.AreEqual(mLabel.FontSize, _button.FontSize, "FontSize of mLabel value & FontSize of _button value should be same");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ImageProperty(BindableProperty) is working correctly or not")]
- [Property("SPEC", "Xamarin.Forms.Button.ImageProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void ImageProperty_PROPERTY_READ_ONLY()
- {
- /*TEST CODE*/
- var label = new Label()
- {
- Text = "hello"
- };
-
- var mEditText = new Editor()
- {
- Text = "EDITOR"
- };
- var mFirstString = "FirstString";
- var mSecondString = "var mFirsString";
- var mFistImage = new FileImageSource()
- {
- BindingContext = label,
- File = mFirstString
- };
- var mSecondImage = new FileImageSource()
- {
- BindingContext = mEditText,
- File = mSecondString
- };
- _button.Image = mFistImage;
- _button.HorizontalOptions = LayoutOptions.FillAndExpand;
- Button mButton = new Button()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Image = mSecondImage
- };
- Assert.AreNotEqual(mButton.Image, _button.Image, "FontFamily of _button value must be different form FontSize of mButton value");
- _button.BindingContext = mButton;
- _button.SetBinding(Button.ImageProperty, "Image");
- Assert.AreEqual(mButton.Image, _button.Image, "Image of mButton value & Image of _button value should be same");
- Assert.AreEqual(mButton.Image, _button.Image, "Image of mButton value & Image of _button value should be same");
- Assert.AreEqual(mButton.Image.BindingContext, _button.Image.BindingContext, "Image.BindingContext of mButton value & Image.BindingContext of _button value should be same");
- Assert.AreEqual(mButton.Image.File, _button.Image.File, "Image.File of mButton value & Image.File of _button value should be same");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether TextColorProperty(BindableProperty) is working correctly or not")]
- [Property("SPEC", "Xamarin.Forms.Button.TextColorProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void TextColorProperty_PROPERTY_READ_ONLY()
- {
- /*TEST CODE*/
- var mColor1 = Color.Red;
- var mColor2 = Color.White;
- _button.TextColor = mColor1;
- _button.HorizontalOptions = LayoutOptions.FillAndExpand;
- Label mLabel = new Label()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- TextColor = mColor2
- };
- Assert.AreNotEqual(mLabel.TextColor, _button.TextColor, "TextColor of _button value must be different form TextColor of mLabel value");
- _button.BindingContext = mLabel;
- _button.SetBinding(Button.TextColorProperty, "TextColor");
- Assert.AreEqual(mLabel.TextColor, _button.TextColor, "TextColor of mLabel value & TextColor of _button value should be same");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check override method OnBindingContextChanged is invoked when it is bound.")]
- [Property("SPEC", "Xamarin.Forms.Button.OnBindingContextChanged M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void OnBindingContextChanged_OVERRIDE_METHOD()
- {
- /*PRE CONDITION
- * _flagOnBindingContext flag is initialize false value
- * Create a instance subButton
- */
- Assert.False(_flagOnBindingContext, "_flagOnSizeRequest should false initial");
- var mSubButton = new subButton()
- {
- Text = "My Button",
- BorderColor = new Color(0.15, 0.14, 0.11, 0.12)
- };
- /**TEST CODE**/
- var mButton = new Button()
- {
- Text = "My SubButton",
- BorderColor = new Color(0.2, 0.3, 0.4, 0.1)
- };
-
- mSubButton.BindingContext = mButton;
- mSubButton.SetBinding(subButton.TextProperty, "Text");
- Assert.True(_flagOnBindingContext, "OnBindingContextChanged overrided method not invoked.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check override method OnPropertyChanging is invoked when it is changed.")]
- [Property("SPEC", "Xamarin.Forms.Button.OnPropertyChanging M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void OnPropertyChanging_OVERRIDE_METHOD()
- {
- /*PRE CONDITION
- * _flagOnPropertyChanging flag is initialize false value
- * Create a instance subButton
- */
- Assert.False(_flagOnPropertyChanging, "_flagOnSizeRequest should false initial");
- var mSubButton = new subButton()
- {
- Text = "My Button",
- BorderColor = new Color(0.15, 0.14, 0.11, 0.12)
- };
- /**TEST CODE**/
- var mButton = new Button()
- {
- Text = "My SubButton",
- BorderColor = new Color(0.2, 0.3, 0.4, 0.1)
- };
-
- mSubButton.BindingContext = mButton;
- mSubButton.SetBinding(subButton.TextProperty, "Text");
- Assert.True(_flagOnPropertyChanging, "OnPropertyChanging overrided method not invoked.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check return button configuration")]
- [Property("SPEC", "Xamarin.Forms.Button.On<T> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void On_CONFIGURATION_METHOD()
- {
- /*TEST CODE*/
- _button.Text = "Test Button";
- _button.FontSize = 12.3;
- var myConfig = _button.On<IConfigPlatform>();
- Assert.IsInstanceOf<IPlatformElementConfiguration<IConfigPlatform,Button>>(myConfig, "myConfig should be a instance of IPlatformElementConfiguration");
- Assert.IsInstanceOf<Button>(myConfig.Element, "myConfig.Element should be a instance of Button");
- Assert.AreEqual("Test Button", myConfig.Element.Text, "Text of myConfig.Element value & Text of _button should be equal");
- Assert.AreEqual(12.3,Math.Round(myConfig.Element.FontSize,1), "FontSize of myConfig.Element value & FontSize of _button should be equal");
- }
-
- }
-}
+++ /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 NUnit.Framework.TUnit;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class CarouselPageTests
- {
- CarouselPage _carouselPage;
- static bool _flagCreateDefault;
- internal class SubCarouselPage: CarouselPage
- {
- public SubCarouselPage() : base()
- {
- }
- protected override ContentPage CreateDefault(object item)
- {
- _flagCreateDefault = true;
- return base.CreateDefault(item);
- }
-
- public ContentPage testCreateDefault()
- {
- return CreateDefault("Hello");
- }
- }
- [SetUp]
- public void SetUp()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "CarouselPage CLASS: Setup---------------------------------");
- _carouselPage = new CarouselPage();
- _flagCreateDefault = false;
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "CarouselPage CLASS: Teardown---------------------------------");
- _carouselPage = null;
- }
-
- [Test]
- [Category("P1")]
- [Description(" Create a CarouselPage instance. Check whether object is successfully created or not.")]
- [Property("SPEC", "Xamarin.Forms.CarouselPage.CarouselPage C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void CarouselPage_CONST()
- {
- /*TEST CODE*/
- _carouselPage = new CarouselPage();
- Assert.IsInstanceOf<CarouselPage>(_carouselPage, "_carouselPage should be an instance of CarouselPage");
- Assert.IsNotNull(_carouselPage, "Can't create success object Button");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check return CarouselPage configuration")]
- [Property("SPEC", "Xamarin.Forms.CarouselPage.On<T> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void On_CONFIGURATION_METHOD()
- {
- /*TEST CODE*/
- var mPage = new ContentPage();
- var mColor = new Color(0.111, 0.123, 0.145);
- _carouselPage.CurrentPage = mPage;
- _carouselPage.BackgroundColor = mColor;
- var myConfig = _carouselPage.On<IConfigPlatform>();
- Assert.IsInstanceOf<IPlatformElementConfiguration<IConfigPlatform, CarouselPage>>(myConfig, "myConfig should be a instance of IPlatformElementConfiguration");
- Assert.IsInstanceOf<CarouselPage>(myConfig.Element, "myConfig.Element should be a instance of CarouselPage");
- Assert.AreEqual(mPage, myConfig.Element.CurrentPage, "CurrentPage of myConfig.Element value & CurrentPage of _carouselPage should be equal");
- Assert.AreEqual(mColor, myConfig.Element.BackgroundColor, "mColor of myConfig.Element value & mColor of _carouselPage should be equal");
- Assert.AreEqual(0.111, Math.Round(_carouselPage.BackgroundColor.R, 3), "R _carouselPage.BackgroundColor of _button & myConfig value should be same");
- Assert.AreEqual(0.123, Math.Round(_carouselPage.BackgroundColor.G, 3), "G _carouselPage.BackgroundColor of _button & myConfig value should be same");
- Assert.AreEqual(0.145, Math.Round(_carouselPage.BackgroundColor.B, 3), "B _carouselPage.BackgroundColor of _button & myConfig value should be same");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check override method CreateDefault is invoked when it is changed.")]
- [Property("SPEC", "Xamarin.Forms.CarouselPage.CreateDefault M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void CreateDefault_OVERRIDE_METHOD()
- {
- /**TEST CODE**/
- var mSubCarouselPage = new SubCarouselPage();
- Assert.AreEqual("Hello", mSubCarouselPage.testCreateDefault().Title);
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-using System.Threading.Tasks;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.Cell Tests")]
- public class CellTests
- {
- internal class TestCell : Cell
- {
- public bool OnAppearingSent { get; set; }
- public bool OnDisappearingSent { get; set; }
-
- public bool OnParentSetOccured { get; set; }
-
- public bool OnTappedOccured { get; set; }
-
- protected override void OnAppearing()
- {
- base.OnAppearing();
- OnAppearingSent = true;
- }
-
- protected override void OnDisappearing()
- {
- base.OnDisappearing();
- OnDisappearingSent = true;
- }
-
- protected override void OnParentSet()
- {
- base.OnParentSet();
- OnParentSetOccured = true;
- }
-
- protected override void OnTapped()
- {
- base.OnTapped();
- OnTappedOccured = true;
- }
- }
-
- private TestCell _cell;
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("BoundsTypeConverterTests --------------- Setup()");
- _cell = new TestCell()
- {
- IsEnabled = true
- };
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("BoundsTypeConverterTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a Cell object")]
- [Property("SPEC", "Xamarin.Forms.Cell.Cell A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONST")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void Cell_INIT()
- {
- var cell = new TestCell();
- /*TEST CODE*/
- Assert.IsNotNull(cell, "Should be not null.");
- Assert.IsInstanceOf<Cell>(cell, "Should be Cell type.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of IsEnabledProperty's bound or not")]
- [Property("SPEC", "Xamarin.Forms.Cell.IsEnabledProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void IsEnabledProperty_CHECK_BINDABLE()
- {
- /*TEST CODE*/
- _cell.IsEnabled = true;
- Entry entry = new Entry()
- {
- IsEnabled = false
- };
- Assert.AreNotEqual(entry.IsEnabled, _cell.IsEnabled, "Enable status of Cell value must be different form entry enable status");
-
- _cell.BindingContext = entry;
- _cell.SetBinding(Cell.IsEnabledProperty, "IsEnabled");
- Assert.AreEqual(entry.IsEnabled, _cell.IsEnabled, "Enable status of Cell value must be same as entry enable status");
- }
-
- [Test]
- [Category("P1")]
- [Description("IList<MenuItem>. Gets a list of menu items to display when the user performs the device-specific context gesture on the Cell.")]
- [Property("SPEC", "Xamarin.Forms.Cell.ContextActions A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PR")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi , ef.razi@samsung.com")]
- public void ContextActions_READ()
- {
- /* TEST CODE */
- _cell.ContextActions.Add(new MenuItem());
- object bc = new object();
- _cell.BindingContext = bc;
- //System.Collections.Generic.List<MenuItem> menuList = (System.Collections.Generic.List<MenuItem>)_cell.ContextActions;
- System.Collections.ObjectModel.ObservableCollection<MenuItem> menuList = (System.Collections.ObjectModel.ObservableCollection<MenuItem>)_cell.ContextActions;
- Assert.AreEqual(menuList[0].BindingContext, bc, "Object should be equal");
- }
-
- [Test]
- [Category("P1")]
- [Description("Boolean. Gets a value that indicates whether the cell has at least one menu item in its Cell.ContextActions list property.")]
- [Property("SPEC", "Xamarin.Forms.Cell.HasContextActions A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PR")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi , ef.razi@samsung.com")]
- public void HasContextActions_READ()
- {
- /* TEST CODE */
- bool changed = false;
- _cell.PropertyChanged += (sender, args) =>
- {
- if (args.PropertyName == "HasContextActions")
- changed = true;
- };
-
- Assert.IsFalse(_cell.HasContextActions, "HasContextActions should be false");
- Assert.IsFalse(changed, "changed should be false");
-
- var collection = _cell.ContextActions;
-
- Assert.IsFalse(_cell.HasContextActions, "HasContextActions should be false");
- Assert.IsFalse(changed, "changed should be false");
-
- collection.Add(new MenuItem());
-
- Assert.IsTrue(_cell.HasContextActions, "HasContextActions should be true");
- Assert.IsTrue(changed, "changed should be true");
- }
-
- [Test]
- [Category("P1")]
- [Description("Double. Gets or sets the height of the Cell.")]
- [Property("SPEC", "Xamarin.Forms.Cell.Height A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi , ef.razi@samsung.com")]
- public void Height_READ_WRITE()
- {
- /* TEST CODE */
- var _cellHeight = 2.3;
- _cell.Height = _cellHeight;
- Assert.IsInstanceOf<double>(_cell.Height, "Cell hight should be double");
- Assert.AreEqual(_cellHeight, _cell.Height, "Cell height should be 2.3");
- }
-
- [Test]
- [Category("P1")]
- [Description("Boolean. Gets or sets the IsEnabled state of the Cell. This is a bindable property.")]
- [Property("SPEC", "Xamarin.Forms.Cell.IsEnabled A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi , ef.razi@samsung.com")]
- public void IsEnabled_READ_WRITE()
- {
- /* TEST CODE */
- var _isEnabled = false;
- Assert.AreNotEqual(_isEnabled, _cell.IsEnabled, "_cell.IsEnabled should be true");
- _cell.IsEnabled = _isEnabled;
- Assert.IsInstanceOf<bool>(_cell.IsEnabled, "Cell hight should be double");
- Assert.IsFalse(_cell.IsEnabled, "IsEnabled should be false");
- _cell.IsEnabled = !_isEnabled;
- Assert.IsTrue(_cell.IsEnabled, "IsEnabled should be true");
- }
-
- [Test]
- [Category("P1")]
- [Description("Double. Gets the height of the rendered cell on the device.")]
- [Property("SPEC", "Xamarin.Forms.Cell.RenderHeight A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PR")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi , ef.razi@samsung.com")]
- public void RenderHeight_READ()
- {
- /* TEST CODE */
- var lv = new ListView();
- _cell.Parent = lv;
- lv.RowHeight = 5;
- Assert.AreEqual(5, _cell.RenderHeight, "_cell.RenderHeight should be 5");
- }
-
- [Test]
- [Category("P1")]
- [Description("Immediately updates the cell's size.")]
- [Property("SPEC", "Xamarin.Forms.Cell.ForceUpdateSize M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public async Task ForceUpdateSize_CHECK_STATUS()
- {
- var lv = new ListView { HasUnevenRows = true };
- _cell.Parent = lv;
- // For even rows.
- int numberOfCalls = 0;
- ((ICellController)_cell).ForceUpdateSizeRequested += (object sender, System.EventArgs e) => { numberOfCalls++; };
-
- _cell.ForceUpdateSize();
-
- await System.Threading.Tasks.Task.Delay(TimeSpan.FromMilliseconds(150));
-
- Assert.AreEqual(1, numberOfCalls, "numberOfCalls need to be changed");
- }
-
- [Test]
- [Category("P1")]
- [Description("Invoked whenever an Cell.Appearing event occurs. Implement this method to add class handling for this event.")]
- [Property("SPEC", "Xamarin.Forms.Cell.OnAppearing M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void OnAppearing_CHECK_INVOCK()
- {
- /* TEST CODE */
- bool emitted = false;
- _cell.Appearing += (sender, args) => emitted = true;
- ((ICellController)_cell).SendAppearing();
- Assert.IsTrue(emitted, "Value should be true");
- Assert.IsTrue(_cell.OnAppearingSent, "Value should be true");
- Assert.IsFalse(_cell.OnDisappearingSent, "Value should be false");
- }
-
- [Test]
- [Category("P1")]
- [Description("Event that is raised when the binding context is changed.")]
- [Property("SPEC", "Xamarin.Forms.Cell.OnBindingContextChanged M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void OnBindingContextChanged_CHECK_INVOCK()
- {
- /* TEST CODE */
- bool emitted = false;
- _cell.BindingContextChanged += (sender, args) => emitted = true;
- object bc = new object();
- _cell.BindingContext = bc;
- Assert.IsTrue(emitted, "Value should be true");
- }
-
- [Test]
- [Category("P1")]
- [Description("Invoked whenever an Cell.Disappearing event occurs. Implement this method to add class handling for this event.")]
- [Property("SPEC", "Xamarin.Forms.Cell.OnDisappearing M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void OnDisappearing_CHECK_INVOCK()
- {
- /* TEST CODE */
- bool emitted = false;
- _cell.Disappearing += (sender, args) => emitted = true;
- ((ICellController)_cell).SendDisappearing();
- Assert.IsTrue(emitted, "Value should be true");
- Assert.IsFalse(_cell.OnAppearingSent, "Value should be false");
- Assert.IsTrue(_cell.OnDisappearingSent, "Value should be true");
- }
-
- [Test]
- [Category("P1")]
- [Description("Application developers can override this method to do actions when the cell's parent is set.")]
- [Property("SPEC", "Xamarin.Forms.Cell.OnParentSet M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void OnParentSet_CHECK_INVOCK()
- {
- /* TEST CODE */
- //bool emitted = false;
- var lv = new ListView();
- _cell.Parent = lv;
- Assert.IsTrue(_cell.OnParentSetOccured, "Value should be true");
- }
-
- [Test]
- [Category("P1")]
- [Description("TApplication developers can override this method to do actions when the property named by propertyName is set.")]
- [Property("SPEC", "Xamarin.Forms.Cell.OnPropertyChanging M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void OnPropertyChanging_CHECK_INVOCK()
- {
- /* TEST CODE */
- //bool emitted = false;
- var lv = new ListView();
-
- _cell.Parent = lv;
- int changing = 0;
- _cell.PropertyChanging += (sender, args) =>
- {
- if (args.PropertyName == "RenderHeight")
- changing++;
- };
- lv.RowHeight = 5;
- Assert.AreEqual(5, _cell.RenderHeight, "_cell.RenderHeight should be 5");
- Assert.AreEqual(1, changing, "changing should be 1");
- }
-
- [Test]
- [Category("P1")]
- [Description("Occurs when the visual representation of the Cell is being added to the visual layout.")]
- [Property("SPEC", "Xamarin.Forms.Cell.Appearing E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void Appearing_CHECK_EVENT()
- {
- /* TEST CODE */
- bool emitted = false;
- _cell.Appearing += (sender, args) => emitted = true;
- ((ICellController)_cell).SendAppearing();
- Assert.IsTrue(emitted, "Value should be true");
- Assert.IsTrue(_cell.OnAppearingSent, "Value should be true");
- Assert.IsFalse(_cell.OnDisappearingSent, "Value should be false");
- }
-
- [Test]
- [Category("P1")]
- [Description("Occurs when the visual representation of the Cell is being removed from the visual layout.")]
- [Property("SPEC", "Xamarin.Forms.Cell.Disappearing E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void Disappearing_CHECK_EVENT()
- {
- /* TEST CODE */
- bool emitted = false;
- _cell.Disappearing += (sender, args) => emitted = true;
- ((ICellController)_cell).SendDisappearing();
- Assert.IsTrue(emitted, "Value should be true");
- //Assert.IsFalse(_cell.OnAppearingSent, "Value should be false");
- Assert.IsTrue(_cell.OnDisappearingSent, "Value should be true");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check whether occurs when the Cell is Tapped.")]
- [Property("SPEC", "Xamarin.Forms.Cell.Tapped E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void Tapped_EVENT()
- {
- /* TEST CODE */
- Assert.True(false, "[NA] Need to make manul test case");
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Threading.Tasks;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.CollectionSynchronizationCallback test")]
- public class CollectionSynchronizationCallbackTests
- {
- public void CallbackMethod(IEnumerable collection, object context, Action accessMethod, bool writeAccess)
- {
- accessMethod();
- }
-
- public void AcessMethod(IEnumerable collection)
- {
- ((List<string>)collection).Add("new");
- }
-
- [SetUp]
- public void Setup()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "CollectionSynchronizationCallback CLASS: Setup---------------------------------");
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "CollectionSynchronizationCallback CLASS: Teardown------------------------------");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check CollectionSynchronizationCallback delegate.")]
- [Property("SPEC", "Xamarin.Forms.CollectionSynchronizationCallback.CollectionSynchronizationCallback C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void CollectionSynchronizationCallback_INIT()
- {
- /* TEST CODE */
- List<string> nameArray = new List<string>() { "foo", "bar" };
- CollectionSynchronizationCallbackTests mTestObject = new CollectionSynchronizationCallbackTests();
- Action mAccessMethod = delegate () { mTestObject.AcessMethod(nameArray); };
- CollectionSynchronizationCallback mCollectionSynchronizationCallback = mTestObject.CallbackMethod;
- Assert.IsNotNull(mCollectionSynchronizationCallback, "Object should not null after initializing.");
-
- BindingBase.EnableCollectionSynchronization(nameArray, mTestObject, mCollectionSynchronizationCallback);
- mCollectionSynchronizationCallback(nameArray, mTestObject, mAccessMethod, true);
- Assert.AreEqual(3, nameArray.Count, "Count of list should be increase after call method.");
- Assert.AreEqual("new", nameArray[2].ToString(), "Added element should be correct.");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check BeginInvoke of CollectionSynchronizationCallback delegate.")]
- [Property("SPEC", "Xamarin.Forms.CollectionSynchronizationCallback.BeginInvoke M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void BeginInvoke_CHECK_DELEGATE()
- {
- /* Precondition:
- - Init mCollectionSynchronizationCallback */
- List<string> nameArray = new List<string>() { "foo", "bar" };
- CollectionSynchronizationCallbackTests mTestObject = new CollectionSynchronizationCallbackTests();
- Action mAccessMethod = delegate () { mTestObject.AcessMethod(nameArray); };
- CollectionSynchronizationCallback mCollectionSynchronizationCallback = mTestObject.CallbackMethod;
- Assert.IsNotNull(mCollectionSynchronizationCallback, "Object should not null after initializing.");
- /* TEST CODE */
- AsyncCallback mAsyncCallback = delegate (IAsyncResult ar) { Console.WriteLine("TUnit - BeginInvoke - AsyncCallback"); };
- mCollectionSynchronizationCallback.BeginInvoke(nameArray, mTestObject, mAccessMethod, true, mAsyncCallback, new object());
- Assert.AreEqual(3, nameArray.Count, "Count of list should be increase after call method.");
- Assert.AreEqual("new", nameArray[2].ToString(), "Added element should be correct.");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check EndInvoke of CollectionSynchronizationCallback delegate.")]
- [Property("SPEC", "Xamarin.Forms.CollectionSynchronizationCallback.EndInvoke M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void EndInvoke_CHECK_DELEGATE()
- {
- /* Precondition:
- - Init mCollectionSynchronizationCallback */
- List<string> nameArray = new List<string>() { "foo", "bar" };
- CollectionSynchronizationCallbackTests mTestObject = new CollectionSynchronizationCallbackTests();
- Action mAccessMethod = delegate () { mTestObject.AcessMethod(nameArray); };
- CollectionSynchronizationCallback mCollectionSynchronizationCallback = mTestObject.CallbackMethod;
- Assert.IsNotNull(mCollectionSynchronizationCallback, "Object should not null after initializing.");
- /* TEST CODE */
- AsyncCallback mAsyncCallback = delegate (IAsyncResult ar) { Console.WriteLine("TUnit - EndInvoke - AsyncCallback"); };
- var asyncResult = mCollectionSynchronizationCallback.BeginInvoke(nameArray, mTestObject, mAccessMethod, true, mAsyncCallback, new object());
- Assert.AreEqual(3, nameArray.Count, "Count of list should be increase after call method.");
- Assert.AreEqual("new", nameArray[2].ToString(), "Added element should be correct.");
- mCollectionSynchronizationCallback.EndInvoke(asyncResult);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check Invoke of CollectionSynchronizationCallback delegate.")]
- [Property("SPEC", "Xamarin.Forms.CollectionSynchronizationCallback.Invoke M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void Invoke_CHECK_DELEGATE()
- {
- /* Precondition:
- - Init mCollectionSynchronizationCallback */
- List<string> nameArray = new List<string>() { "foo", "bar" };
- CollectionSynchronizationCallbackTests mTestObject = new CollectionSynchronizationCallbackTests();
- Action mAccessMethod = delegate () { mTestObject.AcessMethod(nameArray); };
- CollectionSynchronizationCallback mCollectionSynchronizationCallback = mTestObject.CallbackMethod;
- Assert.IsNotNull(mCollectionSynchronizationCallback, "Object should not null after initializing.");
- /* TEST CODE */
- mCollectionSynchronizationCallback.Invoke(nameArray, mTestObject, mAccessMethod, true);
- Assert.AreEqual(3, nameArray.Count, "Count of list should be increase after call method.");
- Assert.AreEqual("new", nameArray[2].ToString(), "Added element should be correct.");
- }
- }
-}
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns="http://tizen.org/ns/packages" api-version="6" package="Tizen.XamarinForms1.Tests" version="1.0.0">
- <profile name="common" />
- <ui-application appid="Tizen.XamarinForms1.Tests"
- exec="Tizen.XamarinForms1.Tests.dll"
- type="dotnet"
- multiple="false"
- taskmanage="true"
- launch_mode="single">
- <icon>Tizen.XamarinForms1.Tests.png</icon>
- <label>Tizen.XamarinForms1.Tests</label>
- </ui-application>
- <privileges>
- <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
- </privileges>
-</manifest>
+++ /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.Platform.Tizen.Forms.Init(app);
- app.Run(args);
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-<Project Sdk="Microsoft.NET.Sdk">
-
- <!-- Property Group for .NET Core Project -->
- <PropertyGroup>
- <OutputType>Exe</OutputType>
- <TargetFramework>tizen60</TargetFramework>
- </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>
- <PackageReference Include="Tizen.NET.Sdk" Version="$(TizenNETSdkVersion)" />
- </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.XamarinForms2.Tests", "Tizen.XamarinForms2.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 System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Xamarin.Forms;
-using Xamarin.Forms.Platform.Tizen;
-using XamarinForTizen.Tizen.common;
-
-[assembly: ResolutionGroupName("Samsung")]
-[assembly: ExportEffect(typeof(MockEffect), "MockEffect")]
-namespace XamarinForTizen.Tizen.common
-{
- class MockEffect : PlatformEffect
- {
-
- protected override void OnAttached()
- {
- Container.Color = ElmSharp.Color.Red;
- }
-
- protected override void OnDetached()
- {
-
- }
- }
-}
\ 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 NUnit.Framework.TUnit;
-using System;
-using System.Globalization;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class ColorTests
- {
- public const int IntR = 255, IntG = 0, IntB = 0, IntA = 255;
- public const double DoubleR = 0.5, DoubleG = 0.1, DoubleB = 0.4, DoubleA = 0.5;
- public const double Hue = 0.2, Sat = 0.3, Lum = 0.4;
- private Color _color;
-
- [SetUp]
- public void Init()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Setup-------------------------");
- _color = new Color(DoubleR, DoubleG, DoubleB, DoubleA);
- }
-
- [TearDown]
- public void Destroy()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Teardown-------------------------");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a Color object with a value is double")]
- [Property("SPEC", "Xamarin.Forms.Color.Color C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- [Property("COVPARAM", "Double")]
- public void Color_INIT()
- {
- /* TEST CODE */
- double value = 0.7;
- var color = new Color(value);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a Color object with three values are r,g,b.")]
- [Property("SPEC", "Xamarin.Forms.Color.Color C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- [Property("COVPARAM", "Double, Double, Double")]
- public void Color_INIT_WITH_RGB()
- {
- /* TEST CODE */
- var color = new Color(DoubleR, DoubleG, DoubleB);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a Color object with four values are r,g,b,a.")]
- [Property("SPEC", "Xamarin.Forms.Color.Color C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- [Property("COVPARAM", "Double, Double, Double, Double")]
- public void Color_INIT_WITH_RGBA()
- {
- /* TEST CODE */
- var color = new Color(DoubleR, DoubleG, DoubleB, DoubleA);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check value return Accent.")]
- [Property("SPEC", "Xamarin.Forms.Color.Accent M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void Accent_READONLY()
- {
- /* TEST CODE */
- var color = Color.Accent;
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check value return Default.")]
- [Property("SPEC", "Xamarin.Forms.Color.Default M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void Default_READONLY()
- {
- /* TEST CODE */
- var color = Color.Default;
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
- }
-
- [Test]
- [Category("P1")]
- [Description("Checl value R of color after initialize.")]
- [Property("SPEC", "Xamarin.Forms.Color.R A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void R_GET()
- {
- /* TEST CODE */
- var r = _color.R;
- Assert.AreEqual(Math.Round(DoubleR, 3), Math.Round(r, 3), "Value R of color should be same value r used to initialize this color.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Checl value G of color after initialize.")]
- [Property("SPEC", "Xamarin.Forms.Color.G A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void G_GET()
- {
- /* TEST CODE */
- var g = _color.G;
- Assert.AreEqual(Math.Round(DoubleG, 3), Math.Round(g, 3), "Value G of color should be same value g used to initialize this color.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Checl value B of color after initialize.")]
- [Property("SPEC", "Xamarin.Forms.Color.B A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void B_GET()
- {
- /* TEST CODE */
- var b = _color.B;
- Assert.AreEqual(Math.Round(DoubleB, 3), Math.Round(b, 3), "Value B of color should be same value b used to initialize this color.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Checl value A of color after initialize.")]
- [Property("SPEC", "Xamarin.Forms.Color.A A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void A_GET()
- {
- /* TEST CODE */
- var a = _color.A;
- Assert.AreEqual(Math.Round(DoubleA, 3), Math.Round(a, 3), "Value A of color should be same value a used to initialize this color.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Checl value returned by FromHex.")]
- [Property("SPEC", "Xamarin.Forms.Color.FromHex M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void FromHex_RETURN()
- {
- /* PRECONDITION
- * 1. Create a string.
- */
- string hex = "#000000";
-
- /* TEST CODE */
- var color = Color.FromHex(hex);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
- Assert.AreEqual(Color.Black, color, "Value of color returned by FromHex should be is black.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Checl value returned by FromRgb.")]
- [Property("SPEC", "Xamarin.Forms.Color.FromRgb M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- [Property("COVPARAM", "int, int, int")]
- public void FromRgb_INT_RETURN()
- {
- /* TEST CODE */
- var color = Color.FromRgb(IntR, IntG, IntB);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
- Assert.AreEqual(Color.Red, color, "Value of color returned by FromHex should be is red.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Checl value returned by FromRgb.")]
- [Property("SPEC", "Xamarin.Forms.Color.FromRgb M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- [Property("COVPARAM", "Double, Double, Double")]
- public void FromRgb_DOUBLE_RETURN()
- {
- /* TEST CODE */
- var color = Color.FromRgb(DoubleR, DoubleG, DoubleB);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
- Assert.AreEqual(Math.Round(DoubleR, 3), Math.Round(color.R, 3), "Value R of color should be same value r used to set this color.");
- Assert.AreEqual(Math.Round(DoubleG, 3), Math.Round(color.G, 3), "Value G of color should be same value g used to set this color.");
- Assert.AreEqual(Math.Round(DoubleB, 3), Math.Round(color.B, 3), "Value B of color should be same value b used to set this color.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Checl value returned by FromRgba.")]
- [Property("SPEC", "Xamarin.Forms.Color.FromRgba M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- [Property("COVPARAM", "int, int, int, int")]
- public void FromRgba_INT_RETURN()
- {
- /* TEST CODE */
- var color = Color.FromRgba(IntR, IntG, IntB, IntA);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
- Assert.AreEqual(Color.Red, color, "Value of color returned by FromHex should be is red.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Checl value returned by FromRgba.")]
- [Property("SPEC", "Xamarin.Forms.Color.FromRgba M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- [Property("COVPARAM", "Double, Double, Double, Double")]
- public void FromRgba_DOUBLE_RETURN()
- {
- /* TEST CODE */
- var color = Color.FromRgba(DoubleR, DoubleG, DoubleB, DoubleA);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
- Assert.AreEqual(Math.Round(DoubleR, 3), Math.Round(color.R,3), "Value R of color should be same value r used to set this color.");
- Assert.AreEqual(Math.Round(DoubleG, 3), Math.Round(color.G,3), "Value G of color should be same value g used to set this color.");
- Assert.AreEqual(Math.Round(DoubleB, 3), Math.Round(color.B,3), "Value B of color should be same value b used to set this color.");
- Assert.AreEqual(Math.Round(DoubleA, 3), Math.Round(color.A,3), "Value A of color should be same value a used to set this color.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Checl value returned by FromHsla.")]
- [Property("SPEC", "Xamarin.Forms.Color.FromHsla M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void FromHsla_DOUBLE_RETURN()
- {
- /* TEST CODE */
- var color = Color.FromHsla(Hue, Sat, Lum, 1);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
- Assert.AreEqual(Math.Round(Hue, 3), Math.Round(color.Hue, 3), "Value Hue of color should be same value Hue used to set this color.");
- Assert.AreEqual(Math.Round(Sat, 3), Math.Round(color.Saturation, 3), "Value Saturation of color should be same value Saturation used to set this color.");
- Assert.AreEqual(Math.Round(Lum, 3), Math.Round(color.Luminosity, 3), "Value Luminosity of color should be same value Luminosity used to set this color.");
- }
-
- [Test]
- [Category("P1")]
- [Description("check whether FormUint method works properly or not.")]
- [Property("SPEC", "Xamarin.Forms.Color.FromHsla M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void FromUnit_COLOR_RETURN()
- {
- Random rd = new Random();
- int num = rd.Next(1, 255);
- var color = Color.FromUint((uint)num);
- Assert.IsNotNull(color, "This object is not null");
- Assert.IsInstanceOf<Color>(color);
- }
-
- [Test]
- [Category("P1")]
- [Description("Checl value returned by FromHsla.")]
- [Property("SPEC", "Xamarin.Forms.Color.Hue")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PR0")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void Hue_GET()
- {
- /* PRECONDITION
- * 1. Create a color with FromHsla.
- */
- var color = Color.FromHsla(Hue, Sat, Lum, 1);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- double hue = color.Hue;
- Assert.AreEqual(Math.Round(Hue, 3), Math.Round(hue, 3), "Value Hue of color should be same value r used to set this color.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Checl value returned by Saturation.")]
- [Property("SPEC", "Xamarin.Forms.Color.Saturation A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PR0")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void Saturation_GET()
- {
- /* PRECONDITION
- * 1. Create a color with FromHsla.
- */
- var color = Color.FromHsla(Hue, Sat, Lum, 1);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- double saturation = color.Saturation;
- Assert.AreEqual(Math.Round(Sat, 3), Math.Round(saturation, 3), "Value Saturation of color should be same value r used to set this color.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Checl value returned by Luminosity.")]
- [Property("SPEC", "Xamarin.Forms.Color.Luminosity A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PR0")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void Luminosity_GET()
- {
- /* PRECONDITION
- * 1. Create a color with FromHsla.
- */
- var color = Color.FromHsla(Hue, Sat, Lum, 1);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- double luminosity = color.Luminosity;
- Assert.AreEqual(Math.Round(Lum, 3), Math.Round(luminosity, 3), "Value Luminosity of color should be same value r used to set this color.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Return a boolean indicating whether the given Color is equal to this Color instance.")]
- [Property("SPEC", "Xamarin.Forms.Color.Equals M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void Equals_COMPARE()
- {
- /* TEST CODE */
- var color1 = new Color(DoubleR, DoubleG, DoubleB, DoubleA);
- var check1 = _color.Equals(color1);
- Assert.IsTrue(check1, "Equals doens't get True after comparing 2 same colors");
- var color2 = new Color(0.3, 0.1, 0.2, 1);
- var check2 = _color.Equals(color2);
- Assert.IsFalse(check2, "Equals doens't get False after comparing 2 different colors");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of the GetHashCode method.")]
- [Property("SPEC", "Xamarin.Forms.Color.GetHashCode M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void GetHashCode_RETURN()
- {
- /* PRECONDITION
- */
- var color1 = Color.FromRgba(IntR, IntG, IntB, IntA);
- var color2 = Color.FromRgba(IntR, IntG, IntB, IntA);
- var color3 = Color.FromRgba(IntR, IntG, 16, 0);
-
- /* TEST CODE */
- var hashCode1 = color1.GetHashCode();
- var hashCode2 = color2.GetHashCode();
- var hashCode3 = color3.GetHashCode();
- Assert.AreEqual(hashCode1, hashCode2, "GetHashCode of two colors same should be same.");
- Assert.AreNotEqual(hashCode1, hashCode3, "GetHashCode of two colors not same should be not equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return type of the Equality method.")]
- [Property("SPEC", "Xamarin.Forms.Color.== M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void Equality_COMPARE()
- {
- /* TEST CODE */
- var color1 = new Color(DoubleR, DoubleG, DoubleB, DoubleA);
- var check1 = (_color == color1);
- Assert.IsTrue(check1, "Operator== doens't get True after comparing 2 same colors");
- var color2 = new Color(0.1, 0.4, 0.5, 0.2);
- var check2 = (_color == color2);
- Assert.IsFalse(check2, "Operator== doens't get False after comparing 2 different colors");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return type of the Inequality method.")]
- [Property("SPEC", "Xamarin.Forms.Color.!= M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void Inequality_COMPARE()
- {
- /* TEST CODE */
- var color1 = new Color(DoubleR, DoubleG, DoubleB, DoubleA);
- var check1 = (_color != color1);
- Assert.IsFalse(check1, "Operator!= doens't get False after comparing 2 same colors");
- var color2 = new Color(0.1, 0.4, 0.5, 0.2);
- var check2 = (_color != color2);
- Assert.IsTrue(check2, "Operator!= doens't get True after comparing 2 different colors");
- }
-
- [Test]
- [Category("P1")]
- [Description("Checl value returned by WithHue.")]
- [Property("SPEC", "Xamarin.Forms.Color.WithHue M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void WithHue_RETURN()
- {
- /* PRECONDITION
- * 1 Create a color via method FromHsla
- */
- var color = Color.FromHsla(Hue, Sat, Lum, 1);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
- Assert.AreEqual(Math.Round(Hue, 3), Math.Round(color.Hue, 3), "Value Hue of color should be same value Hue used to set this color.");
- Assert.AreEqual(Math.Round(Sat, 3), Math.Round(color.Saturation, 3), "Value Saturation of color should be same value Saturation used to set this color.");
- Assert.AreEqual(Math.Round(Lum, 3), Math.Round(color.Luminosity, 3), "Value Luminosity of color should be same value Luminosity used to set this color.");
- double newHue = 0.6;
-
- /* TEST CODE */
- var color1 = color.WithHue(newHue);
- Assert.AreEqual(Math.Round(newHue, 3), Math.Round(color1.Hue, 3), "Value Hue of color should be same value Hue had been changed by WithHue.");
- Assert.AreEqual(Math.Round(Sat, 3), Math.Round(color1.Saturation, 3), "Saturation of color should be keeping.");
- Assert.AreEqual(Math.Round(Lum, 3), Math.Round(color1.Luminosity, 3), "Luminosity of color should be keeping.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Checl value returned by WithLuminosity.")]
- [Property("SPEC", "Xamarin.Forms.Color.WithLuminosity M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void WithLuminosity_RETURN()
- {
- /* PRECONDITION
- * 1 Create a color via method FromHsla
- */
- var color = Color.FromHsla(Hue, Sat, Lum, 1);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
- Assert.AreEqual(Math.Round(Hue, 3), Math.Round(color.Hue, 3), "Value Hue of color should be same value Hue used to set this color.");
- Assert.AreEqual(Math.Round(Sat, 3), Math.Round(color.Saturation, 3), "Value Saturation of color should be same value Saturation used to set this color.");
- Assert.AreEqual(Math.Round(Lum, 3), Math.Round(color.Luminosity, 3), "Value Luminosity of color should be same value Luminosity used to set this color.");
- double newLuminosity = 0.6;
-
- /* TEST CODE */
- var color1 = color.WithLuminosity(newLuminosity);
- Assert.AreEqual(Math.Round(Hue, 3), Math.Round(color1.Hue, 3), "Hue of color should be keeping.");
- Assert.AreEqual(Math.Round(Sat, 3), Math.Round(color1.Saturation, 3), "Saturation of color should be keeping.");
- Assert.AreEqual(Math.Round(newLuminosity, 3), Math.Round(color1.Luminosity, 3), "Value Luminosity of color should be same value Luminosity had been changed by WithLuminosity.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Checl value returned by WithSaturation.")]
- [Property("SPEC", "Xamarin.Forms.Color.WithSaturation M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void WithSaturation_RETURN()
- {
- /* PRECONDITION
- * 1 Create a color via method FromHsla
- */
- var color = Color.FromHsla(Hue, Sat, Lum, 1);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
- Assert.AreEqual(Math.Round(Hue, 3), Math.Round(color.Hue, 3), "Value Hue of color should be same value Hue used to set this color.");
- Assert.AreEqual(Math.Round(Sat, 3), Math.Round(color.Saturation, 3), "Value Saturation of color should be same value Saturation used to set this color.");
- Assert.AreEqual(Math.Round(Lum, 3), Math.Round(color.Luminosity, 3), "Value Luminosity of color should be same value Luminosity used to set this color.");
- double newSaturation = 0.6;
-
- /* TEST CODE */
- var color1 = color.WithSaturation(newSaturation);
- Assert.AreEqual(Math.Round(Hue, 3), Math.Round(color1.Hue, 3), "Hue of color should be keeping.");
- Assert.AreEqual(Math.Round(newSaturation, 3), Math.Round(color1.Saturation, 3), "Value Saturation of color should be same value Saturation had been changed by WithSaturation.");
- Assert.AreEqual(Math.Round(Lum, 3), Math.Round(color1.Luminosity, 3), "Luminosity of color should be keeping.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Checl value returned by AddLuminosity.")]
- [Property("SPEC", "Xamarin.Forms.Color.AddLuminosity M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void AddLuminosity_RETURN()
- {
- /* PRECONDITION
- * 1 Create a color via method FromHsla
- */
- var color = Color.FromHsla(Hue, Sat, Lum, 1);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
- Assert.AreEqual(Math.Round(Hue, 3), Math.Round(color.Hue, 3), "Value Hue of color should be same value Hue used to set this color.");
- Assert.AreEqual(Math.Round(Sat, 3), Math.Round(color.Saturation, 3), "Value Saturation of color should be same value Saturation used to set this color.");
- Assert.AreEqual(Math.Round(Lum, 3), Math.Round(color.Luminosity, 3), "Value Luminosity of color should be same value Luminosity used to set this color.");
- double lum = 0.5;
-
- /* TEST CODE */
- var color1 = color.AddLuminosity(lum);
- Assert.AreEqual(Math.Round(Hue, 3), Math.Round(color1.Hue, 3), "Value Hue of color should be keeping.");
- Assert.AreEqual(Math.Round(Sat, 3), Math.Round(color1.Saturation, 3), "Value Hue of color should be keeping.");
- Assert.AreEqual(Math.Round(lum+Lum, 3), Math.Round(color1.Luminosity, 3), "Value Luminosity of color should be changed.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Checl value returned by MultiplyAlpha.")]
- [Property("SPEC", "Xamarin.Forms.Color.MultiplyAlpha M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void MultiplyAlpha_RETURN()
- {
- /* PRECONDITION
- * 1 Create a color via method FromRgba
- */
- var color = Color.FromRgba(DoubleR, DoubleG, DoubleB, DoubleA);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- double alpha = 0.3;
- var color1 = color.MultiplyAlpha(alpha);
- Assert.AreEqual(Math.Round(DoubleR, 3), Math.Round(color1.R, 3), "Value R of color should be keeping.");
- Assert.AreEqual(Math.Round(DoubleG, 3), Math.Round(color1.G, 3), "Value G of color should be keeping.");
- Assert.AreEqual(Math.Round(DoubleB, 3), Math.Round(color1.B, 3), "Value B of color should be keeping.");
- Assert.AreEqual(Math.Round(DoubleA*alpha, 3), Math.Round(color1.A, 3), "Value A of color should be changed.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Checl value returned by FromUint.")]
- [Property("SPEC", "Xamarin.Forms.Color.FromUint M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void FromUint_RETURN()
- {
- /* PRECONDITION
- * 1 Create a red color have alpha = 0 via method FromRgba
- */
- var color1 = Color.FromRgba(IntR, IntG, IntB, 0);
-
- /* TEST CODE */
- uint argb = 16711680; //AARRGGBB = "00FF0000"
- var color2 = Color.FromUint(argb);
- Assert.IsNotNull(color2, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color2);
- Assert.AreEqual(color1, color2, "Value of color returned by FromHex should be is red.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Checl value returned by ToString.")]
- [Property("SPEC", "Xamarin.Forms.Color.ToString M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void ToString_RETURN()
- {
- /* PRECONDITION
- * 1 Create a color via method FromRgb
- */
- var color = Color.FromRgb(IntR, IntG, IntB);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
- Assert.AreEqual(Color.Red, color, "Value of color returned by FromHex should be is red.");
-
- /* TEST CODE */
- var str = "[Color: A=1, R=1, G=0, B=0, Hue=1, Saturation=1, Luminosity=0.5]";
- Assert.AreEqual(str, color.ToString(), "ToString doesn't return properly");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property AliceBlue.")]
- [Property("SPEC", "Xamarin.Forms.Color.AliceBlue A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void AliceBlue_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a aqua color via FromHex.
- */
- string AliceBlue = "#FFF0F8FF";
- var color = Color.FromHex(AliceBlue);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color,Color.AliceBlue, "Property AliceBlue should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property AntiqueWhite.")]
- [Property("SPEC", "Xamarin.Forms.Color.AntiqueWhite A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void AntiqueWhite_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a AntiqueWhite color via FromHex.
- */
- string AntiqueWhite = "#FFFAEBD7";
- var color = Color.FromHex(AntiqueWhite);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.AntiqueWhite, "Property AntiqueWhite should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Aqua.")]
- [Property("SPEC", "Xamarin.Forms.Color.Aqua A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void Aqua_READONLY()
- {
- /* PRECONDITION
- * 1. Create a aqua color via FromHex.
- */
- string aqua = "#00ffff";
- var color = Color.FromHex(aqua);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Aqua, "Property Aqua should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Aquamarine.")]
- [Property("SPEC", "Xamarin.Forms.Color.Aquamarine A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Aquamarine_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a Aquamarine color via FromHex.
- */
- string Aquamarine = "#FF7FFFD4";
- var color = Color.FromHex(Aquamarine);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Aquamarine, "Property Aquamarine should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Azure.")]
- [Property("SPEC", "Xamarin.Forms.Color.Azure A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Azure_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a Azure color via FromHex.
- */
- string Azure = "#FFF0FFFF";
- var color = Color.FromHex(Azure);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Azure, "Property Azure should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Beige.")]
- [Property("SPEC", "Xamarin.Forms.Color.Beige A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Beige_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a Beige color via FromHex.
- */
- string Beige = "#FFF5F5DC";
- var color = Color.FromHex(Beige);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Beige, "Property Beige should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Bisque.")]
- [Property("SPEC", "Xamarin.Forms.Color.Bisque A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Bisque_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a Bisque color via FromHex.
- */
- string Bisque = "#FFFFE4C4";
- var color = Color.FromHex(Bisque);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Bisque, "Property Bisque should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Black.")]
- [Property("SPEC", "Xamarin.Forms.Color.Black A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void Black_READONLY()
- {
- /* PRECONDITION
- * 1. Create a black color via FromHex.
- */
- string black = "#000000";
- var color = Color.FromHex(black);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Black, "Property Black should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property BlanchedAlmond.")]
- [Property("SPEC", "Xamarin.Forms.Color.BlanchedAlmond A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void BlanchedAlmond_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a BlanchedAlmond color via FromHex.
- */
- string BlanchedAlmond = "#FFFFEBCD";
- var color = Color.FromHex(BlanchedAlmond);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.BlanchedAlmond, "Property BlanchedAlmond should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Blue.")]
- [Property("SPEC", "Xamarin.Forms.Color.Blue A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void Blue_READONLY()
- {
- /* PRECONDITION
- * 1. Create a blue color via FromHex.
- */
- string blue = "#0000ff";
- var color = Color.FromHex(blue);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Blue, "Property Blue should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property BlueViolet.")]
- [Property("SPEC", "Xamarin.Forms.Color.BlueViolet A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void BlueViolet_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a BlueViolet color via FromHex.
- */
- string BlueViolet = "#FF8A2BE2";
- var color = Color.FromHex(BlueViolet);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.BlueViolet, "Property BlueViolet should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Brown.")]
- [Property("SPEC", "Xamarin.Forms.Color.Brown A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Brown_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a Brown color via FromHex.
- */
- string Brown = "#FFA52A2A";
- var color = Color.FromHex(Brown);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Brown, "Property Brown should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property BurlyWood.")]
- [Property("SPEC", "Xamarin.Forms.Color.BurlyWood A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void BurlyWood_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a BurlyWood color via FromHex.
- */
- string BurlyWood = "#FFDEB887";
- var color = Color.FromHex(BurlyWood);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.BurlyWood, "Property BurlyWood should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property CadetBlue.")]
- [Property("SPEC", "Xamarin.Forms.Color.CadetBlue A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void CadetBlue_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a CadetBlue color via FromHex.
- */
- string CadetBlue = "#FF5F9EA0";
- var color = Color.FromHex(CadetBlue);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.CadetBlue, "Property CadetBlue should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Chartreuse.")]
- [Property("SPEC", "Xamarin.Forms.Color.Chartreuse A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Chartreuse_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a Chartreuse color via FromHex.
- */
- string Chartreuse = "#FF7FFF00";
- var color = Color.FromHex(Chartreuse);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Chartreuse, "Property Chartreuse should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Chocolate.")]
- [Property("SPEC", "Xamarin.Forms.Color.Chocolate A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Chocolate_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a Chocolate color via FromHex.
- */
- string Chocolate = "#FFD2691E";
- var color = Color.FromHex(Chocolate);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Chocolate, "Property Chocolate should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Coral.")]
- [Property("SPEC", "Xamarin.Forms.Color.Coral A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Coral_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a Coral color via FromHex.
- */
- string Coral = "#FFFF7F50";
- var color = Color.FromHex(Coral);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Coral, "Property Coral should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property CornflowerBlue.")]
- [Property("SPEC", "Xamarin.Forms.Color.CornflowerBlue A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void CornflowerBlue_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a CornflowerBlue color via FromHex.
- */
- string CornflowerBlue = "#FF6495ED";
- var color = Color.FromHex(CornflowerBlue);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.CornflowerBlue, "Property CornflowerBlue should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Cornsilk.")]
- [Property("SPEC", "Xamarin.Forms.Color.Cornsilk A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Cornsilk_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a Cornsilk color via FromHex.
- */
- string Cornsilk = "#FFFFF8DC";
- var color = Color.FromHex(Cornsilk);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Cornsilk, "Property Cornsilk should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Crimson.")]
- [Property("SPEC", "Xamarin.Forms.Color.Crimson A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Crimson_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a Crimson color via FromHex.
- */
- string Crimson = "#FFDC143C";
- var color = Color.FromHex(Crimson);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Crimson, "Property Crimson should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Cyan.")]
- [Property("SPEC", "Xamarin.Forms.Color.Cyan A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Cyan_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a Cyan color via FromHex.
- */
- string Cyan = "#FF00FFFF";
- var color = Color.FromHex(Cyan);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Cyan, "Property Cyan should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property DarkBlue.")]
- [Property("SPEC", "Xamarin.Forms.Color.DarkBlue A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void DarkBlue_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a DarkBlue color via FromHex.
- */
- string DarkBlue = "#FF00008B";
- var color = Color.FromHex(DarkBlue);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.DarkBlue, "Property DarkBlue should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property DarkCyan.")]
- [Property("SPEC", "Xamarin.Forms.Color.DarkCyan A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void DarkCyan_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a DarkCyan color via FromHex.
- */
- string DarkCyan = "#FF008B8B";
- var color = Color.FromHex(DarkCyan);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.DarkCyan, "Property DarkCyan should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property DarkGoldenrod.")]
- [Property("SPEC", "Xamarin.Forms.Color.DarkGoldenrod A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void DarkGoldenrod_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a DarkGoldenrod color via FromHex.
- */
- string DarkGoldenrod = "#FFB8860B";
- var color = Color.FromHex(DarkGoldenrod);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.DarkGoldenrod, "Property DarkGoldenrod should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property DarkGray.")]
- [Property("SPEC", "Xamarin.Forms.Color.DarkGray A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void DarkGray_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a DarkGray color via FromHex.
- */
- string DarkGray = "#FFA9A9A9";
- var color = Color.FromHex(DarkGray);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.DarkGray, "Property DarkGray should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property DarkGreen.")]
- [Property("SPEC", "Xamarin.Forms.Color.DarkGreen A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void DarkGreen_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a DarkGreen color via FromHex.
- */
- string DarkGreen = "#FF006400";
- var color = Color.FromHex(DarkGreen);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.DarkGreen, "Property DarkGreen should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property DarkKhaki.")]
- [Property("SPEC", "Xamarin.Forms.Color.DarkKhaki A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void DarkKhaki_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a DarkKhaki color via FromHex.
- */
- string DarkKhaki = "#FFBDB76B";
- var color = Color.FromHex(DarkKhaki);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.DarkKhaki, "Property DarkKhaki should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property DarkMagenta.")]
- [Property("SPEC", "Xamarin.Forms.Color.DarkMagenta A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void DarkMagenta_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a DarkMagenta color via FromHex.
- */
- string DarkMagenta = "#FF8B008B";
- var color = Color.FromHex(DarkMagenta);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.DarkMagenta, "Property DarkMagenta should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property DarkOliveGreen.")]
- [Property("SPEC", "Xamarin.Forms.Color.DarkOliveGreen A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void DarkOliveGreen_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a DarkOliveGreen color via FromHex.
- */
- string DarkOliveGreen = "#FF556B2F";
- var color = Color.FromHex(DarkOliveGreen);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.DarkOliveGreen, "Property DarkOliveGreen should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property DarkOrange.")]
- [Property("SPEC", "Xamarin.Forms.Color.DarkOrange A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void DarkOrange_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a DarkOrange color via FromHex.
- */
- string DarkOrange = "#FFFF8C00";
- var color = Color.FromHex(DarkOrange);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.DarkOrange, "Property DarkOrange should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property DarkOrchid.")]
- [Property("SPEC", "Xamarin.Forms.Color.DarkOrchid A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void DarkOrchid_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a DarkOrchid color via FromHex.
- */
- string DarkOrchid = "#FF9932CC";
- var color = Color.FromHex(DarkOrchid);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.DarkOrchid, "Property DarkOrchid should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property DarkRed.")]
- [Property("SPEC", "Xamarin.Forms.Color.DarkRed A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void DarkRed_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a DarkRed color via FromHex.
- */
- string DarkRed = "#FF8B0000";
- var color = Color.FromHex(DarkRed);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.DarkRed, "Property DarkRed should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property DarkSalmon.")]
- [Property("SPEC", "Xamarin.Forms.Color.DarkSalmon A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void DarkSalmon_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a DarkSalmon color via FromHex.
- */
- string DarkSalmon = "#FFE9967A";
- var color = Color.FromHex(DarkSalmon);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.DarkSalmon, "Property DarkSalmon should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property DarkSeaGreen.")]
- [Property("SPEC", "Xamarin.Forms.Color.DarkSeaGreen A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void DarkSeaGreen_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a DarkSeaGreen color via FromHex.
- */
- string DarkSeaGreen = "#FF8FBC8F";
- var color = Color.FromHex(DarkSeaGreen);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.DarkSeaGreen, "Property DarkSeaGreen should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property DarkSlateBlue.")]
- [Property("SPEC", "Xamarin.Forms.Color.DarkSlateBlue A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void DarkSlateBlue_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a DarkSlateBlue color via FromHex.
- */
- string DarkSlateBlue = "#FF483D8B";
- var color = Color.FromHex(DarkSlateBlue);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.DarkSlateBlue, "Property DarkSlateBlue should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property DarkSlateGray.")]
- [Property("SPEC", "Xamarin.Forms.Color.DarkSlateGray A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void DarkSlateGray_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a DarkSlateGray color via FromHex.
- */
- string DarkSlateGray = "#FF2F4F4F";
- var color = Color.FromHex(DarkSlateGray);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.DarkSlateGray, "Property DarkSlateGray should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property DarkTurquoise.")]
- [Property("SPEC", "Xamarin.Forms.Color.DarkTurquoise A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void DarkTurquoise_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a DarkTurquoise color via FromHex.
- */
- string DarkTurquoise = "#FF00CED1";
- var color = Color.FromHex(DarkTurquoise);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.DarkTurquoise, "Property DarkTurquoise should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property DarkViolet.")]
- [Property("SPEC", "Xamarin.Forms.Color.DarkViolet A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void DarkViolet_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a DarkViolet color via FromHex.
- */
- string DarkViolet = "#FF9400D3";
- var color = Color.FromHex(DarkViolet);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.DarkViolet, "Property DarkViolet should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property DeepPink.")]
- [Property("SPEC", "Xamarin.Forms.Color.DeepPink A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void DeepPink_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a DeepPink color via FromHex.
- */
- string DeepPink = "#FFFF1493";
- var color = Color.FromHex(DeepPink);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.DeepPink, "Property DeepPink should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property DeepSkyBlue.")]
- [Property("SPEC", "Xamarin.Forms.Color.DeepSkyBlue A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void DeepSkyBlue_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a DeepSkyBlue color via FromHex.
- */
- string DeepSkyBlue = "#FF00BFFF";
- var color = Color.FromHex(DeepSkyBlue);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.DeepSkyBlue, "Property DeepSkyBlue should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property DimGray.")]
- [Property("SPEC", "Xamarin.Forms.Color.DimGray A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void DimGray_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a DimGray color via FromHex.
- */
- string DimGray = "#FF696969";
- var color = Color.FromHex(DimGray);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.DimGray, "Property DimGray should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property DodgerBlue.")]
- [Property("SPEC", "Xamarin.Forms.Color.DodgerBlue A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void DodgerBlue_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a DodgerBlue color via FromHex.
- */
- string DodgerBlue = "#FF1E90FF";
- var color = Color.FromHex(DodgerBlue);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.DodgerBlue, "Property DodgerBlue should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Firebrick.")]
- [Property("SPEC", "Xamarin.Forms.Color.Firebrick A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Firebrick_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a Firebrick color via FromHex.
- */
- string Firebrick = "#FFB22222";
- var color = Color.FromHex(Firebrick);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Firebrick, "Property Firebrick should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property FloralWhite.")]
- [Property("SPEC", "Xamarin.Forms.Color.FloralWhite A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void FloralWhite_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a FloralWhite color via FromHex.
- */
- string FloralWhite = "#FFFFFAF0";
- var color = Color.FromHex(FloralWhite);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.FloralWhite, "Property FloralWhite should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property ForestGreen.")]
- [Property("SPEC", "Xamarin.Forms.Color.ForestGreen A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void ForestGreen_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a ForestGreen color via FromHex.
- */
- string ForestGreen = "#FF228B22";
- var color = Color.FromHex(ForestGreen);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.ForestGreen, "Property ForestGreen should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Fuchsia.")]
- [Property("SPEC", "Xamarin.Forms.Color.Fuchsia A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void Fuchsia_READONLY()
- {
- /* PRECONDITION
- * 1. Create a fuchsia color via FromHex.
- */
- string fuchsia = "#ff00ff";
- var color = Color.FromHex(fuchsia);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Fuchsia, "Property Fuchsia should same color create via hex string refer document.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Fuschia.")]
- [Property("SPEC", "Xamarin.Forms.Color.Fuschia A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void Fuschia_READONLY()
- {
- /* PRECONDITION
- * 1. Create a fuschia color via FromHex.
- */
- string fuschia = "#ff00ff";
- var color = Color.FromHex(fuschia);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Fuschia, "Property Fuschia should same color create via hex string refer document.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Gainsboro.")]
- [Property("SPEC", "Xamarin.Forms.Color.Gainsboro A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Gainsboro_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a Gainsboro color via FromHex.
- */
- string Gainsboro = "#FFDCDCDC";
- var color = Color.FromHex(Gainsboro);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Gainsboro, "Property Gainsboro should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property GhostWhite.")]
- [Property("SPEC", "Xamarin.Forms.Color.GhostWhite A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void GhostWhite_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a GhostWhite color via FromHex.
- */
- string GhostWhite = "#FFF8F8FF";
- var color = Color.FromHex(GhostWhite);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.GhostWhite, "Property GhostWhite should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Gold.")]
- [Property("SPEC", "Xamarin.Forms.Color.Gold A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Gold_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a Gold color via FromHex.
- */
- string Gold = "#FFFFD700";
- var color = Color.FromHex(Gold);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Gold, "Property Gold should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Goldenrod.")]
- [Property("SPEC", "Xamarin.Forms.Color.Goldenrod A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Goldenrod_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a Goldenrod color via FromHex.
- */
- string Goldenrod = "#FFDAA520";
- var color = Color.FromHex(Goldenrod);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Goldenrod, "Property Goldenrod should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Gray.")]
- [Property("SPEC", "Xamarin.Forms.Color.Gray A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void Gray_READONLY()
- {
- /* PRECONDITION
- * 1. Create a gray color via FromHex.
- */
- string gray = "#808080";
- var color = Color.FromHex(gray);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Gray, "Property Gray should same color create via hex string refer document.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Green.")]
- [Property("SPEC", "Xamarin.Forms.Color.Green A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void Green_READONLY()
- {
- /* PRECONDITION
- * 1. Create a green color via FromHex.
- */
- string green = "#008000";
- var color = Color.FromHex(green);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Green, "Property Green should same color create via hex string refer document.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property GreenYellow.")]
- [Property("SPEC", "Xamarin.Forms.Color.GreenYellow A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void GreenYellow_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a GreenYellow color via FromHex.
- */
- string GreenYellow = "#FFADFF2F";
- var color = Color.FromHex(GreenYellow);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.GreenYellow, "Property GreenYellow should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Honeydew.")]
- [Property("SPEC", "Xamarin.Forms.Color.Honeydew A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Honeydew_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a Honeydew color via FromHex.
- */
- string Honeydew = "#FFF0FFF0";
- var color = Color.FromHex(Honeydew);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Honeydew, "Property Honeydew should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property HotPink.")]
- [Property("SPEC", "Xamarin.Forms.Color.HotPink A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void HotPink_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a HotPink color via FromHex.
- */
- string HotPink = "#FFFF69B4";
- var color = Color.FromHex(HotPink);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.HotPink, "Property HotPink should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property IndianRed.")]
- [Property("SPEC", "Xamarin.Forms.Color.IndianRed A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void IndianRed_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a IndianRed color via FromHex.
- */
- string IndianRed = "#FFCD5C5C";
- var color = Color.FromHex(IndianRed);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.IndianRed, "Property IndianRed should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Indigo.")]
- [Property("SPEC", "Xamarin.Forms.Color.Indigo A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Indigo_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a Indigo color via FromHex.
- */
- string Indigo = "#FF4B0082";
- var color = Color.FromHex(Indigo);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Indigo, "Property Indigo should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Ivory.")]
- [Property("SPEC", "Xamarin.Forms.Color.Ivory A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Ivory_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a Ivory color via FromHex.
- */
- string Ivory = "#FFFFFFF0";
- var color = Color.FromHex(Ivory);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Ivory, "Property Ivory should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Khaki.")]
- [Property("SPEC", "Xamarin.Forms.Color.Khaki A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Khaki_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a Khaki color via FromHex.
- */
- string Khaki = "#FFF0E68C";
- var color = Color.FromHex(Khaki);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Khaki, "Property Khaki should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Lavender.")]
- [Property("SPEC", "Xamarin.Forms.Color.Lavender A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Lavender_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a Lavender color via FromHex.
- */
- string Lavender = "#FFE6E6FA";
- var color = Color.FromHex(Lavender);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Lavender, "Property Lavender should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property LavenderBlush.")]
- [Property("SPEC", "Xamarin.Forms.Color.LavenderBlush A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void LavenderBlush_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a LavenderBlush color via FromHex.
- */
- string LavenderBlush = "#FFFFF0F5";
- var color = Color.FromHex(LavenderBlush);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.LavenderBlush, "Property LavenderBlush should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property LawnGreen.")]
- [Property("SPEC", "Xamarin.Forms.Color.LawnGreen A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void LawnGreen_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a LawnGreen color via FromHex.
- */
- string LawnGreen = "#FF7CFC00";
- var color = Color.FromHex(LawnGreen);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.LawnGreen, "Property LawnGreen should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property LemonChiffon.")]
- [Property("SPEC", "Xamarin.Forms.Color.LemonChiffon A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void LemonChiffon_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a LemonChiffon color via FromHex.
- */
- string LemonChiffon = "#FFFFFACD";
- var color = Color.FromHex(LemonChiffon);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.LemonChiffon, "Property LemonChiffon should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property LightBlue.")]
- [Property("SPEC", "Xamarin.Forms.Color.LightBlue A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void LightBlue_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a LightBlue color via FromHex.
- */
- string LightBlue = "#FFADD8E6";
- var color = Color.FromHex(LightBlue);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.LightBlue, "Property LightBlue should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property LightCoral.")]
- [Property("SPEC", "Xamarin.Forms.Color.LightCoral A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void LightCoral_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a LightCoral color via FromHex.
- */
- string LightCoral = "#FFF08080";
- var color = Color.FromHex(LightCoral);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.LightCoral, "Property LightCoral should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property LightCyan.")]
- [Property("SPEC", "Xamarin.Forms.Color.LightCyan A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void LightCyan_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a LightCyan color via FromHex.
- */
- string LightCyan = "#FFE0FFFF";
- var color = Color.FromHex(LightCyan);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.LightCyan, "Property LightCyan should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property LightGoldenrodYellow.")]
- [Property("SPEC", "Xamarin.Forms.Color.LightGoldenrodYellow A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void LightGoldenrodYellow_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a LightGoldenrodYellow color via FromHex.
- */
- string LightGoldenrodYellow = "#FFFAFAD2";
- var color = Color.FromHex(LightGoldenrodYellow);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.LightGoldenrodYellow, "Property LightGoldenrodYellow should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property LightGray.")]
- [Property("SPEC", "Xamarin.Forms.Color.LightGray A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void LightGray_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a LightGray color via FromHex.
- */
- string LightGray = "#FFD3D3D3";
- var color = Color.FromHex(LightGray);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.LightGray, "Property LightGray should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property LightGreen.")]
- [Property("SPEC", "Xamarin.Forms.Color.LightGreen A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void LightGreen_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a LightGray color via FromHex.
- */
- string LightGreen = "#FF90EE90";
- var color = Color.FromHex(LightGreen);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.LightGreen, "Property LightGreen should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property LightPink.")]
- [Property("SPEC", "Xamarin.Forms.Color.LightPink A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void LightPink_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a LightPink color via FromHex.
- */
- string LightPink = "#FFFFB6C1";
- var color = Color.FromHex(LightPink);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.LightPink, "Property LightPink should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property LightSalmon.")]
- [Property("SPEC", "Xamarin.Forms.Color.LightSalmon A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void LightSalmon_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a LightSalmon color via FromHex.
- */
- string LightSalmon = "#FFFFA07A";
- var color = Color.FromHex(LightSalmon);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.LightSalmon, "Property LightSalmon should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property LightSeaGreen.")]
- [Property("SPEC", "Xamarin.Forms.Color.LightSeaGreen A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void LightSeaGreen_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a LightSeaGreen color via FromHex.
- */
- string LightSeaGreen = "#FF20B2AA";
- var color = Color.FromHex(LightSeaGreen);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.LightSeaGreen, "Property LightSeaGreen should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property LightSkyBlue.")]
- [Property("SPEC", "Xamarin.Forms.Color.LightSkyBlue A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void LightSkyBlue_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a LightSkyBlue color via FromHex.
- */
- string LightSkyBlue = "#FF87CEFA";
- var color = Color.FromHex(LightSkyBlue);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.LightSkyBlue, "Property LightSkyBlue should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property LightSlateGray.")]
- [Property("SPEC", "Xamarin.Forms.Color.LightSlateGray A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void LightSlateGray_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a LightSlateGray color via FromHex.
- */
- string LightSlateGray = "#FF778899";
- var color = Color.FromHex(LightSlateGray);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.LightSlateGray, "Property LightSlateGray should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property LightSteelBlue.")]
- [Property("SPEC", "Xamarin.Forms.Color.LightSteelBlue A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void LightSteelBlue_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a LightSlateGray color via FromHex.
- */
- string LightSteelBlue = "#FFB0C4DE";
- var color = Color.FromHex(LightSteelBlue);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.LightSteelBlue, "Property LightSteelBlue should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property LightYellow.")]
- [Property("SPEC", "Xamarin.Forms.Color.LightYellow A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void LightYellow_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a LightYellow color via FromHex.
- */
- string LightYellow = "#FFFFFFE0";
- var color = Color.FromHex(LightYellow);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.LightYellow, "Property LightYellow should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Lime.")]
- [Property("SPEC", "Xamarin.Forms.Color.Lime A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void Lime_READONLY()
- {
- /* PRECONDITION
- * 1. Create a lime color via FromHex.
- */
- string lime = "#00ff00";
- var color = Color.FromHex(lime);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Lime, "Property Lime should same color create via hex string refer document.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property LimeGreen.")]
- [Property("SPEC", "Xamarin.Forms.Color.LimeGreen A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void LimeGreen_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a LimeGreen color via FromHex.
- */
- string LimeGreen = "#FF32CD32";
- var color = Color.FromHex(LimeGreen);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.LimeGreen, "Property LimeGreen should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Linen.")]
- [Property("SPEC", "Xamarin.Forms.Color.Linen A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Linen_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a Linen color via FromHex.
- */
- string Linen = "#FFFAF0E6";
- var color = Color.FromHex(Linen);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Linen, "Property Linen should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Magenta.")]
- [Property("SPEC", "Xamarin.Forms.Color.Magenta A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Magenta_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a Magenta color via FromHex.
- */
- string Magenta = "#FFFF00FF";
- var color = Color.FromHex(Magenta);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Magenta, "Property Magenta should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Maroon.")]
- [Property("SPEC", "Xamarin.Forms.Color.Maroon A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void Maroon_READONLY()
- {
- /* PRECONDITION
- * 1. Create a maroon color via FromHex.
- */
- string maroon = "#800000";
- var color = Color.FromHex(maroon);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Maroon, "Property Maroon should same color create via hex string refer document.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property MediumAquamarine.")]
- [Property("SPEC", "Xamarin.Forms.Color.MediumAquamarine A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void MediumAquamarine_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a MediumAquamarine color via FromHex.
- */
- string MediumAquamarine = "#FF66CDAA";
- var color = Color.FromHex(MediumAquamarine);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.MediumAquamarine, "Property MediumAquamarine should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property MediumBlue.")]
- [Property("SPEC", "Xamarin.Forms.Color.MediumBlue A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void MediumBlue_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a MediumBlue color via FromHex.
- */
- string MediumBlue = "#FF0000CD";
- var color = Color.FromHex(MediumBlue);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.MediumBlue, "Property MediumBlue should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property MediumOrchid.")]
- [Property("SPEC", "Xamarin.Forms.Color.MediumOrchid A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void MediumOrchid_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a MediumOrchid color via FromHex.
- */
- string MediumOrchid = "#FFBA55D3";
- var color = Color.FromHex(MediumOrchid);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.MediumOrchid, "Property MediumOrchid should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property MediumPurple.")]
- [Property("SPEC", "Xamarin.Forms.Color.MediumPurple A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void MediumPurple_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a MediumPurple color via FromHex.
- */
- string MediumPurple = "#FF9370DB";
- var color = Color.FromHex(MediumPurple);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.MediumPurple, "Property MediumPurple should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property MediumSeaGreen.")]
- [Property("SPEC", "Xamarin.Forms.Color.MediumSeaGreen A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void MediumSeaGreen_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a MediumSeaGreen color via FromHex.
- */
- string MediumSeaGreen = "#FF3CB371";
- var color = Color.FromHex(MediumSeaGreen);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.MediumSeaGreen, "Property MediumSeaGreen should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property MediumSlateBlue.")]
- [Property("SPEC", "Xamarin.Forms.Color.MediumSlateBlue A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void MediumSlateBlue_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a MediumSlateBlue color via FromHex.
- */
- string MediumSlateBlue = "#FF7B68EE";
- var color = Color.FromHex(MediumSlateBlue);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.MediumSlateBlue, "Property MediumSlateBlue should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property MediumSpringGreen.")]
- [Property("SPEC", "Xamarin.Forms.Color.MediumSpringGreen A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void MediumSpringGreen_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a MediumSpringGreen color via FromHex.
- */
- string MediumSpringGreen = "#FF00FA9A";
- var color = Color.FromHex(MediumSpringGreen);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.MediumSpringGreen, "Property MediumSpringGreen should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property MediumTurquoise.")]
- [Property("SPEC", "Xamarin.Forms.Color.MediumTurquoise A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void MediumTurquoise_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a MediumTurquoise color via FromHex.
- */
- string MediumTurquoise = "#FF48D1CC";
- var color = Color.FromHex(MediumTurquoise);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.MediumTurquoise, "Property MediumTurquoise should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property MediumVioletRed.")]
- [Property("SPEC", "Xamarin.Forms.Color.MediumVioletRed A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void MediumVioletRed_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a MediumVioletRed color via FromHex.
- */
- string MediumVioletRed = "#FFC71585";
- var color = Color.FromHex(MediumVioletRed);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.MediumVioletRed, "Property MediumVioletRed should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property MidnightBlue.")]
- [Property("SPEC", "Xamarin.Forms.Color.MidnightBlue A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void MidnightBlue_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a MidnightBlue color via FromHex.
- */
- string MidnightBlue = "#FF191970";
- var color = Color.FromHex(MidnightBlue);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.MidnightBlue, "Property MidnightBlue should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property MintCream.")]
- [Property("SPEC", "Xamarin.Forms.Color.MintCream A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void MintCream_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a MintCream color via FromHex.
- */
- string MintCream = "#FFF5FFFA";
- var color = Color.FromHex(MintCream);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.MintCream, "Property MintCream should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property MistyRose.")]
- [Property("SPEC", "Xamarin.Forms.Color.MistyRose A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void MistyRose_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a MistyRose color via FromHex.
- */
- string MistyRose = "#FFFFE4E1";
- var color = Color.FromHex(MistyRose);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.MistyRose, "Property MistyRose should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Moccasin.")]
- [Property("SPEC", "Xamarin.Forms.Color.Moccasin A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Moccasin_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a Moccasin color via FromHex.
- */
- string Moccasin = "#FFFFE4B5";
- var color = Color.FromHex(Moccasin);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Moccasin, "Property Moccasin should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property NavajoWhite.")]
- [Property("SPEC", "Xamarin.Forms.Color.NavajoWhite A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void NavajoWhite_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a NavajoWhite color via FromHex.
- */
- string NavajoWhite = "#FFFFDEAD";
- var color = Color.FromHex(NavajoWhite);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.NavajoWhite, "Property NavajoWhite should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Navy.")]
- [Property("SPEC", "Xamarin.Forms.Color.Navy A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void Navy_READONLY()
- {
- /* PRECONDITION
- * 1. Create a navy color via FromHex.
- */
- string navy = "#000080";
- var color = Color.FromHex(navy);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Navy, "Property Navy should same color create via hex string refer document.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property OldLace.")]
- [Property("SPEC", "Xamarin.Forms.Color.OldLace A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void OldLace_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a OldLace color via FromHex.
- */
- string OldLace = "#FFFDF5E6";
- var color = Color.FromHex(OldLace);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.OldLace, "Property OldLace should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Olive.")]
- [Property("SPEC", "Xamarin.Forms.Color.Olive A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void Olive_READONLY()
- {
- /* PRECONDITION
- * 1. Create a olive color via FromHex.
- */
- string olive = "#808000";
- var color = Color.FromHex(olive);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Olive, "Property Olive should same color create via hex string refer document.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property OliveDrab.")]
- [Property("SPEC", "Xamarin.Forms.Color.OliveDrab A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void OliveDrab_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a OliveDrab color via FromHex.
- */
- string OliveDrab = "#FF6B8E23";
- var color = Color.FromHex(OliveDrab);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.OliveDrab, "Property OliveDrab should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Orange.")]
- [Property("SPEC", "Xamarin.Forms.Color.Orange A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void Orange_READONLY()
- {
- /* PRECONDITION
- * 1. Create a orange color via FromHex.
- */
- string orange = "#ffa500";
- var color = Color.FromHex(orange);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Orange, "Property Orange should same color create via hex string refer document.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property OrangeRed.")]
- [Property("SPEC", "Xamarin.Forms.Color.OrangeRed A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void OrangeRed_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a OrangeRed color via FromHex.
- */
- string OrangeRed = "#FFFF4500";
- var color = Color.FromHex(OrangeRed);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.OrangeRed, "Property OrangeRed should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Orchid.")]
- [Property("SPEC", "Xamarin.Forms.Color.Orchid A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Orchid_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a Orchid color via FromHex.
- */
- string Orchid = "#FFDA70D6";
- var color = Color.FromHex(Orchid);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Orchid, "Property Orchid should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property PaleGoldenrod.")]
- [Property("SPEC", "Xamarin.Forms.Color.PaleGoldenrod A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void PaleGoldenrod_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a PaleGoldenrod color via FromHex.
- */
- string PaleGoldenrod = "#FFEEE8AA";
- var color = Color.FromHex(PaleGoldenrod);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.PaleGoldenrod, "Property PaleGoldenrod should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property PaleGreen.")]
- [Property("SPEC", "Xamarin.Forms.Color.PaleGreen A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void PaleGreen_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a PaleGreen color via FromHex.
- */
- string PaleGreen = "#FF98FB98";
- var color = Color.FromHex(PaleGreen);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.PaleGreen, "Property PaleGreen should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property PaleTurquoise.")]
- [Property("SPEC", "Xamarin.Forms.Color.PaleTurquoise A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void PaleTurquoise_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a PaleTurquoise color via FromHex.
- */
- string PaleTurquoise = "#FFAFEEEE";
- var color = Color.FromHex(PaleTurquoise);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.PaleTurquoise, "Property PaleTurquoise should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property PaleVioletRed.")]
- [Property("SPEC", "Xamarin.Forms.Color.PaleVioletRed A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void PaleVioletRed_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a PaleVioletRed color via FromHex.
- */
- string PaleVioletRed = "#FFDB7093";
- var color = Color.FromHex(PaleVioletRed);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.PaleVioletRed, "Property PaleVioletRed should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property PapayaWhip.")]
- [Property("SPEC", "Xamarin.Forms.Color.PapayaWhip A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void PapayaWhip_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a PapayaWhip color via FromHex.
- */
- string PapayaWhip = "#FFFFEFD5";
- var color = Color.FromHex(PapayaWhip);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.PapayaWhip, "Property PapayaWhip should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property PeachPuff.")]
- [Property("SPEC", "Xamarin.Forms.Color.PeachPuff A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void PeachPuff_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a PeachPuff color via FromHex.
- */
- string PeachPuff = "#FFFFDAB9";
- var color = Color.FromHex(PeachPuff);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.PeachPuff, "Property PeachPuff should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Peru.")]
- [Property("SPEC", "Xamarin.Forms.Color.Peru A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Peru_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a Peru color via FromHex.
- */
- string Peru = "#FFCD853F";
- var color = Color.FromHex(Peru);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Peru, "Property Peru should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Pink.")]
- [Property("SPEC", "Xamarin.Forms.Color.Pink A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void Pink_READONLY()
- {
- /* PRECONDITION
- * 1. Create a pink color via FromHex.
- */
- string pink = "#ffc0cb";
- var color = Color.FromHex(pink);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Pink, "Property Pink should same color create via hex string refer document.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Plum.")]
- [Property("SPEC", "Xamarin.Forms.Color.Plum A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Plum_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a Plum color via FromHex.
- */
- string Plum = "#FFDDA0DD";
- var color = Color.FromHex(Plum);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Plum, "Property Plum should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property PowderBlue.")]
- [Property("SPEC", "Xamarin.Forms.Color.PowderBlue A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void PowderBlue_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a PowderBlue color via FromHex.
- */
- string PowderBlue = "#FFB0E0E6";
- var color = Color.FromHex(PowderBlue);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.PowderBlue, "Property PowderBlue should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Purple.")]
- [Property("SPEC", "Xamarin.Forms.Color.Purple A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void Purple_READONLY()
- {
- /* PRECONDITION
- * 1. Create a purple color via FromHex.
- */
- string purple = "#800080";
- var color = Color.FromHex(purple);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Purple, "Property Purple should same color create via hex string refer document.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Red.")]
- [Property("SPEC", "Xamarin.Forms.Color.Red A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void Red_READONLY()
- {
- /* PRECONDITION
- * 1. Create a red color via FromHex.
- */
- string red = "#ff0000";
- var color = Color.FromHex(red);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Red, "Property Red should same color create via hex string refer document.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property RosyBrown.")]
- [Property("SPEC", "Xamarin.Forms.Color.RosyBrown A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void RosyBrown_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a RosyBrown color via FromHex.
- */
- string RosyBrown = "#FFBC8F8F";
- var color = Color.FromHex(RosyBrown);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.RosyBrown, "Property RosyBrown should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property RoyalBlue.")]
- [Property("SPEC", "Xamarin.Forms.Color.RoyalBlue A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void RoyalBlue_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a RoyalBlue color via FromHex.
- */
- string RoyalBlue = "#FF4169E1";
- var color = Color.FromHex(RoyalBlue);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.RoyalBlue, "Property RoyalBlue should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property SaddleBrown.")]
- [Property("SPEC", "Xamarin.Forms.Color.SaddleBrown A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void SaddleBrown_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a SaddleBrown color via FromHex.
- */
- string SaddleBrown = "#FF8B4513";
- var color = Color.FromHex(SaddleBrown);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.SaddleBrown, "Property SaddleBrown should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Salmon.")]
- [Property("SPEC", "Xamarin.Forms.Color.Salmon A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Salmon_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a Salmon color via FromHex.
- */
- string Salmon = "#FFFA8072";
- var color = Color.FromHex(Salmon);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Salmon, "Property Salmon should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property SandyBrown.")]
- [Property("SPEC", "Xamarin.Forms.Color.SandyBrown A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void SandyBrown_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a SandyBrown color via FromHex.
- */
- string SandyBrown = "#FFF4A460";
- var color = Color.FromHex(SandyBrown);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.SandyBrown, "Property SandyBrown should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property SeaGreen.")]
- [Property("SPEC", "Xamarin.Forms.Color.SeaGreen A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void SeaGreen_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a SeaGreen color via FromHex.
- */
- string SeaGreen = "#FF2E8B57";
- var color = Color.FromHex(SeaGreen);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.SeaGreen, "Property SeaGreen should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property SeaShell.")]
- [Property("SPEC", "Xamarin.Forms.Color.SeaShell A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void SeaShell_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a SeaShell color via FromHex.
- */
- string SeaShell = "#FFFFF5EE";
- var color = Color.FromHex(SeaShell);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.SeaShell, "Property SeaShell should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Sienna.")]
- [Property("SPEC", "Xamarin.Forms.Color.Sienna A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Sienna_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a Sienna color via FromHex.
- */
- string Sienna = "#FFA0522D";
- var color = Color.FromHex(Sienna);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Sienna, "Property Sienna should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Silver.")]
- [Property("SPEC", "Xamarin.Forms.Color.Silver A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void Silver_READONLY()
- {
- /* PRECONDITION
- * 1. Create a silver color via FromHex.
- */
- string silver = "#c0c0c0";
- var color = Color.FromHex(silver);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Silver, "Property Silver should same color create via hex string refer document.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property SkyBlue.")]
- [Property("SPEC", "Xamarin.Forms.Color.SkyBlue A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void SkyBlue_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a SkyBlue color via FromHex.
- */
- string SkyBlue = "#FF87CEEB";
- var color = Color.FromHex(SkyBlue);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.SkyBlue, "Property SkyBlue should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property SlateBlue.")]
- [Property("SPEC", "Xamarin.Forms.Color.SlateBlue A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void SlateBlue_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a SlateBlue color via FromHex.
- */
- string SlateBlue = "#FF6A5ACD";
- var color = Color.FromHex(SlateBlue);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.SlateBlue, "Property SlateBlue should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property SlateGray.")]
- [Property("SPEC", "Xamarin.Forms.Color.SlateGray A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void SlateGray_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a SlateGray color via FromHex.
- */
- string SlateGray = "#FF708090";
- var color = Color.FromHex(SlateGray);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.SlateGray, "Property SlateGray should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Snow.")]
- [Property("SPEC", "Xamarin.Forms.Color.Snow A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Snow_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a Snow color via FromHex.
- */
- string Snow = "#FFFFFAFA";
- var color = Color.FromHex(Snow);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Snow, "Property Snow should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property SpringGreen.")]
- [Property("SPEC", "Xamarin.Forms.Color.SpringGreen A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void SpringGreen_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a SpringGreen color via FromHex.
- */
- string SpringGreen = "#FF00FF7F";
- var color = Color.FromHex(SpringGreen);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.SpringGreen, "Property SpringGreen should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property SteelBlue.")]
- [Property("SPEC", "Xamarin.Forms.Color.SteelBlue A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void SteelBlue_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a SteelBlue color via FromHex.
- */
- string SteelBlue = "#FF4682B4";
- var color = Color.FromHex(SteelBlue);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.SteelBlue, "Property SteelBlue should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Tan.")]
- [Property("SPEC", "Xamarin.Forms.Color.Tan A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Tan_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a Tan color via FromHex.
- */
- string Tan = "#FFD2B48C";
- var color = Color.FromHex(Tan);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Tan, "Property Tan should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Teal.")]
- [Property("SPEC", "Xamarin.Forms.Color.Teal A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void Teal_READONLY()
- {
- /* PRECONDITION
- * 1. Create a teal color via FromHex.
- */
- string teal = "#008080";
- var color = Color.FromHex(teal);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Teal, "Property Teal should same color create via hex string refer document.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Thistle.")]
- [Property("SPEC", "Xamarin.Forms.Color.Thistle A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Thistle_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a Thistle color via FromHex.
- */
- string Thistle = "#FFD8BFD8";
- var color = Color.FromHex(Thistle);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Thistle, "Property Thistle should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Tomato.")]
- [Property("SPEC", "Xamarin.Forms.Color.Tomato A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Tomato_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a Tomato color via FromHex.
- */
- string Tomato = "#FFFF6347";
- var color = Color.FromHex(Tomato);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Tomato, "Property Tomato should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Transparent.")]
- [Property("SPEC", "Xamarin.Forms.Color.Transparent A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void Transparent_READONLY()
- {
- /* PRECONDITION
- * 1. Create a transparent color via FromHex.
- */
- string transparent = "#00ffffff";
- var color = Color.FromHex(transparent);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Transparent, "Property Transparent should same color create via hex string refer document.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Turquoise.")]
- [Property("SPEC", "Xamarin.Forms.Color.Turquoise A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Turquoise_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a Turquoise color via FromHex.
- */
- string Turquoise = "#FF40E0D0";
- var color = Color.FromHex(Turquoise);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Turquoise, "Property Turquoise should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Violet.")]
- [Property("SPEC", "Xamarin.Forms.Color.Violet A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Violet_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a Violet color via FromHex.
- */
- string Violet = "#FFEE82EE";
- var color = Color.FromHex(Violet);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Violet, "Property Violet should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Wheat.")]
- [Property("SPEC", "Xamarin.Forms.Color.Wheat A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Wheat_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a Wheat color via FromHex.
- */
- string Wheat = "#FFF5DEB3";
- var color = Color.FromHex(Wheat);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Wheat, "Property Wheat should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property White.")]
- [Property("SPEC", "Xamarin.Forms.Color.White A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void White_READONLY()
- {
- /* PRECONDITION
- * 1. Create a white color via FromHex.
- */
- string white = "#ffffff";
- var color = Color.FromHex(white);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.White, "Property White should same color create via hex string refer document.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property WhiteSmoke.")]
- [Property("SPEC", "Xamarin.Forms.Color.WhiteSmoke A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void WhiteSmoke_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a WhiteSmoke color via FromHex.
- */
- string WhiteSmoke = "#FFF5F5F5";
- var color = Color.FromHex(WhiteSmoke);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.WhiteSmoke, "Property WhiteSmoke should same color create via hex string refer w3c.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property Yellow.")]
- [Property("SPEC", "Xamarin.Forms.Color.Yellow A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void Yellow_READONLY()
- {
- /* PRECONDITION
- * 1. Create a yellow color via FromHex.
- */
- string yellow = "#ffff00";
- var color = Color.FromHex(yellow);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.Yellow, "Property Yellow should same color create via hex string refer document.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property YellowGreen.")]
- [Property("SPEC", "Xamarin.Forms.Color.YellowGreen A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void YellowGreen_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Create a YellowGreen color via FromHex.
- */
- string YellowGreen = "#FF9ACD32";
- var color = Color.FromHex(YellowGreen);
- Assert.IsNotNull(color, "Instance Switch is null");
- Assert.IsInstanceOf<Color>(color);
-
- /* TEST CODE */
- Assert.AreEqual(color, Color.YellowGreen, "Property YellowGreen should same color create via hex string refer w3c.");
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class ColorTypeConverterTests
- {
- ColorTypeConverter _colorTypeConverter;
- public void SetUp()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "ColorTypeConverter CLASS: Setup---------------------------------");
- _colorTypeConverter = new ColorTypeConverter();
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "ColorTypeConverter CLASS: Teardown---------------------------------");
- _colorTypeConverter = null;
- }
-
- [Test]
- [Category("P1")]
- [Description(" Create a ColorTypeConverter instance. Check whether object is successfully created or not.")]
- [Property("SPEC", "Xamarin.Forms.ColorTypeConverter.ColorTypeConverter C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void ColorTypeConverter_CONST()
- {
- /*TEST CODE*/
- _colorTypeConverter = new ColorTypeConverter();
- Assert.IsInstanceOf<ColorTypeConverter>(_colorTypeConverter, "_colorTypeConverter should be an instance of ColorTypeConverter");
- Assert.IsNotNull(_colorTypeConverter, "Can't create success object Button");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check override method ConvertFromInvariantString is invoked when it is changed.")]
- [Property("SPEC", "Xamarin.Forms.ColorTypeConverter.ConvertFromInvariantString M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void ConvertFromInvariantString_OVERRIDE_METHOD()
- {
- /**TEST CODE**/
- var mSubColorTypeConverter = new ColorTypeConverter();
- Assert.AreEqual(Color.Red,mSubColorTypeConverter.ConvertFromInvariantString("Color.Red"),"Can't convert Color from String type to Color object");
- Assert.AreEqual(Color.Red, mSubColorTypeConverter.ConvertFromInvariantString("Red"), "Can't convert Color from String type to Color object");
- Assert.AreEqual(Color.Blue, mSubColorTypeConverter.ConvertFromInvariantString("#0000ff"), "Can't convert Color from String type to Color object");
- Assert.AreEqual(Color.Blue, mSubColorTypeConverter.ConvertFromInvariantString("#0000ff"), "Can't convert Color from String type to Color object");
- Assert.AreEqual(Color.Accent, mSubColorTypeConverter.ConvertFromInvariantString("Accent"), "Can't convert Color from String to Color object");
- Assert.AreEqual(Color.Default, mSubColorTypeConverter.ConvertFromInvariantString("Color.Default"), "Can't convert Color from String to Color object");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class ColumnDefinitionTest
- {
- private static ColumnDefinition sColumnDefinition;
- public Boolean isSizeChanged;
-
- [SetUp]
- public void setUp()
- {
- Console.WriteLine("ColumnDefinitionTests --------------- Setup()");
- sColumnDefinition = new ColumnDefinition();
- }
-
- [TearDown]
- public void tearDown()
- {
- sColumnDefinition = null;
- Console.WriteLine("ColumnDefinitionTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P0")]
- [Description("Create a ColumnDefinition Instance")]
- [Property("SPEC", "Xamarin.Forms.ColumnDefinition.ColumnDefinition C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void ColumnDefinition_INIT()
- {
- /* TEST CODE */
- var colDef = new ColumnDefinition();
- Assert.IsNotNull(colDef, "Object is null after initialize");
- Assert.IsInstanceOf<ColumnDefinition>(colDef);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property Width is readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.ColumnDefinition.Width A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Width_READ_WRITE()
- {
- /* TEST CODE */
- GridLength gridlenth = new GridLength(13.00);
- sColumnDefinition.Width = gridlenth;
- Assert.IsInstanceOf<GridLength>(sColumnDefinition.Width);
- Assert.AreEqual((double)(13.00), sColumnDefinition.Width.Value, "Set and get values are not equal.");
- }
-
- public void SizeChangedCallback(object sender, System.EventArgs e)
- {
- isSizeChanged = true;
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether SizeChanged Event is raised when the size of the column is changed.")]
- [Property("SPEC", "Xamarin.Forms.ColumnDefinition.SizeChanged E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void SizeChanged_EVENT()
- {
- /* TEST CODE */
- isSizeChanged = false;
- var sColDef = new ColumnDefinition();
- sColDef.Width = 12.0;
- sColDef.SizeChanged += SizeChangedCallback;
- sColDef.Width = 2.0;
- Assert.IsTrue(isSizeChanged, "Event value changed should be handled.");
- sColDef.SizeChanged -= SizeChangedCallback;
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property WidthProperty is bound or not.")]
- [Property("SPEC", "Xamarin.Forms.ColumnDefinition.WidthProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void WidthProperty_CHECK_BINDABLE()
- {
- /*TEST CODE*/
- GridLength mFirstWidthProperty = new GridLength(12.00);
- GridLength mSecondWidthProperty = new GridLength(10.00);
- sColumnDefinition.Width = mFirstWidthProperty;
-
- ColumnDefinition bindingObject = new ColumnDefinition();
- bindingObject.Width = mSecondWidthProperty;
-
- Assert.AreNotEqual(sColumnDefinition.Width, bindingObject.Width, "Width of sColumnDefinition value must be different form Width of bindingObject value");
- sColumnDefinition.BindingContext = bindingObject;
- sColumnDefinition.SetBinding(ColumnDefinition.WidthProperty, "Width");
- Assert.AreEqual(sColumnDefinition.Width, bindingObject.Width, "Width of bindingObject value & Width of sColumnDefinition value should be same");
- }
-
- }
-}
-
-
-
-
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.ColumnDefinitionCollection Tests")]
- public class ColumnDefinitionCollectionTest
- {
- [SetUp]
- public void setUp()
- {
- Console.WriteLine("ColumnDefinitionCollectionTests --------------- Setup()");
- }
-
- [TearDown]
- public void tearDown()
- {
- Console.WriteLine("ColumnDefinitionCollectionTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a ColumnDefinitionCollection Instance")]
- [Property("SPEC", "Xamarin.Forms.ColumnDefinitionCollection.ColumnDefinitionCollection C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void ColumnDefinitionCollection_INIT()
- {
- /* TEST CODE */
- var colDefCollection = new ColumnDefinitionCollection();
- Assert.IsNotNull(colDefCollection, "Object is null after initialize");
- Assert.IsInstanceOf<ColumnDefinitionCollection>(colDefCollection);
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class CommandTest
- {
- [SetUp]
- public void setUp()
- {
- Console.WriteLine("CommandTests --------------- Setup()");
- }
-
- [TearDown]
- public void tearDown()
- {
- Console.WriteLine("CommandTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P0")]
- [Description("Create a Command Instance with Action.")]
- [Property("SPEC", "Xamarin.Forms.Command.Command C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Property("COVPARAM", "Action")]
- public void Command_INIT_ACTION()
- {
- /* TEST CODE */
- var cmd = new Command(() => { });
- Assert.IsNotNull(cmd, "Object is null after initialize");
- Assert.IsInstanceOf<Command>(cmd);
- }
-
- [Test]
- [Category("P0")]
- [Description("Create a Command Instance with Action<object>.")]
- [Property("SPEC", "Xamarin.Forms.Command.Command C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Property("COVPARAM", "Action<object>")]
- public void Command_INIT_ACTION_OBJECT()
- {
- /* TEST CODE */
- string result = null;
- var cmd = new Command(v=>result="test");
- Assert.IsNotNull(cmd, "Object is null after initialize");
- Assert.IsInstanceOf<Command>(cmd);
- }
-
- [Test]
- [Category("P0")]
- [Description("Create a Command Instance with Action<object> and Func<object,bool>).")]
- [Property("SPEC", "Xamarin.Forms.Command.Command C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Property("COVPARAM", "Action<object>, Func<object, bool>")]
- public void Command_INIT_ACTION_OBJECT_FUNC_BOOL()
- {
- /* TEST CODE */
- string result = null;
- var cmd = new Command(s => result = "test", s => true); ;
- Assert.IsNotNull(cmd, "Object is null after initialize");
- Assert.IsInstanceOf<Command>(cmd);
- }
-
- [Test]
- [Category("P0")]
- [Description("Create a Command Instance with Action and Func<bool>).")]
- [Property("SPEC", "Xamarin.Forms.Command.Command C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- [Property("COVPARAM", "Action, Func<bool>")]
- public void Command_INIT_ACTION_FUNC_BOOL()
- {
- /* TEST CODE */
- string result = null;
- var cmd = new Command(() => { },()=>true); ;
- Assert.IsNotNull(cmd, "Object is null after initialize");
- Assert.IsInstanceOf<Command>(cmd);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Execute method is invoked or not.")]
- [Property("SPEC", "Xamarin.Forms.Command.Execute M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Execute_INVOKE_CHECK()
- {
- /* TEST CODE */
- string result = null;
- var cmd = new Command<string>(s => result = s);
- cmd.Execute("Razin");
- Assert.AreEqual("Razin", result,"Execute method was not invoked.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check return value of CanExecute.")]
- [Property("SPEC", "Xamarin.Forms.Command.CanExecute M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void CanExecute_CHECK_RETURN()
- {
- /* TEST CODE */
- string result = null;
- var cmd = new Command<string>(s => result = s);
- var ret = cmd.CanExecute(null);
- Assert.IsInstanceOf<bool>(ret,"CanExecute return value is not boolean.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ChangeCanExecute method is invoked or not.")]
- [Property("SPEC", "Xamarin.Forms.Command.ChangeCanExecute M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void ChangeCanExecute_INVOKE_CHECK()
- {
- /* TEST CODE */
- bool signaled = false;
- var cmd = new Command(() => { });
- cmd.CanExecuteChanged += (sender, args) => signaled = true;
- cmd.ChangeCanExecute();
- Assert.True(signaled, "ChangeCanExecute was not invoked.");
- cmd.CanExecuteChanged -= (sender, args) => signaled = false;
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether CanExecuteChanged event is invoked or not.")]
- [Property("SPEC", "Xamarin.Forms.Command.CanExecuteChanged E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void CanExecuteChanged_INVOKE_CHECK()
- {
- /* TEST CODE */
- bool cFlag = false;
- var cmd = new Command(() => { });
- cmd.CanExecuteChanged += (sender, args) => cFlag = true;
- cmd.ChangeCanExecute();
- Assert.True(cFlag, "CanExecuteChanged was not invoked.");
- cmd.CanExecuteChanged -= (sender, args) => cFlag = false;
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.CommandTemplate Tests")]
- public class CommandTemplateTests
- {
- Command<Rectangle> command;
-
- [SetUp]
- public void Setup()
- {
- Console.WriteLine("CommandTemplateTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("CommandTemplateTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a Command instance.")]
- [Property("SPEC", "Xamarin.Forms.Command<T>.Command C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Property("COVPARAM", "Action<T>")]
- public void Command_INIT()
- {
- /* TEST CODE */
- Action<Rectangle> demoRectangle = delegate (Rectangle rect)
- {
- rect.Height = 5.0;
- };
-
- command = new Command<Rectangle>(demoRectangle);
- Assert.IsNotNull(command, "Instance of Command<Rectangle> is null");
- Assert.IsInstanceOf<Command<Rectangle>>(command, "Is not an instance of Command<Rectangle>");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a Command instance.")]
- [Property("SPEC", "Xamarin.Forms.Command<T>.Command C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Property("COVPARAM", "Action<T>, Func<T,bool>")]
- public void Command_INIT_WITH_TYPE_BOOL()
- {
- /* TEST CODE */
- Action<Rectangle> demoRectangle = delegate (Rectangle rect)
- {
- rect.Height = 5.0;
- };
- Func<Rectangle, bool> functionDemo = vm => true;
-
- command = new Command<Rectangle>(demoRectangle, functionDemo);
- Assert.IsNotNull(command, "Instance of Command<Rectangle> is null");
- Assert.IsInstanceOf<Command<Rectangle>>(command, "Is not an instance of Command<Rectangle>");
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.Configuration test")]
- class ConfigurationTemplateTests
- {
-
- internal class subPlatForm : IConfigPlatform
- {
-
- }
-
- [SetUp]
- public void Setup()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "ConfigurationTemplateTests: Setup---------------------------------");
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "ConfigurationTemplateTests: Teardown------------------------------");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a Configuration<TPlatform, TElement> instance. Check whether object is successfully created or not.")]
- [Property("SPEC", "Xamarin.Forms.Configuration<TPlatform,TElement>.Configuration C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void Configuration_INIT()
- {
- /*TEST CODE*/
- var mConfig = new Configuration<subPlatForm, Element>(new Button());
- Assert.IsNotNull(mConfig, "Can't create success object Configuration");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of Element are identical with the initialize.")]
- [Property("SPEC", "Xamarin.Forms.Configuration<TPlatform,TElement>.Element A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void Element_GET()
- {
- //TEST CODE
- var text = "Test";
- var mButton = new Button
- {
- Text = text
- };
- var mConfig = new Configuration<subPlatForm, Element>(mButton);
- Assert.IsNotNull(mConfig, "Can't create success object Configuration");
- var mElement = mConfig.Element;
- Assert.AreEqual(mButton, (Button)mElement, "Retrieved Element value is not equal to the set value.");
- Assert.AreEqual(mButton.Text, ((Button)mElement).Text, "Retrieved Text value is not equal to the set value.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check create a Configuration instance")]
- [Property("SPEC", "Xamarin.Forms.Configuration<TPlatform,TElement>.Create M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void Create_METHOD()
- {
- var text = "Test";
- var mButton = new Button
- {
- Text = text
- };
- var mConfig = Configuration<subPlatForm, Element>.Create(mButton);
- Assert.IsNotNull(mConfig, "Can't create success object Configuration");
- var mElement = mConfig.Element;
- Assert.AreEqual(mButton, (Button)mElement, "Retrieved Element value is not equal to the set value.");
- Assert.AreEqual(mButton.Text, ((Button)mElement).Text, "Retrieved Text value is not equal to the set value.");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class ConstraintTest
- {
- [SetUp]
- public void setUp()
- {
- Console.WriteLine("ConstraintTest --------------- Setup()");
- }
-
- [TearDown]
- public void tearDown()
- {
- Console.WriteLine("ConstraintTest --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether method Constant returns a Constraint type object.")]
- [Property("SPEC", "Xamarin.Forms.Constraint.Constant M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Constant_CHECK_RETURN_TYPE()
- {
- /* TEST CODE */
- var constant = Constraint.Constant(12.00);
- Assert.IsNotNull(constant, "Object is null after initialize");
- Assert.IsInstanceOf<Constraint>(constant , "constant is not Constraint type instance.");
- }
-
- [Test]
- [Category("P0")]
- [Description("Check whether method FromExpression returns a Constraint type object.")]
- [Property("SPEC", "Xamarin.Forms.Constraint.FromExpression M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void FromExpression_CHECK_RETURN_TYPE()
- {
- /* TEST CODE */
- System.Linq.Expressions.Expression<Func<double>> expr = () => 5.0;
- var fromExpression = Constraint.FromExpression(expr);
- Assert.IsNotNull(fromExpression, "Object is null after initialize");
- }
-
- [Test]
- [Category("P0")]
- [Description("Check whether method RelativeToParent returns a Constraint type object.")]
- [Property("SPEC", "Xamarin.Forms.Constraint.RelativeToParent M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void RelativeToParent_CHECK_RETURN_TYPE()
- {
- /* TEST CODE */
- var relativeToParent = Constraint.RelativeToParent(parent => parent.Height / 2);
- Assert.IsNotNull(relativeToParent, "Object is null after initialize");
- Assert.IsInstanceOf<Constraint>(relativeToParent, "relativeToParent is not Constraint type instance.");
- }
-
- [Test]
- [Category("P0")]
- [Description("Check whether method RelativeToView returns a Constraint type object.")]
- [Property("SPEC", "Xamarin.Forms.Constraint.RelativeToView M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void RelativeToView_CHECK_RETURN_TYPE()
- {
- /* TEST CODE */
- var btn = new Button();
- var relativeToView = Constraint.RelativeToView(btn, (layout, view) => view.Height * 2);
- Assert.IsNotNull(relativeToView, "Object is null after initialize");
- Assert.IsInstanceOf<Constraint>(relativeToView, "relativeToView is not Constraint type instance.");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-using NUnit.Framework.TUnit;
-using System.Linq.Expressions;
-using System.Threading.Tasks;
-using XamarinForTizen.Tizen;
-using XamarinForTizen;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.ConstraintExpression test")]
- public class ConstraintExpressionTests
- {
- private static ConstraintExpression _constraintExpression;
-
- [SetUp]
- public void Setup()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "ConstraintExpression CLASS: Setup---------------------------------");
- _constraintExpression = new ConstraintExpression();
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "ConstraintExpression CLASS: Teardown------------------------------");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a ConstraintExpression instance. Check whether object is successfully created or not.")]
- [Property("SPEC", "Xamarin.Forms.ConstraintExpression.ConstraintExpression C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void ConstraintExpression_INIT()
- {
- /* TEST CODE */
- var constraintExpression = new ConstraintExpression();
- Assert.IsNotNull(constraintExpression, "ConstraintExpression object is not created successfully.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Constant is readable and writable or not.")]
- [Property("SPEC", "Xamarin.Forms.ConstraintExpression.Constant A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void Constant_SET_GET()
- {
- /* TEST CODE */
- double constantValue = 100.5;
- _constraintExpression.Constant = constantValue;
- Assert.AreEqual(constantValue, _constraintExpression.Constant, "Returned Constant value should be equal to set value.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property ElementName is readable and writable or not.")]
- [Property("SPEC", "Xamarin.Forms.ConstraintExpression.ElementName A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void ElementName_SET_GET()
- {
- /* TEST CODE */
- string elementName = "ConstraintExpression ElementName";
- _constraintExpression.ElementName = elementName;
- Assert.AreEqual(elementName, _constraintExpression.ElementName, "Returned ElementName value should be equal to set value.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Factor is readable and writable or not.")]
- [Property("SPEC", "Xamarin.Forms.ConstraintExpression.Factor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void Factor_SET_GET()
- {
- /* TEST CODE */
- double factor = 1.5;
- _constraintExpression.Factor = factor;
- Assert.AreEqual(factor, _constraintExpression.Factor, "Returned Factor value should be equal to set value.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Property is readable and writable or not.")]
- [Property("SPEC", "Xamarin.Forms.ConstraintExpression.Property A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void Property_SET_GET()
- {
- /* TEST CODE */
- string property = "ConstraintExpression Property";
- _constraintExpression.Property = property;
- Assert.AreEqual(property, _constraintExpression.Property, "Returned Property value should be equal to set value.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Type is readable and writable or not.")]
- [Property("SPEC", "Xamarin.Forms.ConstraintExpression.Type A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void Type_SET_GET()
- {
- /* TEST CODE */
- ConstraintType typeConstant = ConstraintType.Constant;
- _constraintExpression.Type = typeConstant;
- Assert.AreEqual(typeConstant, _constraintExpression.Type, "Returned Type value should be equal to set value ConstraintType.Constant.");
- ConstraintType typeRelativeToParent = ConstraintType.RelativeToParent;
- _constraintExpression.Type = typeRelativeToParent;
- Assert.AreEqual(typeRelativeToParent, _constraintExpression.Type, "Returned Type value should be equal to set value ConstraintType.RelativeToParent.");
- ConstraintType typeRelativeToView = ConstraintType.RelativeToView;
- _constraintExpression.Type = typeRelativeToView;
- Assert.AreEqual(typeRelativeToView, _constraintExpression.Type, "Returned Type value should be equal to set value ConstraintType.RelativeToView.");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check ProvideValue() of ConstraintExpression.")]
- [Property("SPEC", "Xamarin.Forms.ConstraintExpression.ProvideValue M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void ProvideValue_CHECK()
- {
- /* TEST CODE */
- Assert.True(false, "[NA] Need to check behavior.");
- }
- }
-}
+++ /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;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class ConstraintTypeConverterTests
- {
- [SetUp]
- public void Setup()
- {
- Console.WriteLine("ConstraintTypeConverterTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("ConstraintTypeConverterTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Creates ConstraintTypeConverter with default values.")]
- [Property("SPEC", "Xamarin.Forms.ConstraintTypeConverter.ConstraintTypeConverter C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void ConstraintTypeConverter_INIT()
- {
- /* TEST CODE */
- ConstraintTypeConverter constraintTypeConverter = new ConstraintTypeConverter();
- Assert.IsNotNull(constraintTypeConverter, "Instance of ConstraintTypeConverter is null");
- Assert.IsInstanceOf<ConstraintTypeConverter>(constraintTypeConverter, "Instance should be of ConstraintTypeConverter type.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if converts value into a Constraint.")]
- [Property("SPEC", "Xamarin.Forms.ConstraintTypeConverter.ConvertFromInvariantString M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void ConvertFromInvariantString_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- ConstraintTypeConverter constraintTypeConverter = new ConstraintTypeConverter();
- Assert.IsInstanceOf<Constraint>(constraintTypeConverter.ConvertFromInvariantString("12.00") , "Instance should be of Constraint 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 NUnit.Framework.TUnit;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class ContentPageTests
- {
- ContentPage _contentpage;
- static bool _flagOnBindingContextChanged;
- internal class SubContentPage : ContentPage
- {
- protected override void OnBindingContextChanged()
- {
- _flagOnBindingContextChanged = true;
- base.OnBindingContextChanged();
- }
- }
- public void SetUp()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "ContentPage CLASS: Setup---------------------------------");
- _contentpage = new ContentPage();
- _flagOnBindingContextChanged = false;
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "ContentPage CLASS: Teardown---------------------------------");
- _contentpage = null;
- }
-
- [Test]
- [Category("P1")]
- [Description(" Create a ContentPage instance. Check whether object is successfully created or not.")]
- [Property("SPEC", "Xamarin.Forms.ContentPage.ContentPage C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void ContentPage_CONST()
- {
- /*TEST CODE*/
- _contentpage = new ContentPage();
- Assert.IsInstanceOf<ContentPage>(_contentpage, "_contentpage should be an instance of ContentPage");
- Assert.IsNotNull(_contentpage, "Can't successfully create a ContentPage object");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of Content are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.ContentPage.Content A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void Content_SET_GET()
- {
- /*TEST CODE*/
- var text = "My Label";
- var mLabel = new Label()
- {
- Text = text
- };
- var mButton = new Button
- {
- BorderColor = Color.Pink
- };
- var mStackLayout = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- mButton,
- mLabel
- }
- };
- _contentpage = new ContentPage
- {
- Content = mStackLayout
- };
- Assert.AreEqual(mStackLayout,(StackLayout)_contentpage.Content, "Retrieved Content value is not equal to set value");
- Assert.AreEqual(text, ((Label)(((StackLayout)_contentpage.Content).Children[1])).Text, "Retrieved Text of Label value is not equal to set value");
- Assert.AreEqual(Color.Pink, ((Button)(((StackLayout)_contentpage.Content).Children[0])).BorderColor, "Retrieved BorderColor of Content value is not equal to set value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ContentProperty(BindableProperty) is working correctly or not")]
- [Property("SPEC", "Xamarin.Forms.ContentPage.ContentProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void ContentProperty_PROPERTY_READ_ONLY()
- {
- /*TEST CODE*/
- var mStackLayout = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- };
- var mStack2 = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.Fill,
- };
- _contentpage = new ContentPage()
- {
- Content = mStackLayout
- };
- var mContentPage = new ContentPage()
- {
- Content = mStack2
- };
- Assert.AreNotEqual(mContentPage.Content, (StackLayout)_contentpage.Content, "Content of _contentpage value must be different form Content of mContentPage value");
- _contentpage.BindingContext = mContentPage;
- _contentpage.SetBinding(ContentPage.ContentProperty, "Content");
- Assert.AreEqual(mStack2, _contentpage.Content, "Content of mContentPage value & Content of _contentpage value should be same");
- Assert.AreEqual(mStack2.HorizontalOptions, _contentpage.Content.HorizontalOptions, "Content.HorizontalOptions of mContentPage value & Content of _contentpage.HorizontalOptions value should be same");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check override method OnBindingContextChanged is invoked when it is bound.")]
- [Property("SPEC", "Xamarin.Forms.ContentPage.OnBindingContextChanged M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void OnBindingContextChanged_OVERRIDE_METHOD()
- {
- /*PRE CONDITION
- * _flagOnBindingContext flag is initialize false value
- * Create a instance subButton
- */
- Assert.False(_flagOnBindingContextChanged, "_flagOnBindingContextChanged should false initial");
- var mStackLayout = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- };
- var mStack2 = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.Fill,
- };
- _contentpage = new SubContentPage()
- {
- Content = mStackLayout
- };
- var mContentPage = new SubContentPage()
- {
- Content = mStack2
- };
- _contentpage.BindingContext = mContentPage;
- _contentpage.SetBinding(ContentPage.ContentProperty, "Content");
- Assert.True(_flagOnBindingContextChanged, "OnBindingContextChanged overrided method not invoked.");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-using NUnit.Framework.TUnit;
-using XamarinForTizen.Tizen;
-using System.Threading.Tasks;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- public class CustomContentPresenter : ContentPresenter
- {
- public Boolean _flagIsOnSizeRequest = false;
- public Boolean _flagLayoutChildren = false;
- protected override void LayoutChildren(double x, double y, double width, double height)
- {
- _flagLayoutChildren = true;
- base.LayoutChildren(x, y, width, height);
- }
- protected override SizeRequest OnSizeRequest(double widthConstraint, double heightConstraint)
- {
- _flagIsOnSizeRequest = true;
- return base.OnSizeRequest(widthConstraint, heightConstraint);
- }
- }
-
- [TestFixture]
- [Description("Xamarin.Forms.ContentPresenter Tests")]
- public class ContentPresenterTests
- {
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("ContentPresenterTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("ContentPresenterTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a ContentPresenter instance.")]
- [Property("SPEC", "Xamarin.Forms.ContentPresenter.ContentPresenter C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void ContentPresenter_INIT()
- {
- /* TEST CODE */
- ContentPresenter contentPresenter = new ContentPresenter();
-
- Assert.IsNotNull(contentPresenter, "Object should be not null after initialize");
- Assert.IsInstanceOf<ContentPresenter>(contentPresenter, "Object should be instance of ContentPresenter");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the Content property is readable and writable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.ContentPresenter.Content A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Content_READ_WRITE()
- {
- /* TEST CODE */
- ContentPresenter contentPresenter = new ContentPresenter();
- contentPresenter.Content = new StackLayout();
- Assert.IsInstanceOf<View>(contentPresenter.Content, "Object should be instance of View");
- var stack = contentPresenter.Content;
- stack.AnchorX = 10.00;
- Assert.AreEqual(10.00, contentPresenter.Content.AnchorX, "Should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of ContentProperty's bound or not")]
- [Property("SPEC", "Xamarin.Forms.ContentPresenter.ContentProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void ContentProperty_READ_ONLY()
- {
- /*TEST CODE*/
- ContentPresenter contentPresenter = new ContentPresenter();
- contentPresenter.Content = new StackLayout();
- ContentPresenter contentPresenter2 = new ContentPresenter();
- contentPresenter2.Content = new StackLayout();
-
- contentPresenter.Content.AnchorX = 10.00;
- contentPresenter2.Content.AnchorX = 20.00;
-
- Assert.AreNotEqual(contentPresenter.Content.AnchorX, contentPresenter2.Content.AnchorX, "ContentProperty value must be different.");
- contentPresenter.BindingContext = contentPresenter2;
- contentPresenter.SetBinding(ContentPresenter.ContentProperty, "Content");
- Assert.AreEqual(contentPresenter.Content.AnchorX, contentPresenter2.Content.AnchorX, "After binding, should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether LayoutChildren is invoked or not.")]
- [Property("SPEC", "Xamarin.Forms.ContentPresenter.LayoutChildren M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public async Task LayoutChildren_INVOKE_CHECK()
- {
- /* TEST CODE */
- NavigationPage mainPage = (NavigationPage)Program.getApp().MainPage;
- var customContentPresenter = new CustomContentPresenter();
- StackLayout stackLayout = new StackLayout();
-
- await mainPage.PushAsync(new ContentPage { Content = customContentPresenter });
- customContentPresenter.Content = stackLayout;
- customContentPresenter.Layout(new Rectangle() { X = 0, Y = 0, Width = 300, Height = 400 });
- Assert.IsTrue(customContentPresenter._flagLayoutChildren, "LayoutChildren is not invoked!");
-
- /* Postcondition:
- -Pop CustomContentPresenter */
- await mainPage.PopAsync();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OnSizeRequest is invoked or not.")]
- [Property("SPEC", "Xamarin.Forms.ContentPresenter.OnSizeRequest M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void OnSizeRequest_INVOKED_CHECK()
- {
- /*TEST CODE*/
- CustomContentPresenter customContentPresenter = new CustomContentPresenter();
- customContentPresenter.GetSizeRequest(double.PositiveInfinity, double.PositiveInfinity);
- Assert.IsTrue(customContentPresenter._flagIsOnSizeRequest, "OnSizeRequest method didn't invoke.");
- }
- }
-}
+++ /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 Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class ContentPropertyAttributeTests
- {
- private ContentPropertyAttribute _contentPropertyAttribute;
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("ContentPropertyAttribute --------------- SetUp()");
- _contentPropertyAttribute = new ContentPropertyAttribute("Content Property Attribute");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("ContentPropertyAttribute --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a ContentPropertyAttribute instance. Check whether object is successfully created or not")]
- [Property("SPEC", "Xamarin.Forms.ContentPropertyAttribute.ContentPropertyAttribute C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void ContentPropertyAttribute_INIT()
- {
- /* TEST CODE */
- var name = "ContentPropertyAttribute Test";
- var contentPropertyAttribute = new ContentPropertyAttribute(name);
- Assert.IsNotNull(contentPropertyAttribute, "Creating a ContentPropertyAttribute object failed. It is set to null");
- Assert.AreEqual(name, contentPropertyAttribute.Name, "Object didn't create successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Name is readable correct or not")]
- [Property("SPEC", "Xamarin.Forms.ContentPropertyAttribute.Name A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void Name_PROPERTY_GET()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- Assert.IsNotNull(_contentPropertyAttribute, "Creating a ContentPropertyAttribute object failed. It is set to null");
-
- /* TEST CODE */
- var name = "Content Property Attribute";
- Assert.AreEqual(name, _contentPropertyAttribute.Name, "Get value of Name is not correct");
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class ContentViewTests
- {
- ContentView _contentview;
- static bool _flagOnBindingContextChanged;
- internal class SubContentView : ContentView
- {
- protected override void OnBindingContextChanged()
- {
- _flagOnBindingContextChanged = true;
- base.OnBindingContextChanged();
- }
- }
- public void SetUp()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "ContentView CLASS: Setup---------------------------------");
- _contentview = new ContentView();
- _flagOnBindingContextChanged = false;
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "ContentView CLASS: Teardown---------------------------------");
- _contentview = null;
- }
-
- [Test]
- [Category("P1")]
- [Description(" Create a ContentView instance. Check whether object is successfully created or not.")]
- [Property("SPEC", "Xamarin.Forms.ContentView.ContentView C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void ContentView_CONST()
- {
- /*TEST CODE*/
- _contentview = new ContentView();
- Assert.IsInstanceOf<ContentView>(_contentview, "_contentview should be an instance of ContentView");
- Assert.IsNotNull(_contentview, "Can't successfully create a ContentView object");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of Content are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.ContentView.Content A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void Content_SET_GET()
- {
- /*TEST CODE*/
- var text = "My Label";
- var mLabel = new Label()
- {
- Text = text
- };
- var mButton = new Button
- {
- BorderColor = Color.Pink
- };
- var mStackLayout = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Children =
- {
- mButton,
- mLabel
- }
- };
- _contentview = new ContentView
- {
- Content = mStackLayout
- };
- Assert.AreEqual(mStackLayout, (StackLayout)_contentview.Content, "Retrieved Content value is not equal to set value");
- Assert.AreEqual(text, ((Label)(((StackLayout)_contentview.Content).Children[1])).Text, "Retrieved Text of Label value is not equal to set value");
- Assert.AreEqual(Color.Pink, ((Button)(((StackLayout)_contentview.Content).Children[0])).BorderColor, "Retrieved BorderColor of Content value is not equal to set value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ContentProperty(BindableProperty) is working correctly or not")]
- [Property("SPEC", "Xamarin.Forms.ContentView.ContentProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void ContentProperty_PROPERTY_READ_ONLY()
- {
- /*TEST CODE*/
- var mStackLayout = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- };
- var mStack2 = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.Fill,
- };
- _contentview = new ContentView()
- {
- Content = mStackLayout
- };
- var mContentView = new ContentView()
- {
- Content = mStack2
- };
- Assert.AreNotEqual(_contentview.Content, (StackLayout)mContentView.Content, "Content of _contentview value must be different form Content of mContentView value");
- mContentView.BindingContext = mContentView;
- mContentView.SetBinding(ContentView.ContentProperty, "Content");
- Assert.AreEqual(mStack2, mContentView.Content, "Content of _contentview value & Content of mContentView value should be same");
- Assert.AreEqual(mStack2.HorizontalOptions, mContentView.Content.HorizontalOptions, "Content.HorizontalOptions of mContentView value & Content of _contentview.HorizontalOptions value should be same");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check override method OnBindingContextChanged is invoked when it is bound.")]
- [Property("SPEC", "Xamarin.Forms.ContentView.OnBindingContextChanged M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void OnBindingContextChanged_OVERRIDE_METHOD()
- {
- /*PRE CONDITION
- * _flagOnBindingContext flag is initialize false value
- * Create a instance subButton
- */
- Assert.False(_flagOnBindingContextChanged, "_flagOnBindingContextChanged should false initial");
- var mStackLayout = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- };
- var mStack2 = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.Fill,
- };
- _contentview = new SubContentView()
- {
- Content = mStackLayout
- };
- var mContentView = new SubContentView()
- {
- Content = mStack2
- };
- _contentview.BindingContext = mContentView;
- _contentview.SetBinding(ContentPage.ContentProperty, "Content");
- Assert.True(_flagOnBindingContextChanged, "OnBindingContextChanged overrided method not invoked.");
- }
- }
-}
+++ /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.IO;
-using System.Reflection;
-using System.Threading;
-using Xamarin.Forms;
-using XamarinForTizen.Tizen;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.ControlTemplate Tests")]
- public class ControlTemplateTests
- {
- private ControlTemplate _controlTemplate;
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("TSControlTemplateTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("TSControlTemplateTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a ControlTemplate instance. Check whether object is successfully created or not")]
- [Property("SPEC", "Xamarin.Forms.ControlTemplate.ControlTemplate C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void ControlTemplate_INIT()
- {
- /* TEST CODE */
- _controlTemplate = new ControlTemplate();
- Assert.IsNotNull(_controlTemplate, "Creating a ControlTemplate object failed. It is set to null");
- Assert.IsInstanceOf<ControlTemplate>(_controlTemplate, "Is not an instance of ControlTemplate");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a ControlTemplate instance. Check whether object is successfully created or not")]
- [Property("SPEC", "Xamarin.Forms.ControlTemplate.ControlTemplate C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("COVPARAM", "Type")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void ControlTemplate_INIT_TYPE()
- {
- /* TEST CODE */
- _controlTemplate = new ControlTemplate(typeof(Button));
- Assert.IsNotNull(_controlTemplate, "Creating a ControlTemplate object failed. It is set to null");
- Assert.IsInstanceOf<ControlTemplate>(_controlTemplate, "Is not an instance of ControlTemplate");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-using System.Collections.Generic;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.DataTemplate Tests")]
- class DataTemplateTests
- {
- [TypeConverter(typeof(ToBarConverter))]
- internal class Bar
- {
- }
-
- internal class Baz
- {
- }
-
- internal class MockBindable : View
- {
- public static readonly BindableProperty TextProperty = BindableProperty.Create<MockBindable, string>(
- b => b.Text, "default", BindingMode.TwoWay);
-
- public string Text
- {
- get { return (string)GetValue(TextProperty); }
- set { SetValue(TextProperty, value); }
- }
-
- public string Foo { get; set; }
-
- public int TargetInt { get; set; }
-
- public readonly BindableProperty BarProperty =
- BindableProperty.Create<MockBindable, Bar>(w => w.Bar, default(Bar));
-
- public Bar Bar
- {
- get { return (Bar)GetValue(BarProperty); }
- set { SetValue(BarProperty, value); }
- }
-
- public readonly BindableProperty BazProperty =
- BindableProperty.Create<MockBindable, Baz>(w => w.Baz, default(Baz));
-
- [TypeConverter(typeof(ToBazConverter))]
- public Baz Baz
- {
- get { return (Baz)GetValue(BazProperty); }
- set { SetValue(BazProperty, value); }
- }
-
- public readonly BindableProperty QuxProperty =
- BindableProperty.Create<MockBindable, Baz>(w => w.Qux, default(Baz));
-
- public Baz Qux
- {
- get { return (Baz)GetValue(QuxProperty); }
- set { SetValue(QuxProperty, value); }
- }
- }
-
- internal class ToBarConverter : TypeConverter
- {
- public override object ConvertFrom(System.Globalization.CultureInfo culture, object value)
- {
- return new Bar();
- }
- }
- internal class ToBazConverter : TypeConverter
- {
- public override object ConvertFrom(System.Globalization.CultureInfo culture, object value)
- {
- return new Baz();
- }
- }
-
- private static DataTemplate _dataTemplate;
-
-
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("RectangleTests --------------- Setup()");
- _dataTemplate = new DataTemplate();
- }
-
- [TearDown]
- public void TearDown()
- {
- _dataTemplate = null;
- Console.WriteLine("RectangleTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a new templated view without any parameter.")]
- [Property("SPEC", "Xamarin.Forms.DataTemplate.DataTemplate C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void DataTemplate_INIT()
- {
- /*TEST CODE*/
- var dataTemplate = new DataTemplate();
- Assert.IsNotNull(dataTemplate, "dataTemplate should be not NULL");
- Assert.IsInstanceOf<DataTemplate>(dataTemplate, "dataTemplate is not instance of DataTemplate.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a new templated view with Func<obj>.")]
- [Property("SPEC", "Xamarin.Forms.DataTemplate.DataTemplate C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Property("COVPARAM", "System.Func<object>")]
- public void DataTemplate_INIT_WITH_FUNC()
- {
- /*TEST CODE*/
- var dataTemplate = new DataTemplate(() => new MockBindable());
- Assert.IsNotNull(dataTemplate, "dataTemplate should be not NULL");
- Assert.IsInstanceOf<DataTemplate>(dataTemplate, "dataTemplate is not instance of DataTemplate.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a new templated view with Type.")]
- [Property("SPEC", "Xamarin.Forms.DataTemplate.DataTemplate C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Property("COVPARAM", "System.Type")]
- public void DataTemplate_INIT_WITH_TYPE()
- {
- /*TEST CODE*/
- var dataTemplate = new DataTemplate(typeof(String));
- Assert.IsNotNull(dataTemplate, "dataTemplate should be not NULL");
- Assert.IsInstanceOf<DataTemplate>(dataTemplate, "dataTemplate is not instance of DataTemplate.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Bindings returns a dictionary of bindings and indexed by the bound properties.")]
- [Property("SPEC", "Xamarin.Forms.DataTemplate.Bindings A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void Bindings_READ()
- {
- var template = new DataTemplate(typeof(MockBindable));
- template.SetBinding(MockBindable.TextProperty, new Binding("text"));
- template.SetBinding(MockBindable.ClassIdProperty, new Binding("class"));
- var dict = template.Bindings;
- Assert.IsInstanceOf<IDictionary<BindableProperty, BindingBase>>(dict, "Bindings should return a dictonary oobject");
- Assert.AreEqual("text", ((Binding)dict[MockBindable.TextProperty]).Path, "Value should be equal for TextProperty");
- Assert.AreEqual("class", ((Binding)dict[MockBindable.ClassIdProperty]).Path, "Value should be equal ClassIdProperty");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Values returns a dictionary of property values for this DataTemplate, indexed by property.")]
- [Property("SPEC", "Xamarin.Forms.DataTemplate.Values A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void Values_READ()
- {
- var template = new DataTemplate(typeof(MockBindable));
- template.SetValue(MockBindable.TextProperty,"text");
- template.SetValue(MockBindable.ClassIdProperty, "class");
- var dict = template.Values;
- Assert.IsInstanceOf<IDictionary<BindableProperty, object>>(dict, "Bindings should return a dictonary oobject");
- Assert.AreEqual("text", dict[MockBindable.TextProperty], "Value should be equal for TextProperty");
- Assert.AreEqual("class", dict[MockBindable.ClassIdProperty], "Value should be equal ClassIdProperty");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check CreateContent method.")]
- [Property("SPEC", "Xamarin.Forms.DataTemplate.CreateContent M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void CreateContent_CHECK()
- {
- /* TEST CODE */
- //With out type
- var template = new DataTemplate(() => new MockBindable());
- object obj = template.CreateContent();
-
- Assert.IsNotNull(obj,"Object obj can not be null.");
- Assert.IsInstanceOf<MockBindable>(obj, "Object obj need to be an instance of MockBindable");
-
- // With Type
- var templateType = new DataTemplate(typeof(MockBindable));
- object objType = templateType.CreateContent();
-
- Assert.IsNotNull(objType, "Object objType can not be null.");
- Assert.IsInstanceOf<MockBindable>(obj, "Object objType need to be an instance of MockBindable");
-
- // With Values
- var templateValues = new DataTemplate(typeof(MockBindable))
- {
- Values = { { MockBindable.TextProperty, "value" } }
- };
-
- MockBindable bindableValues = (MockBindable)templateValues.CreateContent();
- Assert.AreEqual("value",bindableValues.GetValue(MockBindable.TextProperty), "Valuse for TextProperty should be value.");
-
- // With Bindings
- var templateBinding = new DataTemplate(() => new MockBindable())
- {
- Bindings = { { MockBindable.TextProperty, new Binding(".") } }
- };
-
- MockBindable bindableBinding = (MockBindable)templateBinding.CreateContent();
- bindableBinding.BindingContext = "text";
- Assert.AreEqual("text", bindableBinding.GetValue(MockBindable.TextProperty), "Valuse for TextProperty should be text.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check Sets the binding for property.")]
- [Property("SPEC", "Xamarin.Forms.DataTemplate.SetBinding M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void SetBinding_CHECK()
- {
- var template = new DataTemplate(typeof(MockBindable));
- template.SetValue(MockBindable.TextProperty, "value");
- template.SetBinding(MockBindable.TextProperty, new Binding("."));
-
- MockBindable bindable = (MockBindable)template.CreateContent();
- Assert.AreEqual(bindable.BindingContext,bindable.GetValue(MockBindable.TextProperty),"Value should be equal");
-
- bindable.BindingContext = "binding";
- Assert.AreEqual("binding",bindable.GetValue(MockBindable.TextProperty),"Binding value should be change");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check Sets the SetValue of property.")]
- [Property("SPEC", "Xamarin.Forms.DataTemplate.SetValue M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void SetValue_CHECK()
- {
- var template = new DataTemplate(typeof(MockBindable));
- template.SetBinding(MockBindable.TextProperty, new Binding("."));
- template.SetValue(MockBindable.TextProperty, "value");
-
- MockBindable bindable = (MockBindable)template.CreateContent();
- Assert.AreEqual("value",bindable.GetValue(MockBindable.TextProperty), "Value should be equal");
- bindable.BindingContext = "binding";
- Assert.AreEqual("value",bindable.GetValue(MockBindable.TextProperty), "Binding value should be changed.");
- }
- }
- }
+++ /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 NUnit.Framework.TUnit;
-using System.Collections.Generic;
-using System;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.DataTemplateSelector test")]
- public class DataTemplateSelectorTest
- {
- private static bool _flagOnSelectTemplate;
- private static DataTemplate _dataTemplate;
- internal class MockBindableObject : BindableObject
- {
- public readonly BindableProperty BoundNameProperty = BindableProperty.Create("Foo", typeof(string), typeof(MockBindableObject), default(string));
- public string BoundName
- {
- get { return (string)GetValue(BoundNameProperty); }
- set { SetValue(BoundNameProperty, value); }
- }
- }
- internal class SubDataTemplateSelector : DataTemplateSelector
- {
- protected override DataTemplate OnSelectTemplate(object item, BindableObject container)
- {
- _flagOnSelectTemplate = true;
- return _dataTemplate;
- }
-
- }
- [SetUp]
- public void Setup()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "DataTemplateSelector: Setup---------------------------------");
- _flagOnSelectTemplate = false;
- _dataTemplate = new DataTemplate();
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "DataTemplateSelector: Teardown------------------------------");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a DataTemplateSelector instance. Check whether object is successfully created or not.")]
- [Property("SPEC", "Xamarin.Forms.DataTemplateSelector.DataTemplateSelector C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Ngo Van Hai, hai.nv3@samsung.com")]
- public void DataTemplateSelector_INIT()
- {
- /*TEST CODE*/
- SubDataTemplateSelector dataTemplateSelector = new SubDataTemplateSelector();
- Assert.NotNull(dataTemplateSelector, "create DataTemplateSelector is fail");
- MockBindableObject mock = new MockBindableObject();
- dataTemplateSelector.SelectTemplate(new Label(), mock);
- }
-
- [Test]
- [Category("P1")]
- [Description("Invoke SelectTemplate method, and check whether value of flagOnSelectTemplate.")]
- [Property("SPEC", "Xamarin.Forms.DataTemplateSelector.OnSelectTemplate M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Ngo Van Hai, hai.nv3@samsung.com")]
- public void OnSelectTemplate_CHECK_METHOD()
- {
- /*TEST CODE*/
- SubDataTemplateSelector dataTemplateSelector = new SubDataTemplateSelector();
- Assert.NotNull(dataTemplateSelector, "create DataTemplateSelector is fail");
- MockBindableObject mock = new MockBindableObject();
- dataTemplateSelector.SelectTemplate(new Label(), mock);
- Assert.IsTrue(_flagOnSelectTemplate, "_flagOnSelectTemplate should be return true after SelectTemplate");
- }
-
- [Test]
- [Category("P1")]
- [Description("Invoke SelectTemplate method, and check whether value of flagOnSelectTemplate.")]
- [Property("SPEC", "Xamarin.Forms.DataTemplateSelector.SelectTemplate M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Ngo Van Hai, hai.nv3@samsung.com")]
- public void SelectTemplate_CHECK_METHOD()
- {
- /*TEST CODE*/
- SubDataTemplateSelector dataTemplateSelector = new SubDataTemplateSelector();
- Assert.NotNull(dataTemplateSelector, "create DataTemplateSelector is fail");
- MockBindableObject mock = new MockBindableObject();
- var dataTemplate = dataTemplateSelector.SelectTemplate(new Label(), mock);
- Assert.AreEqual(_dataTemplate, dataTemplate);
- }
-
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System.Collections.Generic;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.DataTrigger test")]
- public class DataTriggerTests
- {
- [SetUp]
- public void Setup()
- {
- Console.WriteLine("DataTriggerTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("DataTriggerTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create an DataTrigger object.")]
- [Property("SPEC", "Xamarin.Forms.DataTrigger.DataTrigger C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void DataTrigger_INIT()
- {
- /* TEST CODE */
- DataTrigger dataTrigger = new DataTrigger(typeof(Trigger));
- Assert.IsNotNull(dataTrigger, "DataTrigger Instance is null");
- Assert.IsInstanceOf<DataTrigger>(dataTrigger, "Should be an instance of DataTrigger type.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Binding Property is writeable and readable.")]
- [Property("SPEC", "Xamarin.Forms.DataTrigger.Binding A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Binding_READ_WRITE()
- {
- /* TEST CODE */
- BindingBase bindingBase = new Binding();
- bindingBase.Mode = BindingMode.TwoWay;
- DataTrigger dataTrigger = new DataTrigger(typeof(Trigger));
-
- dataTrigger.Binding = bindingBase;
- Assert.AreEqual(dataTrigger.Binding.Mode, BindingMode.TwoWay, "Not returning expected binding mode(TwoWay).");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the value for Setters.")]
- [Property("SPEC", "Xamarin.Forms.DataTrigger.Setters A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Setters_READ_ONLY()
- {
- /* TEST CODE */
- var bindableProperty = BindableProperty.Create("bar", typeof(string), typeof(BindableObject), null);
- var datatrigger = new DataTrigger(typeof(VisualElement))
- {
- Setters = {
- new Setter { Property = bindableProperty, Value = "foo" },
- }
- };
-
- Assert.IsInstanceOf<IList<Setter>>(datatrigger.Setters, "Not an instance of DataTrigger type.");
- Assert.AreEqual(bindableProperty, datatrigger.Setters[0].Property, "Not returning expected bindable property.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Value Property is writeable and readable.")]
- [Property("SPEC", "Xamarin.Forms.DataTrigger.Value A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Value_READ_WRITE()
- {
- /* TEST CODE */
- DataTrigger dataTrigger = new DataTrigger(typeof(Trigger));
-
- dataTrigger.Value = "Tizen";
- Assert.AreEqual(dataTrigger.Value, "Tizen", "Not returning expected Value property.");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-using System.Collections.Generic;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class DateChangedEventArgsTests
- {
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("DateChangedEventArgsTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("DateChangedEventArgsTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create an instance of DateChangedEventArgs.")]
- [Property("SPEC", "Xamarin.Forms.DateChangedEventArgs.DateChangedEventArgs C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void DateChangedEventArgs_INIT()
- {
- /* TEST CODE */
- var oldDate = new DateTime(11/02/2016);
- var newDate = new DateTime(11/03/2016);
- var dateChangedEventArgs = new DateChangedEventArgs(oldDate,newDate);
- Assert.IsNotNull(dateChangedEventArgs, "Object is null after initialize");
- Assert.IsInstanceOf<DateChangedEventArgs>(dateChangedEventArgs, "dateChangedEventArgs is not instance of DateChangedEventArgs.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether NewDate is readable.")]
- [Property("SPEC", "Xamarin.Forms.DateChangedEventArgs.NewDate A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void NewDate_READ_ONLY()
- {
- /* TEST CODE */
- var oldDate1 = new DateTime(11 / 02 / 2016);
- var newDate1 = new DateTime(11 / 03 / 2016);
- var dateChangedEventArgs1 = new DateChangedEventArgs(oldDate1, newDate1);
- Assert.IsNotNull(dateChangedEventArgs1, "Object is null after initialize");
- Assert.IsInstanceOf<DateChangedEventArgs>(dateChangedEventArgs1, "dateChangedEventArgs is not instance of DateChangedEventArgs.");
- Assert.AreEqual(newDate1, dateChangedEventArgs1.NewDate, "NewDate proerty should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OldDate is readable.")]
- [Property("SPEC", "Xamarin.Forms.DateChangedEventArgs.OldDate A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void OldDate_READ_ONLY()
- {
- /* TEST CODE */
- var oldDate2 = new DateTime(11 / 02 / 2016);
- var newDate2 = new DateTime(11 / 03 / 2016);
- var dateChangedEventArgs2 = new DateChangedEventArgs(oldDate2, newDate2);
- Assert.IsNotNull(dateChangedEventArgs2, "Object is null after initialize");
- Assert.IsInstanceOf<DateChangedEventArgs>(dateChangedEventArgs2, "dateChangedEventArgs is not instance of DateChangedEventArgs.");
- Assert.AreEqual(oldDate2, dateChangedEventArgs2.OldDate, "OldDate proerty should be equal.");
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class DatePickerTests
- {
- public void SetUp()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "DatePicker CLASS: Setup---------------------------------");
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "ContentPage CLASS: Teardown---------------------------------");
- }
-
- [Test]
- [Category("P1")]
- [Description(" Create a DatePicker instance. Check whether object is successfully created or not.")]
- [Property("SPEC", "Xamarin.Forms.DatePicker.DatePicker C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void DatePicker_CONST()
- {
- /*TEST CODE*/
- var _datepicker = new DatePicker();
- Assert.IsInstanceOf<DatePicker>(_datepicker, "_datepicker should be an instance of DatePicker");
- Assert.IsNotNull(_datepicker, "Can't create success object Button");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of Date are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.DatePicker.Date A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void Date_PROPERTY_SET_GET()
- {
- /*TEST CODE*/
- DateTime mDate01 = new DateTime(2016, 10, 21);
- DateTime mDate02 = new DateTime(1992,11,12);
- var _datepicker = new DatePicker();
- _datepicker.Date = mDate01;
- Assert.AreEqual(mDate01, _datepicker.Date, "Retrieved Date value is not equal to set value");
- Assert.AreEqual(2016, _datepicker.Date.Year, "Retrieved Year of Date value is not equal to set value");
- Assert.AreEqual(10, _datepicker.Date.Month, "Retrieved Month of Date value is not equal to set value");
- Assert.AreEqual(21, _datepicker.Date.Day, "Retrieved Day of Date value is not equal to set value");
- _datepicker.Date = mDate02;
- Assert.AreEqual(mDate02, _datepicker.Date, "Retrieved Date value is not equal to set value");
- Assert.AreEqual(1992, _datepicker.Date.Year, "Retrieved Year of Date value is not equal to set value");
- Assert.AreEqual(11, _datepicker.Date.Month, "Retrieved Month of Date value is not equal to set value");
- Assert.AreEqual(12, _datepicker.Date.Day, "Retrieved Day of Date value is not equal to set value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of Format are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.DatePicker.Format A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void Format_PROPERTY_SET_GET()
- {
- /*TEST CODE*/
- var mFormat01 = "2016/12/10";
- var mFormat02 = "2016/11/09";
- var _datepicker = new DatePicker();
- _datepicker.Format = mFormat01;
- Assert.AreEqual(mFormat01, _datepicker.Format, "Retrieved Format value is not equal to set value");
- _datepicker.Format = mFormat02;
- Assert.AreEqual(mFormat02, _datepicker.Format, "Retrieved Format value is not equal to set value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of MaximumDate are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.DatePicker.MaximumDate A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void MaximumDate_PROPERTY_SET_GET()
- {
- /*TEST CODE*/
- var mMaximum01 = new DateTime(2017,11,11);
- var mMaximum02 = new DateTime(3000,1,1);
- var mDate = new DateTime(2016, 2, 3);
- var _datepicker = new DatePicker();
- _datepicker.Date = mDate;
- Assert.AreEqual(mDate, _datepicker.Date, "Retrieved Format value is not equal to set value");
- _datepicker.MaximumDate = mMaximum01;
- mDate = new DateTime(2018, 1, 1);
- _datepicker.Date = mDate;
- Assert.AreNotEqual(mDate, _datepicker.Date, "Retrieved Format should be not equal to set value");
- _datepicker.MaximumDate = mMaximum02;
- mDate = new DateTime(2018, 1, 1);
- _datepicker.Date = mDate;
- Assert.AreEqual(mDate, _datepicker.Date, "Retrieved Format value is not equal to set value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of MinimumDate are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.DatePicker.MinimumDate A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void MinimumDate_PROPERTY_SET_GET()
- {
- /*TEST CODE*/
- var mMinimumDate01 = new DateTime(1980, 11, 11);
- var mMinimumDate02 = new DateTime(1970, 10, 21);
- var mDate = new DateTime(2016, 2, 3);
- var _datepicker = new DatePicker();
- _datepicker.Date = mDate;
- Assert.AreEqual(mDate, _datepicker.Date, "Retrieved Format value is not equal to set value");
- _datepicker.MinimumDate = mMinimumDate01;
- mDate = new DateTime(1975, 11, 12);
- _datepicker.Date = mDate;
- Assert.AreNotEqual(mDate, _datepicker.Date, "Retrieved Format should be not equal to set value");
- _datepicker.MinimumDate = mMinimumDate02;
- mDate = new DateTime(1973, 2, 6);
- _datepicker.Date = mDate;
- Assert.AreEqual(mDate, _datepicker.Date, "Retrieved Format value is not equal to set value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of TextColor are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.DatePicker.TextColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void TextColor_PROPERTY_SET_GET()
- {
- /*TEST CODE*/
- var mColor01 = Color.Red;
- var mColor02 = Color.Pink;
- var _datepicker = new DatePicker();
- _datepicker.TextColor = mColor01;
- Assert.AreEqual(mColor01,_datepicker.TextColor,"Retrieved TextColor value is not equal to set value");
- _datepicker.TextColor = mColor02;
- Assert.AreEqual(mColor02,_datepicker.TextColor,"Retrieved TextColor value is not equal to set value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check return DatePicker configuration")]
- [Property("SPEC", "Xamarin.Forms.DatePicker.On<T> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void On_CONFIGURATION_METHOD()
- {
- /*TEST CODE*/
- var _datepicker = new DatePicker();
- var mColor01 = Color.Red;
- _datepicker.TextColor = mColor01;
- var myConfig = _datepicker.On<IConfigPlatform>();
- Assert.IsInstanceOf<IPlatformElementConfiguration<IConfigPlatform, DatePicker>>(myConfig, "myConfig should be a instance of IPlatformElementConfiguration");
- Assert.IsInstanceOf<DatePicker>(myConfig.Element, "myConfig.Element should be a instance of _datepicker");
- Assert.AreEqual(mColor01, myConfig.Element.TextColor, "TextColor of myConfig.Element value & TextColor of _datepicker should be to equal");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether TextColorProperty(BindableProperty) is working correctly or not")]
- [Property("SPEC", "Xamarin.Forms.DatePicker.TextColorProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void TextColorProperty_PROPERTY_READ_ONLY()
- {
- /*TEST CODE*/
- var mColor1 = Color.Red;
- var mColor2 = Color.White;
- var _datepicker = new DatePicker() {
- TextColor = mColor1
- };
- Label mLabel = new Label()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- TextColor = mColor2
- };
- Assert.AreNotEqual(mLabel.TextColor, _datepicker.TextColor, "TextColor of _datepicker value must be different form TextColor of mLabel value");
- _datepicker.BindingContext = mLabel;
- _datepicker.SetBinding(DatePicker.TextColorProperty, "TextColor");
- Assert.AreEqual(mLabel.TextColor, _datepicker.TextColor, "TextColor of mLabel value & TextColor of _datepicker value should be same");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether DateProperty(BindableProperty) is working correctly or not")]
- [Property("SPEC", "Xamarin.Forms.DatePicker.DateProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void DateProperty_PROPERTY_READ_ONLY()
- {
- /*TEST CODE*/
- var mDate01 = new DateTime(2016, 4, 7);
- var mDate02 = new DateTime(2019, 1, 4);
- var _datepicker = new DatePicker()
- {
- Date = mDate01
- };
- var mDatePicker = new DatePicker()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Date = mDate02
- };
- Assert.AreNotEqual(mDatePicker.Date, _datepicker.Date, "Date of _datepicker value must be different form Date of mDatePicker value");
- _datepicker.BindingContext = mDatePicker;
- _datepicker.SetBinding(DatePicker.DateProperty, "Date");
- Assert.AreEqual(mDatePicker.Date, _datepicker.Date, "Date of mDatePicker value & Date of _datepicker value should be same");
- Assert.AreEqual(2019, _datepicker.Date.Year, "Date.Year of mDatePicker value & Date.Year of _datepicker value should be same");
- Assert.AreEqual(1, _datepicker.Date.Month, "Date.Month of mDatePicker value & Date.Month of _datepicker value should be same");
- Assert.AreEqual(4, _datepicker.Date.Day, "Date.Day of mDatePicker value & Date.Day of _datepicker value should be same");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether MaximumDateProperty(BindableProperty) is working correctly or not")]
- [Property("SPEC", "Xamarin.Forms.DatePicker.MaximumDateProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void MaximumDateProperty_PROPERTY_READ_ONLY()
- {
- /*TEST CODE*/
- var mDate01 = new DateTime(2016, 4, 7);
- var mDate02 = new DateTime(2019, 1, 4);
- var _datepicker = new DatePicker()
- {
- MaximumDate = mDate01
- };
- var mDatePicker = new DatePicker()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- MaximumDate = mDate02
- };
- Assert.AreNotEqual(mDatePicker.MaximumDate, _datepicker.MaximumDate, "MaximumDate of _datepicker value must be different form MaximumDate of mDatePicker value");
- _datepicker.BindingContext = mDatePicker;
- _datepicker.SetBinding(DatePicker.MaximumDateProperty, "MaximumDate");
- Assert.AreEqual(mDatePicker.MaximumDate, _datepicker.MaximumDate, "MaximumDate of mDatePicker value & MaximumDate of _datepicker value should be same");
- Assert.AreEqual(2019, _datepicker.MaximumDate.Year, "MaximumDate.Year of mDatePicker value & MaximumDate.Year of _datepicker value should be same");
- Assert.AreEqual(1, _datepicker.MaximumDate.Month, "MaximumDate.Month of mDatePicker value & MaximumDate.Month of _datepicker value should be same");
- Assert.AreEqual(4, _datepicker.MaximumDate.Day, "MaximumDate.Day of mDatePicker value & MaximumDate.Day of _datepicker value should be same");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether MinimumDateProperty(BindableProperty) is working correctly or not")]
- [Property("SPEC", "Xamarin.Forms.DatePicker.MinimumDateProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void MinimumDateProperty_PROPERTY_READ_ONLY()
- {
- /*TEST CODE*/
- var mDate01 = new DateTime(2016, 4, 7);
- var mDate02 = new DateTime(2019, 1, 4);
- var _datepicker = new DatePicker()
- {
- MinimumDate = mDate01
- };
- var mDatePicker = new DatePicker()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- MinimumDate = mDate02
- };
- Assert.AreNotEqual(mDatePicker.MinimumDate, _datepicker.MinimumDate, "MinimumDate of _datepicker value must be different form MinimumDate of mDatePicker value");
- _datepicker.BindingContext = mDatePicker;
- _datepicker.SetBinding(DatePicker.MinimumDateProperty, "MinimumDate");
- Assert.AreEqual(mDatePicker.MinimumDate, _datepicker.MinimumDate, "MinimumDate of mDatePicker value & MinimumDate of _datepicker value should be same");
- Assert.AreEqual(2019, _datepicker.MinimumDate.Year, "MinimumDate.Year of mDatePicker value & MinimumDate.Year of _datepicker value should be same");
- Assert.AreEqual(1, _datepicker.MinimumDate.Month, "MinimumDate.Month of mDatePicker value & MinimumDate.Month of _datepicker value should be same");
- Assert.AreEqual(4, _datepicker.MinimumDate.Day, "MinimumDate.Day of mDatePicker value & MinimumDate.Day of _datepicker value should be same");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether FormatProperty(BindableProperty) is working correctly or not")]
- [Property("SPEC", "Xamarin.Forms.DatePicker.FormatProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void FormatProperty_PROPERTY_READ_ONLY()
- {
- /*TEST CODE*/
- var mFormat01 = "2018/1/3";
- var mFormat02 = "2016/11/6";
- var _datepicker = new DatePicker()
- {
- Format = mFormat01
- };
- var mDatePicker = new DatePicker()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Format = mFormat02
- };
- Assert.AreNotEqual(mDatePicker.Format, _datepicker.Format, "Format of _datepicker value must be different form Format of mDatePicker value");
- _datepicker.BindingContext = mDatePicker;
- _datepicker.SetBinding(DatePicker.FormatProperty, "Format");
- Assert.AreEqual(mDatePicker.Format, _datepicker.Format, "Format of mDatePicker value & Format of _datepicker value should be same");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether DateSelected events can be invoked or not when date of the DatePicker object is changed.")]
- [Property("SPEC", "Xamarin.Forms.DatePicker.DateSelected E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void DateSelected_CHECK_EVENT()
- {
- /*TEST CODE*/
- var _datepicker = new DatePicker()
- {
- Date = new DateTime(2016, 12, 11)
- };
- bool flagChanged = false;
- _datepicker.DateSelected += (o, e) =>
- {
- flagChanged = true;
- };
- _datepicker.Date = new DateTime(2017, 1, 1);
- Assert.True(flagChanged, "DateSelected event should be invoked.");
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.DefinitionCollection<T> test")]
- public class DefinitionCollectionTemplateTests
- {
- [SetUp]
- public void Setup()
- {
- Console.WriteLine("DefinitionCollectionTemplateTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("DefinitionCollectionTemplateTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the value for Count.")]
- [Property("SPEC", "Xamarin.Forms.DefinitionCollection<T>.Count A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Count_READ_ONLY()
- {
- /* TEST CODE */
- RowDefinition rowDefinition = new RowDefinition();
- rowDefinition.Height = new GridLength(2.0);
- RowDefinition secondRowDefinition = new RowDefinition();
- secondRowDefinition.Height = new GridLength(3.0);
-
- var definitionCollection = new RowDefinitionCollection();
- definitionCollection.Clear();
- var initialCount = definitionCollection.Count;
-
- definitionCollection.Add(rowDefinition);
- Assert.AreEqual(definitionCollection.Count, initialCount + 1, "Count should be increased by one.");
- definitionCollection.Add(secondRowDefinition);
- Assert.AreEqual(definitionCollection.Count, initialCount + 2, "Count should be increased by two.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the value for IsReadOnly.")]
- [Property("SPEC", "Xamarin.Forms.DefinitionCollection<T>.IsReadOnly A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void IsReadOnly_READ_ONLY()
- {
- /* TEST CODE */
- var definitionCollection = new RowDefinitionCollection();
- Assert.IsFalse(definitionCollection.IsReadOnly, "Expected false but returned true.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if sets or gets the value indexed by index.")]
- [Property("SPEC", "Xamarin.Forms.DefinitionCollection<T>.this[int] A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void this_READ_WRITE()
- {
- /* TEST CODE */
- Object returnValue = null;
- RowDefinition rowDefinition = new RowDefinition();
- rowDefinition.Height = new GridLength(2.0);
- RowDefinition secondRowDefinition = new RowDefinition();
- secondRowDefinition.Height = new GridLength(3.0);
-
- var definitionCollection = new RowDefinitionCollection();
- var initialCount = definitionCollection.Count;
-
- definitionCollection.Add(secondRowDefinition);
- definitionCollection[initialCount] = rowDefinition;
- returnValue = definitionCollection[initialCount];
- Assert.AreEqual(returnValue, rowDefinition, "Retrived object is not the expexted one.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether adds a IDefinition to the collection.")]
- [Property("SPEC", "Xamarin.Forms.DefinitionCollection<T>.Add M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Add_CHECK()
- {
- /* TEST CODE */
- RowDefinition rowDefinition = new RowDefinition();
- rowDefinition.Height = new GridLength(2.0);
- RowDefinition secondRowDefinition = new RowDefinition();
- secondRowDefinition.Height = new GridLength(3.0);
-
- var definitionCollection = new RowDefinitionCollection();
- var initialCount = definitionCollection.Count;
-
- definitionCollection.Add(rowDefinition);
- Assert.AreEqual(definitionCollection.Count, initialCount + 1, "Count should be increased by one.");
- definitionCollection.Add(secondRowDefinition);
- Assert.AreEqual(definitionCollection.Count, initialCount + 2, "Count should be increased by two.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether DefinitionCollection is cleared or not.")]
- [Property("SPEC", "Xamarin.Forms.DefinitionCollection<T>.Clear M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Clear_CHECK()
- {
- /* TEST CODE */
- RowDefinition rowDefinition = new RowDefinition();
- rowDefinition.Height = new GridLength(2.0);
- RowDefinition secondRowDefinition = new RowDefinition();
- secondRowDefinition.Height = new GridLength(3.0);
-
- var definitionCollection = new RowDefinitionCollection();
- var initialCount = definitionCollection.Count;
-
- definitionCollection.Add(rowDefinition);
- definitionCollection.Add(secondRowDefinition);
- Assert.AreEqual(definitionCollection.Count, initialCount + 2, "Count should be increased by two.");
- definitionCollection.Clear();
- Assert.AreEqual(definitionCollection.Count, 0, "Count should be zero.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether or not DefinitionCollection contains the specified IDefinition.")]
- [Property("SPEC", "Xamarin.Forms.DefinitionCollection<T>.Contains M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Contains_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- RowDefinition rowDefinition = new RowDefinition();
- rowDefinition.Height = new GridLength(3.0);
- var definitionCollection = new RowDefinitionCollection();
-
- definitionCollection.Add(rowDefinition);
- Assert.IsTrue(definitionCollection.Contains(rowDefinition), "Expected true but returned false.");
- definitionCollection.Clear();
- Assert.IsFalse(definitionCollection.Contains(rowDefinition), "Expected false but returned true.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether copies IDefinition instances to an array.")]
- [Property("SPEC", "Xamarin.Forms.DefinitionCollection<T>.CopyTo M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void CopyTo_CHECK()
- {
- /* TEST CODE */
- RowDefinition[] rowDefinitionArray = new RowDefinition[10];
- RowDefinition rowDefinition = new RowDefinition();
- rowDefinition.Height = new GridLength(2.0);
- RowDefinition secondRowDefinition = new RowDefinition();
- secondRowDefinition.Height = new GridLength(3.0);
-
- var definitionCollection = new RowDefinitionCollection();
- definitionCollection.Clear();
-
- definitionCollection.Add(rowDefinition);
- definitionCollection.Add(secondRowDefinition);
- definitionCollection.CopyTo(rowDefinitionArray, 1);
- Assert.IsTrue(rowDefinitionArray[1].Equals(rowDefinition), "IDefinition instances are not copied.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether returns an enumerator that iterates through the IDefinition.")]
- [Property("SPEC", "Xamarin.Forms.DefinitionCollection<T>.GetEnumerator M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void GetEnumerator_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- RowDefinition rowDefinition = new RowDefinition();
- rowDefinition.Height = new GridLength(2.0);
- RowDefinition secondRowDefinition = new RowDefinition();
- secondRowDefinition.Height = new GridLength(3.0);
- RowDefinition[] rowDefinitionArray = { rowDefinition, secondRowDefinition };
-
- var definitionCollection = new RowDefinitionCollection();
- definitionCollection.Clear();
-
- definitionCollection.Add(rowDefinition);
- definitionCollection.Add(secondRowDefinition);
- var enumerator = definitionCollection.GetEnumerator();
- int index = 0;
- while (enumerator.MoveNext())
- {
- Assert.IsTrue(rowDefinitionArray[index].Equals(enumerator.Current), "Expected true but returning false.");
- index++;
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether returns the index of the first occurrence of item.")]
- [Property("SPEC", "Xamarin.Forms.DefinitionCollection<T>.IndexOf M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void IndexOf_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- RowDefinition rowDefinition = new RowDefinition();
- rowDefinition.Height = new GridLength(2.0);
- RowDefinition secondRowDefinition = new RowDefinition();
- secondRowDefinition.Height = new GridLength(3.0);
-
- var definitionCollection = new RowDefinitionCollection();
- definitionCollection.Clear();
- var initialCount = definitionCollection.Count;
-
- definitionCollection.Add(rowDefinition);
- definitionCollection.Add(secondRowDefinition);
- Assert.AreEqual(definitionCollection.IndexOf(secondRowDefinition), initialCount + 1, "Not returning expected index.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether inserts a IDefinition at the location that is specified by index.")]
- [Property("SPEC", "Xamarin.Forms.DefinitionCollection<T>.Insert M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Insert_CHECK()
- {
- /* TEST CODE */
- RowDefinition rowDefinition = new RowDefinition();
- rowDefinition.Height = new GridLength(2.0);
- RowDefinition secondRowDefinition = new RowDefinition();
- secondRowDefinition.Height = new GridLength(3.0);
- RowDefinition thirdRowDefinition = new RowDefinition();
- thirdRowDefinition.Height = new GridLength(4.0);
-
- var definitionCollection = new RowDefinitionCollection();
- definitionCollection.Clear();
-
- definitionCollection.Add(rowDefinition);
- definitionCollection.Add(secondRowDefinition);
- definitionCollection.Insert(1, thirdRowDefinition);
- Assert.AreEqual(definitionCollection.IndexOf(thirdRowDefinition), 1, "Not returning expected index.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether removes a IDefinition.")]
- [Property("SPEC", "Xamarin.Forms.DefinitionCollection<T>.Remove M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Remove_CHECK()
- {
- /* TEST CODE */
- RowDefinition rowDefinition = new RowDefinition();
- rowDefinition.Height = new GridLength(2.0);
- RowDefinition secondRowDefinition = new RowDefinition();
- secondRowDefinition.Height = new GridLength(3.0);
-
- var definitionCollection = new RowDefinitionCollection();
- definitionCollection.Clear();
-
- definitionCollection.Add(rowDefinition);
- definitionCollection.Add(secondRowDefinition);
- Assert.IsTrue(definitionCollection.Remove(secondRowDefinition), "Expected true but returning false.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether removes an item.")]
- [Property("SPEC", "Xamarin.Forms.DefinitionCollection<T>.RemoveAt M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void RemoveAt_CHECK()
- {
- /* TEST CODE */
- RowDefinition rowDefinition = new RowDefinition();
- rowDefinition.Height = new GridLength(2.0);
- RowDefinition secondRowDefinition = new RowDefinition();
- secondRowDefinition.Height = new GridLength(3.0);
-
- var definitionCollection = new RowDefinitionCollection();
- definitionCollection.Clear();
-
- var initialCount = definitionCollection.Count;
- definitionCollection.Add(rowDefinition);
- definitionCollection.Add(secondRowDefinition);
- Assert.AreEqual(definitionCollection.Count, initialCount + 2, "Count should be increased by tow.");
- definitionCollection.RemoveAt(definitionCollection.IndexOf(secondRowDefinition));
- Assert.AreEqual(definitionCollection.Count, initialCount + 1, "Count should be decreased by one.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ItemSizeChanged Event is raised when the display size of item in the collection changes.")]
- [Property("SPEC", "Xamarin.Forms.DefinitionCollection<T>.ItemSizeChanged E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void ItemSizeChanged_EVENT()
- {
- /* TEST CODE */
- bool isItemSizeChanged = false;
- RowDefinition rowDefinition = new RowDefinition();
- rowDefinition.Height = new GridLength(2.0);
-
- var definitionCollection = new RowDefinitionCollection();
- definitionCollection.Add(rowDefinition);
-
- definitionCollection.ItemSizeChanged += (sender, args) => {
- isItemSizeChanged = true;
- };
-
- rowDefinition.Height = 5.0;
- Assert.IsTrue(isItemSizeChanged, "Event ItemSizeChanged should be handled.");
- }
- }
-}
+++ /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 Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class DependencyAttributeTests
- {
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("DependencyAttribute --------------- SetUp()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("DependencyAttribute --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a DependencyAttribute instance. Check whether object is successfully created or not")]
- [Property("SPEC", "Xamarin.Forms.DependencyAttribute.DependencyAttribute C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void DependencyAttribute_INIT()
- {
- /* TEST CODE */
- var dependencyAttribute = new DependencyAttribute(typeof(Type));
- Assert.IsNotNull(dependencyAttribute, "Creating a DependencyAttribute object failed. It is set to null");
- Assert.IsInstanceOf<DependencyAttribute>(dependencyAttribute);
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System.Collections.Generic;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.DependencyService test")]
- public class DependencyServiceTest
- {
-
- [SetUp]
- public void Setup()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "DependencyService: Setup---------------------------------");
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "DependencyService: Teardown------------------------------");
- }
-
- internal class IInter
- {
-
- public int TestMethod(int i)
- {
- return i;
- }
- }
- internal class TIInter:IInter
- {
- public int Test(int i)
- {
- return i + 1;
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Invoke Register method, and check whether value of Get")]
- [Property("SPEC", "Xamarin.Forms.DependencyService.Get<T> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Ngo Van Hai, hai.nv3@samsung.com")]
- public void Get_PROPERTY()
- {
- /*TEST CODE*/
- DependencyService.Register<IInter>();
- IInter iinter = DependencyService.Get<IInter>();
- Assert.NotNull(iinter,"iinter should be not null");
- Assert.AreEqual(2, iinter.TestMethod(2), "TestMethod(2) should be return 2");
- }
-
-
- [Test]
- [Category("P1")]
- [Description("Invoke Register method, and check whether value of Get")]
- [Property("SPEC", "Xamarin.Forms.DependencyService.Register<T> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Ngo Van Hai, hai.nv3@samsung.com")]
- public void Register_PARAMETER_T()
- {
- /*TEST CODE*/
- DependencyService.Register<IInter>();
- IInter iinter = DependencyService.Get<IInter>();
- Assert.NotNull(iinter, "iinter should be not null");
- Assert.AreEqual(2, iinter.TestMethod(2), "TestMethod(2) should be return 2");
- }
-
- [Test]
- [Category("P1")]
- [Description("Invoke Register method, and check whether value of Get")]
- [Property("SPEC", "Xamarin.Forms.DependencyService.Register<T,TImpl> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Ngo Van Hai, hai.nv3@samsung.com")]
- public void Register_PARAMETER_T_TImpl()
- {
- /*TEST CODE*/
- DependencyService.Register<IInter,TIInter>();
- IInter iinter = DependencyService.Get<IInter>();
- Assert.NotNull(iinter, "iinter should be not null");
- Assert.AreEqual(2, iinter.TestMethod(2), "TestMethod(2) should be return 2");
- }
-
- }
-}
+++ /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 System.Threading.Tasks;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.Device.Styles Tests")]
- public class DeviceStylesTests
- {
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("DeviceStylesTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("DeviceStylesTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property BodyStyleKey is readable.")]
- [Property("SPEC", "Xamarin.Forms.Device.Styles.BodyStyleKey A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void BodyStyleKey_DeviceStyles_READ()
- {
- /* TEST CODE */
- Label label = new Label
- {
- Text = "Style",
- Style = Device.Styles.BodyStyle,
- TextColor = Color.Green
- };
-
- Assert.IsInstanceOf<String>(Device.Styles.BodyStyleKey, "Should be Instance of String.");
- Assert.AreEqual(Device.Styles.BodyStyleKey, label.Style.BaseResourceKey, "BaseResourceKey should be BodyStyle");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property CaptionStyleKey is readable.")]
- [Property("SPEC", "Xamarin.Forms.Device.Styles.CaptionStyleKey A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void CaptionStyleKey_DeviceStyles_READ()
- {
- /* TEST CODE */
- Label label = new Label
- {
- Text = "Style",
- Style = Device.Styles.CaptionStyle,
- TextColor = Color.Green
- };
-
- Assert.IsInstanceOf<String>(Device.Styles.CaptionStyleKey, "Should be Instance of String.");
- Assert.AreEqual(Device.Styles.CaptionStyleKey, label.Style.BaseResourceKey, "BaseResourceKey should be CaptionStyle");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property ListItemDetailTextStyleKey is readable.")]
- [Property("SPEC", "Xamarin.Forms.Device.Styles.ListItemDetailTextStyleKey A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void ListItemDetailTextStyleKey_DeviceStyles_READ()
- {
- /* TEST CODE */
- Label label = new Label
- {
- Text = "Style",
- Style = Device.Styles.ListItemDetailTextStyle,
- TextColor = Color.Green
- };
-
- Assert.IsInstanceOf<String>(Device.Styles.ListItemDetailTextStyleKey, "Should be Instance of String.");
- Assert.AreEqual(Device.Styles.ListItemDetailTextStyleKey, label.Style.BaseResourceKey, "BaseResourceKey should be ListItemDetailTextStyle");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property ListItemTextStyleKey is readable.")]
- [Property("SPEC", "Xamarin.Forms.Device.Styles.ListItemTextStyleKey A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void ListItemTextStyleKey_DeviceStyles_READ()
- {
- /* TEST CODE */
- Label label = new Label
- {
- Text = "Style",
- Style = Device.Styles.ListItemTextStyle,
- TextColor = Color.Green
- };
-
- Assert.IsInstanceOf<String>(Device.Styles.ListItemTextStyleKey, "Should be Instance of String.");
- Assert.AreEqual(Device.Styles.ListItemTextStyleKey, label.Style.BaseResourceKey, "BaseResourceKey should be ListItemTextStyle");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property SubtitleStyleKey is readable.")]
- [Property("SPEC", "Xamarin.Forms.Device.Styles.SubtitleStyleKey A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void SubtitleStyleKey_DeviceStyles_READ()
- {
- /* TEST CODE */
- Label label = new Label
- {
- Text = "Style",
- Style = Device.Styles.SubtitleStyle,
- TextColor = Color.Green
- };
-
- Assert.IsInstanceOf<String>(Device.Styles.SubtitleStyleKey, "Should be Instance of String.");
- Assert.AreEqual(Device.Styles.SubtitleStyleKey, label.Style.BaseResourceKey, "BaseResourceKey should be SubtitleStyle");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property TitleStyleKey is readable.")]
- [Property("SPEC", "Xamarin.Forms.Device.Styles.TitleStyleKey A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void TitleStyleKey_DeviceStyles_READ()
- {
- /* TEST CODE */
- Label label = new Label
- {
- Text = "Style",
- Style = Device.Styles.TitleStyle,
- TextColor = Color.Green
- };
-
- Assert.IsInstanceOf<String>(Device.Styles.TitleStyleKey, "Should be Instance of String.");
- Assert.AreEqual(Device.Styles.TitleStyleKey, label.Style.BaseResourceKey, "BaseResourceKey should be TitleStyle");
- }
- }
-}
+++ /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 System.Threading.Tasks;
-using Tizen.System;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.Device Tests")]
- public class DeviceTests
- {
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("DeviceTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("DeviceTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Checking device is phone")]
- [Property("SPEC", "Xamarin.Forms.Device.Idiom A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi , ef.razi@samsung.com")]
- public void Idiom_PHONE_READ()
- {
- string profile;
- Boolean is_mobile = false;
-
- Information.TryGetValue<string>("tizen.org/feature/profile", out profile);
- if (String.Compare(profile, "mobile", true) == 0)
- is_mobile = true;
-
- if (is_mobile == false)
- Assert.Pass("Can not test due to profile is not mobile.");
-
- /* TEST CODE */
- var idiom = Device.Idiom;
-
- Assert.IsNotNull(idiom, "Device.Idiom should not return NULL");
- Assert.IsInstanceOf<TargetIdiom>(idiom, "Device.Idiom should be TargetIdiom type");
- Assert.AreEqual(TargetIdiom.Phone, idiom, "TargetIdiom should return mobile");
- }
-
- [Test]
- [Category("P1")]
- [Description("Checking device is tv")]
- [Property("SPEC", "Xamarin.Forms.Device.Idiom A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi , ef.razi@samsung.com")]
- public void Idiom_TV_READ()
- {
- string profile;
- Boolean is_tv = false;
-
- Information.TryGetValue<string>("tizen.org/feature/profile", out profile);
- if (String.Compare(profile, "tv", true) == 0)
- is_tv = true;
-
- if (is_tv == false)
- Assert.Pass("Can not test due to profile is not mobile.");
-
- /* TEST CODE */
- var idiom = Device.Idiom;
-
- Assert.IsNotNull(idiom, "Device.Idiom should not return NULL");
- Assert.IsInstanceOf<TargetIdiom>(idiom, "Device.Idiom should be TargetIdiom type");
- Assert.AreEqual(TargetIdiom.TV, idiom, "TargetIdiom should return tv");
- }
-
- [Test]
- [Category("P1")]
- [Description("Checking the device os")]
- [Property("SPEC", "Xamarin.Forms.Device.OS A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi , ef.razi@samsung.com")]
- public void OS_READ()
- {
- /* TEST CODE */
- var os = Device.OS;
-
- Assert.IsNotNull(os, "Device.OS should not return NULL");
- Assert.IsInstanceOf<TargetPlatform>(os, "Device.OS should be TargetPlatform type");
- Assert.AreEqual(TargetPlatform.Other , os, "TargetPlatform should return Other. Please use RuntimePlatform if you want to get current platform.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Checking GetNamedSize returns a double that represents the named size for the font.")]
- [Property("SPEC", "Xamarin.Forms.Device.GetNamedSize M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi , ef.razi@samsung.com")]
- [Property("COVPARAM", "Xamarin.Forms.NamedSize, System.Type")]
-
- public void GetNamedSize_WITH_TYPE_CHECK_RETURN()
- {
- /* TEST CODE */
- Button btn = new Button()
- {
- Text = "TestButton"
- };
-
- double btnFontSize = btn.FontSize;
- var fontSize = Device.GetNamedSize(btn.Font.NamedSize, btn.GetType());
-
- Assert.IsNotNull(fontSize, "Device.GetNamedSize should not return NULL");
- Assert.IsInstanceOf<double>(fontSize, "Device.GetNamedSize should be boolean type");
- Assert.AreEqual(btnFontSize, fontSize, "Device.GetNamedSize should return font size same as button font size");
- }
-
- [Test]
- [Category("P1")]
- [Description("Checking GetNamedSize returns a double that represents the named size for the font.")]
- [Property("SPEC", "Xamarin.Forms.Device.GetNamedSize M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi , ef.razi@samsung.com")]
- [Property("COVPARAM", "Xamarin.Forms.NamedSize, Xamarin.Forms.Element")]
- public void GetNamedSize_WITH_ELEMENT_CHECK_RETURN()
- {
- /* TEST CODE */
- Element btn = new Button()
- {
- Text = "TestButton"
- };
-
- double btnFontSize = ((Button)btn).FontSize;
- var fontSize = Device.GetNamedSize(((Button)btn).Font.NamedSize, btn);
-
- Assert.IsNotNull(fontSize, "Device.GetNamedSize should not return NULL");
- Assert.IsInstanceOf<double>(fontSize, "Device.GetNamedSize should be boolean type");
- Assert.AreEqual(btnFontSize, fontSize, "Device.GetNamedSize should return font size same as button font size");
- }
-
- [Test]
- [Category("P1")]
- [Description("Checking OnPlatform can execute action only for Default (Tizen) os.")]
- [Property("SPEC", "Xamarin.Forms.Device.OnPlatform M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Nguyen Van Tan , nguyen.vtan@samsung.com")]
- public void OnPlatform_CHECK_STATUS()
- {
- /* TEST CODE */
- int fonsize = 10;
- Label label = new Label
- {
- FontSize = fonsize
- };
-
- Device.OnPlatform(Default: () => label.FontSize = 20);
- Assert.AreNotEqual(fonsize, label.FontSize, "FontSize should be different with initization value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Checking OnPlatform<T> can return values only for Default (Tizen) os.")]
- [Property("SPEC", "Xamarin.Forms.Device.OnPlatform<T> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi , ef.razi@samsung.com")]
- public void OnPlatform_GENERIC_CHECK_RETURN()
- {
- /* TEST CODE */
- //Device.OS = TargetPlatform.WinPhone;
- Assert.AreNotEqual(3, Device.OnPlatform(1, 2, 3), "Device.OnPaltform should not return value for WinPhone os.");
-
- //Device.OS = TargetPlatform.Android;
- Assert.AreNotEqual(2, Device.OnPlatform(1, 2, 3), "Device.OnPaltform should not return value for Android os.");
-
- //Device.OS = TargetPlatform.Other or Device.OS = TargetPlatform.iOS;
- Assert.AreEqual(1, Device.OnPlatform(1, 2, 3), "Device.OnPaltform shoud return value for Other (Tizen) os.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Checking StartTimer can starts a recurring timer using the device clock capabilities.")]
- [Property("SPEC", "Xamarin.Forms.Device.StartTimer M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi , ef.razi@samsung.com")]
- public async Task StartTimer_CHECK_STATUS()
- {
- var task = new TaskCompletionSource<int>();
-
- int steps = 0;
- await Task.Factory.StartNew(() => Device.StartTimer(TimeSpan.FromMilliseconds(200), () =>
- {
- steps++;
- if (steps < 2)
- return true;
- task.SetResult(steps);
- return false;
- }));
-
- await Task.Delay(3000);
-
- Assert.AreEqual(2, task.Task.Result, "StartTimer should starts a recurring timer using the device clock capabilities.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property RuntimePlatform is readable or not.")]
- [Property("SPEC", "Xamarin.Forms.Device.RuntimePlatform A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void RuntimePlatform_Device_READ()
- {
- /* TEST CODE */
- var device = Device.RuntimePlatform;
-
- Assert.IsNotNull(device, "Device.RuntimePlatform should not return NULL");
- Assert.IsInstanceOf<String>(device, "Device.RuntimePlatform should be String type");
- Assert.AreEqual("Tizen", device, "RuntimePlatform should return Tizen platform.");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-using NUnit.Framework.TUnit;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.Easing Tests")]
- public class EasingTests
- {
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("EasingTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("EasingTests --------------- TearDown()");
- }
-
- private double ValueDouble([Values(0.0, 1.0)] double val)
- {
- return val;
- }
-
- [Test]
- [Category("P1")]
- [Description("Create an Easing instance.")]
- [Property("SPEC", "Xamarin.Forms.Easing.Easing C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Easing_INIT()
- {
- /* TEST CODE */
- Easing easing = new Easing(dbl => 0.5);
- Assert.IsNotNull(easing, "Should not be null.");
- Assert.IsInstanceOf<Easing>(easing, "Should be an instance of Easing");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Ease.")]
- [Property("SPEC", "Xamarin.Forms.Easing.Ease M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Ease_CHECK_RETURN()
- {
- /* TEST CODE */
- double input = 0.7;
- Assert.AreEqual(input, Easing.Linear.Ease(input));
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the BounceIn property is readable.")]
- [Property("SPEC", "Xamarin.Forms.Easing.BounceIn A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void BounceIn_READ()
- {
- /* TEST CODE */
- const double epsilon = 0.001;
- double val = 0.0;
- Assert.IsInstanceOf<Easing>(Easing.BounceIn, "BounceIn should return object Easing.");
- Assert.True(Math.Abs(val - Easing.BounceIn.Ease(val)) < epsilon, "Should be true.");
-
- double val2 = 1.00;
- Assert.True(Math.Abs(val2 - Easing.BounceIn.Ease(val2)) < epsilon, "Should be true.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the BounceOut property is readable.")]
- [Property("SPEC", "Xamarin.Forms.Easing.BounceOut A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void BounceOut_READ()
- {
- /* TEST CODE */
- const double epsilon = 0.001;
- double val = 0.0;
- Assert.IsInstanceOf<Easing>(Easing.BounceOut, "BounceOut should return object Easing.");
- Assert.True(Math.Abs(val - Easing.BounceOut.Ease(val)) < epsilon, "Should be true.");
-
- double val2 = 1.00;
- Assert.True(Math.Abs(val2 - Easing.BounceOut.Ease(val2)) < epsilon, "Should be true.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the CubicIn property is readable.")]
- [Property("SPEC", "Xamarin.Forms.Easing.CubicIn A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void CubicIn_READ()
- {
- /* TEST CODE */
- const double epsilon = 0.001;
- double val = 0.0;
- Assert.IsInstanceOf<Easing>(Easing.CubicIn, "CubicIn should return object Easing.");
- Assert.True(Math.Abs(val - Easing.CubicIn.Ease(val)) < epsilon, "Should be true.");
-
- double val2 = 1.00;
- Assert.True(Math.Abs(val2 - Easing.CubicIn.Ease(val2)) < epsilon, "Should be true.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the CubicInOut property is readable.")]
- [Property("SPEC", "Xamarin.Forms.Easing.CubicInOut A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void CubicInOut_READ()
- {
- /* TEST CODE */
- const double epsilon = 0.001;
- double val = 0.0;
- Assert.IsInstanceOf<Easing>(Easing.CubicInOut, "CubicInOut should return object Easing.");
- Assert.True(Math.Abs(val - Easing.CubicInOut.Ease(val)) < epsilon, "Should be true.");
-
- double val2 = 1.00;
- Assert.True(Math.Abs(val2 - Easing.CubicInOut.Ease(val2)) < epsilon, "Should be true.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the CubicOut property is readable.")]
- [Property("SPEC", "Xamarin.Forms.Easing.CubicOut A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void CubicOut_READ()
- {
- /* TEST CODE */
- const double epsilon = 0.001;
- double val = 0.0;
- Assert.IsInstanceOf<Easing>(Easing.CubicOut, "CubicOut should return object Easing.");
- Assert.True(Math.Abs(val - Easing.CubicOut.Ease(val)) < epsilon, "Should be true.");
-
- double val2 = 1.00;
- Assert.True(Math.Abs(val2 - Easing.CubicOut.Ease(val2)) < epsilon, "Should be true.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the Linear property is readable.")]
- [Property("SPEC", "Xamarin.Forms.Easing.Linear A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Linear_READ()
- {
- /* TEST CODE */
- const double epsilon = 0.001;
- double val = 0.0;
- Assert.IsInstanceOf<Easing>(Easing.Linear, "Linear should return object Easing.");
- Assert.True(Math.Abs(val - Easing.Linear.Ease(val)) < epsilon, "Should be true.");
-
- double val2 = 1.00;
- Assert.True(Math.Abs(val2 - Easing.Linear.Ease(val2)) < epsilon, "Should be true.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the SinIn property is readable.")]
- [Property("SPEC", "Xamarin.Forms.Easing.SinIn A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void SinIn_READ()
- {
- /* TEST CODE */
- const double epsilon = 0.001;
- double val = 0.0;
- Assert.IsInstanceOf<Easing>(Easing.SinIn, "SinIn should return object Easing.");
- Assert.True(Math.Abs(val - Easing.SinIn.Ease(val)) < epsilon, "Should be true.");
-
- double val2 = 1.00;
- Assert.True(Math.Abs(val2 - Easing.SinIn.Ease(val2)) < epsilon, "Should be true.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the SinInOut property is readable.")]
- [Property("SPEC", "Xamarin.Forms.Easing.SinInOut A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void SinInOut_READ()
- {
- /* TEST CODE */
- const double epsilon = 0.001;
- double val = 0.0;
- Assert.IsInstanceOf<Easing>(Easing.SinInOut, "SinInOut should return object Easing.");
- Assert.True(Math.Abs(val - Easing.SinInOut.Ease(val)) < epsilon, "Should be true.");
-
- double val2 = 1.00;
- Assert.True(Math.Abs(val2 - Easing.SinInOut.Ease(val2)) < epsilon, "Should be true.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the SinOut property is readable.")]
- [Property("SPEC", "Xamarin.Forms.Easing.SinOut A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void SinOut_READ()
- {
- /* TEST CODE */
- const double epsilon = 0.001;
- double val = 0.0;
- Assert.IsInstanceOf<Easing>(Easing.SinOut, "SinOut should return object Easing.");
- Assert.True(Math.Abs(val - Easing.SinOut.Ease(val)) < epsilon, "Should be true.");
-
- double val2 = 1.00;
- Assert.True(Math.Abs(val2 - Easing.SinOut.Ease(val2)) < epsilon, "Should be true.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the SpringIn property is readable.")]
- [Property("SPEC", "Xamarin.Forms.Easing.SpringIn A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void SpringIn_READ()
- {
- /* TEST CODE */
- const double epsilon = 0.001;
- double val = 0.0;
- Assert.IsInstanceOf<Easing>(Easing.SpringIn, "SpringIn should return object Easing.");
- Assert.True(Math.Abs(val - Easing.SpringIn.Ease(val)) < epsilon, "Should be true.");
-
- double val2 = 1.00;
- Assert.True(Math.Abs(val2 - Easing.SpringIn.Ease(val2)) < epsilon, "Should be true.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the SpringOut property is readable.")]
- [Property("SPEC", "Xamarin.Forms.Easing.SpringOut A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void SpringOut_READ()
- {
- /* TEST CODE */
- const double epsilon = 0.001;
- double val = 0.0;
- Assert.IsInstanceOf<Easing>(Easing.SpringOut, "SpringOut should return object Easing.");
- Assert.True(Math.Abs(val - Easing.SpringOut.Ease(val)) < epsilon, "Should be true.");
-
- double val2 = 1.00;
- Assert.True(Math.Abs(val2 - Easing.SpringOut.Ease(val2)) < epsilon, "Should be true.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the conversion of a function into Easing.")]
- [Property("SPEC", "Xamarin.Forms.Easing.Implicit M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void Implicit_CHECK_RETURN()
- {
- /* TEST CODE */
-
- Func<double, double> func = funtionTest;
- Easing easing1 = new Easing(func);
-
- Easing easing2 = func;
-
- Assert.AreNotEqual(easing1, easing2, "easing1 & easing2 should be same");
- //Assert.True(false, "[NA] Need to check API behavior");
- }
-
- private double funtionTest(double a)
- {
- return a + 1;
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class EditorTests
- {
- Editor _editor;
- [SetUp]
- public void SetUp()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Editor CLASS: Setup---------------------------------");
- _editor = new Editor();
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Editor CLASS: Teardown---------------------------------");
- _editor = null;
- }
-
- [Test]
- [Category("P1")]
- [Description(" Create a Editor instance. Check whether object is successfully created or not.")]
- [Property("SPEC", "Xamarin.Forms.Editor.Editor C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void Editor_CONST()
- {
- /*TEST CODE*/
- _editor = new Editor();
- Assert.IsInstanceOf<Editor>(_editor, "_editor should be an instance of Editor");
- Assert.IsNotNull(_editor, "Can't create success object Button");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of FontAttributes are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.Editor.FontAttributes A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void FontAttributes_PROPERTY_SET_GET()
- {
- /*TEST CODE*/
- _editor.FontAttributes = FontAttributes.Bold;
- Assert.AreEqual(FontAttributes.Bold, _editor.FontAttributes, "Retrieved FontAttributes value is not equal to set value");
- _editor.FontAttributes = FontAttributes.None;
- Assert.AreEqual(FontAttributes.None, _editor.FontAttributes, "Retrieved FontAttributes value is not equal to set value");
- _editor.FontAttributes = FontAttributes.Italic;
- Assert.AreEqual(FontAttributes.Italic, _editor.FontAttributes, "Retrieved FontAttributes value is not equal to set value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of FontFamily are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.Editor.FontFamily A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void FontFamily_PROPERTY_SET_GET()
- {
- /*TEST CODE*/
- var mFont1 = "Vietnamese";
- var mFont2 = "Calibri";
- _editor.FontFamily = mFont1;
- Assert.AreEqual(mFont1, _editor.FontFamily, "Retrieved FontFamily value is not equal to set value");
- _editor.FontFamily = mFont2;
- Assert.AreEqual(mFont2, _editor.FontFamily, "Retrieved FontFamily value is not equal to set value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of Text are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.Editor.Text A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void Text_PROPERTY_SET_GET()
- {
- /*TEST CODE*/
- var mFont1 = "Vietnamese";
- var mFont2 = "English";
- _editor.Text = mFont1;
- Assert.AreEqual(mFont1, _editor.Text, "Retrieved Text value is not equal to set value");
- _editor.Text = mFont2;
- Assert.AreEqual(mFont2, _editor.Text, "Retrieved Text value is not equal to set value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of FontSize are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.Editor.FontSize A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void FontSize_PROPERTY_SET_GET()
- {
- /*TEST CODE*/
- var mFontSize1 = 12.5;
- var mFontSize2 = 22.2;
- _editor.FontSize = mFontSize1;
- Assert.AreEqual(mFontSize1, _editor.FontSize, "Retrieved FontSize value is not equal to set value");
- _editor.FontSize = mFontSize2;
- Assert.AreEqual(mFontSize2, _editor.FontSize, "Retrieved FontSize value is not equal to set value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of TextColor are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.Editor.TextColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void TextColor_PROPERTY_SET_GET()
- {
- /*TEST CODE*/
- var mColorRed = Color.Red;
- var mColorBlue = Color.Blue;
- _editor.TextColor = mColorRed;
- Assert.AreEqual(mColorRed, _editor.TextColor, "Retrieved TextColor value is not equal to set value");
- _editor.TextColor = mColorBlue;
- Assert.AreEqual(mColorBlue, _editor.TextColor, "Retrieved TextColor value is not equal to set value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check return Editor configuration")]
- [Property("SPEC", "Xamarin.Forms.Editor.On<T> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void On_CONFIGURATION_METHOD()
- {
- /*TEST CODE*/
- var mColor = Color.Red;
- _editor.TextColor = mColor;
- var myConfig = _editor.On<IConfigPlatform>();
- Assert.IsInstanceOf<IPlatformElementConfiguration<IConfigPlatform, Editor>>(myConfig, "myConfig should be a instance of IPlatformElementConfiguration");
- Assert.IsInstanceOf<Editor>(myConfig.Element, "myConfig.Element should be a instance of Editor");
- Assert.AreEqual(mColor, myConfig.Element.TextColor, "TextColor of myConfig.Element value & TextColor of _editor should be to equal");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether TextColorProperty(BindableProperty) is working correctly or not")]
- [Property("SPEC", "Xamarin.Forms.Editor.TextColorProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void TextColorProperty_PROPERTY_READ_ONLY()
- {
- /*TEST CODE*/
- var mColor1 = Color.Red;
- var mColor2 = Color.White;
- _editor.TextColor = mColor1;
- Label mLabel = new Label()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- TextColor = mColor2
- };
- Assert.AreNotEqual(mLabel.TextColor, _editor.TextColor, "TextColor of _editor value must be different form TextColor of mLabel value");
- _editor.BindingContext = mLabel;
- _editor.SetBinding(Editor.TextColorProperty, "TextColor");
- Assert.AreEqual(mLabel.TextColor, _editor.TextColor, "TextColor of mLabel value & TextColor of _editor value should be same");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether FontAttributesProperty(BindableProperty) is working correctly or not")]
- [Property("SPEC", "Xamarin.Forms.Editor.FontAttributesProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void FontAttributesProperty_PROPERTY_READ_ONLY()
- {
- /*TEST CODE*/
- var mFontBold = FontAttributes.Bold;
- var mFontNone = FontAttributes.None;
- _editor.FontAttributes = mFontBold;
- Label mLabel = new Label()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- FontAttributes = mFontNone
- };
- Assert.AreNotEqual(mLabel.FontAttributes, _editor.FontAttributes, "FontAttributes of _editor value must be different form FontAttributes of mLabel value");
- _editor.BindingContext = mLabel;
- _editor.SetBinding(Editor.FontAttributesProperty, "FontAttributes");
- Assert.AreEqual(mLabel.FontAttributes, _editor.FontAttributes, "FontAttributes of mLabel value & FontAttributes of _editor value should be same");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether FontFamilyProperty(BindableProperty) is working correctly or not")]
- [Property("SPEC", "Xamarin.Forms.Editor.FontFamilyProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void FontFamilyProperty_PROPERTY_READ_ONLY()
- {
- /*TEST CODE*/
- var mFontVietNam = "Vietnamese";
- var mFontArial = "Arial";
- _editor.FontFamily = mFontVietNam;
- var mButton = new Button()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- FontFamily = mFontArial
- };
- Assert.AreNotEqual(mButton.FontFamily, _editor.FontFamily, "FontFamily of _editor value must be different form FontFamily of mButton value");
- _editor.BindingContext = mButton;
- _editor.SetBinding(Editor.FontFamilyProperty, "FontFamily");
- Assert.AreEqual(mButton.FontAttributes, _editor.FontAttributes, "FontFamily of mButton value & FontFamily of _editor value should be same");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether TextProperty(BindableProperty) is working correctly or not")]
- [Property("SPEC", "Xamarin.Forms.Editor.TextProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void TextProperty_PROPERTY_READ_ONLY()
- {
- /*TEST CODE*/
- var mTextVietNam = "Vietnamese";
- var mTextEnglish = "English";
- _editor.Text = mTextVietNam;
- var mButton = new Button()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Text = mTextEnglish
- };
- Assert.AreNotEqual(mButton.Text, _editor.Text, "Text of _editor value must be different form Text of mButton value");
- _editor.BindingContext = mButton;
- _editor.SetBinding(Editor.TextProperty, "Text");
- Assert.AreEqual(mButton.Text, _editor.Text, "Text of mButton value & Text of _editor value should be same");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether FontSizeProperty(BindableProperty) is working correctly or not")]
- [Property("SPEC", "Xamarin.Forms.Editor.FontSizeProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void FontSizeProperty_PROPERTY_READ_ONLY()
- {
- /*TEST CODE*/
- var mSize01 = 12.6;
- var mSize02 = 26.9;
- _editor.FontSize = mSize01;
- var mButton = new Button()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- FontSize = mSize02
- };
- Assert.AreNotEqual(mButton.FontSize, _editor.FontSize, "FontSize of _editor value must be different form FontSize of mButton value");
- _editor.BindingContext = mButton;
- _editor.SetBinding(Editor.FontSizeProperty, "FontSize");
- Assert.AreEqual(mButton.FontSize, _editor.FontSize, "FontSize of mButton value & FontSize of _editor value should be same");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether TextChanged events can be invoked or not when text of the Editor object is changed.")]
- [Property("SPEC", "Xamarin.Forms.Editor.TextChanged E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void TextChanged_CHECK_EVENT()
- {
- /*TEST CODE*/
- _editor.Text = "TestEditor";
- bool flagChanged = false;
- _editor.TextChanged += (o, e) =>
- {
- flagChanged = true;
- };
- _editor.Text = "Editor";
- Assert.True(flagChanged, "TextChanged event should be invoked.");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check whether Completed events can be invoked or not when the Editor object created complete.")]
- [Property("SPEC", "Xamarin.Forms.Editor.Completed E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void Completed_CHECK_EVENT()
- {
- Assert.True(false, "[NA]Manual TC.");
- ///*TEST CODE*/
- //_editor.Text = "TestEditor";
- //_editor.HorizontalOptions = LayoutOptions.FillAndExpand;
- //bool flagComplete = false;
- //_editor.Completed += (o, e) =>
- //{
- // flagComplete = true;
- //};
- //var mButton = new Button()
- //{
- // HorizontalOptions = LayoutOptions.FillAndExpand,
- //};
- //new ContentPage()
- //{
- // Content = new StackLayout()
- // {
- // HorizontalOptions = LayoutOptions.FillAndExpand,
- // Children =
- // {
- // _editor,
- // mButton
- // }
- // }
- //};
- //_editor.Focus();
- //_editor.Text = "Test";
- //_editor.Unfocus();
- //mButton.Focus();
- //Assert.True(flagComplete, "Completed event should be invoked.");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-using Xamarin.Forms.Platform.Tizen;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.Effect Tests")]
- public class EffectTests
- {
- class EffectControlProvider : IEffectControlProvider
- {
- public void RegisterEffect(Effect effect)
- {
- var e = effect as CustomEffect;
- if (e != null)
- e.Registered = true;
- }
- }
-
- class CustomEffect : PlatformEffect
- {
- public bool OnAttachedCalled;
- public bool OnDetachedCalled;
- public bool Registered;
-
- protected override void OnAttached()
- {
- OnAttachedCalled = true;
- }
-
- protected override void OnDetached()
- {
- OnDetachedCalled = true;
- }
- }
-
- [SetUp]
- public void Setup()
- {
- Console.WriteLine("EffectTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("EffectTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the value for Element.")]
- [Property("SPEC", "Xamarin.Forms.Effect.Element A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Element_READ_ONLY()
- {
- /* TEST CODE */
- Element element = new Page();
- element.ClassId = "Tizen";
- CustomEffect customEffect = new CustomEffect();
-
- ((IVisualElementController)element).EffectControlProvider = new EffectControlProvider();
- element.Effects.Add(customEffect);
- Assert.AreEqual(element, customEffect.Element, "Not returning expected element.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the value for IsAttached.")]
- [Property("SPEC", "Xamarin.Forms.Effect.IsAttached A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void IsAttached_READ_ONLY()
- {
- /* TEST CODE */
- Element element = new Page();
- element.ClassId = "Tizen";
- CustomEffect customEffect = new CustomEffect();
-
- ((IVisualElementController)element).EffectControlProvider = new EffectControlProvider();
- element.Effects.Add(customEffect);
- Assert.IsNotNull(customEffect, "CustomEffect instance is null");
- Assert.IsTrue(customEffect.IsAttached, "Expected true but was false.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the value for ResolveId.")]
- [Property("SPEC", "Xamarin.Forms.Effect.ResolveId A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void ResolveId_READ_ONLY()
- {
- /* TEST CODE */
- string resolveId = "Tizen";
- var effect = Effect.Resolve(resolveId);
- Assert.AreEqual(resolveId, effect.ResolveId, "Not returning expected Resolve ID.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value type for Resolve.")]
- [Property("SPEC", "Xamarin.Forms.Effect.Resolve M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Resolve_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- var effect = Effect.Resolve("Foo");
- Assert.IsInstanceOf<Effect>(effect, "Should return instance of Effect.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OnAttached is called after an effect is attached.")]
- [Property("SPEC", "Xamarin.Forms.Effect.OnAttached M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void OnAttached_CHECK()
- {
- /* TEST CODE */
- CustomEffect customEffect = new CustomEffect();
- var element = new Label();
-
- element.Effects.Add(customEffect);
- ((IVisualElementController)element).EffectControlProvider = new EffectControlProvider();
- Assert.True(customEffect.OnAttachedCalled, "Expected true but returned false.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OnDetached is called after an effect is detached.")]
- [Property("SPEC", "Xamarin.Forms.Effect.OnDetached M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void OnDetached_CHECK()
- {
- /* TEST CODE */
- CustomEffect customEffect = new CustomEffect();
- var element = new Label();
-
- ((IVisualElementController)element).EffectControlProvider = new EffectControlProvider();
- element.Effects.Add(customEffect);
- element.Effects.Clear();
- Assert.True(customEffect.OnDetachedCalled, "Expected true but returned false.");
- }
- }
-}
+++ /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.Collections.ObjectModel;
-using Xamarin.Forms;
-using NUnit.Framework;
-using System.Collections.Specialized;
-using System.Runtime.CompilerServices;
-using Xamarin.Forms.Platform.Tizen;
-using XamarinForTizen.Tizen.common;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.Element Tests")]
- public class ElementTests
- {
- public class TestElement : Element
- {
- public bool BindingContextChangedHapped { get; set; }
- public bool ChildAddedHapped { get; set; }
- public bool ChildRemovedHapped { get; set; }
- public bool ParentSetHapped { get; set; }
- public bool PropertyChangedHapped { get; set; }
- public TestElement()
- {
- internalChildren.CollectionChanged += OnChildrenChanged;
- }
-
- void OnChildrenChanged(object sender, NotifyCollectionChangedEventArgs e)
- {
- if (e.NewItems != null)
- {
- foreach (Element element in e.NewItems)
- OnChildAdded(element);
- }
-
- if (e.OldItems != null)
- {
- foreach (Element element in e.OldItems)
- OnChildRemoved(element);
- }
- }
-
- public IList<Element> Children
- {
- get { return internalChildren; }
- }
-
- protected override void OnBindingContextChanged()
- {
- base.OnBindingContextChanged();
- BindingContextChangedHapped = true;
- }
-
- protected override void OnChildAdded(Element child)
- {
- base.OnChildAdded(child);
- ChildAddedHapped = true;
- }
- protected override void OnChildRemoved(Element child)
- {
- base.OnChildRemoved(child);
- ChildRemovedHapped = true;
- }
-
- protected override void OnParentSet()
- {
- base.OnParentSet();
- ParentSetHapped = true;
- }
-
- protected override void OnPropertyChanged([CallerMemberName] string propertyName = null)
- {
- base.OnPropertyChanged(propertyName);
- PropertyChangedHapped = true;
- }
- readonly ObservableCollection<Element> internalChildren = new ObservableCollection<Element>();
- }
-
- private TestElement _element;
- public readonly BindableProperty ClassIdProperty = BindableProperty.Create("ClassId", typeof(string), typeof(View), null);
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("ElementTests --------------- Setup()");
- _element = new TestElement();
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("ElementTestss --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a Cell object")]
- [Property("SPEC", "Xamarin.Forms.Element.Element A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONST")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void Element_INIT()
- {
- var element = new TestElement();
- /*TEST CODE*/
- Assert.IsNotNull(element, "Should be not null.");
- Assert.IsInstanceOf<Element>(element, "Should be Cell type.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check ClassId bindable property.")]
- [Property("SPEC", "Xamarin.Forms.Element.ClassIdProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void ClassIdProperty_CHECK_BINDABLE()
- {
- /*TEST CODE*/
- _element.ClassId = "0X00001";
- var lbl = new Label()
- {
- ClassId = "0X00002"
- };
-
- Assert.AreNotEqual(_element.ClassId, lbl.ClassId, "ClassId of Element & Lable must be different");
- _element.BindingContext = lbl;
- _element.SetBinding(Element.ClassIdProperty, "ClassId");
- Assert.AreEqual(_element.ClassId, lbl.ClassId, "ClassId of Element & Lable must be equal");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the AutomationID whether writeable and readable.")]
- [Property("SPEC", "Xamarin.Forms.Element.AutomationId A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi , ef.razi@samsung.com")]
- public void AutomationId_READ_WRITE()
- {
- /* TEST CODE */
- string setAutoMateId = "a00001";
- _element.AutomationId = setAutoMateId;
- var getAutoMateId = _element.AutomationId;
- Assert.IsInstanceOf<string>(getAutoMateId, "AutomationId should be double");
- Assert.AreEqual(setAutoMateId, getAutoMateId, "SET and GET Value should be same");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the ClassId whether writeable and readable.")]
- [Property("SPEC", "Xamarin.Forms.Element.ClassId A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi , ef.razi@samsung.com")]
- public void ClassId_READ_WRITE()
- {
- /* TEST CODE */
- string setClassId = "0X00001";
- _element.ClassId = setClassId;
- var getClassId = _element.ClassId;
- Assert.IsInstanceOf<string>(getClassId, "ClassId should be double");
- Assert.AreEqual(setClassId, getClassId, "SET and GET Value should be same");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check Effects whether readable.")]
- [Property("SPEC", "Xamarin.Forms.Element.Effects A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi , ef.razi@samsung.com")]
- public void Effects_READ()
- {
- /* TEST CODE */
- var lbl = new Label();
- var effect = Effect.Resolve("Samsung.MockEffect");
- lbl.Effects.Add(effect);
-
- foreach (Effect e in (ObservableCollection<Effect>)lbl.Effects)
- {
- _element.Effects.Add(e);
- }
-
- ObservableCollection<Effect> effects = (ObservableCollection<Effect>)_element.Effects;
- bool isEffectPresnt = effects.Contains(effect);
- Assert.IsTrue(isEffectPresnt, "Effect should be present.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check Id whether readable.")]
- [Property("SPEC", "Xamarin.Forms.Element.Id A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi , ef.razi@samsung.com")]
- public void Id_READ()
- {
- /* TEST CODE */
- var id = _element.Id;
-
- Assert.IsNotNull(id, "Id should not be NULL");
- Assert.IsInstanceOf<Guid>(id, "id should be Guid type");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the Parent whether writeable and readable.")]
- [Property("SPEC", "Xamarin.Forms.Element.Parent A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi , ef.razi@samsung.com")]
- public void Parent_READ_WRITE()
- {
- /* TEST CODE */
- Label lbl = new Label()
- {
- Text = "Parent"
- };
-
- _element.Parent = lbl;
-
- var parent = _element.Parent;
-
- Assert.IsNotNull(parent, "Parent should not be NULL");
- Assert.IsInstanceOf<Label>(parent, "id should be Guid type");
- Assert.AreEqual("Parent",((Label)parent).Text,"Text should be same as Parent");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the ParentView whether readable.")]
- [Property("SPEC", "Xamarin.Forms.Element.ParentView A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi , ef.razi@samsung.com")]
- public void ParentView_READ()
- {
- /* TEST CODE */
- Label lbl = new Label()
- {
- Text = "Parent"
- };
-
- _element.Parent = lbl;
-
- var parent = _element.ParentView;
-
- Assert.IsNotNull(parent, "Parent should not be NULL");
- Assert.IsInstanceOf<Label>(parent, "id should be Guid type");
- Assert.AreEqual("Parent", ((Label)parent).Text, "Text should be same as Parent");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the StyleId whether writeable and readable.")]
- [Property("SPEC", "Xamarin.Forms.Element.StyleId A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi , ef.razi@samsung.com")]
- public void StyleId_READ_WRITE()
- {
- /* TEST CODE */
- string setStyleId = "01xStyle";
-
- _element.StyleId = setStyleId;
-
- var getStyleId = _element.StyleId;
-
- Assert.IsNotNull(getStyleId, "StyleId should not be NULL");
- Assert.IsInstanceOf<string>(getStyleId, "StyleId should be string type");
- Assert.AreEqual(setStyleId, getStyleId, "SET & GET value of StyleId should be same");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check dynamic resource has been removed.")]
- [Property("SPEC", "Xamarin.Forms.Element.RemoveDynamicResource M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi , ef.razi@samsung.com")]
- public void RemoveDynamicResource_CHECK_STATUS()
- {
- /* TEST CODE */
- Element elemnt = new Label();
- ((Label)elemnt).Resources = new ResourceDictionary { { "foo", "FOO" } };
-
- Assert.AreEqual(Label.TextProperty.DefaultValue, ((Label)elemnt).Text, "Label.TextProperty.DefaultValue should be same as Element Text");
-
- elemnt.SetDynamicResource(Label.TextProperty, "foo");
- Assert.AreEqual("FOO", ((Label)elemnt).Text,"Text should be FOO");
-
- ((Label)elemnt).RemoveDynamicResource(Label.TextProperty);
- ((Label)elemnt).Resources["foo"] = "BAR";
- Assert.AreEqual("FOO", ((Label)elemnt).Text,"Text should be FOO");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check dynamic resource can be set.")]
- [Property("SPEC", "Xamarin.Forms.Element.SetDynamicResource M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi , ef.razi@samsung.com")]
- public void SetDynamicResource_CHECK_STATUS()
- {
- /* TEST CODE */
- Element elemnt = new Label();
- ((Label)elemnt).SetDynamicResource(Label.TextProperty, "foo");
- var layout = new StackLayout
- {
- Children = {
- ((Label)elemnt)
- }
- };
-
- Assert.AreEqual(Label.TextProperty.DefaultValue, ((Label)elemnt).Text, "Label.TextProperty.DefaultValue should be same as Element Text");
-
- layout.Resources = new ResourceDictionary {
- { "foo", "FOO" }
- };
- Assert.AreEqual("FOO", ((Label)elemnt).Text, "Text should be FOO");
-
- }
-
- [Test]
- [Category("P1")]
- [Description("Check OnBindingContextChanged is invoked whenever the binding context of the element changes.")]
- [Property("SPEC", "Xamarin.Forms.Element.OnBindingContextChanged M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi , ef.razi@samsung.com")]
- public void OnBindingContextChanged_CHECK_INVOCK()
- {
- /* TEST CODE */
- object obj = new object();
- _element.BindingContext = obj;
- Assert.IsTrue(_element.BindingContextChangedHapped, "OnBindingContextChanged should be invoked");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check OnChildAdded is invoked whenever the Element.ChildAdded event needs to be emitted.")]
- [Property("SPEC", "Xamarin.Forms.Element.OnChildAdded M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi , ef.razi@samsung.com")]
- public void OnChildAdded_CHECK_INVOCK()
- {
- /* TEST CODE */
- bool emitted = false;
- var lbl = new Label();
- _element.ChildAdded += (sender, args) => emitted = true;
- _element.Children.Add(lbl);
- Assert.IsTrue(_element.ChildAddedHapped, "OnChildAdded should be invoked");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check OnChildRemoved is invoked whenever the Element.ChildRemoved event needs to be emitted.")]
- [Property("SPEC", "Xamarin.Forms.Element.OnChildRemoved M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi , ef.razi@samsung.com")]
- public void OnChildRemoved_CHECK_INVOCK()
- {
- /* TEST CODE */
- bool emitted = false;
- var lbl = new Label();
- _element.ChildAdded += (sender, args) => emitted = true;
- _element.Children.Add(lbl);
- Assert.IsTrue(_element.ChildAddedHapped, "OnChildAdded should be invoked");
- _element.ChildRemoved += (sender, args) => emitted = false;
- _element.Children.Remove(lbl);
- Assert.IsTrue(_element.ChildRemovedHapped, "OnChildRemoved should be invoked");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check OnParentSet is invoked whenever the Parent of an element is set.")]
- [Property("SPEC", "Xamarin.Forms.Element.OnParentSet M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi , ef.razi@samsung.com")]
- public void OnParentSet_CHECK_INVOCK()
- {
- /* TEST CODE */
- var lbl = new Label();
- _element.Parent = lbl;
- Assert.IsTrue(_element.ParentSetHapped, "OnChildRemoved should be invoked");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check OnPropertyChanged method that is called when a bound property is changed.")]
- [Property("SPEC", "Xamarin.Forms.Element.OnPropertyChanged M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi , ef.razi@samsung.com")]
- public void OnPropertyChanged_CHECK_INVOCK()
- {
- /* TEST CODE */
- string setStyleId = "01xStyle";
- _element.StyleId = setStyleId;
- Assert.IsTrue(_element.PropertyChangedHapped, "OnChildRemoved should be invoked");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check ChildAdded event whether occurs whenever a child element is added to the element.")]
- [Property("SPEC", "Xamarin.Forms.Element.ChildAdded E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void ChildAdded_CHECK_EVENT()
- {
- /* TEST CODE */
- bool emitted = false;
- var lbl = new Label();
- _element.ChildAdded += (sender, args) => {
- Assert.AreEqual(args.Element, lbl, "args.Element and lbl should be same");
- emitted = true;
- };
-
- _element.Children.Add(lbl);
- Assert.IsTrue(emitted, "Value should be true");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check ChildRemoved event whether occurs whenever a child element is removed from the element.")]
- [Property("SPEC", "Xamarin.Forms.Element.ChildRemoved E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void ChildRemoved_CHECK_EVENT()
- {
- /* TEST CODE */
- bool emitted = false;
- var lbl = new Label();
- _element.Children.Add(lbl);
- _element.ChildRemoved += (sender, args) => {
- Assert.AreEqual(args.Element, lbl, "args.Element and lbl should be same");
- emitted = false;
- };
- _element.Children.Remove(lbl);
- Assert.IsFalse(emitted, "Value should be false");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check DescendantAdded whether occurs whenever a child element is added to the elements subtree.")]
- [Property("SPEC", "Xamarin.Forms.Element.DescendantAdded E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void DescendantAdded_CHECK_EVENT()
- {
- /* TEST CODE */
- var root = new TestElement();
-
- var child = new TestElement();
- root.Children.Add(child);
-
- var child2 = new TestElement();
-
- bool added = false;
- root.DescendantAdded += (sender, args) => {
- Assert.AreEqual(args.Element, child2, "args.Element and child2 should be same");
- added = true;
- };
-
- child.Children.Add(child2);
- Assert.IsTrue(added, "Value should be true");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check DescendantRemoved whether occurs whenever a child element is removed from the elements subtree.")]
- [Property("SPEC", "Xamarin.Forms.Element.DescendantRemoved E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void DescendantRemoved_CHECK_EVENT()
- {
- /* TEST CODE */
- var root = new TestElement();
-
- var child = new TestElement();
- root.Children.Add(child);
-
- bool removed = false;
- root.DescendantRemoved += (sender, args) => {
- Assert.AreEqual(args.Element, child, "args.Element and child2 should be same");
- removed = true;
- };
-
- root.Children.Remove(child);
- Assert.IsTrue(removed, "Value should be true");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.ElementEventArgs Tests")]
- public class ElementEventArgsTest
- {
- private static ElementEventArgs _elementEventArgs;
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("FontSizeConverterTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("FontSizeConverterTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create an ElementEventArgs instance.")]
- [Property("SPEC", "Xamarin.Forms.ElementEventArgs.ElementEventArgs C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void ElementEventArgs_INIT()
- {
- /* TEST CODE */
- var lbl = new Label();
-
- var elementEventArgs = new ElementEventArgs(lbl);
- Assert.IsNotNull(elementEventArgs, "Object is null after initialize");
- Assert.IsInstanceOf<ElementEventArgs>(elementEventArgs);
- }
-
- [Test]
- [Category("P1")]
- [Description("Gets the element relevant to the event.")]
- [Property("SPEC", "Xamarin.Forms.ElementEventArgs.Element A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void Element_READ()
- {
- /* TEST CODE */
- String msg = "ElementEventArgs Test";
- var lbl = new Label()
- {
- Text = msg
- };
-
- _elementEventArgs = new ElementEventArgs(lbl);
- Assert.IsNotNull(_elementEventArgs, "Object is null after initialize");
- Assert.IsInstanceOf<ElementEventArgs>(_elementEventArgs);
- var element = _elementEventArgs.Element;
- Assert.IsNotNull(element, "Element should be not null");
- Assert.IsInstanceOf<Element>(element,"Object should be an Element type.");
- Assert.AreEqual(msg, ((Label)element).Text, "Return object is not equal.");
-
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.ElementTemplate Tests")]
- public class ElementTemplateTests
- {
- internal class MockBindable : Button
- {
- }
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("TSElementTemplate --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("TSElementTemplate --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether CreateContent load data templates and set up the content of the resulting UI")]
- [Property("SPEC", "Xamarin.Forms.ElementTemplate.CreateContent M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void CreateContent_CHECK()
- {
- /*TEST CODE*/
- var template = new DataTemplate(() => new MockBindable())
- {
- Bindings = { { MockBindable.TextProperty, new Binding(".") } }
- };
- var objectDemo = (MockBindable)template.CreateContent();
- objectDemo.BindingContext = "Tizen";
-
- Assert.IsNotNull(objectDemo, "Object instance is null.");
- Assert.IsInstanceOf<MockBindable>(objectDemo, "Is not an instance of MockBindable.");
- Assert.IsTrue(objectDemo.GetValue(MockBindable.TextProperty).Equals("Tizen"), "Not returning expected value.");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-using NUnit.Framework.TUnit;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.Entry Tests")]
- public class EntryTests
- {
- private Entry _entry;
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("EntryTests --------------- Setup()");
- _entry = new Entry();
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("EntryTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create an Entry instance.")]
- [Property("SPEC", "Xamarin.Forms.Entry.Entry C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Entry_INIT()
- {
- /* TEST CODE */
- var entry = new Entry();
- Assert.IsNotNull(entry, "Object is null after initialize");
- Assert.IsInstanceOf<Entry>(entry);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property FontAttributes can be retrieved with the enum values None, Bold, Italic.")]
- [Property("SPEC", "Xamarin.Forms.Entry.FontAttributes A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRE")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void FontAttributes_READ_WRITE()
- {
- /* TEST CODE */
- _entry.FontAttributes = FontAttributes.None;
- Assert.IsInstanceOf<FontAttributes>(_entry.FontAttributes);
- Assert.AreEqual((int)FontAttributes.None, (int)_entry.FontAttributes, "Property FontAttributes: Mismatch between setted and getted value.");
-
- _entry.FontAttributes = FontAttributes.Bold;
- Assert.IsInstanceOf<FontAttributes>(_entry.FontAttributes);
- Assert.AreEqual((int)FontAttributes.Bold, (int)_entry.FontAttributes, "Property FontAttributes: Mismatch between setted and getted value.");
-
- _entry.FontAttributes = FontAttributes.Italic;
- Assert.IsInstanceOf<FontAttributes>(_entry.FontAttributes);
- Assert.AreEqual((int)FontAttributes.Italic, (int)_entry.FontAttributes, "Property FontAttributes: Mismatch between setted and getted value.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property FontFamily is readable and settable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.Entry.FontFamily A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void FontFamily_READ_WRITE()
- {
- /* TEST CODE */
- _entry.FontFamily = "Times New Roman";
- Assert.IsInstanceOf<string>(_entry.FontFamily);
- Assert.AreEqual("Times New Roman", _entry.FontFamily, "FontFamily property doesn't set and get successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property FontSize is readable and settable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.Entry.FontSize A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void FontSize_READ_WRITE()
- {
- /* TEST CODE */
- _entry.FontSize = 12.00;
- Assert.IsInstanceOf<double>(_entry.FontSize);
- Assert.AreEqual(12.00, _entry.FontSize, "FontSize property doesn't set and get successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property HorizontalTextAlignment can be retrieved with the enum values Start, End, Center.")]
- [Property("SPEC", "Xamarin.Forms.Entry.HorizontalTextAlignment A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRE")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void HorizontalTextAlignment_READ_WRITE()
- {
- /* TEST CODE */
- _entry.HorizontalTextAlignment = TextAlignment.Start;
- Assert.IsInstanceOf<TextAlignment>(_entry.HorizontalTextAlignment);
- Assert.AreEqual((int)TextAlignment.Start, (int)_entry.HorizontalTextAlignment, "Property HorizontalTextAlignment: Mismatch between setted and getted value.");
-
- _entry.HorizontalTextAlignment = TextAlignment.End;
- Assert.IsInstanceOf<TextAlignment>(_entry.HorizontalTextAlignment);
- Assert.AreEqual((int)TextAlignment.End, (int)_entry.HorizontalTextAlignment, "Property HorizontalTextAlignment: Mismatch between setted and getted value.");
-
- _entry.HorizontalTextAlignment = TextAlignment.Center;
- Assert.IsInstanceOf<TextAlignment>(_entry.HorizontalTextAlignment);
- Assert.AreEqual((int)TextAlignment.Center, (int)_entry.HorizontalTextAlignment, "Property HorizontalTextAlignment: Mismatch between setted and getted value.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property IsPassword is readable and settable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.Entry.IsPassword A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void IsPassword_READ_WRITE()
- {
- /* TEST CODE */
- _entry.IsPassword = true;
- Assert.IsTrue(_entry.IsPassword, "IsPassword property is not set true");
- _entry.IsPassword = false;
- Assert.IsFalse(_entry.IsPassword, "IsPassword property is not set false");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Placeholder is readable and settable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.Entry.Placeholder A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Placeholder_READ_WRITE()
- {
- /* TEST CODE */
- _entry.Placeholder = "PlaceholderInput";
- Assert.IsInstanceOf<string>(_entry.Placeholder);
- Assert.AreEqual("PlaceholderInput", _entry.Placeholder, "Placeholder property doesn't set and get successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property PlaceholderColor is readable and settable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.Entry.PlaceholderColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void PlaceholderColor_READ_WRITE()
- {
- /* TEST CODE */
- _entry.PlaceholderColor = Color.Blue;
- Assert.IsInstanceOf<Color>(_entry.PlaceholderColor, "Should be instance of Color.");
- Assert.AreEqual(Color.Blue, _entry.PlaceholderColor, "PlaceholderColor doesn't set and get successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Text is readable and settable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.Entry.Text A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Text_READ_WRITE()
- {
- /* TEST CODE */
- _entry.Text = "EntryTextInput";
- Assert.AreEqual("EntryTextInput", _entry.Text, "Text property doesn't set and get successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property TextColor is readable and settable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.Entry.TextColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void TextColor_READ_WRITE()
- {
- /* TEST CODE */
- _entry.TextColor = Color.Pink;
- Assert.IsInstanceOf<Color>(_entry.TextColor, "Should be instance of Color.");
- Assert.AreEqual(Color.Pink, _entry.TextColor, "TextColor doesn't set and get successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether FontAttributesProperty property bound or not")]
- [Property("SPEC", "Xamarin.Forms.Entry.FontAttributesProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void FontAttributesProperty_READ_ONLY()
- {
- /* TEST CODE */
- _entry.FontAttributes = FontAttributes.Bold;
- Entry mEntry = new Entry();
- mEntry.FontAttributes = FontAttributes.Italic;
- Assert.AreNotEqual(mEntry.FontAttributes, _entry.FontAttributes, "FontAttributesProperty value must be different.");
- _entry.BindingContext = mEntry;
- _entry.SetBinding(Entry.FontAttributesProperty, "FontAttributes");
- Assert.AreEqual(mEntry.FontAttributes, _entry.FontAttributes, "After binding, value should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether FontFamilyProperty property bound or not")]
- [Property("SPEC", "Xamarin.Forms.Entry.FontFamilyProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void FontFamilyProperty_READ_ONLY()
- {
- /* TEST CODE */
- _entry.FontFamily = "Times New Roman";
- Entry mEntry = new Entry();
- mEntry.FontFamily = "Calibri";
- Assert.AreNotEqual(mEntry.FontFamily, _entry.FontFamily, "FontFamilyProperty value must be different.");
- _entry.BindingContext = mEntry;
- _entry.SetBinding(Entry.FontFamilyProperty, "FontFamily");
- Assert.AreEqual(mEntry.FontFamily, _entry.FontFamily, "After binding, value should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether FontSizeProperty property bound or not")]
- [Property("SPEC", "Xamarin.Forms.Entry.FontSizeProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void FontSizeProperty_READ_ONLY()
- {
- /* TEST CODE */
- _entry.FontSize = 10.00;
- Entry mEntry = new Entry();
- mEntry.FontSize = 15.00;
- Assert.AreNotEqual(mEntry.FontSize, _entry.FontSize, "FontSizeProperty value must be different.");
- _entry.BindingContext = mEntry;
- _entry.SetBinding(Entry.FontSizeProperty, "FontSize");
- Assert.AreEqual(mEntry.FontSize, _entry.FontSize, "After binding, value should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether HorizontalTextAlignmentProperty property bound or not")]
- [Property("SPEC", "Xamarin.Forms.Entry.HorizontalTextAlignmentProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void HorizontalTextAlignmentProperty_READ_ONLY()
- {
- /* TEST CODE */
- _entry.HorizontalTextAlignment = TextAlignment.Start;
- Entry mEntry = new Entry();
- mEntry.HorizontalTextAlignment = TextAlignment.Center;
- Assert.AreNotEqual(mEntry.HorizontalTextAlignment, _entry.HorizontalTextAlignment, "HorizontalTextAlignmentProperty value must be different.");
- _entry.BindingContext = mEntry;
- _entry.SetBinding(Entry.HorizontalTextAlignmentProperty, "HorizontalTextAlignment");
- Assert.AreEqual(mEntry.HorizontalTextAlignment, _entry.HorizontalTextAlignment, "After binding, value should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether IsPasswordProperty property bound or not")]
- [Property("SPEC", "Xamarin.Forms.Entry.IsPasswordProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void IsPasswordProperty_READ_ONLY()
- {
- /* TEST CODE */
- _entry.IsPassword = true;
- Entry mEntry = new Entry();
- mEntry.IsPassword = false;
- Assert.AreNotEqual(mEntry.IsPassword, _entry.IsPassword, "IsPasswordProperty value must be different.");
- _entry.BindingContext = mEntry;
- _entry.SetBinding(Entry.IsPasswordProperty, "IsPassword");
- Assert.AreEqual(mEntry.IsPassword, _entry.IsPassword, "After binding, value should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether PlaceholderColorProperty property bound or not")]
- [Property("SPEC", "Xamarin.Forms.Entry.PlaceholderColorProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void PlaceholderColorProperty_READ_ONLY()
- {
- /* TEST CODE */
- _entry.PlaceholderColor = Color.Green;
- Entry mEntry = new Entry();
- mEntry.PlaceholderColor = Color.Gray;
- Assert.AreNotEqual(mEntry.PlaceholderColor, _entry.PlaceholderColor, "PlaceholderColorProperty value must be different.");
- _entry.BindingContext = mEntry;
- _entry.SetBinding(Entry.PlaceholderColorProperty, "PlaceholderColor");
- Assert.AreEqual(mEntry.PlaceholderColor, _entry.PlaceholderColor, "After binding, value should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether PlaceholderProperty property bound or not")]
- [Property("SPEC", "Xamarin.Forms.Entry.PlaceholderProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void PlaceholderProperty_READ_ONLY()
- {
- /* TEST CODE */
- _entry.Placeholder = "PlaceholderText";
- Entry mEntry = new Entry();
- mEntry.Placeholder = "PlaceholderText2";
- Assert.AreNotEqual(mEntry.Placeholder, _entry.Placeholder, "PlaceholderProperty value must be different.");
- _entry.BindingContext = mEntry;
- _entry.SetBinding(Entry.PlaceholderProperty, "Placeholder");
- Assert.AreEqual(mEntry.Placeholder, _entry.Placeholder, "After binding, value should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether TextColorProperty property bound or not")]
- [Property("SPEC", "Xamarin.Forms.Entry.TextColorProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void TextColorProperty_READ_ONLY()
- {
- /* TEST CODE */
- _entry.TextColor = Color.Green;
- Entry mEntry = new Entry();
- mEntry.TextColor = Color.Gray;
- Assert.AreNotEqual(mEntry.TextColor, _entry.TextColor, "TextColorProperty value must be different.");
- _entry.BindingContext = mEntry;
- _entry.SetBinding(Entry.TextColorProperty, "TextColor");
- Assert.AreEqual(mEntry.TextColor, _entry.TextColor, "After binding, value should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether TextProperty property bound or not")]
- [Property("SPEC", "Xamarin.Forms.Entry.TextProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void TextProperty_READ_ONLY()
- {
- /* TEST CODE */
- _entry.Text = "Text";
- Entry mEntry = new Entry();
- mEntry.Text = "Text2";
- Assert.AreNotEqual(mEntry.Text, _entry.Text, "TextProperty value must be different.");
- _entry.BindingContext = mEntry;
- _entry.SetBinding(Entry.TextProperty, "Text");
- Assert.AreEqual(mEntry.Text, _entry.Text, "After binding, value should be equal.");
-
- }
-
- [Test]
- [Category("P1")]
- [Description("Check return Entry configuration")]
- [Property("SPEC", "Xamarin.Forms.Entry.On<T> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void On_CONFIGURATION_METHOD()
- {
- /*TEST CODE*/
- _entry.Text = "EntryText";
- _entry.FontSize = 12.3;
- var myConfig = _entry.On<IConfigPlatform>();
- Assert.IsInstanceOf<IPlatformElementConfiguration<IConfigPlatform, Entry>>(myConfig, "Should be an instance of IPlatformElementConfiguration");
- Assert.IsInstanceOf<Entry>(myConfig.Element, "Should be an instance of Entry");
- Assert.AreEqual("EntryText", myConfig.Element.Text, "Text of myConfig.Element value & Text of _entry should be equal");
- Assert.AreEqual(12.3, Math.Round(myConfig.Element.FontSize, 1), "FontSize of myConfig.Element value & FontSize of _entry should be equal");
-
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether TextChanged Event is raised when a property is changed.")]
- [Property("SPEC", "Xamarin.Forms.Entry.TextChanged E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void TextChanged_EVENT()
- {
- /* TEST CODE */
- Entry entry = new Entry();
- entry.Text = "EntryText";
-
- bool flagTextChanged = false;
- entry.TextChanged += (sender, args) => flagTextChanged = true;
-
- entry.Text = entry.Text + "Changed";
- Assert.IsTrue(flagTextChanged, "Event value changed should be handled.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Completed Event is raised when a property is changed.")]
- [Property("SPEC", "Xamarin.Forms.Entry.Completed E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Completed_EVENT()
- {
- /* TEST CODE */
- Entry entry = new Entry
- {
- Text = "TextEntry",
- TextColor = Color.Blue
- };
- bool flagCompleted = false;
- entry.Completed += (sender, args) => flagCompleted = true;
-
- ((IEntryController)entry).SendCompleted();
- Assert.IsTrue(flagCompleted, "Event value changed should be handled.");
- }
- }
-}
+++ /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 Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class EntryCellTests
- {
- private EntryCell _entryCell;
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("EntryCellTests --------------- SetUp()");
- _entryCell = new EntryCell();
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("EntryCellTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a EntryCell instance. Check whether object is successfully created or not")]
- [Property("SPEC", "Xamarin.Forms.EntryCell.EntryCell C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void EntryCell_INIT()
- {
- /* TEST CODE */
- var entryCell = new EntryCell();
- Assert.IsNotNull(entryCell, "EntryCell object is not created successfully. It is set to null");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property LabelProperty is readable")]
- [Property("SPEC", "Xamarin.Forms.EntryCell.LabelProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void LabelProperty_PROPERTY()
- {
- /* TEST CODE */
- var entryCell1 = new EntryCell();
- entryCell1.Label = "label 1";
- var entryCell2 = new EntryCell()
- {
- Label = "Test Label 02"
- };
- Assert.AreNotEqual(entryCell1.Label, entryCell2.Label, "Label should be different between two EntryCell objects");
- entryCell1.BindingContext = entryCell2;
- entryCell1.SetBinding(EntryCell.LabelProperty, "Label");
- Assert.AreEqual(entryCell1.Label, entryCell2.Label, "Label should be same between two EntryCell objects");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property LabelColorProperty is readable")]
- [Property("SPEC", "Xamarin.Forms.EntryCell.LabelColorProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void LabelColorProperty_PROPERTY()
- {
- /* TEST CODE */
- var entryCell1 = new EntryCell();
- var color1 = new Color(0.2, 0.3, 0.4);
- entryCell1.LabelColor = color1;
- var entryCell2 = new EntryCell();
- var color2 = new Color(0.3, 0.6, 0.9);
- entryCell2.LabelColor = color2;
- Assert.AreNotEqual(entryCell1.LabelColor.R, entryCell2.LabelColor.R, "LabelColor.R should be different between two EntryCell objects");
- Assert.AreNotEqual(entryCell1.LabelColor.G, entryCell2.LabelColor.G, "LabelColor.G should be different between two EntryCell objects");
- Assert.AreNotEqual(entryCell1.LabelColor.B, entryCell2.LabelColor.B, "LabelColor.B should be different between two EntryCell objects");
- entryCell1.BindingContext = entryCell2;
- entryCell1.SetBinding(EntryCell.LabelColorProperty, "LabelColor");
- Assert.AreEqual(entryCell1.LabelColor.R, entryCell2.LabelColor.R, "LabelColor.R should be same between two EntryCell objects");
- Assert.AreEqual(entryCell1.LabelColor.G, entryCell2.LabelColor.G, "LabelColor.G should be same between two EntryCell objects");
- Assert.AreEqual(entryCell1.LabelColor.B, entryCell2.LabelColor.B, "LabelColor.B should be same between two EntryCell objects");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property PlaceholderProperty is readable")]
- [Property("SPEC", "Xamarin.Forms.EntryCell.PlaceholderProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void PlaceholderProperty_PROPERTY()
- {
- /* TEST CODE */
- var entryCell1 = new EntryCell();
- entryCell1.Placeholder = "Placeholder 1";
- var entryCell2 = new EntryCell();
- entryCell2.Placeholder = "Test Placeholder 02";
- Assert.AreNotEqual(entryCell1.Placeholder, entryCell2.Placeholder, "Placeholder should be different between two EntryCell objects");
- entryCell1.BindingContext = entryCell2;
- entryCell1.SetBinding(EntryCell.PlaceholderProperty, "Placeholder");
- Assert.AreEqual(entryCell1.Placeholder, entryCell2.Placeholder, "Placeholder should be same between two EntryCell objects");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property TextProperty is readable")]
- [Property("SPEC", "Xamarin.Forms.EntryCell.TextProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void TextProperty_PROPERTY()
- {
- /* TEST CODE */
- var entryCell1 = new EntryCell();
- entryCell1.Text = "Text 1";
- var entryCell2 = new EntryCell();
- entryCell2.Text = "Test 02";
- Assert.AreNotEqual(entryCell1.Text, entryCell2.Text, "Text should be different between two EntryCell objects");
- entryCell1.BindingContext = entryCell2;
- entryCell1.SetBinding(EntryCell.TextProperty, "Text");
- Assert.AreEqual(entryCell1.Text, entryCell2.Text, "Text should be same between two EntryCell objects");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property HorizontalTextAlignmentProperty is readable")]
- [Property("SPEC", "Xamarin.Forms.EntryCell.HorizontalTextAlignmentProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void HorizontalTextAlignmentProperty_PROPERTY()
- {
- /* TEST CODE */
- var entryCell1 = new EntryCell();
- entryCell1.HorizontalTextAlignment = TextAlignment.Center;
- var entryCell2 = new EntryCell();
- entryCell2.HorizontalTextAlignment = TextAlignment.End;
- Assert.AreNotEqual(entryCell1.HorizontalTextAlignment.ToString(), entryCell2.HorizontalTextAlignment.ToString(), "HorizontalTextAlignment should be different between two EntryCell objects");
- entryCell1.BindingContext = entryCell2;
- entryCell1.SetBinding(EntryCell.HorizontalTextAlignmentProperty, "HorizontalTextAlignment");
- Assert.AreEqual(entryCell1.HorizontalTextAlignment.ToString(), entryCell2.HorizontalTextAlignment.ToString(), "HorizontalTextAlignment should be same between two EntryCell objects");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property KeyboardProperty is readable")]
- [Property("SPEC", "Xamarin.Forms.EntryCell.KeyboardProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void KeyboardProperty_PROPERTY()
- {
- /* TEST CODE */
- var entryCell1 = new EntryCell();
- entryCell1.Keyboard = Keyboard.Telephone;
- var entryCell2 = new EntryCell();
- entryCell2.Keyboard = Keyboard.Email;
- Assert.AreNotEqual(entryCell1.Keyboard, entryCell2.Keyboard, "Keyboard should be different between two EntryCell objects");
- entryCell1.BindingContext = entryCell2;
- entryCell1.SetBinding(EntryCell.KeyboardProperty, "Keyboard");
- Assert.AreEqual(entryCell1.Keyboard, entryCell2.Keyboard, "Keyboard should be same between two EntryCell objects");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property XAlignProperty is readable")]
- [Property("SPEC", "Xamarin.Forms.EntryCell.XAlignProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void XAlignProperty_PROPERTY()
- {
- /* TEST CODE */
- var entryCell1 = new EntryCell();
- entryCell1.XAlign = TextAlignment.Center;
- var entryCell2 = new EntryCell();
- entryCell2.XAlign = TextAlignment.End;
- Assert.AreNotEqual(entryCell1.XAlign.ToString(), entryCell2.XAlign.ToString(), "XAlign should be different between two EntryCell objects");
- entryCell1.BindingContext = entryCell2;
- entryCell1.SetBinding(EntryCell.XAlignProperty, "XAlign");
- Assert.AreEqual(entryCell1.XAlign.ToString(), entryCell2.XAlign.ToString(), "XAlign should be same between two EntryCell objects");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Label is readable and settable with valid values")]
- [Property("SPEC", "Xamarin.Forms.EntryCell.Label A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void Label_PROPERTY_SET_GET()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- Assert.IsNotNull(_entryCell, "EntryCell object is not created successfully. It is set to null");
-
- /* TEST CODE */
- var label = "This is EntryCell";
- _entryCell.Label = label;
- Assert.AreEqual(label, _entryCell.Label, "Set and get value of Label is not successful");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property LabelColor is readable and settable with valid values")]
- [Property("SPEC", "Xamarin.Forms.EntryCell.LabelColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void LabelColor_PROPERTY_SET_GET()
- {
- /*PRECONDITION
- * 1. Check whether object is successfully created or not
- * 2. Create an Color instance for set to property LabelColor
- */
- Assert.IsNotNull(_entryCell, "EntryCell object is not created successfully. It is set to null");
- var r = 0.2;
- var g = 0.5;
- var b = 0.3;
- var color = new Color(r, g, b);
-
- /* TEST CODE */
- _entryCell.LabelColor = color;
- var getLabelColor = _entryCell.LabelColor;
- Assert.AreEqual(color.R, getLabelColor.R, "Set and get value R of color is not successful");
- Assert.AreEqual(color.G, getLabelColor.G, "Set and get value G of color is not successful");
- Assert.AreEqual(color.B, getLabelColor.B, "Set and get value B of color is not successful");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Placeholder is readable and settable with valid values")]
- [Property("SPEC", "Xamarin.Forms.EntryCell.Placeholder A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void Placeholder_PROPERTY_SET_GET()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- Assert.IsNotNull(_entryCell, "EntryCell object is not created successfully. It is set to null");
-
- /* TEST CODE */
- var placeholder = "Test Placeholder";
- _entryCell.Placeholder = placeholder;
- Assert.AreEqual(placeholder.ToString(), _entryCell.Placeholder.ToString(), "Set and get value of Placeholder is not successful");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Text is readable and settable with valid values")]
- [Property("SPEC", "Xamarin.Forms.EntryCell.Text A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void Text_PROPERTY_SET_GET()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- Assert.IsNotNull(_entryCell, "EntryCell object is not created successfully. It is set to null");
-
- /* TEST CODE */
- var text = "Test Text";
- _entryCell.Text = text;
- Assert.AreEqual(text.ToString(), _entryCell.Text.ToString(), "Set and get value of Text is not successful");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property HorizontalTextAlignment is readable and settable with valid values")]
- [Property("SPEC", "Xamarin.Forms.EntryCell.HorizontalTextAlignment A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void HorizontalTextAlignment_PROPERTY_SET_GET()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- Assert.IsNotNull(_entryCell, "EntryCell object is not created successfully. It is set to null");
-
- /* TEST CODE */
- _entryCell.HorizontalTextAlignment = TextAlignment.Center;
- Assert.AreEqual(TextAlignment.Center.ToString(), _entryCell.HorizontalTextAlignment.ToString(), "Set and get value of TextAlignment.Center is not successful");
- _entryCell.HorizontalTextAlignment = TextAlignment.End;
- Assert.AreEqual(TextAlignment.End.ToString(), _entryCell.HorizontalTextAlignment.ToString(), "Set and get value of TextAlignment.End is not successful");
- _entryCell.HorizontalTextAlignment = TextAlignment.Start;
- Assert.AreEqual(TextAlignment.Start.ToString(), _entryCell.HorizontalTextAlignment.ToString(), "Set and get value of TextAlignment.Start is not successful");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property XAlign is readable and settable with valid values")]
- [Property("SPEC", "Xamarin.Forms.EntryCell.XAlign A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void XAlign_PROPERTY_SET_GET()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- Assert.IsNotNull(_entryCell, "EntryCell object is not created successfully. It is set to null");
-
- /* TEST CODE */
- _entryCell.XAlign = TextAlignment.Center;
- Assert.AreEqual(TextAlignment.Center.ToString(), _entryCell.XAlign.ToString(), "Set and get value of TextAlignment.Center is not successful");
- _entryCell.XAlign = TextAlignment.End;
- Assert.AreEqual(TextAlignment.End.ToString(), _entryCell.XAlign.ToString(), "Set and get value of TextAlignment.End is not successful");
- _entryCell.XAlign = TextAlignment.Start;
- Assert.AreEqual(TextAlignment.Start.ToString(), _entryCell.XAlign.ToString(), "Set and get value of TextAlignment.Start is not successful");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Keyboard is readable and settable with valid values")]
- [Property("SPEC", "Xamarin.Forms.EntryCell.Keyboard A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void Keyboard_PROPERTY_SET_GET()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- Assert.IsNotNull(_entryCell, "EntryCell object is not created successfully. It is set to null");
-
- /* TEST CODE */
- _entryCell.Keyboard = Keyboard.Chat;
- var getKeyboard = _entryCell.Keyboard;
- Assert.AreEqual(Keyboard.Chat, getKeyboard, "Set and get value of Keyboard is not successful");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check whether Completed event is invoked or not")]
- [Property("SPEC", "Xamarin.Forms.EntryCell.Completed E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void Completed_EVENT()
- {
- /* TEST CODE */
- Assert.True(false, "[NA]Manual TC.");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-using System.Collections.Generic;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class EventTriggerTests
- {
- private EventTrigger _eventTrigger;
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("EventTriggerTests --------------- Setup()");
- _eventTrigger = new EventTrigger();
- }
-
- [TearDown]
- public void TearDown()
- {
- _eventTrigger = null;
- Console.WriteLine("EventTriggerTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a new instance of EventTrigger.")]
- [Property("SPEC", "Xamarin.Forms.EventTrigger.EventTrigger C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void EventTrigger_INIT()
- {
- /* TEST CODE */
- var eventTrigger = new EventTrigger();
- Assert.IsNotNull(eventTrigger, "Object is null after initialize");
- Assert.IsInstanceOf<EventTrigger>(eventTrigger, "eventTrigger is not instance of EventTrigger.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Event is readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.EventTrigger.Event A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Event_READ_WRITE()
- {
- /*TEST CODE*/
- string str = "MockEvent";
- _eventTrigger.Event = str;
- Assert.AreEqual(str, _eventTrigger.Event,"Event property should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Actions is readable.")]
- [Property("SPEC", "Xamarin.Forms.EventTrigger.Actions A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Actions_READ_ONLY()
- {
- /*TEST CODE*/
- var getProperty = _eventTrigger.Actions;
- Assert.IsNotNull(getProperty, "Object is null after initialize");
- Assert.IsInstanceOf<IList<TriggerAction>>(getProperty, "getProperty is not instance of IList<TriggerAction>.");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.ExportEffectAttribute Tests")]
- public class ExportEffectAttributeTests
- {
- [SetUp]
- public void Setup()
- {
- Console.WriteLine("ExportEffectAttributeTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("ExportEffectAttributeTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a ExportEffectAttribute object")]
- [Property("SPEC", "Xamarin.Forms.ExportEffectAttribute.ExportEffectAttribute C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void ExportEffectAttribute_INIT()
- {
- /* TEST CODE */
- ExportEffectAttribute exportEffectAttribute = new ExportEffectAttribute(typeof(String), "Tizen");
- Assert.IsNotNull(exportEffectAttribute, "ExportEffectAttribute instance is null");
- Assert.IsInstanceOf<ExportEffectAttribute>(exportEffectAttribute, "Not an instance of ExportEffectAttribute.");
- }
- }
-}
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns="http://tizen.org/ns/packages" api-version="6" package="Tizen.XamarinForms2.Tests" version="1.0.0">
- <profile name="common" />
- <ui-application appid="Tizen.XamarinForms2.Tests"
- exec="Tizen.XamarinForms2.Tests.dll"
- type="dotnet"
- multiple="false"
- taskmanage="true"
- launch_mode="single">
- <icon>Tizen.XamarinForms2.Tests.png</icon>
- <label>Tizen.XamarinForms2.Tests</label>
- </ui-application>
- <privileges>
- <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
- </privileges>
-</manifest>
+++ /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.Platform.Tizen.Forms.Init(app);
- app.Run(args);
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-<Project Sdk="Microsoft.NET.Sdk">
-
- <!-- Property Group for .NET Core Project -->
- <PropertyGroup>
- <OutputType>Exe</OutputType>
- <TargetFramework>tizen60</TargetFramework>
- </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>
- <PackageReference Include="Tizen.NET.Sdk" Version="$(TizenNETSdkVersion)" />
- </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.XamarinForms3.Tests", "Tizen.XamarinForms3.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 System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Xamarin.Forms;
-using Xamarin.Forms.Platform.Tizen;
-using XamarinForTizen.Tizen.common;
-
-[assembly: ResolutionGroupName("Samsung")]
-[assembly: ExportEffect(typeof(MockEffect), "MockEffect")]
-namespace XamarinForTizen.Tizen.common
-{
- class MockEffect : PlatformEffect
- {
-
- protected override void OnAttached()
- {
- Container.Color = ElmSharp.Color.Red;
- }
-
- protected override void OnDetached()
- {
-
- }
- }
-}
\ 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 System;
-using Xamarin.Forms;
-using XamarinForTizen.Tizen;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class FileImageSourceTests
- {
- private FileImageSource _fileImageSource;
- private string _appResourcePath = Program.Current.DirectoryInfo.Resource;
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("FileImageSourceTests --------------- SetUp()");
- _fileImageSource = new FileImageSource();
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("FileImageSourceTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a FileImageSource instance. Check whether object is successfully created or not")]
- [Property("SPEC", "Xamarin.Forms.FileImageSource.FileImageSource C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void FileImageSource_INIT()
- {
- /* TEST CODE */
- var fileImageSource = new FileImageSource();
- Assert.IsNotNull(fileImageSource, "Creating a FileImageSource object failed. It is set to null");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property File is readable and settable with valid values")]
- [Property("SPEC", "Xamarin.Forms.FileImageSource.File A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void File_PROPERTY_SET_GET()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- Assert.IsNotNull(_fileImageSource, "Creating a FileImageSource object failed. It is set to null.");
-
- /* TEST CODE */
- var file = _appResourcePath + "TED/thumbnail/a.jpg";
- _fileImageSource.File = file;
- var getFile = _fileImageSource.File;
- Assert.AreEqual(file, getFile, "Set and get value of File is not successful");
- }
-
- [Test]
- [Category("P1")]
- [Description("Implicit operator to convert string type to FileImageSource")]
- [Property("SPEC", "Xamarin.Forms.FileImageSource.Implicit M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- [Property("COVPARAM", "string")]
- public void Implicit_STRING_TO_FILEIMAGESOURCE()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- Assert.IsNotNull(_fileImageSource, "Creating a FileImageSource object failed. It is set to null.");
-
- /* TEST CODE */
- var strSource = _appResourcePath + "TED/thumbnail/a.jpg";
- _fileImageSource = strSource;
- Assert.AreEqual(strSource, _fileImageSource.File, "Can't setup implicit method");
- }
-
- [Test]
- [Category("P1")]
- [Description("Implicit operator to convert FileImageSource type to string")]
- [Property("SPEC", "Xamarin.Forms.FileImageSource.Implicit M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- [Property("COVPARAM", "Xamarin.Forms.FileImageSource")]
- public void Implicit_FILEIMAGESOURCE_TO_STRING()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- Assert.IsNotNull(_fileImageSource, "Creating a FileImageSource object failed. It is set to null.");
-
- /* TEST CODE */
- var file = _appResourcePath + "TED/thumbnail/a.jpg";
- _fileImageSource.File = file;
- string getString = _fileImageSource;
- Assert.AreEqual(_fileImageSource.File, getString, "Can't setup implicit method");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property FileProperty is readable")]
- [Property("SPEC", "Xamarin.Forms.FileImageSource.FileProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void FileProperty_PROPERTY()
- {
- /* TEST CODE */
- var file1 = _appResourcePath + "TED/thumbnail/a.jpg";
- var fileImageSource1 = new FileImageSource();
- fileImageSource1.File = file1;
- var file2 = _appResourcePath + "TED/thumbnail/b.jpg";
- var fileImageSource2 = new FileImageSource();
- fileImageSource2.File = file2;
- Assert.AreNotEqual(fileImageSource1.File, fileImageSource2.File, "File should be different between two FileImageSource objects");
- fileImageSource1.BindingContext = fileImageSource2;
- fileImageSource1.SetBinding(FileImageSource.FileProperty, "File");
- Assert.AreEqual(fileImageSource1.File, fileImageSource2.File, "File should be same between two FileImageSource objects");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check Cancel the ImageSource loading")]
- [Property("SPEC", "Xamarin.Forms.FileImageSource.Cancel M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void Cancel_CHECK()
- {
- /* TEST CODE */
- var strSource = _appResourcePath + "TED/thumbnail/a.jpg";
- //instance a ImageCell object to trigger the load of image resource
- var imageCell = new ImageCell
- {
- ImageSource = ImageSource.FromFile(strSource),
- Text = "This is an ImageCell",
- };
- try
- {
- var fileImageSource = (FileImageSource)imageCell.ImageSource;
- fileImageSource.Cancel();
- Assert.IsTrue(true, "Fail to cancel the image of loading");
- }
- catch (Exception e)
- {
- Assert.IsTrue(false, e.Message);
- }
- }
-
- //[Test]
- [Category("P1")]
- [Description("Invoke OnPropertyChanged method, and check whether OnPropertyChanged method is invoked or not.")]
- [Property("SPEC", "Xamarin.Forms.FileImageSource.OnPropertyChanged M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Nhu Anh, anh.vn@samsung.com")]
- public void OnPropertyChanged_CHECK()
- {
- /* TEST CODE */
- Assert.True(false, "[NA] Can't inherit this api in a sealed class for test");
- }
- }
-}
+++ /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 XamarinForTizen.Tizen;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class FileImageSourceConverterTests
- {
- private FileImageSourceConverter _fileImageSourceConverter;
- private string _appResourcePath = Program.Current.DirectoryInfo.Resource;
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("FileImageSourceConverterTests --------------- SetUp()");
- _fileImageSourceConverter = new FileImageSourceConverter();
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("FileImageSourceConverterTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a FileImageSourceConverter instance. Check whether object is successfully created or not")]
- [Property("SPEC", "Xamarin.Forms.FileImageSourceConverter.FileImageSourceConverter C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void FileImageSourceConverter_INIT()
- {
- /* TEST CODE */
- var fileImageSourceConverter = new FileImageSourceConverter();
- Assert.IsNotNull(fileImageSourceConverter, "Creating a FileImageSourceConverter object failed. It is set to null");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ConvertFromInvariantString is corrected or not")]
- [Property("SPEC", "Xamarin.Forms.FileImageSourceConverter.ConvertFromInvariantString A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void ConvertFromInvariantString_CHECK()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- Assert.IsNotNull(_fileImageSourceConverter, "Creating a FileImageSourceConverter object failed. It is set to null");
-
- /* TEST CODE */
- var strSource = _appResourcePath + "TED/thumbnail/a.jpg";
- var getConvertFromInvariantString =(FileImageSource)_fileImageSourceConverter.ConvertFromInvariantString(strSource);
- Assert.AreEqual(strSource, getConvertFromInvariantString.File, "ConvertFromInvariantString doesn't return correct");
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System.Collections.Generic;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.FocusEventArgs test")]
- public class FocusEventArgsTest
- {
- private FocusEventArgs _focusEventArgs;
- private Label _label;
- [SetUp]
- public void Setup()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "FocusEventArgs: Setup---------------------------------");
- _label = new Label()
- {
- Text = "my label"
- };
- _focusEventArgs = new FocusEventArgs(_label, true);
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "FocusEventArgs: Teardown------------------------------");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a FocusEventArgs instance. Check whether object is successfully created or not.")]
- [Property("SPEC", "Xamarin.Forms.FocusEventArgs.FocusEventArgs C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Ngo Van Hai, hai.nv3@samsung.com")]
- public void FocusEventArgs_INIT()
- {
- var focusEventArgs = new FocusEventArgs(new Label(), true);
- Assert.NotNull(focusEventArgs, "focusEventArgs should be not null");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property IsFocused is readable.")]
- [Property("SPEC", "Xamarin.Forms.FocusEventArgs.IsFocused A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Ngo Van Hai, hai.nv3@samsung.com")]
- public void IsFocused_PROPERTY()
- {
- Assert.NotNull(_focusEventArgs, "_focusEventArgs should be not null");
- var getIsFocussed = _focusEventArgs.IsFocused;
- Assert.IsTrue(getIsFocussed, "IsFocused should be return true after init is true");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property VisualElement is readable.")]
- [Property("SPEC", "Xamarin.Forms.FocusEventArgs.VisualElement A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Ngo Van Hai, hai.nv3@samsung.com")]
- public void VisualElement_PROPERTY()
- {
- Assert.NotNull(_focusEventArgs, "_focusEventArgs should be not null");
- var getVisualElement = (Label)_focusEventArgs.VisualElement;
- Assert.AreEqual(_label.Text.ToString(), getVisualElement.Text.ToString(), "VisualElement should be return label");
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class FontTests
- {
- [SetUp]
- public void SetUp()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Font CLASS: Setup---------------------------------");
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Font CLASS: Teardown---------------------------------");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of Default of Font are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.Font.Default A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void Default_PROPERTY_GET()
- {
- /*TEST CODE*/
- var FontSet = new Font();
- Assert.AreEqual(Font.Default, FontSet,"Retrieved Default of Font object should be equal to the set value.");
- Assert.AreEqual(Font.Default.FontSize, FontSet.FontSize,"Retrieved FontSize of Font object should be equal to the set value.");
- Assert.AreEqual(Font.Default.NamedSize, FontSet.NamedSize,"Retrieved NamedSize of Font object should be equal to the set value.");
- Assert.AreEqual(Font.Default.FontAttributes, FontSet.FontAttributes,"Retrieved FontAttributes of Font object should be equal to the set value.");
- Assert.AreEqual(Font.Default.FontFamily, FontSet.FontFamily,"Retrieved FontFamily of Font object should be equal to the set value.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of FontAttributes of Font are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.Font.FontAttributes A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void FontAttributes_PROPERTY_GET()
- {
- /*TEST CODE*/
- var FontSet = new Font();
- Assert.AreEqual(Font.Default.FontAttributes, FontSet.FontAttributes,"Retrieved FontAttributes of Font object should be equal to the set value.");
- FontSet = FontSet.WithAttributes(FontAttributes.Bold);
- Assert.AreEqual(FontAttributes.Bold, FontSet.FontAttributes,"Retrieved Bold of FontAttributes object should be equal to the set value.");
- FontSet = FontSet.WithAttributes(FontAttributes.Italic);
- Assert.AreEqual(FontAttributes.Italic, FontSet.FontAttributes,"Retrieved Italic of FontAttributes object should be equal to the set value.");
- FontSet = FontSet.WithAttributes(FontAttributes.None);
- Assert.AreEqual(FontAttributes.None, FontSet.FontAttributes,"Retrieved None of FontAttributes object should be equal to the set value.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of FontFamily of Font are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.Font.FontFamily A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void FontFamily_PROPERTY_GET()
- {
- /*TEST CODE*/
- var FontSet = new Font();
- Assert.AreEqual(Font.Default.FontFamily, FontSet.FontFamily, "Retrieved FontFamily of Font object should be equal to the set value.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of FontSize of Font are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.Font.FontSize A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void FontSize_PROPERTY_GET()
- {
- /*TEST CODE*/
- var FontSet = new Font();
- var fontsize = 12.0;
- Assert.AreEqual(Font.Default.FontSize, FontSet.FontSize,"Retrieved FontSize of Font object should be equal to the set value.");
- FontSet = FontSet.WithSize(fontsize);
- Assert.AreEqual(fontsize, FontSet.FontSize,"Retrieved FontSize of Font object should be equal to the set value.");
- fontsize = 20.3;
- FontSet = FontSet.WithSize(fontsize);
- Assert.AreEqual(fontsize, FontSet.FontSize,"Retrieved FontSize of Font object should be equal to the set value.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of IsDefault of Font are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.Font.IsDefault A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void IsDefault_PROPERTY_GET()
- {
- /*TEST CODE*/
- var FontSet = new Font();
- var fontsize = 12.0;
- Assert.AreEqual(Font.Default.IsDefault, FontSet.IsDefault, "Retrieved FontSize of Font object should be equal to the set value.");
- Assert.True(FontSet.IsDefault,"FontSet should be a default value");
- FontSet = FontSet.WithSize(fontsize);
- Assert.False(FontSet.IsDefault,"FontSet don't must a default value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of NamedSize of Font are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.Font.NamedSize A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void NamedSize_PROPERTY_GET()
- {
- /*TEST CODE*/
- var FontSet = new Font();
- Assert.AreEqual(Font.Default.NamedSize, FontSet.NamedSize,"Retrieved NamedSize of Font object should be equal to the set value.");
- FontSet = FontSet.WithSize(NamedSize.Large);
- Assert.AreEqual(NamedSize.Large, FontSet.NamedSize,"Retrieved Large value of NamedSize object should be equal to the set value.");
- FontSet = FontSet.WithSize(NamedSize.Medium);
- Assert.AreEqual(NamedSize.Medium, FontSet.NamedSize,"Retrieved Medium value of NamedSize object should be equal to the set value.");
- FontSet = FontSet.WithSize(NamedSize.Micro);
- Assert.AreEqual(NamedSize.Micro, FontSet.NamedSize,"Retrieved Micro value of NamedSize object should be equal to the set value.");
- FontSet = FontSet.WithSize(NamedSize.Small);
- Assert.AreEqual(NamedSize.Small, FontSet.NamedSize,"Retrieved Small value of NamedSize object should be equal to the set value.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of UseNamedSize of Font are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.Font.UseNamedSize A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void UseNamedSize_PROPERTY_GET()
- {
- /*TEST CODE*/
- var FontSet = new Font();
- Assert.True(FontSet.UseNamedSize,"UseNamedSize should be a true value");
- FontSet = FontSet.WithSize(NamedSize.Medium);
- Assert.True(FontSet.UseNamedSize,"UseNamedSize should be a true value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether return a font instance that represents the default bold font, in the requested size for the device is correct or not")]
- [Property("SPEC", "Xamarin.Forms.Font.BoldSystemFontOfSize M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- [Property("COVPARAM", "Double")]
- public void BoldSystemFontOfSize_DOUBLE_SIZE_METHOD()
- {
- /*TEST CODE*/
- var fontsize = 11.7;
- var mFont = Font.BoldSystemFontOfSize(fontsize);
- Assert.AreEqual(fontsize, mFont.FontSize,"Retrieved FontSize of Font object should be equal to the set value.");
- fontsize = 6.4;
- mFont = Font.BoldSystemFontOfSize(fontsize);
- Assert.AreEqual(fontsize, mFont.FontSize,"Retrieved FontSize of Font object should be equal to the set value.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether return an usable font instance representing the default bold font, in the requested NamedSize, for the device is correct or not")]
- [Property("SPEC", "Xamarin.Forms.Font.BoldSystemFontOfSize M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- [Property("COVPARAM", "Xamarin.Forms.NamedSize")]
- public void BoldSystemFontOfSize_NAMESIZE_METHOD()
- {
- /*TEST CODE*/
- var fontsize = 11.7;
- var mFont = Font.BoldSystemFontOfSize(NamedSize.Medium);
- Assert.AreEqual(NamedSize.Medium, mFont.NamedSize, "Retrieved NamedSize of Font object should be equal to the set value.");
- mFont = Font.BoldSystemFontOfSize(NamedSize.Large);
- Assert.AreEqual(NamedSize.Large, mFont.NamedSize, "Retrieved NamedSize of Font object should be equal to the set value.");
- mFont = Font.BoldSystemFontOfSize(NamedSize.Micro);
- Assert.AreEqual(NamedSize.Micro, mFont.NamedSize, "Retrieved NamedSize of Font object should be equal to the set value.");
- mFont = Font.BoldSystemFontOfSize(NamedSize.Small);
- Assert.AreEqual(NamedSize.Small, mFont.NamedSize, "Retrieved NamedSize of Font object should be equal to the set value.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether returns a Font structure with the requested font and size are correct or not")]
- [Property("SPEC", "Xamarin.Forms.Font.OfSize M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- [Property("COVPARAM", "string, Double")]
- public void OfSize_NAME_SIZE_METHOD()
- {
- /*TEST CODE*/
- var fontsize = 11.7;
- var name = "Font1";
- var mFont = Font.OfSize(name,fontsize);
- Assert.AreEqual(fontsize, mFont.FontSize,"Retrieved FontSize of Font object should be equal to the set value.");
- Assert.AreEqual(name, mFont.FontFamily,"Retrieved name of Font object should be equal to the set value.");
- name = "Font2";
- fontsize = 18.9223;
- mFont = Font.OfSize(name, fontsize);
- Assert.AreEqual(fontsize, mFont.FontSize,"Retrieved FontSize of Font object should be equal to the set value.");
- Assert.AreEqual(name, mFont.FontFamily,"Retrieved name of Font object should be equal to the set value.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether return an usable Xamarin.Forms.Font, with the requested font and NamedSize are correct or not")]
- [Property("SPEC", "Xamarin.Forms.Font.OfSize M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- [Property("COVPARAM", "string, Xamarin.Forms.NamedSize")]
- public void OfSize_NAME_NAMESIZE_METHOD()
- {
- /*TEST CODE*/
- var fontsize = NamedSize.Large;
- var name = "Font3";
- var mFont = Font.OfSize(name, fontsize);
- Assert.AreEqual(fontsize, mFont.NamedSize,"Retrieved NamedSize of Font object should be equal to the set value.");
- Assert.AreEqual(name, mFont.FontFamily,"Retrieved name of Font object should be equal to the set value.");
- name = "Font4";
- fontsize = NamedSize.Micro;
- mFont = Font.OfSize(name, fontsize);
- Assert.AreEqual(fontsize, mFont.NamedSize,"Retrieved NamedSize of Font object should be equal to the set value.");
- Assert.AreEqual(name, mFont.FontFamily,"Retrieved name of Font object should be equal to the set value.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether return an usable font instance representing the default font, in the requested size, for the device and platform is correct or not")]
- [Property("SPEC", "Xamarin.Forms.Font.SystemFontOfSize M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- [Property("COVPARAM", "Double")]
- public void SystemFontOfSize_DOUBLE_METHOD()
- {
- /*TEST CODE*/
- var fontsize = 11.7;
- var mFont = Font.SystemFontOfSize(fontsize);
- Assert.AreEqual(fontsize, mFont.FontSize,"Retrieved FontSize of Font object should be equal to the set value.");
- fontsize = 18.9223;
- mFont = Font.SystemFontOfSize(fontsize);
- Assert.AreEqual(fontsize, mFont.FontSize,"Retrieved FontSize of Font object should be equal to the set value.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether return an usable font instance representing the default font, in the requested NamedSize, for the device and platform are correct or not")]
- [Property("SPEC", "Xamarin.Forms.Font.SystemFontOfSize M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- [Property("COVPARAM", "Xamarin.Forms.NamedSize")]
- public void SystemFontOfSize_NAMESIZE_METHOD()
- {
- /*TEST CODE*/
- var nameSize = NamedSize.Small;
- var mFont = Font.SystemFontOfSize(nameSize);
- Assert.AreEqual(nameSize, mFont.NamedSize,"Retrieved NamedSize of Font object should be equal to the set value.");
- nameSize = NamedSize.Large;
- mFont = Font.SystemFontOfSize(nameSize);
- Assert.AreEqual(nameSize, mFont.NamedSize,"Retrieved NamedSize of Font object should be equal to the set value.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether return an usable font instance representing the default font, in the requested size and FontAttributes, for the device and platform are correct or not")]
- [Property("SPEC", "Xamarin.Forms.Font.SystemFontOfSize M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- [Property("COVPARAM", "Double, Xamarin.Forms.FontAttributes")]
- public void SystemFontOfSize_SIZE_FONTATTRIBUTE_METHOD()
- {
- /*TEST CODE*/
- var fontsize = 0.123;
- var mFont = Font.SystemFontOfSize(fontsize,FontAttributes.Bold);
- Assert.AreEqual(fontsize, mFont.FontSize,"Retrieved FontSize of Font object should be equal to the set value.");
- Assert.AreEqual(FontAttributes.Bold, mFont.FontAttributes, "Retrieved FontAttributes of Font object should be equal to the set value.");
- fontsize = 18.9223;
- mFont = Font.SystemFontOfSize(fontsize, FontAttributes.Italic);
- Assert.AreEqual(fontsize, mFont.FontSize,"Retrieved FontSize of Font object should be equal to the set value.");
- Assert.AreEqual(FontAttributes.Italic, mFont.FontAttributes, "Retrieved FontAttributes of Font object should be equal to the set value.");
- fontsize = 16.2678;
- mFont = Font.SystemFontOfSize(fontsize, FontAttributes.None);
- Assert.AreEqual(fontsize, mFont.FontSize,"Retrieved FontSize of Font object should be equal to the set value.");
- Assert.AreEqual(FontAttributes.None, mFont.FontAttributes, "Retrieved FontAttributes of Font object should be equal to the set value.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether returns an usable font instance representing the default font, in the requested NamedSize and FontAttributes, for the device and platform are correct or not")]
- [Property("SPEC", "Xamarin.Forms.Font.SystemFontOfSize M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- [Property("COVPARAM", "Xamarin.Forms.NamedSize, Xamarin.Forms.FontAttributes")]
- public void SystemFontOfSize_NAMESIZE_FONTATTRIBUTE_METHOD()
- {
- /*TEST CODE*/
- var nameSize = NamedSize.Small;
- var mFont = Font.SystemFontOfSize(nameSize,FontAttributes.Bold);
- Assert.AreEqual(nameSize, mFont.NamedSize,"Retrieved NamedSize of Font object should be equal to the set value.");
- Assert.AreEqual(FontAttributes.Bold, mFont.FontAttributes, "Retrieved FontAttributes of Font object should be equal to the set value.");
- nameSize = NamedSize.Large;
- mFont = Font.SystemFontOfSize(nameSize, FontAttributes.None);
- Assert.AreEqual(nameSize, mFont.NamedSize,"Retrieved NamedSize of Font object should be equal to the set value.");
- Assert.AreEqual(FontAttributes.None, mFont.FontAttributes, "Retrieved FontAttributes of Font object should be equal to the set value.");
- nameSize = NamedSize.Micro;
- mFont = Font.SystemFontOfSize(nameSize, FontAttributes.Italic);
- Assert.AreEqual(nameSize, mFont.NamedSize,"Retrieved NamedSize of Font object should be equal to the set value.");
- Assert.AreEqual(FontAttributes.Italic, mFont.FontAttributes, "Retrieved FontAttributes of Font object should be equal to the set value.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether return a new font structure with the specified attributes is correct or not")]
- [Property("SPEC", "Xamarin.Forms.Font.WithAttributes M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void WithAttributes_METHOD()
- {
- /*TEST CODE*/
- var mFont = new Font();
- mFont = mFont.WithAttributes(FontAttributes.None);
- Assert.AreEqual(FontAttributes.None, mFont.FontAttributes, "Retrieved FontAttributes of Font object should be equal to the set value.");
- mFont = mFont.WithAttributes(FontAttributes.Italic);
- Assert.AreEqual(FontAttributes.Italic, mFont.FontAttributes, "Retrieved FontAttributes of Font object should be equal to the set value.");
- mFont = mFont.WithAttributes(FontAttributes.Bold);
- Assert.AreEqual(FontAttributes.Bold, mFont.FontAttributes, "Retrieved FontAttributes of Font object should be equal to the set value.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of NamedSize of Font are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.Font.WithSize M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- [Property("COVPARAM", "Xamarin.Forms.NamedSize")]
- public void WithSize_NAMESIZE_METHOD()
- {
- /*TEST CODE*/
- var mFont = new Font();
- mFont = mFont.WithSize(NamedSize.Medium);
- Assert.AreEqual(NamedSize.Medium, mFont.NamedSize,"Retrieved NamedSize of Font object should be equal to the set value.");
- mFont = mFont.WithSize(NamedSize.Small);
- Assert.AreEqual(NamedSize.Small, mFont.NamedSize,"Retrieved NamedSize of Font object should be equal to the set value.");
- mFont = mFont.WithSize(NamedSize.Large);
- Assert.AreEqual(NamedSize.Large, mFont.NamedSize,"Retrieved NamedSize of Font object should be equal to the set value.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of NamedSize of Font are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.Font.WithSize M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- [Property("COVPARAM", "Double")]
- public void WithSize_DOUBLE_SIZE_METHOD()
- {
- /*TEST CODE*/
- var fontsize = 1.234;
- var mFont = new Font();
- mFont = mFont.WithSize(fontsize);
- Assert.AreEqual(fontsize, mFont.FontSize,"Retrieved FontSize of Font object should be equal to the set value.");
- fontsize = 23.345;
- mFont = mFont.WithSize(fontsize);
- Assert.AreEqual(fontsize, mFont.FontSize,"Retrieved FontSize of Font object should be equal to the set value.");
- fontsize = 11.11111;
- mFont = mFont.WithSize(fontsize);
- Assert.AreEqual(fontsize, mFont.FontSize,"Retrieved FontSize of Font object should be equal to the set value.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether return left represents same font that right represents is correct or not")]
- [Property("SPEC", "Xamarin.Forms.Font.== M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void Equality_OPERATOR_METHOD()
- {
- /*TEST CODE*/
- var mFont1 = new Font();
- mFont1 = mFont1.WithSize(12.5);
- mFont1 = mFont1.WithAttributes(FontAttributes.Italic);
- var mFont2 = new Font();
- mFont2 = mFont2.WithSize(12.5);
- mFont2 = mFont2.WithAttributes(FontAttributes.Italic);
- Assert.True((mFont1 == mFont2),"mFont1 should be equal to mFont2");
- var mFont3 = new Font();
- mFont3 = mFont3.WithSize(11.23);
- mFont3 = mFont3.WithAttributes(FontAttributes.None);
- Assert.False((mFont1 == mFont3),"mFont1 should be not equal to mFont3");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check returns true if left does not represent the same font that right represents is correct or not")]
- [Property("SPEC", "Xamarin.Forms.Font.!= M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void Inequality_COMPARE_OPERATOR_METHOD()
- {
- /*TEST CODE*/
- var mFont1 = new Font();
- mFont1 = mFont1.WithSize(12.5);
- mFont1 = mFont1.WithAttributes(FontAttributes.Italic);
- var mFont2 = new Font();
- mFont2 = mFont2.WithSize(12.5);
- mFont2 = mFont2.WithAttributes(FontAttributes.Italic);
- Assert.False((mFont1 != mFont2),"Should be returned false when 2 font are same");
- var mFont3 = new Font();
- mFont3 = mFont3.WithSize(11.23);
- mFont3 = mFont3.WithAttributes(FontAttributes.None);
- bool check = (mFont1 != mFont3);
- Assert.True(check,"Should be returned true when 2 font are difference");
- }
-
- [Test]
- [Category("P1")]
- [Description("Determine if the provided System.Object is equivalent to the current Font is correct or not")]
- [Property("SPEC", "Xamarin.Forms.Font.Equals M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void Equals_METHOD()
- {
- /*TEST CODE*/
- var mFont1 = new Font();
- mFont1 = mFont1.WithSize(12.5);
- mFont1 = mFont1.WithAttributes(FontAttributes.Italic);
- var mFont2 = new Font();
- mFont2 = mFont2.WithSize(12.5);
- mFont2 = mFont2.WithAttributes(FontAttributes.Italic);
- Assert.True(mFont1.Equals(mFont2),"mFont1 should be equal to mFont2");
- var mFont3 = new Font();
- mFont3 = mFont3.WithSize(11.23);
- mFont3 = mFont3.WithAttributes(FontAttributes.None);
- Assert.False((mFont1.Equals(mFont3)),"mFont1 should be not equal to mFont3");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether a string representation of this Xamarin.Forms.Font structure is correct or not")]
- [Property("SPEC", "Xamarin.Forms.Font.ToString M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void ToString_METHOD()
- {
- /*TEST CODE*/
- var mFont1 = new Font();
- mFont1 = mFont1.WithSize(12.5);
- mFont1 = mFont1.WithAttributes(FontAttributes.Italic);
- var mFont2 = new Font();
- mFont2 = mFont2.WithSize(12.5);
- mFont2 = mFont2.WithAttributes(FontAttributes.Italic);
- Assert.AreEqual(mFont1.ToString(),mFont2.ToString(),"mFont1 should be equal to mFont2");
- var mFont3 = new Font();
- mFont3 = mFont3.WithSize(11.23);
- mFont3 = mFont3.WithAttributes(FontAttributes.None);
- Assert.AreNotEqual(mFont1.ToString(), mFont3.ToString(),"mFont1 should be not equal to mFont3");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get the Hashcode for this System.Object is correct or not")]
- [Property("SPEC", "Xamarin.Forms.Font.GetHashCode M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void GetHashCode_METHOD()
- {
- /*TEST CODE*/
- var mFont1 = new Font();
- mFont1 = mFont1.WithSize(12.5);
- mFont1 = mFont1.WithAttributes(FontAttributes.Italic);
- var mFont2 = new Font();
- mFont2 = mFont2.WithSize(12.5);
- mFont2 = mFont2.WithAttributes(FontAttributes.Italic);
- Assert.AreEqual(mFont1.GetHashCode(), mFont2.GetHashCode(), "HashCode of mFont1 should be equal to HashCode of mFont2");
- var mFont3 = new Font();
- mFont3 = mFont3.WithSize(11.23);
- mFont3 = mFont3.WithAttributes(FontAttributes.None);
- Assert.AreNotEqual(mFont1.GetHashCode(), mFont3.GetHashCode(), "HashCode of mFont1 should be not equal to HashCode of mFont3");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.FontSizeConverter Tests")]
- public class FontSizeConverterTests
- {
- private FontSizeConverter _fontSizeConverter;
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("FontSizeConverterTests --------------- Setup()");
- _fontSizeConverter = new FontSizeConverter();
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("FontSizeConverterTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create an FontSizeConverter instance.")]
- [Property("SPEC", "Xamarin.Forms.FontSizeConverter.FontSizeConverter C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void FontSizeConverter_INIT()
- {
- /* TEST CODE */
- var fontSizeConverter = new FontSizeConverter();
- Assert.IsNotNull(fontSizeConverter, "Object is null after initialize");
- Assert.IsInstanceOf<FontSizeConverter>(fontSizeConverter);
- }
-
- //[Test]
- [Category("P1")]
- [Description("Returns a value that indicates if the source type can be converted to a font size.")]
- [Property("SPEC", "Xamarin.Forms.FontSizeConverter.CanConvertFrom M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void CanConvertFrom_CHECK_RETURN()
- {
- /* TEST CODE */
- var canConvert = _fontSizeConverter.CanConvertFrom(typeof(String));
- Assert.IsInstanceOf<bool>(canConvert, "CanCorvertForm's return value should be boolean.");
- Assert.IsTrue(canConvert , "CanConvertFrom mathod should return true for String type");
- }
-
- [Test]
- [Category("P1")]
- [Description("Converts a string representation of a font size into a font size.")]
- [Property("SPEC", "Xamarin.Forms.FontSizeConverter.ConvertFromInvariantString M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void ConvertFromInvariantString_CHECK_RETURN()
- {
- /* TEST CODE */
- var fontSize = _fontSizeConverter.ConvertFromInvariantString("10.2");
- //Assert.IsInstanceOf<Object>(fontSize, "Object need to Object type");
- Assert.AreEqual(10.2, (double)fontSize, "fontSize missmatch");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class FontTypeConverterTests
- {
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("FontTypeConverterTest --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("FontTypeConverterTest --------------- TearDown()");
- }
-
- [Test]
- [Category("P0")]
- [Description("Create a FontTypeConverter Instance")]
- [Property("SPEC", "Xamarin.Forms.FontTypeConverter.FontTypeConverter C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void FontTypeConverter_INIT()
- {
- /* TEST CODE */
- var fontTypeConverter = new FontTypeConverter();
- Assert.IsNotNull(fontTypeConverter, "Object is null after initialize");
- Assert.IsInstanceOf<FontTypeConverter>(fontTypeConverter);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the ConvertFromInvariantString converts the value into Font.")]
- [Property("SPEC", "Xamarin.Forms.FontTypeConverter.ConvertFromInvariantString M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void ConvertFromInvariantString_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- FontTypeConverter fontTypeConverter = new FontTypeConverter();
- var font = fontTypeConverter.ConvertFromInvariantString("Razin");
- Assert.IsInstanceOf<Font>(font);
- Assert.AreEqual(((Font)font).FontFamily, "Razin", "FontFamily should be equal.");
- }
-
- }
-}
+++ /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 Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class FormattedStringTests
- {
- private FormattedString _formattedString;
- private bool _flagPropertyChanged;
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("FormattedStringTests --------------- SetUp()");
- _formattedString = new FormattedString();
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("FormattedStringTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a FormattedString instance. Check whether object is successfully created or not")]
- [Property("SPEC", "Xamarin.Forms.FormattedString.FormattedString C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void FormattedString_INIT()
- {
- /* TEST CODE */
- var formattedString = new FormattedString();
- Assert.IsNotNull(formattedString, "Creating a FormattedString object failed. It is set to null");
- }
-
- [Test]
- [Category("P1")]
- [Description("Gets collection of spans")]
- [Property("SPEC", "Xamarin.Forms.FormattedString.Spans A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void Spans_GET_CHECK()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- Assert.IsNotNull(_formattedString, "Creating a FormattedString object failed. It is set to null");
-
- /* TEST CODE */
- var count = 0;
- var listSpan = _formattedString.Spans;
- foreach(var item in listSpan)
- {
- count++;
- }
- Assert.AreEqual(0, count, "Get value of Spans is not correct, returning 0");
- var span1 = new Span();
- var span2 = new Span();
- var span3 = new Span();
- _formattedString.Spans.Add(span1);
- _formattedString.Spans.Add(span2);
- _formattedString.Spans.Add(span3);
- listSpan = _formattedString.Spans;
- count = 0;
- foreach (var item in listSpan)
- {
- count++;
- }
- Assert.AreEqual(3, count, "Get value of Spans is not correct, it should be return 3");
- }
-
- [Test]
- [Category("P1")]
- [Description("Returns the plain text of the FormattedString as an unformatted string")]
- [Property("SPEC", "Xamarin.Forms.FormattedString.ToString M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void ToString_CHECK()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- Assert.IsNotNull(_formattedString, "Creating a FormattedString object failed. It is set to null");
-
- /* TEST CODE */
- var str = "Hello Tizen";
- _formattedString = str;
- Assert.AreEqual(str, _formattedString.ToString(), "ToString is not working as expected");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Implicit operator can convert from String to FormattedString")]
- [Property("SPEC", "Xamarin.Forms.FormattedString.Implicit M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nhu Anh, anh.vn@samsung.com")]
- public void Implicit_STRING_TO_FORMATTEDSTRING()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- Assert.IsNotNull(_formattedString, "Creating a FormattedString object failed. It is set to null");
-
- /* TEST CODE */
- var strTest = "Hello Tizen";
- _formattedString = strTest;
- Assert.AreEqual(strTest, _formattedString.ToString(), "Can't convert from String to FormattedString");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Explicit operator can assign normally")]
- [Property("SPEC", "Xamarin.Forms.FormattedString.Explicit M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nhu Anh, anh.vn@samsung.com")]
- public void Explicit_FORMATTEDSTRING_TO_STRING()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- Assert.IsNotNull(_formattedString, "Creating a FormattedString object failed. It is set to null");
-
- /* TEST CODE */
- var str = "Explicit Test";
- _formattedString = str;
- var formattedString = new FormattedString();
- formattedString = _formattedString;
- Assert.AreEqual(str, formattedString.ToString(), "Explicit operator of FormattedString not working property");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether PropertyChanged event is invoked when property changed.")]
- [Property("SPEC", "Xamarin.Forms.FormattedString.PropertyChanged E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void PropertyChanged_EVENT()
- {
- /* TEST CODE */
- var span1 = new Span();
- var span2 = new Span();
- var formattedString = new FormattedString();
- formattedString.Spans.Add(span1);
- formattedString.Spans.Add(span2);
- var count = 0;
- var listSpan = formattedString.Spans;
- foreach (var item in listSpan)
- {
- count++;
- }
- Assert.AreEqual(2, count, "Get value of Spans is not correct, it should be return 2");
- _flagPropertyChanged = false;
- Assert.IsFalse(_flagPropertyChanged, "The first Flag PropertyChanged should be False");
- formattedString.PropertyChanged += (o, e) =>
- {
- _flagPropertyChanged = true;
- };
- formattedString.Spans.Remove(span2);
- count = 0;
- listSpan = formattedString.Spans;
- foreach (var item in listSpan)
- {
- count++;
- }
- Assert.AreEqual(1, count, "Get value of Spans is not correct, it should be return 1");
- Assert.IsTrue(_flagPropertyChanged, "Flag PropertyChanged should be True after changing property");
- }
- }
-}
+++ /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 Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class FrameTests
- {
- private Frame _frame;
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("FrameTests --------------- SetUp()");
- _frame = new Frame();
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("FrameTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a Frame instance. Check whether object is successfully created or not")]
- [Property("SPEC", "Xamarin.Forms.Frame.Frame C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void Frame_INIT()
- {
- /* TEST CODE */
- var frame = new Frame();
- Assert.IsNotNull(frame, "Creating a Frame object failed. It is set to null");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property CornerRadius is readable and settable with valid values")]
- [Property("SPEC", "Xamarin.Forms.Frame.CornerRadius A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void CornerRadius_PROPERTY_SET_GET()
- {
- /* TEST CODE */
- Button button = new Button();
- button.BorderRadius = 25;
- _frame.CornerRadius = button.BorderRadius;
- Assert.AreEqual(_frame.CornerRadius, 25, "Not returning expected CornerRadius value.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property HasShadow is readable and settable with valid values")]
- [Property("SPEC", "Xamarin.Forms.Frame.HasShadow A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void HasShadow_PROPERTY_SET_GET()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- Assert.IsNotNull(_frame, "Creating a Frame object failed. It is set to null");
-
- /* TEST CODE */
- _frame.HasShadow = true;
- Assert.IsTrue(_frame.HasShadow);
- _frame.HasShadow = false;
- Assert.IsFalse(_frame.HasShadow);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property OutlineColor is readable and settable with valid values")]
- [Property("SPEC", "Xamarin.Forms.Frame.OutlineColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void OutlineColor_PROPERTY_SET_GET()
- {
- /*PRECONDITION
- * 1. Check whether object is successfully created or not
- * 2. Create an Color instance for set to property OutlineColor
- */
- Assert.IsNotNull(_frame, "Creating a Frame object failed. It is set to null");
- var r = 0.1;
- var g = 0.2;
- var b = 0.3;
- var color = new Color(r, g, b);
-
- /* TEST CODE */
- _frame.OutlineColor = color;
- var getOutlineColor = _frame.OutlineColor;
- Assert.AreEqual(color.R, getOutlineColor.R, "Set and get value R of color is not successful");
- Assert.AreEqual(color.G, getOutlineColor.G, "Set and get value G of color is not successful");
- Assert.AreEqual(color.B, getOutlineColor.B, "Set and get value B of color is not successful");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of CornerRadiusProperty's bound or not.")]
- [Property("SPEC", "Xamarin.Forms.Frame.CornerRadiusProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void CornerRadiusProperty_CHECK_BINDABLE()
- {
- /* TEST CODE */
- Button button = new Button();
- button.BorderRadius = 20;
- Button newButton = new Button();
- Frame frame = new Frame();
- newButton.BorderRadius = 25;
- var mFirstCornerRadiusProperty = button.BorderRadius;
- var mSecondCornerRadiusProperty = newButton.BorderRadius;
-
-
- _frame.CornerRadius = mFirstCornerRadiusProperty;
- frame.CornerRadius = mSecondCornerRadiusProperty;
-
- Assert.AreNotEqual(_frame.CornerRadius, frame.CornerRadius, "CornerRadiusProperty value must be different.");
- _frame.BindingContext = frame;
- _frame.SetBinding(Frame.CornerRadiusProperty, "CornerRadius");
- Assert.AreEqual(_frame.CornerRadius, frame.CornerRadius, "After binding, values should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether HasShaowProperty(BindableProperty) is working correctly or not.")]
- [Property("SPEC", "Xamarin.Forms.Frame.HasShadowProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void HasShadowProperty_PROPERTY()
- {
- /* TEST CODE */
- var frame1 = new Frame();
- frame1.HasShadow = true;
- var frame2 = new Frame()
- {
- HasShadow = false,
- };
- Assert.AreNotEqual(frame1.HasShadow, frame2.HasShadow, "HasShadow should be different between two Frame objects");
- frame1.BindingContext = frame2;
- frame1.SetBinding(Frame.HasShadowProperty, "HasShadow");
- Assert.AreEqual(frame1.HasShadow, frame2.HasShadow, "HasShadow should be same between two Frame objects");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OutlineColorProperty(BindableProperty) is working correctly or not.")]
- [Property("SPEC", "Xamarin.Forms.Frame.OutlineColorProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void OutlineColorProperty_PROPERTY()
- {
- /* TEST CODE */
- var frame1 = new Frame();
- frame1.OutlineColor = Color.Red;
- var frame2 = new Frame()
- {
- OutlineColor = Color.Blue,
- };
- Assert.AreNotEqual(frame1.OutlineColor, frame2.OutlineColor, "OutlineColor should be different between two Frame objects");
- frame1.BindingContext = frame2;
- frame1.SetBinding(Frame.OutlineColorProperty, "OutlineColor");
- Assert.AreEqual(frame1.OutlineColor, frame2.OutlineColor, "OutlineColor should be same between two Frame objects");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether On<IConfigPlatform> is readable correct or not")]
- [Property("SPEC", "Xamarin.Forms.Frame.On<T> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void On_CONFIGURATION_METHOD()
- {
- /* TEST CODE */
- var frame = new Frame()
- {
- HasShadow = true,
- OutlineColor = Color.Black,
- };
- var myConfig = frame.On<IConfigPlatform>();
- Assert.IsInstanceOf<IPlatformElementConfiguration<IConfigPlatform, Frame>>(myConfig, "myConfig should be a instance of IPlatformElementConfiguration");
- var getFrame = myConfig.Element;
- Assert.IsInstanceOf<Frame>(getFrame, "myConfig.Element should be a instance of Frame");
- Assert.AreEqual(frame.HasShadow, getFrame.HasShadow, "Get HasShadow value of Frame is not correct");
- Assert.AreEqual(Color.Black, getFrame.OutlineColor, "Get OutlineColor value of Frame is not correct");
- }
- }
-}
+++ /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.Threading.Tasks;
-using XamarinForTizen.Tizen;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class GridTests
- {
- private Grid _grid;
- private static bool _flagLayoutChildren, _flagOnAdded, _flagOnBindingContextChanged, _flagOnRemoved, _flagOnSizeRequest;
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("Grid --------------- SetUp()");
- _grid = new Grid();
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("Grid --------------- TearDown()");
- }
-
- public class SubGrid: Grid
- {
- protected override void LayoutChildren(double x, double y, double width, double height)
- {
- _flagLayoutChildren = true;
- base.LayoutChildren(x, y, width, height);
- }
- protected override void OnAdded(View view)
- {
- _flagOnAdded = true;
- base.OnAdded(view);
- }
- protected override void OnBindingContextChanged()
- {
- _flagOnBindingContextChanged = true;
- base.OnBindingContextChanged();
- }
- protected override void OnRemoved(View view)
- {
- _flagOnRemoved = true;
- base.OnRemoved(view);
- }
- protected override SizeRequest OnSizeRequest(double widthConstraint, double heightConstraint)
- {
- _flagOnSizeRequest = true;
- return base.OnSizeRequest(widthConstraint, heightConstraint);
- }
- }
-
- public class SubBindableObject: BindableObject
- {
- public SubBindableObject(): base()
- {
-
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a Grid instance. Check whether object is successfully created or not")]
- [Property("SPEC", "Xamarin.Forms.Grid.Grid C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void Grid_INIT()
- {
- /* TEST CODE */
- var grid = new Grid();
- Assert.IsNotNull(grid, "Creating a Grid object failed. It is set to null");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Children is readable")]
- [Property("SPEC", "Xamarin.Forms.Grid.Children A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void Children_PROPERTY_GET()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- Assert.IsNotNull(_grid, "Creating a Grid object failed. It is set to null");
-
- /* TEST CODE */
- var count = 0;
- var listGrid = _grid.Children;
- foreach (var item in listGrid)
- {
- ++count;
- }
- Assert.AreEqual(0, count, "Get value of Children is not correct, returning 0");
- count = 0;
- var label = new Label();
- _grid.Children.Add(label);
- var button = new Button();
- _grid.Children.Add(button);
- var editor = new Editor();
- _grid.Children.Add(editor);
- listGrid = _grid.Children;
- foreach (var item in listGrid)
- {
- ++count;
- }
- Assert.AreEqual(3, count, "Get value of Children is not correct, it should be return 3");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property ColumnDefinitions is readable and settable with valid values")]
- [Property("SPEC", "Xamarin.Forms.Grid.ColumnDefinitions A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void ColumnDefinitions_PROPERTY_SET_GET()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- Assert.IsNotNull(_grid, "Creating a Grid object failed. It is set to null");
-
- /* TEST CODE */
- var columnDefinitionCollection = new ColumnDefinitionCollection();
- _grid.ColumnDefinitions = columnDefinitionCollection;
- var getColumnDefinitionCollection = _grid.ColumnDefinitions;
- Assert.IsNotNull(getColumnDefinitionCollection, "Set and get value of ColumnDefinitions property is not correct");
- Assert.IsInstanceOf<ColumnDefinitionCollection>(getColumnDefinitionCollection);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property ColumnSpacing is readable and settable with valid values")]
- [Property("SPEC", "Xamarin.Forms.Grid.ColumnSpacing A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void ColumnSpacing_PROPERTY_SET_GET()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- Assert.IsNotNull(_grid, "Creating a Grid object failed. It is set to null");
-
- /* TEST CODE */
- var columnSpacing = 5.5;
- _grid.ColumnSpacing = columnSpacing;
- var getColumnSpacing = _grid.ColumnSpacing;
- Assert.AreEqual(columnSpacing, getColumnSpacing, "Set and get value of ColumnSpacing is not correct");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property RowDefinitions is readable and settable with valid values")]
- [Property("SPEC", "Xamarin.Forms.Grid.RowDefinitions A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void RowDefinitions_PROPERTY_SET_GET()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- Assert.IsNotNull(_grid, "Creating a Grid object failed. It is set to null");
-
- /* TEST CODE */
- var rowDefinitionCollection = new RowDefinitionCollection();
- _grid.RowDefinitions = rowDefinitionCollection;
- var getRowDefinitionCollection = _grid.RowDefinitions;
- Assert.IsNotNull(getRowDefinitionCollection, "Set and get value of RowDefinitions property is not correct");
- Assert.IsInstanceOf<RowDefinitionCollection>(getRowDefinitionCollection);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property RowSpacing is readable and settable with valid values")]
- [Property("SPEC", "Xamarin.Forms.Grid.RowSpacing A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void RowSpacing_PROPERTY_SET_GET()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- Assert.IsNotNull(_grid, "Creating a Grid object failed. It is set to null");
-
- /* TEST CODE */
- var rowSpacing = 7.5;
- _grid.RowSpacing = rowSpacing;
- var getRowSpacing = _grid.RowSpacing;
- Assert.AreEqual(rowSpacing, getRowSpacing, "Set and get value of RowSpacing is not correct");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property ColumnDefinitionsProperty is readable")]
- [Property("SPEC", "Xamarin.Forms.Grid.ColumnDefinitionsProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void ColumnDefinitionsProperty_PROPERTY()
- {
- /* TEST CODE */
- var getColumnDefinitionsProperty = Grid.ColumnDefinitionsProperty;
- Assert.IsInstanceOf<BindableProperty>(getColumnDefinitionsProperty);
- Assert.IsFalse(getColumnDefinitionsProperty.IsReadOnly, "ColumnDefinitionsProperty should be not readonly property");
- Assert.AreEqual("ColumnDefinitions", getColumnDefinitionsProperty.PropertyName, "Name of Property should be ColumnDefinitions");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property ColumnProperty is readable")]
- [Property("SPEC", "Xamarin.Forms.Grid.ColumnProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void ColumnProperty_PROPERTY()
- {
- /* TEST CODE */
- var grid1 = new Grid();
- var value1 = 5;
- Grid.SetColumn(grid1, value1);
- var getColumn1 = Grid.GetColumn(grid1);
- var grid2 = new Grid();
- var value2 = 11;
- Grid.SetColumn(grid2, value2);
- var getColumn2 = Grid.GetColumn(grid2);
- Assert.AreNotEqual(getColumn1, getColumn2, "GetColumn should be different between two Grid objects");
- grid1.SetValue(Grid.ColumnProperty, value2);
- getColumn1 = Grid.GetColumn(grid1);
- Assert.AreEqual(getColumn1, getColumn2, "GetColumn should be same between two Grid objects");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ColumnSpacingProperty(BindableProperty) is working correctly or not.")]
- [Property("SPEC", "Xamarin.Forms.Grid.ColumnSpacingProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void ColumnSpacingProperty_PROPERTY()
- {
- /* TEST CODE */
- var grid1 = new Grid();
- grid1.ColumnSpacing = 2.3;
- var grid2 = new Grid()
- {
- ColumnSpacing = 3.1,
- };
- Assert.AreNotEqual(grid1.ColumnSpacing, grid2.ColumnSpacing, "ColumnSpacing should be different between two Grid objects");
- grid1.BindingContext = grid2;
- grid1.SetBinding(Grid.ColumnSpacingProperty, "ColumnSpacing");
- Assert.AreEqual(grid1.ColumnSpacing, grid2.ColumnSpacing, "ColumnSpacing should be same between two Grid objects");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property ColumnSpanProperty is readable")]
- [Property("SPEC", "Xamarin.Forms.Grid.ColumnSpanProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void ColumnSpanProperty_PROPERTY()
- {
- /* TEST CODE */
- var grid1 = new Grid();
- var value1 = 2;
- Grid.SetColumnSpan(grid1, value1);
- var getColumnSpan1 = Grid.GetColumnSpan(grid1);
- var grid2 = new Grid();
- var value2 = 7;
- Grid.SetColumnSpan(grid2, value2);
- var getColumnSpan2 = Grid.GetColumnSpan(grid2);
- Assert.AreNotEqual(getColumnSpan1, getColumnSpan2, "GetColumnSpan should be different between two Grid objects");
- grid1.SetValue(Grid.ColumnSpanProperty, value2);
- getColumnSpan1 = Grid.GetColumnSpan(grid1);
- Assert.AreEqual(getColumnSpan1, getColumnSpan2, "GetColumnSpan should be same between two Grid objects");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property RowDefinitionsProperty is readable")]
- [Property("SPEC", "Xamarin.Forms.Grid.RowDefinitionsProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void RowDefinitionsProperty_PROPERTY()
- {
- /* TEST CODE */
- var getRowDefinitionsProperty = Grid.RowDefinitionsProperty;
- Assert.IsInstanceOf<BindableProperty>(getRowDefinitionsProperty);
- Assert.IsFalse(getRowDefinitionsProperty.IsReadOnly, "RowDefinitionsProperty should be not readonly property");
- Assert.AreEqual("RowDefinitions", getRowDefinitionsProperty.PropertyName, "Name of Property should be RowDefinitions");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property RowProperty is readable")]
- [Property("SPEC", "Xamarin.Forms.Grid.RowProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void RowProperty_PROPERTY()
- {
- /* TEST CODE */
- var grid1 = new Grid();
- var value1 = 4;
- Grid.SetRow(grid1, value1);
- var getRow1 = Grid.GetRow(grid1);
- var grid2 = new Grid();
- var value2 = 6;
- Grid.SetRow(grid2, value2);
- var getRow2 = Grid.GetRow(grid2);
- Assert.AreNotEqual(getRow1, getRow2, "GetRow should be different between two Grid objects");
- grid1.SetValue(Grid.RowProperty, value2);
- getRow1 = Grid.GetRow(grid1);
- Assert.AreEqual(getRow1, getRow2, "GetRow should be same between two Grid objects");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether RowSpacingProperty(BindableProperty) is working correctly or not.")]
- [Property("SPEC", "Xamarin.Forms.Grid.RowSpacingProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void RowSpacingProperty_PROPERTY()
- {
- /* TEST CODE */
- var grid1 = new Grid();
- grid1.RowSpacing = 1.6;
- var grid2 = new Grid()
- {
- RowSpacing = 3.7,
- };
- Assert.AreNotEqual(grid1.RowSpacing, grid2.RowSpacing, "RowSpacing should be different between two Grid objects");
- grid1.BindingContext = grid2;
- grid1.SetBinding(Grid.RowSpacingProperty, "RowSpacing");
- Assert.AreEqual(grid1.RowSpacing, grid2.RowSpacing, "RowSpacing should be same between two Grid objects");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property RowSpanProperty is readable")]
- [Property("SPEC", "Xamarin.Forms.Grid.RowSpanProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void RowSpanProperty_PROPERTY()
- {
- /* TEST CODE */
- var grid1 = new Grid();
- var value1 = 2;
- Grid.SetRowSpan(grid1, value1);
- var getRowSpan1 = Grid.GetRowSpan(grid1);
- var grid2 = new Grid();
- var value2 = 5;
- Grid.SetRowSpan(grid2, value2);
- var getRowSpan2 = Grid.GetRowSpan(grid2);
- Assert.AreNotEqual(getRowSpan1, getRowSpan2, "GetRowSpan should be different between two Grid objects");
- grid1.SetValue(Grid.RowSpanProperty, value2);
- getRowSpan1 = Grid.GetRowSpan(grid1);
- Assert.AreEqual(getRowSpan1, getRowSpan2, "GetRowSpan should be same between two Grid objects");
- }
-
- [Test]
- [Category("P1")]
- [Description("Invoke OnAdded method, and check whether value of _flagOnAdded is changed to true.")]
- [Property("SPEC", "Xamarin.Forms.Grid.OnAdded M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Nhu Anh, anh.vn@samsung.com")]
- public void OnAdded_CHECK()
- {
- _flagOnAdded = false;
- Assert.False(_flagOnAdded, "The first Flag OnAdded should be False");
- var label = new Label()
- {
- Text = "This is a label",
- };
- var subGrid = new SubGrid();
- subGrid.Children.Add(label);
- Assert.True(_flagOnAdded, "Flag OnAdded should be True after initiating");
- }
-
- [Test]
- [Category("P1")]
- [Description("Invoke OnRemoved method, and check whether value of _flagOnRemoved is changed to true.")]
- [Property("SPEC", "Xamarin.Forms.Grid.OnRemoved M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Nhu Anh, anh.vn@samsung.com")]
- public void OnRemoved_CHECK()
- {
- _flagOnRemoved = false;
- Assert.False(_flagOnRemoved, "The first Flag OnRemoved should be False");
- var label = new Label()
- {
- Text = "This is a label",
- };
- var subGrid = new SubGrid();
- subGrid.Children.Add(label);
- subGrid.Children.Remove(label);
- Assert.True(_flagOnRemoved, "Flag OnRemoved should be True after initiating");
- }
-
- [Test]
- [Category("P1")]
- [Description("Invoke OnBindingContextChanged method, and check whether value of _flagOnBindingContextChanged is changed to true.")]
- [Property("SPEC", "Xamarin.Forms.Grid.OnBindingContextChanged M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Nhu Anh, anh.vn@samsung.com")]
- public void OnBindingContextChanged_CHECK()
- {
- /* TEST CODE */
- var subGrid = new SubGrid();
- _flagOnBindingContextChanged = false;
- Assert.IsFalse(_flagOnBindingContextChanged, "The first Flag OnBindingContextChanged should be False");
- var grid = new Grid()
- {
- ColumnSpacing = 2.3,
- };
- subGrid.BindingContext = grid;
- Assert.IsTrue(_flagOnBindingContextChanged, "Flag OnBindingContextChanged should be True after BindingContext is changed");
- }
-
- [Test]
- [Category("P1")]
- [Description("Invoke OnSizeRequest method, and check whether value of _flagOnSizeRequest is changed to true.")]
- [Property("SPEC", "Xamarin.Forms.Grid.OnSizeRequest M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Nhu Anh, anh.vn@samsung.com")]
- public void OnSizeRequest_CHECK()
- {
- /* TEST CODE */
- var subGrid = new SubGrid();
- _flagOnSizeRequest = false;
- Assert.IsFalse(_flagOnSizeRequest, "The first Flag OnSizeRequest should be False");
- subGrid.Measure(150, 120, MeasureFlags.IncludeMargins);
- Assert.IsTrue(_flagOnSizeRequest, "Flag OnSizeRequest should be True after Measure is changed");
- }
-
- [Test]
- [Category("P1")]
- [Description("Invoke LayoutChildren method, and check whether value of _flagLayoutChildren is changed to true.")]
- [Property("SPEC", "Xamarin.Forms.Grid.LayoutChildren M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Nhu Anh, anh.vn@samsung.com")]
- public async Task LayoutChildren_CHECK()
- {
- /* TEST CODE */
- var subGrid = new SubGrid()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.Start,
- HeightRequest = 200
- };
- var label = new Label()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- Text = "Label 1"
- };
- subGrid.Children.Add(label, 0, 0);
- _flagLayoutChildren = false;
- Assert.IsFalse(_flagLayoutChildren, "The first Flag LayoutChildren should be False");
- var rec = new Rectangle(10.5, 12.3, 100.5, 120.5);
- var page = new ContentPage()
- {
- Content = subGrid
- };
-
- await Program.getApp().MainPage.Navigation.PushAsync(page);
- await Task.Delay(1000);
- subGrid.HeightRequest += 20;
-
- Assert.IsTrue(_flagLayoutChildren, "Flag LayoutChildren should be True after Layout is changed");
-
- //POST CONDITION
- await Program.getApp().MainPage.Navigation.PopToRootAsync();
- await Task.Delay(1000);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether SetColumn is settable correct or not")]
- [Property("SPEC", "Xamarin.Forms.Grid.SetColumn M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void SetColumn_SET_VALUE()
- {
- /* TEST CODE */
- var subBindableObject = new SubBindableObject();
- var getColumnDefault = Grid.GetColumn(subBindableObject);
- var value = 6;
- Grid.SetColumn(subBindableObject, value);
- var getColumnAfterSetting = Grid.GetColumn(subBindableObject);
- Assert.AreNotEqual(getColumnDefault, getColumnAfterSetting, "Set value of SetColumn is not successful");
- Assert.AreEqual(value, getColumnAfterSetting, "Set value of SetColumn is not successful");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether GetColumn is readable correct or not")]
- [Property("SPEC", "Xamarin.Forms.Grid.GetColumn M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void GetColumn_GET_VALUE()
- {
- /* TEST CODE */
- var subBindableObject = new SubBindableObject();
- var value = 5;
- Grid.SetColumn(subBindableObject, value);
- var getColumn = Grid.GetColumn(subBindableObject);
- Assert.AreEqual(value, getColumn, "Get value of GetColumn is not successful");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether SetColumnSpan is settable correct or not")]
- [Property("SPEC", "Xamarin.Forms.Grid.SetColumnSpan M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void SetColumnSpan_SET_VALUE()
- {
- /* TEST CODE */
- var subBindableObject = new SubBindableObject();
- var getSetColumnSpanDefault = Grid.GetColumnSpan(subBindableObject);
- var value = 8;
- Grid.SetColumnSpan(subBindableObject, value);
- var getColumnSpanAfterSetting = Grid.GetColumnSpan(subBindableObject);
- Assert.AreNotEqual(getSetColumnSpanDefault, getColumnSpanAfterSetting, "Set value of SetColumnSpan is not successful");
- Assert.AreEqual(value, getColumnSpanAfterSetting, "Set value of SetColumnSpan is not successful");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether GetColumnSpan is readable correct or not")]
- [Property("SPEC", "Xamarin.Forms.Grid.GetColumnSpan M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void GetColumnSpan_GET_VALUE()
- {
- /* TEST CODE */
- var subBindableObject = new SubBindableObject();
- var value = 6;
- Grid.SetColumnSpan(subBindableObject, value);
- var getColumnSpan = Grid.GetColumnSpan(subBindableObject);
- Assert.AreEqual(value, getColumnSpan, "Get value of GetColumnSpan is not successful");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether SetRow is settable correct or not")]
- [Property("SPEC", "Xamarin.Forms.Grid.SetRow M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void SetRow_SET_VALUE()
- {
- /* TEST CODE */
- var subBindableObject = new SubBindableObject();
- var getRowDefault = Grid.GetRow(subBindableObject);
- var value = 6;
- Grid.SetRow(subBindableObject, value);
- var getRowAfterSetting = Grid.GetRow(subBindableObject);
- Assert.AreNotEqual(getRowDefault, getRowAfterSetting, "Set value of SetRow is not successful");
- Assert.AreEqual(value, getRowAfterSetting, "Set value of SetRow is not successful");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether GetRow is readable correct or not")]
- [Property("SPEC", "Xamarin.Forms.Grid.GetRow M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void GetRow_GET_VALUE()
- {
- /* TEST CODE */
- var subBindableObject = new SubBindableObject();
- var value = 5;
- Grid.SetRow(subBindableObject, value);
- var getRow = Grid.GetRow(subBindableObject);
- Assert.AreEqual(value, getRow, "Get value of GetRow is not successful");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether SetRowSpan is settable correct or not")]
- [Property("SPEC", "Xamarin.Forms.Grid.SetRowSpan M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void SetRowSpan_SET_VALUE()
- {
- /* TEST CODE */
- var subBindableObject = new SubBindableObject();
- var getSetRowSpanDefault = Grid.GetRowSpan(subBindableObject);
- var value = 8;
- Grid.SetRowSpan(subBindableObject, value);
- var getRowSpanAfterSetting = Grid.GetRowSpan(subBindableObject);
- Assert.AreNotEqual(getSetRowSpanDefault, getRowSpanAfterSetting, "Set value of SetRowSpan is not successful");
- Assert.AreEqual(value, getRowSpanAfterSetting, "Set value of SetRowSpan is not successful");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether GetRowSpan is readable correct or not")]
- [Property("SPEC", "Xamarin.Forms.Grid.GetRowSpan M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void GetRowSpan_GET_VALUE()
- {
- /* TEST CODE */
- var subBindableObject = new SubBindableObject();
- var value = 6;
- Grid.SetRowSpan(subBindableObject, value);
- var getRowSpan = Grid.GetRowSpan(subBindableObject);
- Assert.AreEqual(value, getRowSpan, "Get value of GetRowSpan is not successful");
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class GridLengthTests
- {
- [SetUp]
- public void SetUp()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "GridLength CLASS: Setup---------------------------------");
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "GridLength CLASS: Teardown---------------------------------");
- }
-
- [Test]
- [Category("P1")]
- [Description(" Create a GridLength instance. Check whether object is successfully created or not.")]
- [Property("SPEC", "Xamarin.Forms.GridLength.GridLength C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- [Property("COVPARAM", "Double")]
- public void GridLength_VALUE_CONST()
- {
- /*TEST CODE*/
- GridLength mGridLength = new GridLength(12.6);
- Assert.IsInstanceOf<GridLength>(mGridLength, "mGridLength should be an instance of GridLength");
- Assert.IsNotNull(mGridLength, "Can't successfully create a GridLength object");
- }
-
- [Test]
- [Category("P1")]
- [Description(" Create a GridLength instance. Check whether object is successfully created or not.")]
- [Property("SPEC", "Xamarin.Forms.GridLength.GridLength C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- [Property("COVPARAM", "Double, Xamarin.Forms.GridUnitType")]
- public void GridLength_VALUE_TYPE_CONST()
- {
- /*TEST CODE*/
- GridLength mGridLength = new GridLength(12.6, GridUnitType.Absolute);
- Assert.IsInstanceOf<GridLength>(mGridLength, "mGridLength should be an instance of GridLength");
- Assert.IsNotNull(mGridLength, "Can't successfully create a GridLength object");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of Auto of GridLength are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.GridLength.Auto A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void Auto_PROPERTY_GET()
- {
- /*TEST CODE*/
- GridLength mGridLength = new GridLength(12.6, GridUnitType.Auto);
- GridLength testGridLength = GridLength.Auto;
- Assert.AreEqual(mGridLength.IsAuto, testGridLength.IsAuto, "Retrieved Auto of GridLength object should be equal to the set value.");
- GridLength gridlenght = new GridLength(11.3, GridUnitType.Star);
- Assert.AreNotEqual(testGridLength.IsAuto, gridlenght.IsAuto, "Auto value of gridlenght should be not equal to auto value of testGridLength");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of Star of GridLength are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.GridLength.Star A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void Star_PROPERTY_GET()
- {
- /*TEST CODE*/
- GridLength mGridLength = new GridLength(12.6, GridUnitType.Star);
- GridLength testGridLength = GridLength.Star;
- Assert.AreEqual(mGridLength.IsStar, testGridLength.IsStar, "Retrieved IsStar of GridLength object should be equal to the set value.");
- GridLength gridlenght = new GridLength(11.3, GridUnitType.Absolute);
- Assert.AreNotEqual(testGridLength.IsStar, gridlenght.IsStar, "IsStar value of gridlenght should be not equal to IsStar value of testGridLength");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of GridUnitType of GridLength are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.GridLength.GridUnitType A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void GridUnitType_PROPERTY_GET()
- {
- /*TEST CODE*/
- GridLength mGridLength = new GridLength(12.6, GridUnitType.Star);
- Assert.AreEqual(GridUnitType.Star, mGridLength.GridUnitType, "Retrieved GridUnitType of GridLength object should be equal to the set value.");
- mGridLength = new GridLength(12.6, GridUnitType.Absolute);
- Assert.AreEqual(GridUnitType.Absolute, mGridLength.GridUnitType, "Retrieved GridUnitType of GridLength object should be equal to the set value.");
- mGridLength = new GridLength(12.6, GridUnitType.Auto);
- Assert.AreEqual(GridUnitType.Auto, mGridLength.GridUnitType, "Retrieved GridUnitType of GridLength object should be equal to the set value.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of IsAbsolute of GridLength are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.GridLength.IsAbsolute A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void IsAbsolute_PROPERTY_GET()
- {
- /*TEST CODE*/
- GridLength mGridLength = new GridLength(12.6, GridUnitType.Absolute);
- Assert.True(mGridLength.IsAbsolute, "GridUnitType of GridLength should be Absolute value");
- mGridLength = new GridLength(12.6, GridUnitType.Auto);
- Assert.False(mGridLength.IsAbsolute, "GridUnitType of GridLength should be different with Absolute value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of IsAuto of GridLength are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.GridLength.IsAuto A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void IsAuto_PROPERTY_GET()
- {
- /*TEST CODE*/
- GridLength mGridLength = new GridLength(12.6, GridUnitType.Auto);
- Assert.True(mGridLength.IsAuto, "GridUnitType of GridLength should be Auto value");
- mGridLength = new GridLength(12.6, GridUnitType.Star);
- Assert.False(mGridLength.IsAuto, "GridUnitType of GridLength should be different with Auto value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of IsStar of GridLength are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.GridLength.IsStar A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void IsStar_PROPERTY_GET()
- {
- /*TEST CODE*/
- GridLength mGridLength = new GridLength(12.6, GridUnitType.Star);
- Assert.True(mGridLength.IsStar, "GridUnitType of GridLength should be Star value");
- mGridLength = new GridLength(12.6, GridUnitType.Absolute);
- Assert.False(mGridLength.IsStar, "GridUnitType of GridLength should be different with Star value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of Value of GridLength are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.GridLength.Value A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void Value_PROPERTY_GET()
- {
- /*TEST CODE*/
- var value = 12.6;
- GridLength mGridLength = new GridLength(value, GridUnitType.Star);
- Assert.AreEqual(value, mGridLength.Value, "Retrieved Value of GridLength object should be equal to the set value.");
- value = 2.4;
- mGridLength = new GridLength(value);
- Assert.AreEqual(value, mGridLength.Value, "Retrieved Value of GridLength object should be equal to the set value.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Determine if the provided System.Object is equivalent to the current GridLength is correct or not")]
- [Property("SPEC", "Xamarin.Forms.GridLength.Equals M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void Equals_METHOD()
- {
- /*TEST CODE*/
- GridLength mGridLength1 = new GridLength(11.1, GridUnitType.Star);
- GridLength mGridLength2 = new GridLength(11.1, GridUnitType.Star);
- Assert.True(mGridLength1.Equals(mGridLength2), "mGridLength1 should be equal to mGridLength2");
- GridLength mGridLength3 = new GridLength(10.1, GridUnitType.Auto);
- Assert.False((mGridLength1.Equals(mGridLength3)), "mFont1 should be not equal to mFont3");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether a string representation of this Xamarin.Forms.GridLength structure is correct or not")]
- [Property("SPEC", "Xamarin.Forms.GridLength.ToString M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void ToString_METHOD()
- {
- /*TEST CODE*/
- GridLength mGridLength1 = new GridLength(11.1, GridUnitType.Star);
- GridLength mGridLength2 = new GridLength(11.1, GridUnitType.Star);
- Assert.AreEqual(mGridLength1.ToString(), mGridLength2.ToString(), "mGridLength1 should be equal to mGridLength2");
- GridLength mGridLength3 = new GridLength(10.1, GridUnitType.Auto);
- Assert.AreNotEqual(mGridLength1.ToString(), mGridLength3.ToString(), "mGridLength1 should be not equal to mGridLength3");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get the Hashcode for this System.Object is correct or not")]
- [Property("SPEC", "Xamarin.Forms.GridLength.GetHashCode M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void GetHashCode_METHOD()
- {
- /*TEST CODE*/
- GridLength mGridLength1 = new GridLength(11.1, GridUnitType.Star);
- GridLength mGridLength2 = new GridLength(11.1, GridUnitType.Star);
- Assert.AreEqual(mGridLength1.GetHashCode(), mGridLength2.GetHashCode(), "HashCode of mGridLength1 should be equal to HashCode of mGridLength2");
- GridLength mGridLength3 = new GridLength(10.1, GridUnitType.Auto);
- Assert.AreNotEqual(mGridLength1.GetHashCode(), mGridLength3.GetHashCode(), "HashCode of mGridLength1 should be not equal to HashCode of mGridLength3");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether cast operator to convert a double into a GridLength of type GridUnitType.Absolute is correct or not")]
- [Property("SPEC", "Xamarin.Forms.GridLength.Implicit M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void Implicit_METHOD()
- {
- /*TEST CODE*/
- var value = 23.4;
- GridLength mGridLength = new GridLength(11.1, GridUnitType.Star);
- Assert.True(mGridLength.IsStar, "GridUnitType of GridLength should be type Star");
- Assert.AreNotEqual(value, mGridLength.Value, "Retrieved Value of GridLength object should be not equal to the set value.");
- mGridLength = value;
- Assert.False(mGridLength.IsStar, "GridUnitType of GridLength should be different with type Star");
- Assert.True(mGridLength.IsAbsolute, "GridUnitType of GridLength should be type Absolute");
- Assert.AreEqual(value, mGridLength.Value, "Retrieved Value of GridLength object should be equal to the set value.");
- }
- }
-}
+++ /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 XamarinForTizen.Tizen;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class GridLengthTypeConverterTests
- {
- private GridLengthTypeConverter _gridLengthTypeConverter;
- private string _appResourcePath = Program.Current.DirectoryInfo.Resource;
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("GridLengthTypeConverterTests --------------- SetUp()");
- _gridLengthTypeConverter = new GridLengthTypeConverter();
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("GridLengthTypeConverterTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a GridLengthTypeConverter instance. Check whether object is successfully created or not")]
- [Property("SPEC", "Xamarin.Forms.GridLengthTypeConverter.GridLengthTypeConverter C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void GridLengthTypeConverter_INIT()
- {
- /* TEST CODE */
- var gridLengthTypeConverter = new GridLengthTypeConverter();
- Assert.IsNotNull(gridLengthTypeConverter, "Creating a GridLengthTypeConverter object failed. It is set to null");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ConvertFromInvariantString is corrected or not")]
- [Property("SPEC", "Xamarin.Forms.GridLengthTypeConverter.ConvertFromInvariantString A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void ConvertFromInvariantString_CHECK()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- Assert.IsNotNull(_gridLengthTypeConverter, "Creating a GridLengthTypeConverter object failed. It is set to null");
-
- /* TEST CODE */
- var gridLength = new GridLength(0.3, GridUnitType.Auto);
- var getStringValue = gridLength.Value.ToString();
- var getConvertFromInvariantString =(GridLength) _gridLengthTypeConverter.ConvertFromInvariantString(getStringValue);
- Assert.AreEqual(gridLength.Value, getConvertFromInvariantString.Value, "ConvertFromInvariantString doesn't return correct");
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.HandlerAttribute test")]
- public class HandlerAttributeTests
- {
- class MockHandlerAttribute : HandlerAttribute
- {
- public MockHandlerAttribute(Type handler, Type target) : base(handler, target)
- {
- }
- }
-
- [SetUp]
- public void Setup()
- {
- Console.WriteLine("HandlerAttributeTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("HandlerAttributeTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create an HandlerAttribute object.")]
- [Property("SPEC", "Xamarin.Forms.HandlerAttribute.HandlerAttribute C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void HandlerAttribute_INIT()
- {
- /* TEST CODE */
- HandlerAttribute handlerAttribute = new MockHandlerAttribute(typeof(String), typeof(Label));
- Assert.IsNotNull(handlerAttribute, "HandlerAttribute Instance is null");
- Assert.IsInstanceOf<HandlerAttribute>(handlerAttribute, "Should be an instance of HandlerAttribute type.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether return true or not when runtime should automatically register handler.")]
- [Property("SPEC", "Xamarin.Forms.HandlerAttribute.ShouldRegister M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void ShouldRegister_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- HandlerAttribute handlerAttribute = new MockHandlerAttribute(typeof(String), typeof(Label));
- Assert.IsTrue(handlerAttribute.ShouldRegister(), "Expected true but returned false.");
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.HtmlWebViewSource test")]
- public class HtmlWebViewSourceTests
- {
- [SetUp]
- public void Setup()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "HtmlWebViewSource CLASS: Setup---------------------------------");
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "HtmlWebViewSource CLASS: Teardown------------------------------");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether HtmlWebViewSource object is created or not")]
- [Property("SPEC", "Xamarin.Forms.HtmlWebViewSource.HtmlWebViewSource C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void HtmlWebViewSource_INIT()
- {
- /* TEST CODE */
- HtmlWebViewSource mHtmlWebViewSource = new HtmlWebViewSource();
- Assert.IsNotNull(mHtmlWebViewSource, "Object should be not null after initializing");
- Assert.IsInstanceOf<HtmlWebViewSource>(mHtmlWebViewSource, "Object should be HtmlWebViewSource");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of BaseUrlProperty's bound or not.")]
- [Property("SPEC", "Xamarin.Forms.HtmlWebViewSource.BaseUrlProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void BaseUrlProperty_CHECK_BINDABLE()
- {
- /* TEST CODE */
- HtmlWebViewSource firstHtmlWebViewSource = new HtmlWebViewSource();
- HtmlWebViewSource secondHtmlWebViewSource = new HtmlWebViewSource();
-
- firstHtmlWebViewSource.BaseUrl = "https://www.samsung.net";
- secondHtmlWebViewSource.BaseUrl = "https://www.google.com";
-
- Assert.AreNotEqual(firstHtmlWebViewSource.BaseUrl, secondHtmlWebViewSource.BaseUrl, "BaseUrl value must be different before binding.");
- firstHtmlWebViewSource.BindingContext = secondHtmlWebViewSource;
- firstHtmlWebViewSource.SetBinding(HtmlWebViewSource.BaseUrlProperty, "BaseUrl");
- Assert.AreEqual(firstHtmlWebViewSource.BaseUrl, secondHtmlWebViewSource.BaseUrl, "After binding, BaseUrl values should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of HtmlProperty's bound or not.")]
- [Property("SPEC", "Xamarin.Forms.HtmlWebViewSource.HtmlProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void HtmlProperty_CHECK_BINDABLE()
- {
- /* TEST CODE */
- HtmlWebViewSource firstHtmlWebViewSource = new HtmlWebViewSource();
- HtmlWebViewSource secondHtmlWebViewSource = new HtmlWebViewSource();
-
- firstHtmlWebViewSource.Html = "Heading";
- secondHtmlWebViewSource.Html = "Paragraph";
-
- Assert.AreNotEqual(firstHtmlWebViewSource.Html, secondHtmlWebViewSource.Html, "Html value must be different before binding.");
- firstHtmlWebViewSource.BindingContext = secondHtmlWebViewSource;
- firstHtmlWebViewSource.SetBinding(HtmlWebViewSource.HtmlProperty, "Html");
- Assert.AreEqual(firstHtmlWebViewSource.Html, secondHtmlWebViewSource.Html, "After binding, Html values should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of BaseUrl can be readable and writeable or not.")]
- [Property("SPEC", "Xamarin.Forms.HtmlWebViewSource.BaseUrl A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void BaseUrl_SET_GET()
- {
- /* TEST CODE */
- HtmlWebViewSource mHtmlWebViewSource = new HtmlWebViewSource();
- string mBaseUrl = "https://www.samsung.net";
- mHtmlWebViewSource.BaseUrl = mBaseUrl;
- Assert.AreEqual(mBaseUrl, mHtmlWebViewSource.BaseUrl, "BaseUrl values should be equal value which was set.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of Html can be readable and writeable or not.")]
- [Property("SPEC", "Xamarin.Forms.HtmlWebViewSource.Html A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void Html_SET_GET()
- {
- /* TEST CODE */
- HtmlWebViewSource mHtmlWebViewSource = new HtmlWebViewSource();
- string mHtml = "Heading";
- mHtmlWebViewSource.Html = mHtml;
- Assert.AreEqual(mHtml, mHtmlWebViewSource.Html, "Html values should be equal value which was 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 NUnit.Framework;
-using System;
-using Xamarin.Forms;
-using XamarinForTizen.Tizen;
-
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class ImageTests
- {
- private Image _image;
- private string _appResourcePath = Program.Current.DirectoryInfo.Resource;
- private static bool _flagOnSizeRequest, _flagOnBindingContextChanged;
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("ImageTests --------------- SetUp()");
- _image = new Image();
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("ImageTests --------------- TearDown()");
- }
-
- public class SubImage: Image
- {
- protected override void OnBindingContextChanged()
- {
- _flagOnBindingContextChanged = true;
- base.OnBindingContextChanged();
- }
- protected override SizeRequest OnSizeRequest(double widthConstraint, double heightConstraint)
- {
- _flagOnSizeRequest = true;
- return base.OnSizeRequest(widthConstraint, heightConstraint);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a Image instance. Check whether object is successfully created or not")]
- [Property("SPEC", "Xamarin.Forms.Image.Image C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void Image_INIT()
- {
- /* TEST CODE */
- var image = new Image();
- Assert.IsNotNull(image, "Creating a Image object failed. It is set to null");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Aspect is readable and settable with valid values")]
- [Property("SPEC", "Xamarin.Forms.Image.Aspect A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void Aspect_PROPERTY_SET_GET()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- Assert.IsNotNull(_image, "Image object is not created successfully. It is set to null");
-
- /* TEST CODE */
- _image.Aspect = Aspect.AspectFit;
- Assert.AreEqual(Aspect.AspectFit.ToString(), _image.Aspect.ToString(), "Set and get value of Aspect.AspectFit is not successful");
- _image.Aspect = Aspect.AspectFill;
- Assert.AreEqual(Aspect.AspectFill.ToString(), _image.Aspect.ToString(), "Set and get value of Aspect.AspectFill is not successful");
- _image.Aspect = Aspect.Fill;
- Assert.AreEqual(Aspect.Fill.ToString(), _image.Aspect.ToString(), "Set and get value of Aspect.Fill is not successful");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property IsLoading is readable.")]
- [Property("SPEC", "Xamarin.Forms.Image.IsLoading A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nhu Anh, anh.vn@samsung.com")]
- public void IsLoading_PROPERTY_GET()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- Uri uri = new Uri("http://eoimages.gsfc.nasa.gov/images/imagerecords/57000/57723/globe_west_2048.jpg");
- var image = new Image
- {
- Source = ImageSource.FromUri(uri),
- WidthRequest = 200,
- HeightRequest = 200,
- };
- Assert.False(image.IsLoading, "IsLoading should be fail");
-
- var indicator = new ActivityIndicator { Color = new Color(.5), };
- indicator.SetBinding(ActivityIndicator.IsRunningProperty, "IsLoading");
- indicator.BindingContext = image;
-
- Program.getApp().MainPage = new ContentPage()
- {
- Content = image
- };
- Assert.True(image.IsLoading, "IsLoading should be True");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property IsOpaque is readable and settable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.Image.IsOpaque A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Nhu Anh, anh.vn@samsung.com")]
- public void IsOpaque_PROPERTY_SET_GET()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- Assert.IsNotNull(_image, "Image object is not created successfully. It is set to null");
-
- /* TEST CODE */
- _image.IsOpaque = true;
- Assert.IsTrue(_image.IsOpaque, "Set and get value True of IsOpaque is not correct");
- _image.IsOpaque = false;
- Assert.IsFalse(_image.IsOpaque, "Set and get value False of IsOpaque is not correct");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Source is readable and settable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.Image.Source A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Nhu Anh, anh.vn@samsung.com")]
- public void Source_PROPERTY_SET_GET()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- Assert.IsNotNull(_image, "Image object is not created successfully. It is set to null");
-
- /* TEST CODE */
- var pathImage = _appResourcePath + "TED/thumbnail/a.jpg";
- _image.Source = ImageSource.FromFile(pathImage);
- var getFileImageSource = (FileImageSource)_image.Source;
- Assert.AreEqual(pathImage, getFileImageSource.File, "Set and get value of Source is not correct");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether AspectProperty(BindableProperty) is working correctly or not.")]
- [Property("SPEC", "Xamarin.Forms.Image.AspectProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void AspectProperty_PROPERTY()
- {
- /* TEST CODE */
- var image1 = new Image();
- image1.Aspect = Aspect.AspectFit;
- var image2 = new Image()
- {
- Aspect = Aspect.Fill,
- };
- Assert.AreNotEqual(image1.Aspect.ToString(), image2.Aspect.ToString(), "Aspect should be different between two Image objects");
- image1.BindingContext = image2;
- image1.SetBinding(Image.AspectProperty, "Aspect");
- Assert.AreEqual(image1.Aspect.ToString(), image2.Aspect.ToString(), "Aspect should be same between two Image objects");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether IsLoadingProperty(BindableProperty) is working correctly or not.")]
- [Property("SPEC", "Xamarin.Forms.Image.IsLoadingProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void IsLoadingProperty_PROPERTY()
- {
- /* TEST CODE */
- Assert.AreEqual("IsLoading", Image.IsLoadingProperty.PropertyName, "Name of IsLoadingProperty should be IsLoading");
- // Assert.True(false, "[NA] Need to check API behavior");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether IsOpaqueProperty(BindableProperty) is working correctly or not.")]
- [Property("SPEC", "Xamarin.Forms.Image.IsOpaqueProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void IsOpaqueProperty_PROPERTY()
- {
- /* TEST CODE */
- var image1 = new Image();
- image1.IsOpaque = false;
- var image2 = new Image()
- {
- IsOpaque = true,
- };
- Assert.AreNotEqual(image1.IsOpaque, image2.IsOpaque, "IsOpaque should be different between two Image objects");
- image1.BindingContext = image2;
- image1.SetBinding(Image.IsOpaqueProperty, "IsOpaque");
- Assert.AreEqual(image1.IsOpaque, image2.IsOpaque, "IsOpaque should be same between two Image objects");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether SourceProperty(BindableProperty) is working correctly or not.")]
- [Property("SPEC", "Xamarin.Forms.Image.SourceProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void SourceProperty_PROPERTY()
- {
- /* TEST CODE */
- var image1 = new Image();
- var pathImage1 = _appResourcePath + "TED/thumbnail/a.jpg";
- image1.Source = ImageSource.FromFile(pathImage1);
- var getFileImageSource1 = (FileImageSource)image1.Source;
- var pathImage2 = _appResourcePath + "TED/thumbnail/b.jpg";
- var image2 = new Image()
- {
- Source = ImageSource.FromFile(pathImage2),
- };
- var getFileImageSource2 = (FileImageSource)image2.Source;
- Assert.AreNotEqual(getFileImageSource1.File, getFileImageSource2.File, "Source should be different between two Image objects");
- image1.BindingContext = image2;
- image1.SetBinding(Image.SourceProperty, "Source");
- getFileImageSource1 = (FileImageSource)image1.Source;
- getFileImageSource2 = (FileImageSource)image2.Source;
- Assert.AreEqual(getFileImageSource1.File, getFileImageSource2.File, "Source should be same between two Image objects");
- }
-
- [Test]
- [Category("P1")]
- [Description("Invoke OnBindingContextChanged method, and check whether value of _flagOnBindingContextChanged is changed to true.")]
- [Property("SPEC", "Xamarin.Forms.Image.OnBindingContextChanged M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Nhu Anh, anh.vn@samsung.com")]
- public void OnBindingContextChanged_CHECK()
- {
- /* TEST CODE */
- var subImage = new SubImage();
- _flagOnBindingContextChanged = false;
- Assert.IsFalse(_flagOnBindingContextChanged, "The first Flag OnBindingContextChanged should be False");
- var bindingTest = "Test";
- subImage.BindingContext = bindingTest;
- Assert.IsTrue(_flagOnBindingContextChanged, "Flag OnBindingContextChanged should be True after BindingContext is changed");
- }
-
- [Test]
- [Category("P1")]
- [Description("Invoke OnSizeRequest method, and check whether value of _flagOnSizeRequest is changed to true.")]
- [Property("SPEC", "Xamarin.Forms.Image.OnSizeRequest M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Nhu Anh, anh.vn@samsung.com")]
- public void OnSizeRequest_CHECK()
- {
- /* TEST CODE */
- var subImage = new SubImage();
- _flagOnSizeRequest = false;
- Assert.IsFalse(_flagOnSizeRequest, "The first Flag OnSizeRequest should be False");
- subImage.Measure(50, 100, MeasureFlags.None);
- Assert.IsTrue(_flagOnSizeRequest, "Flag OnSizeRequest should be True after Measure is changed");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether On<IConfigPlatform> is readable correct or not")]
- [Property("SPEC", "Xamarin.Forms.Image.On<T> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void On_CONFIGURATION_METHOD()
- {
- /* TEST CODE */
- var pathImage = _appResourcePath + "TED/thumbnail/a.jpg";
- var image = new Image()
- {
- IsOpaque = true,
- Aspect = Aspect.AspectFit,
- Source = ImageSource.FromFile(pathImage),
- };
- var myConfig = image.On<IConfigPlatform>();
- Assert.IsInstanceOf<IPlatformElementConfiguration<IConfigPlatform, Image>>(myConfig, "myConfig should be a instance of IPlatformElementConfiguration");
- var getImage = myConfig.Element;
- Assert.IsInstanceOf<Image>(getImage, "myConfig.Element should be a instance of Frame");
- Assert.AreEqual(image.IsOpaque, getImage.IsOpaque, "Get IsOpaque value of Image is not correct");
- Assert.AreEqual(image.Aspect, getImage.Aspect, "Get Aspect value of Image is not correct");
- Assert.AreEqual(image.Source, getImage.Source, "Get Source value of Image is not correct");
- }
- }
-}
+++ /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 XamarinForTizen.Tizen;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class ImageCellTests
- {
- private ImageCell _imageCell;
- private string _appResourcePath = Program.Current.DirectoryInfo.Resource;
- private static bool _flagOnBindingContextChanged;
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("ImageCellTests --------------- SetUp()");
- _imageCell = new ImageCell();
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("ImageCellTests --------------- TearDown()");
- }
-
- public class SubImageCell : ImageCell
- {
- protected override void OnBindingContextChanged()
- {
- _flagOnBindingContextChanged = true;
- base.OnBindingContextChanged();
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a ImageCell instance. Check whether object is successfully created or not")]
- [Property("SPEC", "Xamarin.Forms.ImageCell.ImageCell C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void ImageCell_INIT()
- {
- /* TEST CODE */
- var imageCell = new ImageCell();
- Assert.IsNotNull(imageCell, "Creating a ImageCell object failed. It is set to null");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property ImageSource is readable and settable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.ImageCell.ImageSource A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Nhu Anh, anh.vn@samsung.com")]
- public void ImageSource_PROPERTY_SET_GET()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- Assert.IsNotNull(_imageCell, "ImageCell object is not created successfully. It is set to null");
-
- /* TEST CODE */
- var pathImage = _appResourcePath + "TED/thumbnail/a.jpg";
- _imageCell.ImageSource = ImageSource.FromFile(pathImage);
- var getFileImageSource = (FileImageSource)_imageCell.ImageSource;
- Assert.AreEqual(pathImage, getFileImageSource.File, "Set and get value of ImageSource is not correct");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ImageSourceProperty(BindableProperty) is working correctly or not.")]
- [Property("SPEC", "Xamarin.Forms.ImageCell.ImageSourceProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void ImageSourceProperty_PROPERTY()
- {
- /* TEST CODE */
- var imageCell1 = new ImageCell();
- var pathImage1 = _appResourcePath + "TED/thumbnail/a.jpg";
- imageCell1.ImageSource = ImageSource.FromFile(pathImage1);
- var getFileImageSource1 = (FileImageSource)imageCell1.ImageSource;
- var pathImage2 = _appResourcePath + "TED/thumbnail/b.jpg";
- var imageCell2 = new ImageCell()
- {
- ImageSource = ImageSource.FromFile(pathImage2),
- };
- var getFileImageSource2 = (FileImageSource)imageCell2.ImageSource;
- Assert.AreNotEqual(getFileImageSource1.File, getFileImageSource2.File, "ImageSource should be different between two ImageCell objects");
- imageCell1.BindingContext = imageCell2;
- imageCell1.SetBinding(ImageCell.ImageSourceProperty, "ImageSource");
- getFileImageSource1 = (FileImageSource)imageCell1.ImageSource;
- getFileImageSource2 = (FileImageSource)imageCell2.ImageSource;
- Assert.AreEqual(getFileImageSource1.File, getFileImageSource2.File, "ImageSource should be same between two ImageCell objects");
- }
-
- [Test]
- [Category("P1")]
- [Description("Invoke OnBindingContextChanged method, and check whether value of _flagOnBindingContextChanged is changed to true.")]
- [Property("SPEC", "Xamarin.Forms.ImageCell.OnBindingContextChanged M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Nhu Anh, anh.vn@samsung.com")]
- public void OnBindingContextChanged_CHECK()
- {
- /* TEST CODE */
- var subImageCell = new SubImageCell();
- _flagOnBindingContextChanged = false;
- Assert.IsFalse(_flagOnBindingContextChanged, "The first Flag OnBindingContextChanged should be False");
- var pathImage1 = _appResourcePath + "TED/thumbnail/a.jpg";
- var imageCell = new ImageCell()
- {
- ImageSource = ImageSource.FromFile(_appResourcePath),
- };
- subImageCell.BindingContext = imageCell;
- Assert.IsTrue(_flagOnBindingContextChanged, "Flag OnBindingContextChanged should be True after BindingContext is changed");
- }
- }
-}
+++ /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.IO;
-using System.Reflection;
-using System.Threading;
-using System.Threading.Tasks;
-using Xamarin.Forms;
-using XamarinForTizen.Tizen;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class ImageSourceTests
- {
- private ImageSource _imageSource;
- private string _appResourcePath = Program.Current.DirectoryInfo.Resource;
- private static bool _flagOnLoadingStarted, _flagOnLoadingCompleted, _flagOnSourceChanged;
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("ImageSourceTests --------------- SetUp()");
- _imageSource = new FileImageSource();
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("ImageSourceTests --------------- TearDown()");
- }
-
- public class SubImageSource : ImageSource
- {
- public new CancellationTokenSource CancellationTokenSource { get; }
-
- protected new void OnLoadingStarted()
- {
- _flagOnLoadingStarted = true;
- base.OnLoadingStarted();
- }
-
- protected new void OnLoadingCompleted(bool cancelled)
- {
- _flagOnLoadingCompleted = true;
- base.OnLoadingCompleted(cancelled);
- }
-
- protected new void OnSourceChanged()
- {
- _flagOnSourceChanged = true;
- base.OnSourceChanged();
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a FileImageSource instance. Check whether object is successfully created or not")]
- [Property("SPEC", "Xamarin.Forms.ImageSource.ImageSource C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void ImageSource_INIT()
- {
- /* TEST CODE */
- var imageSource = new FileImageSource();
- Assert.IsNotNull(imageSource, "Creating a FileImageSource object failed. It is set to null");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether FromFile is correct or not")]
- [Property("SPEC", "Xamarin.Forms.ImageSource.FromFile M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nhu Anh, anh.vn@samsung.com")]
- public void FromFile_CHECK()
- {
- /* TEST CODE */
- var pathImage = _appResourcePath + "TED/thumbnail/a.jpg";
- var fileImageSource = (FileImageSource)ImageSource.FromFile(pathImage);
- var pathFile = fileImageSource.File;
- Assert.AreEqual(pathImage, pathFile, "Check FromFile is not correct");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether FromResource is correct or not")]
- [Property("SPEC", "Xamarin.Forms.ImageSource.FromResource M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nhu Anh, anh.vn@samsung.com")]
- [Property("COVPARAM", "string, System.Type")]
- public void FromResource_CHECK_RESOURCE_TYPE()
- {
- /* TEST CODE */
- var strSource = _appResourcePath + "TED/thumbnail/b.jpg";
- var getResourceType = ImageSource.FromResource(strSource, typeof(Type));
- Console.WriteLine("TUnit=====================getResource1:" + getResourceType);
- Assert.IsInstanceOf<StreamImageSource>(getResourceType);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether FromResource is correct or not")]
- [Property("SPEC", "Xamarin.Forms.ImageSource.FromResource M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nhu Anh, anh.vn@samsung.com")]
- [Property("COVPARAM", "string, System.Reflection.Assembly")]
- public void FromResource_CHECK_RESOURCE_ASSEMBLY()
- {
- /* TEST CODE */
- var strSource = _appResourcePath + "TED/thumbnail/b.jpg";
- var getResourceAssembly = ImageSource.FromResource(strSource, Assembly.GetEntryAssembly());
- Console.WriteLine("TUnit=====================getResourceAssembly:" + getResourceAssembly);
- Assert.IsNotNull(getResourceAssembly, "Object should be not null");
- Assert.IsInstanceOf<StreamImageSource>(getResourceAssembly);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ImageSource can be created from the specified resource in the specified Stream source")]
- [Property("SPEC", "Xamarin.Forms.ImageSource.FromStream M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nhu Anh, anh.vn@samsung.com")]
- public void FromStream_FUNC_TYPE()
- {
- /* TEST CODE */
- var strSource = _appResourcePath + "TED/thumbnail/a.jpg";
- var stream = new FileStream(strSource, FileMode.Open, FileAccess.Read, FileShare.Read);
- Func<Stream> methodCall = delegate ()
- {
- return stream;
- };
- var getStream = ImageSource.FromStream(methodCall);
- Console.WriteLine("TUnit=====================getStream:" + getStream);
- stream.Close();
-
- Assert.IsNotNull(getStream, "Object should be not null");
- Assert.IsInstanceOf<StreamImageSource>(getStream);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ImageSource can read file from a uri path")]
- [Property("SPEC", "Xamarin.Forms.ImageSource.FromUri M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nhu Anh, anh.vn@samsung.com")]
- public void FromUri_READ_FILE()
- {
- /* TEST CODE */
- var source = "foo://example.com:8042/over/there?name=ferret#nose";
- var uri = new Uri(source);
- var getUriImageSource = (UriImageSource)ImageSource.FromUri(uri);
- Assert.IsNotNull(getUriImageSource, "Object should be not null");
- Assert.AreEqual(source, getUriImageSource.Uri.ToString(), "Returns a new UriImageSource is failed");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check Cancel the ImageSource loading")]
- [Property("SPEC", "Xamarin.Forms.ImageSource.Cancel M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void Cancel_CHECK()
- {
- /* TEST CODE */
- var strSource = _appResourcePath + "TED/thumbnail/a.jpg";
- //instance a ImageCell object to trigger the load of image resource
- var imageCell = new ImageCell
- {
- ImageSource = ImageSource.FromFile(strSource),
- Text = "This is an ImageCell",
- };
- try
- {
- var imageSource = imageCell.ImageSource;
- imageSource.Cancel();
- Assert.IsTrue(true, "Fail to cancel the image of loading");
- }
- catch (Exception e)
- {
- Assert.IsTrue(false, e.Message);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Implicit operator to convert string type to ImageSource")]
- [Property("SPEC", "Xamarin.Forms.ImageSource.Implicit M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- [Property("COVPARAM", "string")]
- public void Implicit_STRING_TO_IMAGESOURCE()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- var imageSource = new FileImageSource();
- Assert.IsNotNull(imageSource, "Creating a FileImageSource object failed. It is set to null.");
-
- /* TEST CODE */
- var strSource = _appResourcePath + "TED/thumbnail/a.jpg";
- imageSource = strSource;
- Assert.AreEqual(strSource, imageSource.File, "Can't setup implicit method");
- }
-
- [Test]
- [Category("P1")]
- [Description("Implicit operator to convert Uri type to ImageSource")]
- [Property("SPEC", "Xamarin.Forms.ImageSource.Implicit M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- [Property("COVPARAM", "System.Uri")]
- public void Implicit_URI_TO_IMAGESOURCE()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- var imageSource = ImageSource.FromFile("test");
- Assert.IsNotNull(imageSource, "Creating a ImageSource object failed. It is set to null.");
- /* TEST CODE */
- var source = "foo://example.com:8042/over/there?name=ferret#nose";
- var uri = new Uri(source);
- imageSource = (Uri)uri;
- Assert.AreEqual(uri, ((UriImageSource)imageSource).Uri, "Can't setup implicit method");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class ImageSourceConverterTest
- {
- [SetUp]
- public void setUp()
- {
- Console.WriteLine("ImageSourceConverterTest --------------- Setup()");
- }
-
- [TearDown]
- public void tearDown()
- {
- Console.WriteLine("ImageSourceConverterTest --------------- TearDown()");
- }
-
- [Test]
- [Category("P0")]
- [Description("Create a ImageSourceConverter Instance")]
- [Property("SPEC", "Xamarin.Forms.ImageSourceConverter.ImageSourceConverter C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void ImageSourceConverter_INIT()
- {
- /* TEST CODE */
- var imgSrcConvert = new ImageSourceConverter();
- Assert.IsNotNull(imgSrcConvert, "Object is null after initialize");
- Assert.IsInstanceOf<ImageSourceConverter>(imgSrcConvert);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether method ConvertFromInvariantString returns a image source object for given URI.")]
- [Property("SPEC", "Xamarin.Forms.ImageSourceConverter.ConvertFromInvariantString M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void ConvertFromInvariantString_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- ImageSourceConverter imageSourceConverter = new ImageSourceConverter();
- var imgSrcObject = imageSourceConverter.ConvertFromInvariantString("http://static.campaign.naver.com/0/hangeul/2011/img/img_family.gif");
- Assert.IsInstanceOf<ImageSource>(imgSrcObject, "Should be instance of image source.");
- Assert.IsNotNull(imgSrcObject, "Should be created object.");
- }
- }
-}
+++ /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 Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class InputViewTests
- {
- private InputView _inputView;
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("InputViewTests --------------- SetUp()");
- _inputView = (InputView)Activator.CreateInstance(typeof(InputView), true);
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("InputViewTests --------------- TearDown()");
- }
-
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Keyboard is readable and settable with valid values")]
- [Property("SPEC", "Xamarin.Forms.InputView.Keyboard A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void Keyboard_PROPERTY_SET_GET()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- Assert.IsNotNull(_inputView, "Creating a InputView object failed. It is set to null");
-
- /* TEST CODE */
- _inputView.Keyboard = Keyboard.Telephone;
- var getKeyboard = _inputView.Keyboard;
- Assert.AreEqual(Keyboard.Telephone, getKeyboard, "Set and get value of Keyboard is not successful");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property KeyboardProperty is readable")]
- [Property("SPEC", "Xamarin.Forms.InputView.KeyboardProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void KeyboardProperty_PROPERTY()
- {
- /* TEST CODE */
- var inputView1 = (InputView)Activator.CreateInstance(typeof(InputView), true);
- inputView1.Keyboard = Keyboard.Email;
- var inputView2 = (InputView)Activator.CreateInstance(typeof(InputView), true);
- inputView2.Keyboard = Keyboard.Numeric;
- Assert.AreNotEqual(inputView1.Keyboard, inputView2.Keyboard, "Keyboard should be different between two InputView objects");
- inputView1.BindingContext = inputView2;
- inputView1.SetBinding(InputView.KeyboardProperty, "Keyboard");
- Assert.AreEqual(inputView1.Keyboard, inputView2.Keyboard, "Keyboard should be same between two InputView objects");
- }
- }
-}
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns="http://tizen.org/ns/packages" api-version="6" package="Tizen.XamarinForms3.Tests" version="1.0.0">
- <profile name="common" />
- <ui-application appid="Tizen.XamarinForms3.Tests"
- exec="Tizen.XamarinForms3.Tests.dll"
- type="dotnet"
- multiple="false"
- taskmanage="true"
- launch_mode="single">
- <icon>Tizen.XamarinForms3.Tests.png</icon>
- <label>Tizen.XamarinForms3.Tests</label>
- </ui-application>
- <privileges>
- <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
- </privileges>
-</manifest>
+++ /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;
-using Xamarin.Forms;\r
-\r
-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()\r
- {\r
- return _app;\r
- }\r
- public static NavigationPage getNaviPage()\r
- {\r
- if (App.NaviPage == null)\r
- {\r
-\r
- App.NaviPage = new NavigationPage(new ContentPage\r
- {\r
- Content = new StackLayout\r
- {\r
- VerticalOptions = LayoutOptions.Center,\r
- Children = {\r
- new Label {\r
- HorizontalTextAlignment = TextAlignment.Center,\r
- Text = "Welcome to Xamarin Forms!"\r
- }\r
- }\r
- }\r
- });\r
- }\r
- return App.NaviPage;\r
- }
- static void Main(string[] args)
- {
- Console.WriteLine("TCT : Main()");
- var app = new Program();
- global::Xamarin.Forms.Platform.Tizen.Forms.Init(app);
- app.Run(args);
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-<Project Sdk="Microsoft.NET.Sdk">
-
- <!-- Property Group for .NET Core Project -->
- <PropertyGroup>
- <OutputType>Exe</OutputType>
- <TargetFramework>tizen60</TargetFramework>
- </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>
- <PackageReference Include="Tizen.NET.Sdk" Version="$(TizenNETSdkVersion)" />
- </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.XamarinForms4.Tests", "Tizen.XamarinForms4.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 System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Xamarin.Forms;
-using Xamarin.Forms.Platform.Tizen;
-using XamarinForTizen.Tizen.common;
-
-[assembly: ResolutionGroupName("Samsung")]
-[assembly: ExportEffect(typeof(MockEffect), "MockEffect")]
-namespace XamarinForTizen.Tizen.common
-{
- class MockEffect : PlatformEffect
- {
-
- protected override void OnAttached()
- {
- Container.Color = ElmSharp.Color.Red;
- }
-
- protected override void OnDetached()
- {
-
- }
- }
-}
\ 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 Xamarin.Forms;
-using NUnit.Framework;
-using System.Collections.Generic;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class ItemTappedEventArgsTests
- {
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("ItemTappedEventArgsTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("ItemTappedEventArgsTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create an instance of ItemTappedEventArgs.")]
- [Property("SPEC", "Xamarin.Forms.ItemTappedEventArgs.ItemTappedEventArgs C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void ItemTappedEventArgs_INIT()
- {
- /* TEST CODE */
- var group = new StackLayout();
- var item = new ScrollView();
- var itemTappedEventArgs = new ItemTappedEventArgs(group, item);
- Assert.IsNotNull(itemTappedEventArgs, "Object is null after initialize");
- Assert.IsInstanceOf<ItemTappedEventArgs>(itemTappedEventArgs, "itemTappedEventArgs is not instance of ItemTappedEventArgs.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Group is readable.")]
- [Property("SPEC", "Xamarin.Forms.ItemTappedEventArgs.Group A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Group_READ_ONLY()
- {
- /* TEST CODE */
- var group1 = new StackLayout();
- var item1 = new ScrollView();
- var itemTappedEventArgs1 = new ItemTappedEventArgs(group1, item1);
- Assert.IsNotNull(itemTappedEventArgs1, "Object is null after initialize");
- Assert.IsInstanceOf<ItemTappedEventArgs>(itemTappedEventArgs1, "itemTappedEventArgs is not instance of ItemTappedEventArgs.");
- Assert.IsInstanceOf<StackLayout>(itemTappedEventArgs1.Group, "Group is not instance of StackLayout.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Item is readable.")]
- [Property("SPEC", "Xamarin.Forms.ItemTappedEventArgs.Item A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Item_READ_ONLY()
- {
- /* TEST CODE */
- var group2 = new StackLayout();
- var item2 = new ScrollView();
- var itemTappedEventArgs2 = new ItemTappedEventArgs(group2, item2);
- Assert.IsNotNull(itemTappedEventArgs2, "Object is null after initialize");
- Assert.IsInstanceOf<ItemTappedEventArgs>(itemTappedEventArgs2, "itemTappedEventArgs2 is not instance of ItemTappedEventArgs.");
- Assert.IsInstanceOf<ScrollView>(itemTappedEventArgs2.Item, "Item is not instance of ScrollView.");
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.ItemVisibilityEventArgs Tests")]
- class ItemVisibilityEventArgsTests
- {
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("TSItemVisibilityEventArgs --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("TSItemVisibilityEventArgs --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create an ItemVisibilityEventArgs object")]
- [Property("SPEC", "Xamarin.Forms.ItemVisibilityEventArgs.ItemVisibilityEventArgs C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void ItemVisibilityEventArgs_INIT()
- {
- /* TEST CODE */
- var item = new ScrollView();
- var itemVisibilityEventArgs = new ItemVisibilityEventArgs(item);
- Assert.IsNotNull(itemVisibilityEventArgs, "Object is null after initialize");
- Assert.IsInstanceOf<ItemVisibilityEventArgs>(itemVisibilityEventArgs, "itemVisibilityEventArgs is not instance of ItemVisibilityEventArgs.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Item property Read Only or not")]
- [Property("SPEC", "Xamarin.Forms.ItemVisibilityEventArgs.Item A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void Item_READ_ONLY()
- {
- /* TEST CODE */
- var item = new ScrollView();
- var itemVisibilityEventArgs = new ItemVisibilityEventArgs(item);
- Assert.IsNotNull(itemVisibilityEventArgs, "Object is null after initialize");
- Assert.IsInstanceOf<ScrollView>(itemVisibilityEventArgs.Item, "Item is not instance of ScrollView.");
- }
- }
-}
+++ /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 NUnit.Framework;
-using NUnit.Framework.TUnit;
-using XamarinForTizen;
-using XamarinForTizen.Tizen;
-using System.Threading.Tasks;
-using AutoTemplate;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.ItemsView<TVisual> test")]
- public class ItemsViewTemplateTests : ListView
- {
- private static App _app = Program.getApp();
- private static bool _flagCreateDefault, _flagSetupContent, _flagUnhookContent;
- protected override Cell CreateDefault(object item)
- {
- _flagCreateDefault = true;
- return base.CreateDefault(item);
- }
- protected override void SetupContent(Cell content, int index)
- {
- _flagSetupContent = true;
- base.SetupContent(content, index);
- }
-
- protected override void UnhookContent(Cell content)
- {
- _flagUnhookContent = true;
- base.UnhookContent(content);
- }
-
- private void ItemSelectedEvent(object sender, SelectedItemChangedEventArgs e)
- {
- TLogger.Write("ItemsViewTemplateTests.ItemSelectedEvent");
- }
-
- [SetUp]
- public void Setup()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "ItemsViewTemplate CLASS: Setup---------------------------------");
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "ItemsViewTemplate CLASS: Teardown------------------------------");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of ItemTemplateProperty's bound or not.")]
- [Property("SPEC", "Xamarin.Forms.ItemsView<TVisual>.ItemTemplateProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void ItemTemplateProperty_CHECK_BINDABLE()
- {
- /* TEST CODE */
- ListView firstListView = new ListView();
- ListView secondListView = new ListView();
- var mFirstItemTemplate = new DataTemplate(typeof(Label))
- {
- Bindings = {
- { Label.TextProperty, new Binding (".") }
- }
- };
- var mSecondItemTemplate = new DataTemplate(typeof(Button))
- {
- Bindings = {
- { Button.TextProperty, new Binding (".") }
- }
- };
-
- firstListView.ItemTemplate = mFirstItemTemplate;
- secondListView.ItemTemplate = mSecondItemTemplate;
-
- Assert.AreNotEqual(firstListView.ItemTemplate, secondListView.ItemTemplate, "ItemTemplate value must be different before binding.");
- firstListView.BindingContext = secondListView;
- firstListView.SetBinding(ItemsView<Cell>.ItemTemplateProperty, "ItemTemplate");
- Assert.AreEqual(firstListView.ItemTemplate, secondListView.ItemTemplate, "After binding, ItemTemplate values should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of ItemsSourceProperty's bound or not.")]
- [Property("SPEC", "Xamarin.Forms.ItemsView<TVisual>.ItemsSourceProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void ItemsSourceProperty_CHECK_BINDABLE()
- {
- /* TEST CODE */
- ListView firstListView = new ListView();
- ListView secondListView = new ListView();
- var mFirstItemSource = new List<string> { "One", "Two" };
- var mSecondItemSource = new List<string> { "Three", "Four" };
-
- firstListView.ItemsSource = mFirstItemSource;
- secondListView.ItemsSource = mSecondItemSource;
-
- Assert.AreNotEqual(firstListView.ItemsSource, secondListView.ItemsSource, "ItemsSource value must be different before binding.");
- firstListView.BindingContext = secondListView;
- firstListView.SetBinding(ItemsView<Cell>.ItemsSourceProperty, "ItemsSource");
- Assert.AreEqual(firstListView.ItemsSource, secondListView.ItemsSource, "After binding, ItemsSource values should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ItemsSource Property is writable and readable.")]
- [Property("SPEC", "Xamarin.Forms.ItemsView<TVisual>.ItemsSource A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void ItemsSource_SET_GET()
- {
- /* TEST CODE */
- ListView mListView = new ListView();
- Assert.IsNotNull(mListView, "ListView object should not be null after instance.");
- var mItemSource = new List<string> { "One", "Two" };
- mListView.ItemsSource = mItemSource;
- Assert.AreEqual(mListView.ItemsSource, mItemSource, "ItemsSource not be equal to value which was set.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ItemTemplate Property is writable and readable.")]
- [Property("SPEC", "Xamarin.Forms.ItemsView<TVisual>.ItemTemplate A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void ItemTemplate_SET_GET()
- {
- /* TEST CODE */
- ListView mListView = new ListView();
- Assert.IsNotNull(mListView, "ListView object should not be null after instance.");
- var mItemTemplate = new DataTemplate(typeof(Label))
- {
- Bindings = {
- { Label.TextProperty, new Binding (".") }
- }
- };
- mListView.ItemTemplate = mItemTemplate;
- Assert.AreEqual(mListView.ItemTemplate, mItemTemplate, "ItemTemplate not be equal to value which was set.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Need to override this method to create a default TVisual instance for item.")]
- [Property("SPEC", "Xamarin.Forms.ItemsView<TVisual>.CreateDefault M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public async Task CreateDefault_CHECK()
- {
- /* TEST CODE */
- ItemsViewTemplateTests mListView = new ItemsViewTemplateTests();
- var mItemSource = new List<string> { "One", "Two" };
- mListView.ItemsSource = mItemSource;
-
- var mNavi = new NavigationPage(
- new ContentPage
- {
- Content = mListView
- }
- );
-
- _flagCreateDefault = false;
-
- await Program.getNaviPage().PushAsync(mNavi);
- await Task.Delay(2000);
- Assert.IsTrue(_flagCreateDefault, "_flagCreateDefault should be true after creating a default TVisual instance for item.");
- await Program.getNaviPage().PopToRootAsync();
- await Task.Delay(1000);
- }
-
- [Test]
- [Category("P1")]
- [Description("Need to override this method to register event handlers for items")]
- [Property("SPEC", "Xamarin.Forms.ItemsView<TVisual>.SetupContent M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public async Task SetupContent_OVERRIDE_METHOD()
- {
- /*TEST CODE*/
- ItemsViewTemplateTests mListView = new ItemsViewTemplateTests();
- var mItemSource = new List<string> { "One", "Two" };
- _flagSetupContent = false;
- mListView.ItemsSource = mItemSource;
- mListView.ItemSelected += ItemSelectedEvent;
-
- var mNavi = new NavigationPage(
- new ContentPage
- {
- Content = mListView
- }
- );
-
- await Program.getNaviPage().PushAsync(mNavi);
- await Task.Delay(2000);
- Assert.IsTrue(_flagSetupContent, "_flagSetupContent should be true after register event handlers for items");
- await Program.getNaviPage().PopToRootAsync();
- await Task.Delay(1000);
- mListView.ItemSelected -= ItemSelectedEvent;
-
- }
-
- [Test]
- [Category("P1")]
- [Description("Need to override this method to unregister event handlers for items")]
- [Property("SPEC", "Xamarin.Forms.ItemsView<TVisual>.UnhookContent M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public async Task UnhookContent_OVERRIDE_METHOD()
- {
- /*TEST CODE*/
- ItemsViewTemplateTests mListView = new ItemsViewTemplateTests();
- var mItemSource = new List<string> { "One", "Two" };
- mListView.ItemsSource = mItemSource;
- mListView.ItemSelected += ItemSelectedEvent;
-
- var mNavi = new NavigationPage(
- new ContentPage
- {
- Content = mListView
- }
- );
-
- _flagUnhookContent = false;
- await Program.getNaviPage().PushAsync(mNavi);
- await Task.Delay(2000);
- mListView.ItemsSource = null;
- await Program.getNaviPage().PopToRootAsync();
- await Task.Delay(1000);
- Assert.IsTrue(_flagUnhookContent, "_flagUnhookContent should be true after unregister event handlers for items");
-
- mListView.ItemSelected -= ItemSelectedEvent;
-
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class KeyboardTests
- {
- [SetUp]
- public void setUp()
- {
- Console.WriteLine("KeyboardTests --------------- Setup()");
- }
-
- [TearDown]
- public void tearDown()
- {
- Console.WriteLine("KeyboardTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P0")]
- [Description("Check return value of Create.")]
- [Property("SPEC", "Xamarin.Forms.Keyboard.Create M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MAE")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Create_CHECK_CREATE_WITH_ALL_FLAGS()
- {
- /* TEST CODE */
- var vAll = Keyboard.Create(KeyboardFlags.All);
- Assert.IsInstanceOf<Keyboard>(vAll);
- var vCapitalizeSentence = Keyboard.Create(KeyboardFlags.CapitalizeSentence);
- Assert.IsInstanceOf<Keyboard>(vCapitalizeSentence);
- var vNone = Keyboard.Create(KeyboardFlags.None);
- Assert.IsInstanceOf<Keyboard>(vNone);
- var vSpellcheck = Keyboard.Create(KeyboardFlags.Spellcheck);
- Assert.IsInstanceOf<Keyboard>(vSpellcheck);
- var vSuggestions = Keyboard.Create(KeyboardFlags.Suggestions);
- Assert.IsInstanceOf<Keyboard>(vSuggestions);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether can gets an instance of type ChatKeyboard or not.")]
- [Property("SPEC", "Xamarin.Forms.Keyboard.Chat A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void Chat_READ_ONLY()
- {
- /* TEST CODE */
- var returnedChatKeyboard = Keyboard.Chat;
- Assert.IsNotNull(returnedChatKeyboard, "Object is null after get ChatKeyboard");
- Assert.IsInstanceOf<Keyboard>(returnedChatKeyboard, "Item is not instance of Keyboard.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether can gets an instance of type Keyboard or not.")]
- [Property("SPEC", "Xamarin.Forms.Keyboard.Default A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void Default_READ_ONLY()
- {
- /* TEST CODE */
- var returnedDefaultKeyboard = Keyboard.Default;
- Assert.IsNotNull(returnedDefaultKeyboard, "Object is null after get DefaultKeyboard");
- Assert.IsInstanceOf<Keyboard>(returnedDefaultKeyboard, "Item is not instance of Keyboard.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether can gets an instance of type Email or not.")]
- [Property("SPEC", "Xamarin.Forms.Keyboard.Email A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void Email_READ_ONLY()
- {
- /* TEST CODE */
- var returnedEmailKeyboard = Keyboard.Email;
- Assert.IsNotNull(returnedEmailKeyboard, "Object is null after get EmailKeyboard");
- Assert.IsInstanceOf<Keyboard>(returnedEmailKeyboard, "Item is not instance of Keyboard.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether can gets an instance of type Numeric or not.")]
- [Property("SPEC", "Xamarin.Forms.Keyboard.Numeric A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void Numeric_READ_ONLY()
- {
- /* TEST CODE */
- var returnedNumericKeyboard = Keyboard.Numeric;
- Assert.IsNotNull(returnedNumericKeyboard, "Object is null after get NumericKeyboard");
- Assert.IsInstanceOf<Keyboard>(returnedNumericKeyboard, "Item is not instance of Keyboard.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether can gets an instance of type Telephone or not.")]
- [Property("SPEC", "Xamarin.Forms.Keyboard.Telephone A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void Telephone_READ_ONLY()
- {
- /* TEST CODE */
- var returnedTelephoneKeyboard = Keyboard.Telephone;
- Assert.IsNotNull(returnedTelephoneKeyboard, "Object is null after get TelephoneKeyboard");
- Assert.IsInstanceOf<Keyboard>(returnedTelephoneKeyboard, "Item is not instance of Keyboard.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether can gets an instance of type Text or not.")]
- [Property("SPEC", "Xamarin.Forms.Keyboard.Text A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void Text_READ_ONLY()
- {
- /* TEST CODE */
- var returnedTextKeyboard = Keyboard.Text;
- Assert.IsNotNull(returnedTextKeyboard, "Object is null after get TextKeyboard");
- Assert.IsInstanceOf<Keyboard>(returnedTextKeyboard, "Item is not instance of Keyboard.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether can gets an instance of type Url or not.")]
- [Property("SPEC", "Xamarin.Forms.Keyboard.Url A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void Url_READ_ONLY()
- {
- /* TEST CODE */
- var returnedUrlKeyboard = Keyboard.Url;
- Assert.IsNotNull(returnedUrlKeyboard, "Object is null after get UrlKeyboard");
- Assert.IsInstanceOf<Keyboard>(returnedUrlKeyboard, "Item is not instance of Keyboard.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether can gets an instance of type Plain or not.")]
- [Property("SPEC", "Xamarin.Forms.Keyboard.Plain A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Plain_READ_ONLY()
- {
- /* TEST CODE */
- var returnedPlainKeyboard = Keyboard.Plain;
- Assert.IsNotNull(returnedPlainKeyboard, "Object is null after get PlainKeyboard");
- Assert.IsInstanceOf<Keyboard>(returnedPlainKeyboard, "Item is not instance of Keyboard.");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class KeyboardTypeConverterTests
- {
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("KeyboardTypeConverterTest --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("KeyboardTypeConverterTest --------------- TearDown()");
- }
-
- [Test]
- [Category("P0")]
- [Description("Create a KeyboardTypeConverter Instance")]
- [Property("SPEC", "Xamarin.Forms.KeyboardTypeConverter.KeyboardTypeConverter C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void KeyboardTypeConverter_INIT()
- {
- /* TEST CODE */
- var skeyboardTypeConverter = new KeyboardTypeConverter();
- Assert.IsNotNull(skeyboardTypeConverter, "Object is null after initialize");
- Assert.IsInstanceOf<KeyboardTypeConverter>(skeyboardTypeConverter, "skeyboardTypeConverter is not KeyboardTypeConverter type instance.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether method ConvertFromInvariantString returns a keyboard for a valid keyboard name.")]
- [Property("SPEC", "Xamarin.Forms.KeyboardTypeConverter.ConvertFromInvariantString M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MAE")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void ConvertFromInvariantString_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- KeyboardTypeConverter keyboardTypeConverter = new KeyboardTypeConverter();
-
- var keyboardDefault = keyboardTypeConverter.ConvertFromInvariantString("Keyboard.Default");
- Assert.IsInstanceOf<Keyboard>(keyboardDefault, "Should be instance of Keyboard.");
- Assert.IsNotNull(keyboardDefault, "Should be created object.");
-
- var keyboardEmail = keyboardTypeConverter.ConvertFromInvariantString("Keyboard.Email");
- Assert.IsInstanceOf<Keyboard>(keyboardEmail, "Should be instance of Keyboard.");
- Assert.IsNotNull(keyboardEmail, "Should be created object.");
-
- var keyboardText = keyboardTypeConverter.ConvertFromInvariantString("Keyboard.Text");
- Assert.IsInstanceOf<Keyboard>(keyboardText, "Should be instance of Keyboard.");
- Assert.IsNotNull(keyboardText, "Should be created object.");
-
- var keyboardUrl = keyboardTypeConverter.ConvertFromInvariantString("Keyboard.Url");
- Assert.IsInstanceOf<Keyboard>(keyboardUrl, "Should be instance of Keyboard.");
- Assert.IsNotNull(keyboardUrl, "Should be created object.");
-
- var keyboardtelephone = keyboardTypeConverter.ConvertFromInvariantString("Keyboard.Telephone");
- Assert.IsInstanceOf<Keyboard>(keyboardtelephone, "Should be instance of Keyboard.");
- Assert.IsNotNull(keyboardtelephone, "Should be created object.");
-
- var keyboardChat = keyboardTypeConverter.ConvertFromInvariantString("Keyboard.Chat");
- Assert.IsInstanceOf<Keyboard>(keyboardChat, "Should be instance of Keyboard.");
- Assert.IsNotNull(keyboardChat, "Should be created object.");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class LabelTests
- {
- private Label label;
-
- [SetUp]
- public void Setup()
- {
- Console.WriteLine("LabelTests --------------- Setup()");
- label = new Label();
- }
-
- [TearDown]
- public void TearDown()
- {
- label = null;
- Console.WriteLine("LabelTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a Label object")]
- [Property("SPEC", "Xamarin.Forms.Label.Label C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Label_INIT()
- {
- /* TEST CODE */
- Assert.IsNotNull(label, "Instance Label is null");
- Assert.IsInstanceOf<Label>(label);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of FontAttributesProperty's bound or not.")]
- [Property("SPEC", "Xamarin.Forms.Label.FontAttributesProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void FontAttributesProperty_CHECK_BINDABLE()
- {
- /* TEST CODE */
- var mFirstFontAttributesProperty = FontAttributes.Bold;
- var mSecondFontAttributesProperty = FontAttributes.Italic;
- Button button = new Button();
-
- label.FontAttributes = mFirstFontAttributesProperty;
- button.FontAttributes = mSecondFontAttributesProperty;
-
- Assert.AreNotEqual(label.FontAttributes, button.FontAttributes, "FontAttributesProperty value must be different.");
- label.BindingContext = button;
- label.SetBinding(Label.FontAttributesProperty, "FontAttributes");
- Assert.AreEqual(label.FontAttributes, button.FontAttributes, "After binding, values should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of FontFamilyProperty's bound or not.")]
- [Property("SPEC", "Xamarin.Forms.Label.FontFamilyProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void FontFamilyProperty_CHECK_BINDABLE()
- {
- /* TEST CODE */
- var mFirstFontFamilyProperty = "Times New Romman";
- var mSecondFontFamilyProperty = "Calibri";
- Button button = new Button();
-
- label.FontFamily = mFirstFontFamilyProperty;
- button.FontFamily = mSecondFontFamilyProperty;
-
- Assert.AreNotEqual(label.FontFamily, button.FontFamily, "FontFamilyProperty value must be different.");
- label.BindingContext = button;
- label.SetBinding(Label.FontFamilyProperty, "FontFamily");
- Assert.AreEqual(label.FontFamily, button.FontFamily, "After binding, values should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of FontProperty's bound or not.")]
- [Property("SPEC", "Xamarin.Forms.Label.FontProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void FontProperty_CHECK_BINDABLE()
- {
- /* TEST CODE */
- var mFirstFontProperty = new Font();
- mFirstFontProperty = mFirstFontProperty.WithSize(2.0);
- var mSecondFontProperty = new Font();
- mSecondFontProperty = mSecondFontProperty.WithSize(3.0);
- Button button = new Button();
-
- label.Font = mFirstFontProperty;
- button.Font = mSecondFontProperty;
-
- Assert.AreNotEqual(label.Font, button.Font, "FontProperty value must be different.");
- label.BindingContext = button;
- label.SetBinding(Label.FontProperty, "Font");
- Assert.AreEqual(label.Font, button.Font, "After binding, values should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of FontSizeProperty's bound or not.")]
- [Property("SPEC", "Xamarin.Forms.Label.FontSizeProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void FontSizeProperty_CHECK_BINDABLE()
- {
- /* TEST CODE */
- var mFirstFontSizeProperty = 2.0;
- var mSecondFontSizeProperty = 3.0;
- Button button = new Button();
-
- label.FontSize = mFirstFontSizeProperty;
- button.FontSize = mSecondFontSizeProperty;
-
- Assert.AreNotEqual(label.FontSize, button.FontSize, "FontSizeProperty value must be different.");
- label.BindingContext = button;
- label.SetBinding(Label.FontSizeProperty, "FontSize");
- Assert.AreEqual(label.FontSize, button.FontSize, "After binding, values should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of FormattedTextProperty's bound or not.")]
- [Property("SPEC", "Xamarin.Forms.Label.FormattedTextProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void FormattedTextProperty_CHECK_BINDABLE()
- {
- /* TEST CODE */
- var mFirstFormattedTextProperty = "Tiz@en";
- var mSecondFormattedTextProperty = "Tizen@New";
- Label labelNew = new Label();
-
- label.FormattedText = mFirstFormattedTextProperty;
- labelNew.FormattedText = mSecondFormattedTextProperty;
-
- Assert.AreNotEqual(label.FormattedText, labelNew.FormattedText, "FormattedTextProperty value must be different.");
- label.BindingContext = labelNew;
- label.SetBinding(Label.FormattedTextProperty, "FormattedText");
- Assert.AreEqual(label.FormattedText, labelNew.FormattedText, "After binding, values should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of HorizontalTextAlignmentProperty's bound or not.")]
- [Property("SPEC", "Xamarin.Forms.Label.HorizontalTextAlignmentProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void HorizontalTextAlignmentProperty_CHECK_BINDABLE()
- {
- /* TEST CODE */
- var mFirstHorizontalTextAlignmentProperty = TextAlignment.Center;
- var mSecondHorizontalTextAlignmentProperty = TextAlignment.End;
- Entry entry = new Entry();
-
- label.HorizontalTextAlignment = mFirstHorizontalTextAlignmentProperty;
- entry.HorizontalTextAlignment = mSecondHorizontalTextAlignmentProperty;
-
- Assert.AreNotEqual(label.HorizontalTextAlignment, entry.HorizontalTextAlignment, "HorizontalTextAlignmentProperty value must be different.");
- label.BindingContext = entry;
- label.SetBinding(Label.HorizontalTextAlignmentProperty, "HorizontalTextAlignment");
- Assert.AreEqual(label.HorizontalTextAlignment, entry.HorizontalTextAlignment, "After binding, values should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of LineBreakModeProperty's bound or not.")]
- [Property("SPEC", "Xamarin.Forms.Label.LineBreakModeProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void LineBreakModeProperty_CHECK_BINDABLE()
- {
- /* TEST CODE */
- var mFirstLineBreakModeProperty = LineBreakMode.CharacterWrap;
- var mSecondLineBreakModeProperty = LineBreakMode.HeadTruncation;
- Label labelNew = new Label();
-
- label.LineBreakMode = mFirstLineBreakModeProperty;
- labelNew.LineBreakMode = mSecondLineBreakModeProperty;
-
- Assert.AreNotEqual(label.LineBreakMode, labelNew.LineBreakMode, "LineBreakModeProperty value must be different.");
- label.BindingContext = labelNew;
- label.SetBinding(Label.LineBreakModeProperty, "LineBreakMode");
- Assert.AreEqual(label.LineBreakMode, labelNew.LineBreakMode, "After binding, values should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of TextColorProperty's bound or not.")]
- [Property("SPEC", "Xamarin.Forms.Label.TextColorProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void TextColorProperty_CHECK_BINDABLE()
- {
- /* TEST CODE */
- var mFirstTextColorProperty = Color.Gray;
- var mSecondTextColorProperty = Color.Red;
- Button button = new Button();
-
- label.TextColor = mFirstTextColorProperty;
- button.TextColor = mSecondTextColorProperty;
-
- Assert.AreNotEqual(label.TextColor, button.TextColor, "TextColorProperty value must be different.");
- label.BindingContext = button;
- label.SetBinding(Label.TextColorProperty, "TextColor");
- Assert.AreEqual(label.TextColor, button.TextColor, "After binding, values should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of TextProperty's bound or not.")]
- [Property("SPEC", "Xamarin.Forms.Label.TextProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void TextProperty_CHECK_BINDABLE()
- {
- /* TEST CODE */
- var mFirstTextProperty = "Tizen";
- var mSecondTextProperty = "TizenNew";
- Button button = new Button();
-
- label.Text = mFirstTextProperty;
- button.Text = mSecondTextProperty;
-
- Assert.AreNotEqual(label.Text, button.Text, "TextProperty value must be different.");
- label.BindingContext = button;
- label.SetBinding(Label.TextProperty, "Text");
- Assert.AreEqual(label.Text, button.Text, "After binding, values should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of VerticalTextAlignmentProperty's bound or not.")]
- [Property("SPEC", "Xamarin.Forms.Label.VerticalTextAlignmentProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void VerticalTextAlignmentProperty_CHECK_BINDABLE()
- {
- /* TEST CODE */
- var mFirstVerticalTextAlignmentProperty = TextAlignment.Center;
- var mSecondVerticalTextAlignmentProperty = TextAlignment.End;
- Label labelNew = new Label();
-
- label.VerticalTextAlignment = mFirstVerticalTextAlignmentProperty;
- labelNew.VerticalTextAlignment = mSecondVerticalTextAlignmentProperty;
-
- Assert.AreNotEqual(label.VerticalTextAlignment, labelNew.VerticalTextAlignment, "VerticalTextAlignmentProperty value must be different.");
- label.BindingContext = labelNew;
- label.SetBinding(Label.VerticalTextAlignmentProperty, "VerticalTextAlignment");
- Assert.AreEqual(label.VerticalTextAlignment, labelNew.VerticalTextAlignment, "After binding, values should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of XAlignProperty's bound or not.")]
- [Property("SPEC", "Xamarin.Forms.Label.XAlignProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void XAlignProperty_CHECK_BINDABLE()
- {
- /* TEST CODE */
- var mFirstXAlignProperty = TextAlignment.Center;
- var mSecondXAlignProperty = TextAlignment.End;
- EntryCell entryCell = new EntryCell();
-
- label.XAlign = mFirstXAlignProperty;
- entryCell.XAlign = mSecondXAlignProperty;
-
- Assert.AreNotEqual(label.XAlign, entryCell.XAlign, "XAlignProperty value must be different.");
- label.BindingContext = entryCell;
- label.SetBinding(Label.XAlignProperty, "XAlign");
- Assert.AreEqual(label.XAlign, entryCell.XAlign, "After binding, values should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of YAlignProperty's bound or not.")]
- [Property("SPEC", "Xamarin.Forms.Label.YAlignProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void YAlignProperty_CHECK_BINDABLE()
- {
- /* TEST CODE */
- var mFirstYAlignProperty = TextAlignment.Center;
- var mSecondYAlignProperty = TextAlignment.End;
- Label labelNew = new Label();
-
- label.YAlign = mFirstYAlignProperty;
- labelNew.YAlign = mSecondYAlignProperty;
-
- Assert.AreNotEqual(label.YAlign, labelNew.YAlign, "YAlignProperty value must be different.");
- label.BindingContext = labelNew;
- label.SetBinding(Label.YAlignProperty, "YAlign");
- Assert.AreEqual(label.YAlign, labelNew.YAlign, "After binding, values should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Sets or gets the Font for the label.")]
- [Property("SPEC", "Xamarin.Forms.Label.Font A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Font_READ_WRITE()
- {
- /* TEST CODE */
- label.Font = Font.Default;
- Assert.IsTrue(label.Font.Equals(Font.Default), "Set and get values are not equal");
- }
-
- [Test]
- [Category("P1")]
- [Description("Sets or gets the FontAttributes for the label.")]
- [Property("SPEC", "Xamarin.Forms.Label.FontAttributes A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void FontAttributes_READ_WRITE()
- {
- /* TEST CODE */
- label.FontAttributes = FontAttributes.Bold;
- Assert.IsTrue(label.FontAttributes.Equals(FontAttributes.Bold), "Set and get values are not equal");
-
- label.FontAttributes = FontAttributes.Italic;
- Assert.IsTrue(label.FontAttributes.Equals(FontAttributes.Italic), "Set and get values are not equal");
-
- label.FontAttributes = FontAttributes.None;
- Assert.IsTrue(label.FontAttributes.Equals(FontAttributes.None), "Set and get values are not equal");
- }
-
- [Test]
- [Category("P1")]
- [Description("Sets or gets the FontFamily for the label.")]
- [Property("SPEC", "Xamarin.Forms.Label.FontFamily A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void FontFamily_READ_WRITE()
- {
- /* TEST CODE */
- label.FontFamily = "Times New Roman";
- Assert.IsTrue(label.FontFamily.Equals("Times New Roman"), "Set and get values are not equal");
- }
-
- [Test]
- [Category("P1")]
- [Description("Sets or gets the FontSize for the label.")]
- [Property("SPEC", "Xamarin.Forms.Label.FontSize A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void FontSize_READ_WRITE()
- {
- /* TEST CODE */
- label.FontSize = 12.0;
- Assert.IsTrue(label.FontSize.Equals(12.0), "Set and get values are not equal");
- }
-
- [Test]
- [Category("P1")]
- [Description("Sets or gets FormattedText for label.")]
- [Property("SPEC", "Xamarin.Forms.Label.FormattedText A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void FormattedText_READ_WRITE()
- {
- /* TEST CODE */
- var formattedStr = new FormattedString();
- Span span = new Span();
- span.Text = "String@Input";
- formattedStr.Spans.Add(span);
- label.FormattedText = formattedStr;
- Assert.IsInstanceOf<FormattedString>(label.FormattedText);
- Assert.IsTrue(formattedStr.Equals(label.FormattedText), "Set and Get values are not equal for FormattedText.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Sets or gets HorizontalTextAlignment for label.")]
- [Property("SPEC", "Xamarin.Forms.Label.HorizontalTextAlignment A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void HorizontalTextAlignment_READ_WRITE()
- {
- /* TEST CODE */
- label.HorizontalTextAlignment = TextAlignment.Center;
- Assert.IsTrue(label.HorizontalTextAlignment.Equals(TextAlignment.Center), "Set and get values are not equal");
-
- label.HorizontalTextAlignment = TextAlignment.End;
- Assert.IsTrue(label.HorizontalTextAlignment.Equals(TextAlignment.End), "Set and get values are not equal");
-
- label.HorizontalTextAlignment = TextAlignment.Start;
- Assert.IsTrue(label.HorizontalTextAlignment.Equals(TextAlignment.Start), "Set and get values are not equal");
- }
-
- [Test]
- [Category("P1")]
- [Description("Sets or gets LineBreakMode for label.")]
- [Property("SPEC", "Xamarin.Forms.Label.LineBreakMode A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void LineBreakMode_READ_WRITE()
- {
- /* TEST CODE */
- label.LineBreakMode = LineBreakMode.CharacterWrap;
- Assert.IsTrue(label.LineBreakMode.Equals(LineBreakMode.CharacterWrap), "Set and get values are not equal");
-
- label.LineBreakMode = LineBreakMode.HeadTruncation;
- Assert.IsTrue(label.LineBreakMode.Equals(LineBreakMode.HeadTruncation), "Set and get values are not equal");
-
- label.LineBreakMode = LineBreakMode.MiddleTruncation;
- Assert.IsTrue(label.LineBreakMode.Equals(LineBreakMode.MiddleTruncation), "Set and get values are not equal");
-
- label.LineBreakMode = LineBreakMode.NoWrap;
- Assert.IsTrue(label.LineBreakMode.Equals(LineBreakMode.NoWrap), "Set and get values are not equal");
-
- label.LineBreakMode = LineBreakMode.TailTruncation;
- Assert.IsTrue(label.LineBreakMode.Equals(LineBreakMode.TailTruncation), "Set and get values are not equal");
-
- label.LineBreakMode = LineBreakMode.WordWrap;
- Assert.IsTrue(label.LineBreakMode.Equals(LineBreakMode.WordWrap), "Set and get values are not equal");
- }
-
- [Test]
- [Category("P1")]
- [Description("Sets or gets Text for label.")]
- [Property("SPEC", "Xamarin.Forms.Label.Text A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Text_READ_WRITE()
- {
- /* TEST CODE */
- label.Text = "Hello Tizen";
- Assert.IsTrue(label.Text.Equals("Hello Tizen"), "Set and get values are not equal");
- }
-
- [Test]
- [Category("P1")]
- [Description("Sets or gets TextColor for label.")]
- [Property("SPEC", "Xamarin.Forms.Label.TextColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void TextColor_READ_WRITE()
- {
- /* TEST CODE */
- label.TextColor = Color.Green;
- Assert.IsTrue(label.TextColor.Equals(Color.Green), "Set and get values are not equal");
- }
-
- [Test]
- [Category("P1")]
- [Description("Sets or gets VerticalTextAlignment for label.")]
- [Property("SPEC", "Xamarin.Forms.Label.VerticalTextAlignment A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void VerticalTextAlignment_READ_WRITE()
- {
- /* TEST CODE */
- label.VerticalTextAlignment = TextAlignment.Center;
- Assert.IsTrue(label.VerticalTextAlignment.Equals(TextAlignment.Center), "Set and get values are not equal");
-
- label.VerticalTextAlignment = TextAlignment.End;
- Assert.IsTrue(label.VerticalTextAlignment.Equals(TextAlignment.End), "Set and get values are not equal");
-
- label.VerticalTextAlignment = TextAlignment.Start;
- Assert.IsTrue(label.VerticalTextAlignment.Equals(TextAlignment.Start), "Set and get values are not equal");
- }
-
- [Test]
- [Category("P1")]
- [Description("Sets or gets XAlign for label.")]
- [Property("SPEC", "Xamarin.Forms.Label.XAlign A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void XAlign_READ_WRITE()
- {
- /* TEST CODE */
- label.XAlign = TextAlignment.Center;
- Assert.IsTrue(label.XAlign.Equals(TextAlignment.Center), "Set and get values are not equal");
-
- label.XAlign = TextAlignment.End;
- Assert.IsTrue(label.XAlign.Equals(TextAlignment.End), "Set and get values are not equal");
-
- label.XAlign = TextAlignment.Start;
- Assert.IsTrue(label.XAlign.Equals(TextAlignment.Start), "Set and get values are not equal");
- }
-
- [Test]
- [Category("P1")]
- [Description("Sets or gets YAlign for label.")]
- [Property("SPEC", "Xamarin.Forms.Label.YAlign A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void YAlign_READ_WRITE()
- {
- /* TEST CODE */
- label.YAlign = TextAlignment.Center;
- Assert.IsTrue(label.YAlign.Equals(TextAlignment.Center), "Set and get values are not equal");
-
- label.YAlign = TextAlignment.End;
- Assert.IsTrue(label.YAlign.Equals(TextAlignment.End), "Set and get values are not equal");
-
- label.YAlign = TextAlignment.Start;
- Assert.IsTrue(label.YAlign.Equals(TextAlignment.Start), "Set and get values are not equal");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check return label configuration")]
- [Property("SPEC", "Xamarin.Forms.Label.On<T> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Md. Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void On_CONFIGURATION_METHOD()
- {
- /*TEST CODE*/
- label.Text = "Test Label";
- label.FontSize = 12.3;
- var myConfig = label.On<IConfigPlatform>();
- Assert.IsInstanceOf<IPlatformElementConfiguration<IConfigPlatform, Label>>(myConfig, "myConfig should be a instance of IPlatformElementConfiguration");
- Assert.IsInstanceOf<Label>(myConfig.Element, "myConfig.Element should be a instance of Label");
- Assert.AreEqual("Test Label", myConfig.Element.Text, "Text of myConfig.Element value & Text of label should be equal");
- Assert.AreEqual(12.3, Math.Round(myConfig.Element.FontSize, 1), "FontSize of myConfig.Element value & FontSize of label should be equal");
- }
- }
-}
+++ /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 XamarinForTizen.Tizen;
-using System.Threading.Tasks;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- public class CustomLayout : Layout<View>
- {
- public bool FlagOnChildMeasureInvalidatedNoParm { get; set; }
- public bool FlagInvalidateLayout { get; set; }
- public bool FlagShouldInvalidateOnChildAdded { get; set; }
- public bool FlagShouldInvalidateOnChildRemoved { get; set; }
- public bool FlagOnSizeAllocated { get; set; }
- public bool FlagLayoutChildren { get; set; }
-
- public CustomLayout() : base()
- {
- ;
- }
- protected override void LayoutChildren(double x, double y, double width, double height)
- {
- FlagLayoutChildren = true;
- }
-
- protected override void OnChildMeasureInvalidated()
- {
- base.OnChildMeasureInvalidated();
- FlagOnChildMeasureInvalidatedNoParm = true;
- }
-
- protected override void OnSizeAllocated(Double width, Double height)
- {
- base.OnSizeAllocated(width, height);
- FlagOnSizeAllocated = true;
- }
-
- protected override void InvalidateLayout()
- {
- base.InvalidateLayout();
- FlagInvalidateLayout = true;
- }
-
- protected override bool ShouldInvalidateOnChildAdded(View child)
- {
- bool ret = base.ShouldInvalidateOnChildAdded(child);
- FlagShouldInvalidateOnChildAdded = true;
- return ret;
- }
-
- protected override bool ShouldInvalidateOnChildRemoved(View child)
- {
- bool ret = base.ShouldInvalidateOnChildRemoved(child);
- FlagShouldInvalidateOnChildRemoved = true;
- return ret;
- }
-
- protected override void InvalidateMeasure()
- {
- base.InvalidateMeasure();
- }
- }
-
- public class CustomStackLayout : StackLayout
- {
- public bool FlagLayoutChildren { get; set; }
- public bool FlagLayoutChangedEvent { get; set; }
- protected override void LayoutChildren(double x, double y, double width, double height)
- {
- FlagLayoutChildren = true;
- base.LayoutChildren(x, y, width, height);
- }
- }
-
-
- [TestFixture]
- [Description("Xamarin.Forms.Layout Tests")]
- public class LayoutTests
- {
- public CustomLayout _customLayout;
-
- [SetUp]
- public void SetUp()
- {
- MasterDetailPage ms = new MasterDetailPage();
- Console.WriteLine("LayoutTests --------------- Setup()");
- _customLayout = new CustomLayout();
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("LayoutTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a new Layout instance.")]
- [Property("SPEC", "Xamarin.Forms.Layout.Layout C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Layout_INIT()
- {
- /* TEST CODE */
- CustomLayout layout = new CustomLayout();
- Assert.IsNotNull(layout, "Object should be not null after initialize");
- Assert.IsInstanceOf<Layout>(layout);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Padding is readable and settable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.Layout.Padding A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Padding_READ_WRITE()
- {
- /* TEST CODE */
- CustomLayout layout = new CustomLayout();
- Assert.IsNotNull(layout, "Object should be not null");
-
- layout.Padding = new Thickness(10, 15, 20, 25);
- var getPadding = layout.Padding;
- Assert.AreEqual(10, getPadding.Left, "Padding property doesn't set and get Left successfully");
- Assert.AreEqual(15, getPadding.Top, "Padding property doesn't set and get Top successfully");
- Assert.AreEqual(20, getPadding.Right, "Padding property doesn't set and get Right successfully");
- Assert.AreEqual(25, getPadding.Bottom, "Padding property doesn't set and get Bottom successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether PaddingProperty property bound or not")]
- [Property("SPEC", "Xamarin.Forms.Layout.PaddingProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void PaddingProperty_READ_ONLY()
- {
- /* TEST CODE */
- CustomLayout layout = new CustomLayout();
- layout.Padding = new Thickness(10, 15, 20, 25);
- StackLayout mStackLayoyut = new StackLayout();
- mStackLayoyut.Padding = new Thickness(15, 20, 25, 30);
- Assert.AreNotEqual(mStackLayoyut.Padding, layout.Padding, "PaddingProperty value must be different.");
- layout.BindingContext = mStackLayoyut;
- layout.SetBinding(Layout.PaddingProperty, "Padding");
- Assert.AreEqual(mStackLayoyut.Padding, layout.Padding, "After binding, value should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the IsClippedToBounds property is readable and writable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.Layout.IsClippedToBounds A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void IsClippedToBounds_READ_WRITE()
- {
- /* TEST CODE */
- Assert.IsFalse(_customLayout.IsClippedToBounds, "IsClippedToBounds property does not set default value false");
- _customLayout.IsClippedToBounds = true;
- Assert.True(_customLayout.IsClippedToBounds, "IsClippedToBounds property does not set true");
- _customLayout.IsClippedToBounds = false;
- Assert.False(_customLayout.IsClippedToBounds, "IsClippedToBounds property does not set false");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether IsClippedToBoundsProperty property bound or not")]
- [Property("SPEC", "Xamarin.Forms.Layout.IsClippedToBoundsProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void IsClippedToBoundsProperty_READ_ONLY()
- {
- /* TEST CODE */
- _customLayout.IsClippedToBounds = true;
- StackLayout mStackLayout = new StackLayout();
- mStackLayout.IsClippedToBounds = false;
- Assert.AreNotEqual(mStackLayout.IsClippedToBounds, _customLayout.IsClippedToBounds, "IsClippedToBoundsProperty value must be different.");
- _customLayout.BindingContext = mStackLayout;
- _customLayout.SetBinding(Layout.IsClippedToBoundsProperty, "IsClippedToBounds");
- Assert.AreEqual(mStackLayout.IsClippedToBounds, _customLayout.IsClippedToBounds, "After binding, value should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of LowerChild.")]
- [Property("SPEC", "Xamarin.Forms.Layout.LowerChild M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void LowerChild_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- Layout layout = new StackLayout();
- var child1 = new Button();
- var child2 = new Button();
- var child3 = new Button();
-
- ((StackLayout)layout).Children.Add(child1);
- ((StackLayout)layout).Children.Add(child2);
- ((StackLayout)layout).Children.Add(child3);
-
- bool flagChildrenReordered = false;
- layout.ChildrenReordered += (sender, args) => flagChildrenReordered = true;
-
- ((StackLayout)layout).LowerChild(child2);
- Assert.IsTrue(flagChildrenReordered, "Event value changed should be handled.");
- Assert.AreEqual(child2, ((IElementController)layout).LogicalChildren[0]);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of RaiseChild.")]
- [Property("SPEC", "Xamarin.Forms.Layout.RaiseChild M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void RaiseChild_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- Layout layout = new StackLayout();
- var child1 = new Button();
- var child2 = new Button();
- var child3 = new Button();
-
- ((StackLayout)layout).Children.Add(child1);
- ((StackLayout)layout).Children.Add(child2);
- ((StackLayout)layout).Children.Add(child3);
-
- bool flagChildrenReordered = false;
- layout.ChildrenReordered += (sender, args) => flagChildrenReordered = true;
-
- ((StackLayout)layout).RaiseChild(child2);
- Assert.IsTrue(flagChildrenReordered, "Event value changed should be handled.");
- Assert.AreEqual(child2, ((IElementController)layout).LogicalChildren[2]);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check ForceLayout returns without any exceptions")]
- [Property("SPEC", "Xamarin.Forms.Layout.ForceLayout M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void ForceLayout_CHECK()
- {
- /* TEST CODE */
- try
- {
- Layout layout = new StackLayout();
- var child1 = new Button();
- var child2 = new Button();
- var child3 = new Button();
-
- ((StackLayout)layout).Children.Add(child1);
- ((StackLayout)layout).Children.Add(child2);
- ((StackLayout)layout).Children.Add(child3);
-
- layout.ForceLayout();
- Assert.True(true);
- }
- catch (Exception ex)
- {
- Assert.False(false, "Should not throw exception. " + ex.ToString());
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of LayoutChildIntoBoundingRegion.")]
- [Property("SPEC", "Xamarin.Forms.Layout.LayoutChildIntoBoundingRegion M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void LayoutChildIntoBoundingRegion_CHECK()
- {
- /* TEST CODE */
- Layout layout = new StackLayout();
- var child1 = new Button();
- ((StackLayout)layout).Children.Add(child1);
-
- Rectangle rect = new Rectangle(2.00, 3.00, 4.00, 5.00);
- Layout.LayoutChildIntoBoundingRegion(child1, rect);
-
- var ret = child1.Bounds;
- Assert.AreEqual(ret, rect, "Get and Set Bounds value should be same.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of GetSizeRequest.")]
- [Property("SPEC", "Xamarin.Forms.Layout.GetSizeRequest M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void GetSizeRequest_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- _customLayout.WidthRequest = 50.00;
- _customLayout.HeightRequest = 80.00;
-
- var res = _customLayout.GetSizeRequest(double.PositiveInfinity, double.PositiveInfinity).Request;
- Assert.AreEqual(new Size(50.00, 80.00), res, "Width and Height values are not same.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Invalidates the current layout.")]
- [Property("SPEC", "Xamarin.Forms.Layout.InvalidateLayout M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Md. Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void InvalidateLayout_INVOKE_CHECK()
- {
- /* TEST CODE */
- var cLayout = new CustomLayout();
- var lbl = new Label();
- cLayout.Children.Add(lbl);
- Assert.IsTrue(cLayout.FlagInvalidateLayout, "FlagInvalidateLayout should be true;");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check positions and sizes the children of a Layoutt.")]
- [Property("SPEC", "Xamarin.Forms.Layout.LayoutChildren M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public async Task LayoutChildren_INVOKE_CHECK()
- {
- /* Precondition:
- - Create custom StackLayout that inherit Layout class layout */
- NavigationPage mainPage = Program.getNaviPage();
- var layout = new CustomStackLayout();
- var lbl = new Label();
- layout.Children.Add(lbl);
- await mainPage.PushAsync(new ContentPage { Content = layout });
- /* TEST CODE */
- layout.Layout(new Rectangle() { X = 0, Y = 0, Width = 300, Height = 400 });
- Assert.IsTrue(layout.FlagLayoutChildren, "LayoutChildren is not invoked!");
- /* Postcondition:
- -Pop layout */
- await mainPage.PopAsync();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OnChildAddedOverride Invoke or not.")]
- [Property("SPEC", "Xamarin.Forms.Layout.OnChildMeasureInvalidated M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Md. Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void OnChildMeasureInvalidated_INVOKE_CHECK()
- {
- /* TEST CODE */
- var cLayout = new CustomLayout();
- var lbl = new Label();
- lbl.IsVisible = false;
- bool emmited = false;
- cLayout.MeasureInvalidated += (sender, arg) => emmited = true;
-
- cLayout.Children.Add(lbl);
- lbl.IsVisible = true;
- Assert.IsTrue(emmited, "emmited should be true;");
- Assert.IsTrue(cLayout.FlagOnChildMeasureInvalidatedNoParm, "FlagInvalidateLayout should be true;");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check whether OnChildAddedOverride Invoke or not.")]
- [Property("SPEC", "Xamarin.Forms.Layout.OnChildMeasureInvalidated M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Md. Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void OnChildMeasureInvalidated_WITH_PARAM_INVOKE_CHECK()
- {
- /* TEST CODE */
- Assert.True(false, "[NA] Can't inherit this api for test");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OnSizeAllocated Invoke or not.")]
- [Property("SPEC", "Xamarin.Forms.Layout.OnSizeAllocated M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Md. Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void OnSizeAllocated_INVOKE_CHECK()
- {
- /* TEST CODE */
- var cLayout = new CustomLayout();
- var lbl = new Label
- {
- Text = "Child1",
- WidthRequest = 21.5
- };
- cLayout.Children.Add(lbl);
-
- lbl.Layout(new Rectangle(0, 0, 2, 5));
- Assert.IsTrue(cLayout.FlagOnSizeAllocated, "FlagOnSizeAllocated should be true");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ShouldInvalidateOnChildAdded Invoke or not.")]
- [Property("SPEC", "Xamarin.Forms.Layout.ShouldInvalidateOnChildAdded M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Md. Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void ShouldInvalidateOnChildAdded_INVOKE_CHECK()
- {
- /* TEST CODE */
- var cLayout = new CustomLayout();
- var lbl = new Label();
- cLayout.Children.Add(lbl);
- Assert.IsTrue(cLayout.FlagShouldInvalidateOnChildAdded, "FlagShouldInvalidateOnChildAdded should be true;");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ShouldInvalidateOnChildRemoved Invoke or not.")]
- [Property("SPEC", "Xamarin.Forms.Layout.ShouldInvalidateOnChildRemoved M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Md. Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void ShouldInvalidateOnChildRemoved_INVOKE_CHECK()
- {
- /* TEST CODE */
- var cLayout = new CustomLayout();
- var lbl = new Label();
- cLayout.Children.Add(lbl);
- cLayout.Children.Remove(lbl);
- Assert.IsTrue(cLayout.FlagShouldInvalidateOnChildRemoved, "FlagShouldInvalidateOnChildRemoved should be true;");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check whether UpdateChildrenLayout Invoke or not.")]
- [Property("SPEC", "Xamarin.Forms.Layout.UpdateChildrenLayout M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Md. Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void UpdateChildrenLayout_INVOKE_CHECK()
- {
- /* TEST CODE */
- Assert.True(false, "[NA] Can't inherit this api for test");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether LayoutChanged Event is raised when a property is changed.")]
- [Property("SPEC", "Xamarin.Forms.Layout.LayoutChanged E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public async Task LayoutChanged_EVENT()
- {
- /* Preconditon:
- * - Create custom StackLayout that inherit Layout class.
- * - Push custom layout into mainpage */
- NavigationPage mainPage = Program.getNaviPage();
- var layout = new CustomStackLayout();
- var label1 = new Label()
- {
- Text = "First label",
- FontSize = 30,
- };
- var label2 = new Label()
- {
- Text = "First label",
- FontSize = 30,
- };
- layout.Children.Add(label1);
- layout.Children.Add(label2);
- await mainPage.PushAsync(new ContentPage { Content = layout });
- /* TEST CODE */
- layout.LayoutChanged += (sender, args) =>
- {
- layout.FlagLayoutChangedEvent = true;
- };
- layout.FlagLayoutChangedEvent = false;
- label1.Layout(new Rectangle { X = 0, Y = 0, Width = 150, Height = 150 });
- layout.Children.Remove(label2);
- Assert.IsTrue(layout.FlagLayoutChangedEvent, "LayoutChanged is not invoked.");
- /* Postcondition:
- - Pop layout*/
- await mainPage.PopAsync();
- }
- }
-}
+++ /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 System.Threading.Tasks;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.LayoutOptions Tests")]
- public class LayoutOptionsTests
- {
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("LayoutOptionsTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("LayoutOptionsTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a LayoutOptions object")]
- [Property("SPEC", "Xamarin.Forms.LayoutOptions.LayoutOptions C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void LayoutOptions_INIT()
- {
- /* TEST CODE */
- var layoutOptions = new LayoutOptions(LayoutAlignment.Center, true);
- Assert.IsNotNull(layoutOptions, "Instance LayoutOptions can not be null.l");
- Assert.IsInstanceOf<LayoutOptions>(layoutOptions, "Object should be as LayoutOptions type.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check LayoutOptions is centerd and not expand")]
- [Property("SPEC", "Xamarin.Forms.LayoutOptions.Center A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void Center_READ()
- {
- /* TEST CODE */
- var layoutOptions = LayoutOptions.Center;
- Assert.IsNotNull(layoutOptions, "Instance LayoutOptions can not be null.");
- Assert.IsInstanceOf<LayoutOptions>(layoutOptions, "Object should be as LayoutOptions type.");
- Assert.AreEqual(LayoutAlignment.Center,layoutOptions.Alignment, "Alignment should be in center.");
- Assert.IsFalse(layoutOptions.Expands, "Expands should be false.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check LayoutOptions is centerd and expand")]
- [Property("SPEC", "Xamarin.Forms.LayoutOptions.CenterAndExpand A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void CenterAndExpand_READ()
- {
- /* TEST CODE */
- var layoutOptions = LayoutOptions.CenterAndExpand;
- Assert.IsNotNull(layoutOptions, "Instance LayoutOptions can not be null.");
- Assert.IsInstanceOf<LayoutOptions>(layoutOptions, "Object should be as LayoutOptions type.");
- Assert.AreEqual(LayoutAlignment.Center, layoutOptions.Alignment, "Alignment should be in center.");
- Assert.IsTrue(layoutOptions.Expands, "Expands should be true.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether LayoutOptions is end and not expand")]
- [Property("SPEC", "Xamarin.Forms.LayoutOptions.End A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void End_READ()
- {
- /* TEST CODE */
- var layoutOptions = LayoutOptions.End;
- Assert.IsNotNull(layoutOptions, "Instance LayoutOptions can not be null.");
- Assert.IsInstanceOf<LayoutOptions>(layoutOptions, "Object should be as LayoutOptions type.");
- Assert.AreEqual(LayoutAlignment.End, layoutOptions.Alignment, "Alignment should be in end.");
- Assert.IsFalse(layoutOptions.Expands, "Expands should be false.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether LayoutOptions is end and expand")]
- [Property("SPEC", "Xamarin.Forms.LayoutOptions.EndAndExpand A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void EndAndExpand_READ()
- {
- /* TEST CODE */
- var layoutOptions = LayoutOptions.EndAndExpand;
- Assert.IsNotNull(layoutOptions, "Instance LayoutOptions can not be null.");
- Assert.IsInstanceOf<LayoutOptions>(layoutOptions, "Object should be as LayoutOptions type.");
- Assert.AreEqual(LayoutAlignment.End, layoutOptions.Alignment, "Alignment should be in end.");
- Assert.IsTrue(layoutOptions.Expands, "Expands should be true.");
- }
-
-
- [Test]
- [Category("P1")]
- [Description("Check whether LayoutOptions is fill and not expand")]
- [Property("SPEC", "Xamarin.Forms.LayoutOptions.Fill A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void Fill_READ()
- {
- /* TEST CODE */
- var layoutOptions = LayoutOptions.Fill;
- Assert.IsNotNull(layoutOptions, "Instance LayoutOptions can not be null.");
- Assert.IsInstanceOf<LayoutOptions>(layoutOptions, "Object should be as LayoutOptions type.");
- Assert.AreEqual(LayoutAlignment.Fill, layoutOptions.Alignment, "Alignment should be in fill.");
- Assert.IsFalse(layoutOptions.Expands, "Expands should be false.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether LayoutOptions is fill and expand")]
- [Property("SPEC", "Xamarin.Forms.LayoutOptions.FillAndExpand A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void FillAndExpand_READ()
- {
- /* TEST CODE */
- var layoutOptions = LayoutOptions.FillAndExpand;
- Assert.IsNotNull(layoutOptions, "Instance LayoutOptions can not be null.");
- Assert.IsInstanceOf<LayoutOptions>(layoutOptions, "Object should be as LayoutOptions type.");
- Assert.AreEqual(LayoutAlignment.Fill, layoutOptions.Alignment, "Alignment should be in fill.");
- Assert.IsTrue(layoutOptions.Expands, "Expands should be true.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether LayoutOptions is Start and not expand")]
- [Property("SPEC", "Xamarin.Forms.LayoutOptions.Start A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void Start_READ()
- {
- /* TEST CODE */
- var layoutOptions = LayoutOptions.Start;
- Assert.IsNotNull(layoutOptions, "Instance LayoutOptions can not be null");
- Assert.IsInstanceOf<LayoutOptions>(layoutOptions, "Object should be as LayoutOptions type");
- Assert.AreEqual(LayoutAlignment.Start, layoutOptions.Alignment, "Alignment should be in start");
- Assert.IsFalse(layoutOptions.Expands, "Expands should be false");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether LayoutOptions is Start and expand")]
- [Property("SPEC", "Xamarin.Forms.LayoutOptions.StartAndExpand A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void StartAndExpand_READ()
- {
- /* TEST CODE */
- var layoutOptions = LayoutOptions.StartAndExpand;
- Assert.IsNotNull(layoutOptions, "Instance LayoutOptions can not be null");
- Assert.IsInstanceOf<LayoutOptions>(layoutOptions, "Object should be as LayoutOptions type");
- Assert.AreEqual(LayoutAlignment.Start, layoutOptions.Alignment, "Alignment should be in start");
- Assert.IsTrue(layoutOptions.Expands, "Expands should be true");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether LayoutOptions Alignment is readable and writable")]
- [Property("SPEC", "Xamarin.Forms.LayoutOptions.Alignment A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void Alignment_READ_WRITE()
- {
- /* TEST CODE */
- var layoutOptions = new LayoutOptions(LayoutAlignment.Start, false);
-
- Assert.IsNotNull(layoutOptions, "Instance LayoutOptions can not be null");
- Assert.IsInstanceOf<LayoutOptions>(layoutOptions, "Object should be as LayoutOptions type");
- Assert.AreEqual(LayoutAlignment.Start, layoutOptions.Alignment, "Alignment should be in start");
-
- layoutOptions.Alignment = LayoutAlignment.Center;
- Assert.AreEqual(LayoutAlignment.Center, layoutOptions.Alignment, "Alignment should be in Center");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether LayoutOptions Expands is readable and writable")]
- [Property("SPEC", "Xamarin.Forms.LayoutOptions.Expands A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void Expands_READ_WRITE()
- {
- /* TEST CODE */
- var layoutOptions = new LayoutOptions(LayoutAlignment.Start, false);
-
- Assert.IsNotNull(layoutOptions, "Instance LayoutOptions can not be null");
- Assert.IsInstanceOf<LayoutOptions>(layoutOptions, "Object should be as LayoutOptions type");
- Assert.IsFalse(layoutOptions.Expands, "Expands should be false");
-
- layoutOptions.Expands = true;
- Assert.IsTrue(layoutOptions.Expands, "Expands should be false");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class LayoutOptionsConverterTests
- {
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("LayoutOptionsConverterTest --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("LayoutOptionsConverterTest --------------- TearDown()");
- }
-
- [Test]
- [Category("P0")]
- [Description("Create a LayoutOptions Instance")]
- [Property("SPEC", "Xamarin.Forms.LayoutOptionsConverter.LayoutOptionsConverter C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void LayoutOptionsConverter_INIT()
- {
- /* TEST CODE */
- var layoutOptionsConverter = new LayoutOptionsConverter();
- Assert.IsNotNull(layoutOptionsConverter, "Object is null after initialize");
- Assert.IsInstanceOf<LayoutOptionsConverter>(layoutOptionsConverter);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether method ConvertFromInvariantString returns a LayoutOptions for a valid layout options string.")]
- [Property("SPEC", "Xamarin.Forms.LayoutOptionsConverter.ConvertFromInvariantString M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void ConvertFromInvariantString_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- LayoutOptionsConverter layoutoption = new LayoutOptionsConverter();
- var layoutoptionObject = layoutoption.ConvertFromInvariantString("LayoutOptions.Center");
- Assert.IsInstanceOf<LayoutOptions>(layoutoptionObject);
- Assert.AreEqual(LayoutOptions.Center, layoutoptionObject, "LayoutOptions should be equal.");
- }
- }
-}
+++ /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 AutoTemplate;
-using NUnit.Framework;
-using NUnit.Framework.TUnit;
-using System.Threading.Tasks;
-using XamarinForTizen;
-using XamarinForTizen.Tizen;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.Layout<T> test")]
- public class LayoutTemplateTests : Layout<View>
- {
- private static App _app = Program.getApp();
- private static LayoutTemplateTests _layoutTemplate;
- private static bool _flagOnChildAdded, _flagOnChildRemoved, _flagOnAdded, _flagOnRemoved;
-
- protected override void LayoutChildren(double x, double y, double width, double height)
- {
-
- }
-
- protected override void OnChildAdded(Element child)
- {
- _flagOnChildAdded = true;
- base.OnChildAdded(child);
- }
-
- protected override void OnChildRemoved(Element child)
- {
- _flagOnChildRemoved = true;
- base.OnChildRemoved(child);
- }
-
- protected override void OnAdded(View view)
- {
- _flagOnAdded = true;
- base.OnAdded(view);
- }
-
- protected override void OnRemoved(View view)
- {
- _flagOnRemoved = true;
- base.OnRemoved(view);
- }
-
- [SetUp]
- public void Setup()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "LayoutTemplate CLASS: Setup---------------------------------");
- _layoutTemplate = new LayoutTemplateTests();
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "LayoutTemplate CLASS: Teardown------------------------------");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether LayoutTemplate is created or not")]
- [Property("SPEC", "Xamarin.Forms.Layout<T>.Layout C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void Layout_INIT()
- {
- /* TEST CODE */
- LayoutTemplateTests mLayoutTemplate = new LayoutTemplateTests();
- Assert.IsNotNull(mLayoutTemplate, "Object should be not null after initializing");
- Assert.IsInstanceOf<Layout<View>>(mLayoutTemplate, "Object should be Layout<View>");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Children property is readable or not")]
- [Property("SPEC", "Xamarin.Forms.Layout<T>.Children A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void Children_GET()
- {
- /* TEST CODE */
- var mChildren = _layoutTemplate.Children;
- Assert.IsNotNull(mChildren, "Children property should be not null");
- _layoutTemplate.Children.Add(new Label());
- Assert.AreEqual(_layoutTemplate.Children.Count, 1, "Children Count should be increased after add a child.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OnChildAdded is called after add a child or not.")]
- [Property("SPEC", "Xamarin.Forms.Layout<T>.OnChildAdded M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void OnChildAdded_CHECK_OVERRIDED()
- {
- /* TEST CODE */
- _flagOnChildAdded = false;
- Label mLabel = new Label();
- _layoutTemplate.Children.Add(mLabel);
- Assert.IsTrue(_flagOnChildAdded, "_flagOnChildAdded should be true after add a child into layout.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OnChildRemoved is called after remove a child or not.")]
- [Property("SPEC", "Xamarin.Forms.Layout<T>.OnChildRemoved M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void OnChildRemoved_CHECK_OVERRIDED()
- {
- /* TEST CODE */
- Label mLabel = new Label();
- _layoutTemplate.Children.Add(mLabel);
- _flagOnChildRemoved = false;
- _layoutTemplate.Children.Clear();
- Assert.IsTrue(_flagOnChildRemoved, "_flagOnChildAdded should be true after add a child into layout.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OnAdded is called after layout is added into another Layout not.")]
- [Property("SPEC", "Xamarin.Forms.Layout<T>.OnAdded M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void OnAdded_CHECK_OVERRIDED()
- {
- /* TEST CODE */
- _flagOnAdded = false;
- Label mLabel = new Label();
- _layoutTemplate.Children.Add(mLabel);
- Assert.IsTrue(_flagOnAdded, "_flagOnAdded should be true after after layout is added into another Layout.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OnRemoved is called after after layout is removed from another layout not.")]
- [Property("SPEC", "Xamarin.Forms.Layout<T>.OnRemoved M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void OnRemoved_CHECK_OVERRIDED()
- {
- /* TEST CODE */
- Label mLabel = new Label();
- _layoutTemplate.Children.Add(mLabel);
- _flagOnRemoved = false;
- _layoutTemplate.Children.Clear();
- Assert.IsTrue(_flagOnRemoved, "_flagOnRemoved should be true after layout is removed from another layout.");
- }
- }
-}
+++ /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 Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class ListStringTypeConverterTests
- {
- private ListStringTypeConverter _listStringTypeConverter;
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("ListStringTypeConverter --------------- SetUp()");
- _listStringTypeConverter = new ListStringTypeConverter();
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("ListStringTypeConverter --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a ListStringTypeConverter instance. Check whether object is successfully created or not")]
- [Property("SPEC", "Xamarin.Forms.ListStringTypeConverter.ListStringTypeConverter C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void ListStringTypeConverter_INIT()
- {
- /* TEST CODE */
- var listStringTypeConverter = new ListStringTypeConverter();
- Assert.IsNotNull(listStringTypeConverter, "Creating a ListStringTypeConverter object failed. It is set to null");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ConvertFromInvariantString is corrected or not")]
- [Property("SPEC", "Xamarin.Forms.ListStringTypeConverter.ConvertFromInvariantString A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void ConvertFromInvariantString_CHECK()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- Assert.IsNotNull(_listStringTypeConverter, "Creating a ListStringTypeConverter object failed. It is set to null");
-
- /* TEST CODE */
- var value = "One, Two, , Three, Four, Five";
- IList<String> lstString;
- lstString = (IList < String >)_listStringTypeConverter.ConvertFromInvariantString(value);
- var count = 6;
- Assert.AreEqual(count, lstString.Count, "ConvertFromInvariantString is not correct");
- string str1 = "Five";
- string str2 = null;
- foreach (string item in lstString)
- {
- str2 = item;
- }
- Assert.AreEqual(str1, str2, "ConvertFromInvariantString is not correct");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-using System.Windows.Input;
-using System.Collections.ObjectModel;
-using System.Collections.Generic;
-using XamarinForTizen.Tizen;
-using System.Threading.Tasks;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class ListViewTests
- {
- private static bool _flagCreateDefault, _flagSetupContent, _flagUnhookContent, _flagOnBindingContextChanged;
- private static ListView listView, listViewNew;
- private static Cell returnCell;
-
- public class CustomListView : ListView
- {
- public CustomListView() : base()
- {
- }
- public bool isOnSizeRequest { get; set; }
-
- protected override SizeRequest OnSizeRequest(double widthConstraint, double heightConstraint)
- {
- isOnSizeRequest = true;
- return base.OnSizeRequest(widthConstraint, heightConstraint);
- }
-
- protected override Cell CreateDefault(object item)
- {
- _flagCreateDefault = true;
- Console.WriteLine("CreateDefault is invoked: item.ToString() = " + item.ToString());
- returnCell = base.CreateDefault(item);
- return returnCell;
- }
-
- protected override void SetupContent(Cell content, int index)
- {
- _flagSetupContent = true;
- base.SetupContent(content, index);
- }
-
- protected override void OnBindingContextChanged()
- {
- _flagOnBindingContextChanged = true;
- base.OnBindingContextChanged();
- }
- }
-
-
- [SetUp]
- public void Setup()
- {
- Console.WriteLine("ListViewTests --------------- Setup()");
- listView = new ListView();
- listViewNew = new ListView();
- }
-
- [TearDown]
- public void TearDown()
- {
- listView = null;
- listViewNew = null;
- Console.WriteLine("ListViewTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a ListView object")]
- [Property("SPEC", "Xamarin.Forms.ListView.ListView C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void ListView_INIT()
- {
- /* TEST CODE */
- Assert.IsNotNull(listView, "ListView Instance is null");
- Assert.IsInstanceOf<ListView>(listView, "Should be an instance of ListView type.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create and initializes a ListView object")]
- [Property("SPEC", "Xamarin.Forms.ListView.ListView C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Property("COVPARAM", "Xamarin.Forms.ListViewCachingStrategy")]
- public void ListView_INIT_WITH_ListViewCachingStrategy()
- {
- /* TEST CODE */
- ListView listView = new ListView(ListViewCachingStrategy.RecycleElement);
- Assert.IsNotNull(listView, "ListView Instance is null");
- Assert.IsInstanceOf<ListView>(listView, "Should be an instance of ListView type.");
-
- listView = new ListView(ListViewCachingStrategy.RetainElement);
- Assert.IsNotNull(listView, "ListView Instance is null");
- Assert.IsInstanceOf<ListView>(listView, "Should be an instance of ListView type.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of FooterProperty's bound or not.")]
- [Property("SPEC", "Xamarin.Forms.ListView.FooterProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void FooterProperty_CHECK_BINDABLE()
- {
- /* TEST CODE */
- Label mFirstFooterProperty = new Label();
- mFirstFooterProperty.Text = "Tizen";
- Label mSecondFooterProperty = new Label();
- mSecondFooterProperty.Text = "TizenNew";
-
- listView.Footer = mFirstFooterProperty;
- listViewNew.Footer = mSecondFooterProperty;
-
- Assert.AreNotEqual(listView.Footer, listViewNew.Footer, "FooterProperty value must be different.");
- listView.BindingContext = listViewNew;
- listView.SetBinding(ListView.FooterProperty, "Footer");
- Assert.AreEqual(listViewNew.Footer, listView.Footer, "After binding, values should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of FooterTemplateProperty's bound or not.")]
- [Property("SPEC", "Xamarin.Forms.ListView.FooterTemplateProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void FooterTemplateProperty_CHECK_BINDABLE()
- {
- /* TEST CODE */
- listView.Footer = "Tizen";
- listViewNew.Footer = "TizenNew";
- var mFirstFooterTemplateProperty = new DataTemplate(typeof(Label))
- {
- Bindings = {
- { Label.TextProperty, new Binding (".") }
- }
- };
- var mSecondFooterTemplateProperty = new DataTemplate(typeof(Button))
- {
- Bindings = {
- { Button.TextProperty, new Binding (".") }
- }
- };
-
- listView.FooterTemplate = mFirstFooterTemplateProperty;
- listViewNew.FooterTemplate = mSecondFooterTemplateProperty;
-
- Assert.AreNotEqual(listView.FooterTemplate, listViewNew.FooterTemplate, "FooterTemplateProperty value must be different.");
- listView.BindingContext = listViewNew;
- listView.SetBinding(ListView.FooterTemplateProperty, "FooterTemplate");
- Assert.AreEqual(listViewNew.FooterTemplate, listView.FooterTemplate, "After binding, values should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of GroupHeaderTemplateProperty's bound or not.")]
- [Property("SPEC", "Xamarin.Forms.ListView.GroupHeaderTemplateProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void GroupHeaderTemplateProperty_CHECK_BINDABLE()
- {
- /* TEST CODE */
- var mFirstGroupHeaderTemplateProperty = new DataTemplate(typeof(TextCell));
- var mSecondGroupHeaderTemplateProperty = new DataTemplate(typeof(string));
-
- listView.GroupHeaderTemplate = mFirstGroupHeaderTemplateProperty;
- listViewNew.GroupHeaderTemplate = mSecondGroupHeaderTemplateProperty;
-
- Assert.AreNotEqual(listView.GroupHeaderTemplate, listViewNew.GroupHeaderTemplate, "GroupHeaderTemplateProperty value must be different.");
- listView.BindingContext = listViewNew;
- listView.SetBinding(ListView.GroupHeaderTemplateProperty, "GroupHeaderTemplate");
- Assert.AreEqual(listViewNew.GroupHeaderTemplate, listView.GroupHeaderTemplate, "After binding, values should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of HasUnevenRowsProperty's bound or not.")]
- [Property("SPEC", "Xamarin.Forms.ListView.HasUnevenRowsProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void HasUnevenRowsProperty_CHECK_BINDABLE()
- {
- /* TEST CODE */
- Boolean mFirstHasUnevenRows = true;
- Boolean mSecondHasUnevenRows = false;
-
- listView.HasUnevenRows = mFirstHasUnevenRows;
- listViewNew.HasUnevenRows = mSecondHasUnevenRows;
-
- Assert.AreNotEqual(listView.HasUnevenRows, listViewNew.HasUnevenRows, "HasUnevenRowsProperty value must be different.");
- listView.BindingContext = listViewNew;
- listView.SetBinding(ListView.HasUnevenRowsProperty, "HasUnevenRows");
- Assert.AreEqual(listViewNew.HasUnevenRows, listView.HasUnevenRows, "After binding, values should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of HeaderProperty's bound or not.")]
- [Property("SPEC", "Xamarin.Forms.ListView.HeaderProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void HeaderProperty_CHECK_BINDABLE()
- {
- /* TEST CODE */
- var mFirstHeader = new Label();
- mFirstHeader.Text = "Tizen";
- var mSecondHeader = new Label();
- mSecondHeader.Text = "TizenNew";
-
- listView.Header = mFirstHeader;
- listViewNew.Header = mSecondHeader;
-
- Assert.AreNotEqual(listView.Header, listViewNew.Header, "HeaderProperty value must be different.");
- listView.BindingContext = listViewNew;
- listView.SetBinding(ListView.HeaderProperty, "Header");
- Assert.AreEqual(listViewNew.Header, listView.Header, "After binding, values should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of HeaderTemplateProperty's bound or not.")]
- [Property("SPEC", "Xamarin.Forms.ListView.HeaderTemplateProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void HeaderTemplateProperty_CHECK_BINDABLE()
- {
- /* TEST CODE */
- var mFirstHeaderTemplateProperty = new DataTemplate(typeof(Label))
- {
- Bindings = {
- {
- Label.TextProperty, new Binding (".") }
- }
- };
- var mSecondHeaderTemplateProperty = new DataTemplate(typeof(Button))
- {
- Bindings = {
- {
- Button.TextProperty, new Binding (".") }
- }
- };
-
- listView.HeaderTemplate = mFirstHeaderTemplateProperty;
- listViewNew.HeaderTemplate = mSecondHeaderTemplateProperty;
-
- Assert.AreNotEqual(listView.HeaderTemplate, listViewNew.HeaderTemplate, "HeaderTemplateProperty value must be different.");
- listView.BindingContext = listViewNew;
- listView.SetBinding(ListView.HeaderTemplateProperty, "HeaderTemplate");
- Assert.AreEqual(listViewNew.HeaderTemplate, listView.HeaderTemplate, "After binding, values should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of IsGroupingEnabledProperty's bound or not.")]
- [Property("SPEC", "Xamarin.Forms.ListView.IsGroupingEnabledProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void IsGroupingEnabledProperty_CHECK_BINDABLE()
- {
- /* TEST CODE */
- var mFirstIsGroupingEnabledProperty = true;
- var mSecondIsGroupingEnabledProperty = false;
-
- listView.IsGroupingEnabled = mFirstIsGroupingEnabledProperty;
- listViewNew.IsGroupingEnabled = mSecondIsGroupingEnabledProperty;
-
- Assert.AreNotEqual(listView.IsGroupingEnabled, listViewNew.IsGroupingEnabled, "IsGroupingEnabledProperty value must be different.");
- listView.BindingContext = listViewNew;
- listView.SetBinding(ListView.IsGroupingEnabledProperty, "IsGroupingEnabled");
- Assert.AreEqual(listViewNew.IsGroupingEnabled, listView.IsGroupingEnabled, "After binding, values should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of IsPullToRefreshEnabledProperty's bound or not.")]
- [Property("SPEC", "Xamarin.Forms.ListView.IsPullToRefreshEnabledProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void IsPullToRefreshEnabledProperty_CHECK_BINDABLE()
- {
- /* TEST CODE */
- var mFirstIsPullToRefreshEnabledProperty = true;
- var mSecondIsPullToRefreshEnabledProperty = false;
-
- listView.IsPullToRefreshEnabled = mFirstIsPullToRefreshEnabledProperty;
- listViewNew.IsPullToRefreshEnabled = mSecondIsPullToRefreshEnabledProperty;
-
- Assert.AreNotEqual(listView.IsPullToRefreshEnabled, listViewNew.IsPullToRefreshEnabled, "IsPullToRefreshEnabledProperty value must be different.");
- listView.BindingContext = listViewNew;
- listView.SetBinding(ListView.IsPullToRefreshEnabledProperty, "IsPullToRefreshEnabled");
- Assert.AreEqual(listViewNew.IsPullToRefreshEnabled, listView.IsPullToRefreshEnabled, "After binding, values should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of IsRefreshingProperty's bound or not.")]
- [Property("SPEC", "Xamarin.Forms.ListView.IsRefreshingProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void IsRefreshingProperty_CHECK_BINDABLE()
- {
- /* TEST CODE */
- var mFirstIsIsRefreshingProperty = true;
- var mSecondIsIsRefreshingProperty = false;
-
- listView.IsRefreshing = mFirstIsIsRefreshingProperty;
- listViewNew.IsRefreshing = mSecondIsIsRefreshingProperty;
-
- Assert.AreNotEqual(listView.IsRefreshing, listViewNew.IsRefreshing, "IsRefreshingProperty value must be different.");
- listView.BindingContext = listViewNew;
- listView.SetBinding(ListView.IsRefreshingProperty, "IsRefreshing");
- Assert.AreEqual(listViewNew.IsRefreshing, listView.IsRefreshing, "After binding, values should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of RefreshCommandProperty's bound or not.")]
- [Property("SPEC", "Xamarin.Forms.ListView.RefreshCommandProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void RefreshCommandProperty_CHECK_BINDABLE()
- {
- /* TEST CODE */
- string result = null;
- string resultNew = "Tizen";
- var mFirstRefreshCommandProperty = new Command<string>(s => result = s, s => true);
- var mSecondRefreshCommandProperty = new Command<string>(s => resultNew = s, s => true);
-
- listView.RefreshCommand = mFirstRefreshCommandProperty;
- listViewNew.RefreshCommand = mSecondRefreshCommandProperty;
-
- Assert.AreNotEqual(listView.RefreshCommand, listViewNew.RefreshCommand, "RefreshCommandProperty value must be different.");
- listView.BindingContext = listViewNew;
- listView.SetBinding(ListView.RefreshCommandProperty, "RefreshCommand");
- Assert.AreEqual(listViewNew.RefreshCommand, listView.RefreshCommand, "After binding, values should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of RowHeightProperty's bound or not.")]
- [Property("SPEC", "Xamarin.Forms.ListView.RowHeightProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void RowHeightProperty_CHECK_BINDABLE()
- {
- /* TEST CODE */
- var mFirstRowHeightProperty = 2;
- var mSecondRowHeightProperty = 5;
-
- listView.RowHeight = mFirstRowHeightProperty;
- listViewNew.RowHeight = mSecondRowHeightProperty;
-
- Assert.AreNotEqual(listView.RowHeight, listViewNew.RowHeight, "RowHeightProperty value must be different.");
- listView.BindingContext = listViewNew;
- listView.SetBinding(ListView.RowHeightProperty, "RowHeight");
- Assert.AreEqual(listViewNew.RowHeight, listView.RowHeight, "After binding, values should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of SelectedItemProperty's bound or not.")]
- [Property("SPEC", "Xamarin.Forms.ListView.SelectedItemProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void SelectedItemProperty_CHECK_BINDABLE()
- {
- /* TEST CODE */
- var mFirstSelectedItemProperty = new Label();
- mFirstSelectedItemProperty.Text = "Tizen";
- var mSecondSelectedItemProperty = new Label();
- mSecondSelectedItemProperty.Text = "TizenNew";
-
- listView.SelectedItem = mFirstSelectedItemProperty;
- listViewNew.SelectedItem = mSecondSelectedItemProperty;
-
- Assert.AreNotEqual(listView.SelectedItem, listViewNew.SelectedItem, "SelectedItemProperty value must be different.");
- listView.BindingContext = listViewNew;
- listView.SetBinding(ListView.SelectedItemProperty, "SelectedItem");
- Assert.AreEqual(listViewNew.SelectedItem, listView.SelectedItem, "After binding, values should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of SeparatorColorProperty's bound or not.")]
- [Property("SPEC", "Xamarin.Forms.ListView.SeparatorColorProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void SeparatorColorProperty_CHECK_BINDABLE()
- {
- /* TEST CODE */
- var mFirstSeparatorColorProperty = Color.Green;
- var mSecondSeparatorColorProperty = Color.Red;
- listView.SeparatorColor = mFirstSeparatorColorProperty;
- listViewNew.SeparatorColor = mSecondSeparatorColorProperty;
-
- Assert.AreNotEqual(listView.SeparatorColor, listViewNew.SeparatorColor, "SeparatorColorProperty value must be different.");
- listView.BindingContext = listViewNew;
- listView.SetBinding(ListView.SeparatorColorProperty, "SeparatorColor");
- Assert.AreEqual(listViewNew.SeparatorColor, listView.SeparatorColor, "After binding, values should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of SeparatorVisibilityProperty's bound or not.")]
- [Property("SPEC", "Xamarin.Forms.ListView.SeparatorVisibilityProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void SeparatorVisibilityProperty_CHECK_BINDABLE()
- {
- /* TEST CODE */
- var mFirstSeparatorVisibilityProperty = SeparatorVisibility.Default;
- var mSecondSeparatorVisibilityProperty = SeparatorVisibility.None;
- listView.SeparatorVisibility = mFirstSeparatorVisibilityProperty;
- listViewNew.SeparatorVisibility = mSecondSeparatorVisibilityProperty;
-
- Assert.AreNotEqual(listView.SeparatorVisibility, listViewNew.SeparatorVisibility, "SeparatorColorProperty value must be different.");
- listView.BindingContext = listViewNew;
- listView.SetBinding(ListView.SeparatorVisibilityProperty, "SeparatorVisibility");
- Assert.AreEqual(listViewNew.SeparatorVisibility, listView.SeparatorVisibility, "After binding, values should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Footer Property is writeable and readable.")]
- [Property("SPEC", "Xamarin.Forms.ListView.Footer A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Footer_READ_WRITE()
- {
- /* TEST CODE */
- Label label = new Label();
- label.Text = "Tizen";
- listView.Footer = label;
- Assert.IsNotNull(listView, "Instance of ListView is null");
- Assert.IsInstanceOf<ListView>(listView, "Instance should be of ListView");
- Assert.AreEqual(listView.Footer, label, "Not returning the value which was set.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether FooterTemplate Property is writeable and readable.")]
- [Property("SPEC", "Xamarin.Forms.ListView.FooterTemplate A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void FooterTemplate_READ_WRITE()
- {
- /* TEST CODE */
- listView = new ListView
- {
- Footer = "footer",
- FooterTemplate = new DataTemplate(typeof(Label))
- {
- Bindings = {
- { Label.TextProperty, new Binding (".") }
- }
- }
- };
-
- IListViewController controller = listView;
- Assert.IsNotNull(controller.FooterElement, "Instance is returning null.");
- Assert.IsInstanceOf<Label>(controller.FooterElement, "Should be instance of Label Type.");
- Assert.AreEqual(((Label)controller.FooterElement).Text, listView.Footer, "Not returning expected footer text.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether GroupDisplayBinding Property is writeable and readable.")]
- [Property("SPEC", "Xamarin.Forms.ListView.GroupDisplayBinding A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void GroupDisplayBinding_READ_WRITE()
- {
- /* TEST CODE */
- BindingBase bindingBase = new Binding();
- bindingBase.StringFormat = "Tizen";
- listView.GroupDisplayBinding = bindingBase;
-
- Assert.IsNotNull(listView, "Instance of ListView is null");
- Assert.IsInstanceOf<ListView>(listView, "Instance should be of ListView");
- Assert.AreEqual(listView.GroupDisplayBinding.StringFormat, bindingBase.StringFormat, "Not returning the value which was set.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether GroupHeaderTemplate Property is writeable and readable.")]
- [Property("SPEC", "Xamarin.Forms.ListView.GroupHeaderTemplate A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void GroupHeaderTemplate_READ_WRITE()
- {
- /* TEST CODE */
- var groupHeaderTemplate = new DataTemplate(typeof(Label));
- listView.GroupHeaderTemplate = groupHeaderTemplate;
-
- Assert.IsNotNull(listView, "Listview instance is null.");
- Assert.IsInstanceOf<ListView>(listView, "Should be instance of ListView Type.");
- Assert.AreEqual(listView.GroupHeaderTemplate, groupHeaderTemplate, "Not returning expected value.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether GroupShortNameBinding Property is writeable and readable.")]
- [Property("SPEC", "Xamarin.Forms.ListView.GroupShortNameBinding A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void GroupShortNameBinding_READ_WRITE()
- {
- /* TEST CODE */
- BindingBase bindingBase = new Binding();
- bindingBase.StringFormat = "Tizen";
- listView.GroupShortNameBinding = bindingBase;
-
- Assert.IsNotNull(listView, "Listview instance is null.");
- Assert.IsInstanceOf<ListView>(listView, "Should be instance of ListView Type.");
- Assert.AreEqual(listView.GroupShortNameBinding.StringFormat, bindingBase.StringFormat, "Not returning expected value.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether HasUnevenRows Property is writeable and readable.")]
- [Property("SPEC", "Xamarin.Forms.ListView.HasUnevenRows A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void HasUnevenRows_READ_WRITE()
- {
- /* TEST CODE */
- listView.HasUnevenRows = true;
- Assert.IsNotNull(listView, "Listview instance is null.");
- Assert.IsInstanceOf<ListView>(listView, "Should be instance of ListView Type.");
- Assert.AreEqual(listView.HasUnevenRows, true, "Returning true expected false.");
-
- listView.HasUnevenRows = false;
- Assert.AreEqual(listView.HasUnevenRows, false, "Returning false expected true.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Header Property is writeable and readable.")]
- [Property("SPEC", "Xamarin.Forms.ListView.Header A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Header_READ_WRITE()
- {
- /* TEST CODE */
- Label label = new Label();
- label.Text = "Tizen";
- listView.Header = label;
- Assert.IsNotNull(listView, "Listview instance is null.");
- Assert.IsInstanceOf<ListView>(listView, "Should be instance of ListView Type.");
- Assert.AreEqual(listView.Header, label, "Not returning label type object.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether HeaderTemplate Property is writeable and readable.")]
- [Property("SPEC", "Xamarin.Forms.ListView.HeaderTemplate A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void HeaderTemplate_READ_WRITE()
- {
- /* TEST CODE */
- var headerTemplate = new DataTemplate(typeof(Label));
- listView.HeaderTemplate = headerTemplate;
-
- Assert.IsNotNull(listView, "Listview instance is null.");
- Assert.IsInstanceOf<ListView>(listView, "Should be instance of ListView Type.");
- Assert.AreEqual(listView.HeaderTemplate, headerTemplate, "Not returning expected return type.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether IsGroupingEnabled Property is writeable and readable.")]
- [Property("SPEC", "Xamarin.Forms.ListView.IsGroupingEnabled A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void IsGroupingEnabled_READ_WRITE()
- {
- /* TEST CODE */
- listView.IsGroupingEnabled = true;
- Assert.IsNotNull(listView, "Listview instance is null.");
- Assert.IsInstanceOf<ListView>(listView, "Should be instance of ListView Type.");
- Assert.AreEqual(listView.IsGroupingEnabled, true, "Returning false expected true.");
-
- listView.IsGroupingEnabled = false;
- Assert.AreEqual(listView.IsGroupingEnabled, false, "Returning true expected false.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether IsPullToRefreshEnabled Property is writeable and readable.")]
- [Property("SPEC", "Xamarin.Forms.ListView.IsPullToRefreshEnabled A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void IsPullToRefreshEnabled_READ_WRITE()
- {
- /* TEST CODE */
- listView.IsPullToRefreshEnabled = true;
- Assert.IsNotNull(listView, "Listview instance is null.");
- Assert.IsInstanceOf<ListView>(listView, "Should be instance of ListView Type.");
- Assert.AreEqual(listView.IsPullToRefreshEnabled, true, "Returning false expected true.");
-
- listView.IsPullToRefreshEnabled = false;
- Assert.AreEqual(listView.IsPullToRefreshEnabled, false, "Returning true expected false.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether IsRefreshing Property is writeable and readable.")]
- [Property("SPEC", "Xamarin.Forms.ListView.IsRefreshing A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void IsRefreshing_READ_WRITE()
- {
- /* TEST CODE */
- listView.IsRefreshing = true;
- Assert.IsNotNull(listView, "Listview instance is null.");
- Assert.IsInstanceOf<ListView>(listView, "Should be instance of ListView Type.");
- Assert.AreEqual(listView.IsRefreshing, true, "Returning false expected true.");
-
- listView.IsRefreshing = false;
- Assert.AreEqual(listView.IsRefreshing, false, "Returning true expected false.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether RefreshCommand Property is writeable and readable.")]
- [Property("SPEC", "Xamarin.Forms.ListView.RefreshCommand A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void RefreshCommand_READ_WRITE()
- {
- /* TEST CODE */
- bool commandExecuted = false;
- Command refresh = new Command(() => commandExecuted = true);
-
- listView.RefreshCommand = refresh;
- IListViewController controller = listView;
- controller.SendRefreshing();
- Assert.IsTrue(commandExecuted, "Expected true but returning false.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether RowHeight Property is writeable and readable.")]
- [Property("SPEC", "Xamarin.Forms.ListView.RowHeight A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void RowHeight_READ_WRITE()
- {
- /* TEST CODE */
- listView.RowHeight = 5;
- Assert.IsNotNull(listView, "Listview instance is null.");
- Assert.IsInstanceOf<ListView>(listView, "Should be instance of ListView Type.");
- Assert.AreEqual(listView.RowHeight, 5, "Not returning expected integer value.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether SelectedItem Property is writeable and readable.")]
- [Property("SPEC", "Xamarin.Forms.ListView.SelectedItem A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void SelectedItem_READ_WRITE()
- {
- /* TEST CODE */
- Label label = new Label();
- label.Text = "Tizen";
- listView.SelectedItem = label;
- Assert.IsNotNull(listView, "Listview instance is null.");
- Assert.IsInstanceOf<ListView>(listView, "Should be instance of ListView Type.");
- Assert.AreEqual(listView.SelectedItem, label, "Not returning expected label type.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether SeparatorColor Property is writeable and readable.")]
- [Property("SPEC", "Xamarin.Forms.ListView.SeparatorColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void SeparatorColor_READ_WRITE()
- {
- /* TEST CODE */
- listView.SeparatorColor = Color.Gray;
- Assert.IsNotNull(listView, "Listview instance is null.");
- Assert.IsInstanceOf<ListView>(listView, "Should be instance of ListView Type.");
- Assert.AreEqual(listView.SeparatorColor, Color.Gray, "Not returning expected color(Gray).");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether SeparatorVisibility Property is writeable and readable.")]
- [Property("SPEC", "Xamarin.Forms.ListView.SeparatorVisibility A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void SeparatorVisibility_READ_WRITE()
- {
- /* TEST CODE */
- listView.SeparatorVisibility = SeparatorVisibility.Default;
- Assert.IsNotNull(listView, "Listview instance is null.");
- Assert.IsInstanceOf<ListView>(listView, "Should be instance of ListView Type.");
- Assert.AreEqual(listView.SeparatorVisibility, SeparatorVisibility.Default, "Not returning expected SeparatorVisibility(Default).");
-
- listView.SeparatorVisibility = SeparatorVisibility.None;
- Assert.AreEqual(listView.SeparatorVisibility, SeparatorVisibility.None, "Not returning expected SeparatorVisibility(None).");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Refresh is starting.")]
- [Property("SPEC", "Xamarin.Forms.ListView.BeginRefresh M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void BeginRefresh_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- bool refreshing = false;
- listView.Refreshing += (sender, args) =>
- {
- refreshing = true;
- };
-
- listView.BeginRefresh();
- Assert.IsTrue(refreshing, "Expected true but was false.");
- Assert.IsTrue(listView.IsRefreshing, "Expected true but was false.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Refresh is ended.")]
- [Property("SPEC", "Xamarin.Forms.ListView.EndRefresh M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void EndRefresh_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- listView = new ListView { IsRefreshing = true };
- Assert.IsTrue(listView.IsRefreshing, "Expected true but returning false.");
-
- listView.EndRefresh();
- Assert.IsFalse(listView.IsRefreshing, "Expected false but returning true.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if scroll the listview to the item.")]
- [Property("SPEC", "Xamarin.Forms.ListView.ScrollTo M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Property("COVPARAM", "object, Xamarin.Forms.ScrollToPosition, bool")]
- public void ScrollTo_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- Label label = new Label();
- label.Text = "Tizen";
-
- try
- {
- listView.ScrollTo(label, ScrollToPosition.MakeVisible, animated: true);
- }
- catch (Exception ex)
- {
- Assert.IsTrue(false, "Should not throw exception. Exception: " + ex.Message);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if scroll the ListView to the item in the group.")]
- [Property("SPEC", "Xamarin.Forms.ListView.ScrollTo M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Property("COVPARAM", "object, object, Xamarin.Forms.ScrollToPosition, bool")]
- public void ScrollTo_CHECK_RETURN_VALUE_OBJECT()
- {
- /* TEST CODE */
- Label label = new Label();
- label.Text = "Tizen";
- Button button = new Button();
- button.Text = "TizenNew";
-
- try
- {
- listView.IsGroupingEnabled = true;
- listView.ScrollTo(button, label, ScrollToPosition.MakeVisible, animated: true);
- }
- catch (Exception ex)
- {
- Assert.IsTrue(false, "Should not throw exception. Exception: " + ex.Message);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if OnSizeRequest is invoked when SizeRequest is made.")]
- [Property("SPEC", "Xamarin.Forms.ListView.CreateDefault M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Nguyen Thao, nguyen.tthao@samsung.com")]
- public async Task CreateDefault_CHECK()
- {
- NavigationPage mainPage = Program.getNaviPage();
-
- /* TEST CODE */
- //CreateDefault: This method is called by the templating system when ListView.ItemTemplate is null.
- _flagCreateDefault = false;
- var listView1 = new CustomListView();
- Assert.IsNotNull(listView1, "Object should be null after initialize");
- listView1.ItemTemplate = null;
- var data = new List<string>();
- data.Add("item1");
- data.Add("item2");
- listView1.ItemsSource = data;
- await mainPage.PushAsync(new ContentPage { Content = listView1 });
-
- //Get value from returnCell which returned from protected override method "CreateDefault":
- Assert.IsNotNull(returnCell, "Returned cell should not null");
- Assert.True(_flagCreateDefault, "CreateDefault overrided method not invoked.");
-
- /* Postcondition: - Pop layout*/
- await mainPage.PopAsync();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check return ListView configuration")]
- [Property("SPEC", "Xamarin.Forms.ListView.On<T> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void On_CONFIGURATION_METHOD()
- {
- /*TEST CODE*/
- listView.ItemsSource = "Test Label";
- var myConfig = listView.On<IConfigPlatform>();
- Assert.IsInstanceOf<IPlatformElementConfiguration<IConfigPlatform, ListView>>(myConfig, "myConfig should be a instance of IPlatformElementConfiguration");
- Assert.IsInstanceOf<ListView>(myConfig.Element, "myConfig.Element should be an instance of Label");
- Assert.AreEqual("Test Label", myConfig.Element.ItemsSource, "Text of myConfig.Element value & Text of ListView Itemsource should be equal");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Need to override this method to register event handlers for list view items")]
- [Property("SPEC", "Xamarin.Forms.ListView.SetupContent M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Thao, nguyen.tthao@samsung.com")]
- public void SetupContent_OVERRIDE_METHOD()
- {
- /*TEST CODE*/
- /* TEST CODE */
- //CreateDefault: This method is called by the templating system when ListView.ItemTemplate is null.
- _flagSetupContent = false;
- var listView1 = new CustomListView();
- listView1.ItemTemplate = null;
- Assert.IsNotNull(listView, "Object should be null after initialize");
-
- //Get value from returnCell which returned from protected override method "CreateDefault":
- Assert.IsNotNull(returnCell, "Returned cell should not null");
- Assert.True(_flagSetupContent, "SetupContent overrided method not invoked.");
-
- //listView1. add item --> click item --> invoke SetupContent
-
- }
-
- //[Test]
- [Category("P1")]
- [Description("Need to override this method to unregister event handlers for list view items")]
- [Property("SPEC", "Xamarin.Forms.ListView.UnhookContent M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void UnhookContent_OVERRIDE_METHOD()
- {
- /*TEST CODE*/
- Assert.True(false, "[NA] Need to check API behavior");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if OnSizeRequest is invoked when SizeRequest is made.")]
- [Property("SPEC", "Xamarin.Forms.ListView.OnSizeRequest M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void OnSizeRequest_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- CustomListView customListView = new CustomListView();
- customListView.GetSizeRequest(double.PositiveInfinity, double.PositiveInfinity);
- Assert.IsTrue(customListView.isOnSizeRequest, "Returning false expected true.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ItemAppearing Event is raised when the visual representation of an item is being added to the visual layout.")]
- [Property("SPEC", "Xamarin.Forms.ListView.ItemAppearing E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void ItemAppearing_EVENT()
- {
- /* TEST CODE */
- bool flagItemAppearing = false;
-
- listView.ItemAppearing += (sender, args) =>
- {
- flagItemAppearing = true;
- };
- ((IListViewController)listView).SendCellAppearing(new TextCell());
-
- Assert.IsTrue(flagItemAppearing, "Event ItemAppearing should be handled.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ItemDisappearing Event is raised when the visual representation of an item is being removed from the visual layout.")]
- [Property("SPEC", "Xamarin.Forms.ListView.ItemDisappearing E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void ItemDisappearing_EVENT()
- {
- /* TEST CODE */
- bool flagItemDisappearing = false;
- listView.ItemsSource = new object[] { 0d, "test" };
-
- listView.ItemDisappearing += (sender, args) =>
- {
- flagItemDisappearing = true;
- };
-
- //listView.ItemsSource = null;
- ((IListViewController)listView).SendCellDisappearing(new TextCell());
- Assert.IsTrue(flagItemDisappearing, "Event ItemDisappearing should be handled.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ItemSelected Event is raised when a new item is selected.")]
- [Property("SPEC", "Xamarin.Forms.ListView.ItemSelected E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void ItemSelected_EVENT()
- {
- /* TEST CODE */
- Label label = new Label();
- label.Text = "Tizen";
- bool flagItemSelected = false;
-
- listView.ItemSelected += (sender, args) =>
- {
- flagItemSelected = true;
- };
- listView.SelectedItem = label;
- Assert.IsTrue(flagItemSelected, "Event ItemSelected should be handled.");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check whether ItemTapped Event is raised when an item is tapped.")]
- [Property("SPEC", "Xamarin.Forms.ListView.ItemTapped E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void ItemTapped_EVENT()
- {
- /* TEST CODE */
- Assert.IsTrue(false, "[NA] Need to do manual.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Refreshing Event is raised when the list view refreshes.")]
- [Property("SPEC", "Xamarin.Forms.ListView.Refreshing E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Refreshing_EVENT()
- {
- /* TEST CODE */
- bool flagRefreshing = false;
-
- listView.Refreshing += (sender, args) =>
- {
- flagRefreshing = true;
- };
-
- listView.BeginRefresh();
- listView.EndRefresh();
- Assert.IsTrue(flagRefreshing, "Event Refreshing should be handled.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OnBindingContextChanged overridden method is called when the binding context changes.")]
- [Property("SPEC", "Xamarin.Forms.ListView.OnBindingContextChanged M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void OnBindingContextChanged_OVERRIDE_METHOD()
- {
- /* TEST CODE */
- _flagOnBindingContextChanged = false;
- var listView1 = new CustomListView();
- listView1.ItemTemplate = null;
- Assert.IsNotNull(listView, "Object should be null after initialize");
-
- var mFirstHeader = new Label();
- mFirstHeader.Text = "Tizen";
- var mSecondHeader = new Label();
- mSecondHeader.Text = "TizenNew";
-
- listView1.Header = mFirstHeader;
- listViewNew.Header = mSecondHeader;
-
- listView1.BindingContext = listViewNew;
- listView1.SetBinding(ListView.HeaderProperty, "Header");
-
- listView1.ItemTemplate = new DataTemplate();
- Label label = new Label();
- label.Text = "Tizen";
- listView1.Header = label;
-
- Assert.True(_flagOnBindingContextChanged, "OnBindingContextChanged overrided method not invoked.");
- }
- }
-}
+++ /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 XamarinForTizen.Tizen;
-using System.Threading.Tasks;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class MasterDetailPageTests
- {
- private static NavigationPage _mainNavigationPage = Program.getNaviPage();
-
- public class CustomMasterDetailPage : MasterDetailPage
- {
- public bool MdOnAppearing { get; set; }
- public bool MdOnDisappearing { get; set; }
- public bool MdOnParentSet { get; set; }
-
- public bool FlagLayoutChildren { get; set; }
-
- protected override void OnAppearing()
- {
- base.OnAppearing();
- MdOnAppearing = true;
- }
-
- protected override void OnDisappearing()
- {
- base.OnDisappearing();
- MdOnDisappearing = true;
- }
-
- protected override void OnParentSet()
- {
- base.OnParentSet();
- MdOnParentSet = true;
- }
-
- protected override void LayoutChildren(double x, double y, double width, double height)
- {
- base.LayoutChildren(x, y, width, height);
- FlagLayoutChildren = true;
- }
- }
-
- private void CreateMasterPage(CustomMasterDetailPage masterPage)
- {
- Label header = new Label
- {
- Text = "MasterDetailPage",
- FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)),
- HorizontalOptions = LayoutOptions.Center
- };
-
- Label detail = new Label
- {
- Text = "Detail Page",
- FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)),
- HorizontalOptions = LayoutOptions.Center
- };
-
- string[] pageDetailArray =
- {
- "Page 1", "Page 2", "Page 3", "Page 4"
- };
- ListView listView = new ListView
- {
- ItemsSource = pageDetailArray
- };
-
- masterPage.Master = new ContentPage
- {
- Title = header.Text,
- Content = new StackLayout
- {
- Children =
- {
- header,
- listView
- }
- }
- };
- masterPage.Detail = new ContentPage { Content = detail };
- listView.ItemSelected += (sender, arg) =>
- {
- detail.Text = arg.SelectedItem.ToString();
- };
- _mainNavigationPage.PushAsync(masterPage);
- }
-
- private static CustomMasterDetailPage _masterDetails;
-
- [SetUp]
- public void Setup()
- {
- Console.WriteLine("MasterDetailPageTests --------------- Setup()");
- if (Device.Idiom != TargetIdiom.Phone)
- {
- Assert.Pass("Not Supported");
- }
- else
- {
- _masterDetails = new CustomMasterDetailPage();
- }
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("MasterDetailPageTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Creates a new empty MasterDetailPage.")]
- [Property("SPEC", "Xamarin.Forms.MasterDetailPage.MasterDetailPage C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void MasterDetailPage_INIT()
- {
- /* TEST CODE */
- MasterDetailPage masterDetailPage = new MasterDetailPage();
- Assert.IsNotNull(masterDetailPage, "Instance of MasterDetailPage is null");
- Assert.IsInstanceOf<MasterDetailPage>(masterDetailPage, "Instance should be of MasterDetailPage.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether IsGestureEnabledProperty property bound or not.")]
- [Property("SPEC", "Xamarin.Forms.MasterDetailPage.IsGestureEnabledProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void IsGestureEnabledProperty_CHECK_BINDABLE()
- {
- /*TEST CODE*/
- var mFirstGestureEnabledProperty = true;
- var mSecondGestureEnabledProperty = false;
- MasterDetailPage firstMasterDetailPage = new MasterDetailPage();
- MasterDetailPage secondMasterDetailPage = new MasterDetailPage();
-
- firstMasterDetailPage.IsGestureEnabled = mFirstGestureEnabledProperty;
- secondMasterDetailPage.IsGestureEnabled = mSecondGestureEnabledProperty;
-
- Assert.AreNotEqual(firstMasterDetailPage.IsGestureEnabled, secondMasterDetailPage.IsGestureEnabled, "IsGestureEnabledProperty value must be different.");
- firstMasterDetailPage.BindingContext = secondMasterDetailPage;
- firstMasterDetailPage.SetBinding(MasterDetailPage.IsGestureEnabledProperty, "IsGestureEnabled");
- Assert.AreEqual(firstMasterDetailPage.IsGestureEnabled, secondMasterDetailPage.IsGestureEnabled, "After binding, values should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether IsPresented property bound or not.")]
- [Property("SPEC", "Xamarin.Forms.MasterDetailPage.IsPresentedProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void IsPresentedProperty_CHECK_BINDABLE()
- {
- /*TEST CODE*/
- var mFirstIsPresentedProperty = true;
- var mSecondIsPresentedProperty = false;
- MasterDetailPage firstMasterDetailPage = new MasterDetailPage();
- MasterDetailPage secondMasterDetailPage = new MasterDetailPage();
-
- firstMasterDetailPage.IsPresented = mFirstIsPresentedProperty;
- secondMasterDetailPage.IsPresented = mSecondIsPresentedProperty;
-
- Assert.AreNotEqual(firstMasterDetailPage.IsPresented, secondMasterDetailPage.IsPresented, "IsPresentedProperty value must be different.");
- firstMasterDetailPage.BindingContext = secondMasterDetailPage;
- firstMasterDetailPage.SetBinding(MasterDetailPage.IsPresentedProperty, "IsPresented");
- Assert.AreEqual(firstMasterDetailPage.IsPresented, secondMasterDetailPage.IsPresented, "After binding, values should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether MasterBehavior property bound or not.")]
- [Property("SPEC", "Xamarin.Forms.MasterDetailPage.MasterBehaviorProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void MasterBehaviorProperty_CHECK_BINDABLE()
- {
- /*TEST CODE*/
- var mFirstMasterBehaviorProperty = MasterBehavior.Popover;
- var mSecondMasterBehaviorProperty = MasterBehavior.Split;
- MasterDetailPage firstMasterDetailPage = new MasterDetailPage();
- MasterDetailPage secondMasterDetailPage = new MasterDetailPage();
-
- firstMasterDetailPage.MasterBehavior = mFirstMasterBehaviorProperty;
- secondMasterDetailPage.MasterBehavior = mSecondMasterBehaviorProperty;
-
- Assert.AreNotEqual(firstMasterDetailPage.MasterBehavior, secondMasterDetailPage.MasterBehavior, "MasterBehaviorProperty value must be different.");
- firstMasterDetailPage.BindingContext = secondMasterDetailPage;
- firstMasterDetailPage.SetBinding(MasterDetailPage.MasterBehaviorProperty, "MasterBehavior");
- Assert.AreEqual(firstMasterDetailPage.MasterBehavior, secondMasterDetailPage.MasterBehavior, "After binding, values should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Detail Property is writeable and readable.")]
- [Property("SPEC", "Xamarin.Forms.MasterDetailPage.Detail A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Detail_READ_WRITE()
- {
- /* TEST CODE */
- Page page = new Page();
- page.Title = "Tizen";
- MasterDetailPage masterDetailPage = new MasterDetailPage();
- masterDetailPage.Detail = page;
- Assert.IsNotNull(masterDetailPage, "Instance of MasterDetailPage is null");
- Assert.IsInstanceOf<MasterDetailPage>(masterDetailPage, "Instance should be of MasterDetailPage");
- Assert.AreEqual(masterDetailPage.Detail, page, "Set and get values are not equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether IsGestureEnabled Property is writeable and readable.")]
- [Property("SPEC", "Xamarin.Forms.MasterDetailPage.IsGestureEnabled A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void IsGestureEnabled_READ_WRITE()
- {
- /* TEST CODE */
- MasterDetailPage masterDetailPage = new MasterDetailPage();
- masterDetailPage.IsGestureEnabled = true;
- Assert.IsNotNull(masterDetailPage, "Instance of MasterDetailPage is null");
- Assert.IsInstanceOf<MasterDetailPage>(masterDetailPage, "Instance should be of MasterDetailPage");
- Assert.AreEqual(masterDetailPage.IsGestureEnabled, true, "Returning false, even though set value was true.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether IsPresented Property is writeable and readable.")]
- [Property("SPEC", "Xamarin.Forms.MasterDetailPage.IsPresented A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void IsPresented_READ_WRITE()
- {
- /* TEST CODE */
- MasterDetailPage masterDetailPage = new MasterDetailPage();
- masterDetailPage.IsPresented = true;
- Assert.IsNotNull(masterDetailPage, "Instance of MasterDetailPage is null");
- Assert.IsInstanceOf<MasterDetailPage>(masterDetailPage, "Instance should be of MasterDetailPage");
- Assert.AreEqual(masterDetailPage.IsPresented, true, "Returning false, even though set value was true.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Master Property is writeable and readable.")]
- [Property("SPEC", "Xamarin.Forms.MasterDetailPage.Master A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Master_READ_WRITE()
- {
- /* TEST CODE */
- Page page = new Page();
- page.Title = "Tizen";
- MasterDetailPage masterDetailPage = new MasterDetailPage();
- masterDetailPage.Master = page;
- Assert.IsNotNull(masterDetailPage, "Instance of MasterDetailPage is null");
- Assert.IsInstanceOf<MasterDetailPage>(masterDetailPage, "Instance should be of MasterDetailPage");
- Assert.AreEqual(masterDetailPage.Master, page, "Set and get values are not equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether MasterBehavior Property is writeable and readable.")]
- [Property("SPEC", "Xamarin.Forms.MasterDetailPage.MasterBehavior A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRE")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void MasterBehavior_READ_WRITE()
- {
- /* TEST CODE */
- MasterDetailPage masterDetailPage = new MasterDetailPage();
- masterDetailPage.MasterBehavior = MasterBehavior.Default;
- Assert.IsNotNull(masterDetailPage, "Instance of MasterDetailPage is null");
- Assert.IsInstanceOf<MasterDetailPage>(masterDetailPage, "Instance should be of MasterDetailPage");
- Assert.AreEqual(masterDetailPage.MasterBehavior, MasterBehavior.Default, "Set and get values are not equal.");
-
- masterDetailPage.MasterBehavior = MasterBehavior.Popover;
- Assert.AreEqual(masterDetailPage.MasterBehavior, MasterBehavior.Popover, "Set and get values are not equal.");
-
- masterDetailPage.MasterBehavior = MasterBehavior.Split;
- Assert.AreEqual(masterDetailPage.MasterBehavior, MasterBehavior.Split, "Set and get values are not equal.");
-
- masterDetailPage.MasterBehavior = MasterBehavior.SplitOnLandscape;
- Assert.AreEqual(masterDetailPage.MasterBehavior, MasterBehavior.SplitOnLandscape, "Set and get values are not equal.");
-
- masterDetailPage.MasterBehavior = MasterBehavior.SplitOnPortrait;
- Assert.AreEqual(masterDetailPage.MasterBehavior, MasterBehavior.SplitOnPortrait, "Set and get values are not equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if list view should display a toolbar button or not.")]
- [Property("SPEC", "Xamarin.Forms.MasterDetailPage.ShouldShowToolbarButton M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void ShouldShowToolbarButton_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- MasterDetailPage masterDetailPage = new MasterDetailPage();
- Assert.IsInstanceOf<Boolean>(masterDetailPage.ShouldShowToolbarButton(), "Should be a instance ob Boolean");
- Assert.IsTrue(masterDetailPage.ShouldShowToolbarButton(), "ListView should display a toolbar button.");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check if list view should display a toolbar button or not.")]
- [Property("SPEC", "Xamarin.Forms.MasterDetailPage.ShouldShowToolbarButton M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Shddn_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- MasterDetailPage masterDetailPage = new MasterDetailPage();
-
- Assert.IsInstanceOf<Boolean>(masterDetailPage.ShouldShowToolbarButton(), "Should be a instance ob Boolean");
- Assert.IsTrue(masterDetailPage.ShouldShowToolbarButton(), "ListView should display a toolbar button.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check Invoke LayoutChildren method, and check whether lays out the master and detail pages.")]
- [Property("SPEC", "Xamarin.Forms.MasterDetailPage.LayoutChildren M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public async Task LayoutChildren_CHECK()
- {
- /* TEST CODE */
- CustomMasterDetailPage masterPage = new CustomMasterDetailPage();
- masterPage.FlagLayoutChildren = false;
- CreateMasterPage(masterPage);
- masterPage.Layout(new Rectangle() { X = 0, Y = 0, Width = 300, Height = 400 });
-
- await Task.Delay(2000);
-
- Assert.IsTrue(masterPage.FlagLayoutChildren, "layout the MasterDetail pages not call LayoutChildren()");
- await _mainNavigationPage.PopAsync();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if event is raised when a detail appears.")]
- [Property("SPEC", "Xamarin.Forms.MasterDetailPage.OnAppearing M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void OnAppearing_CHECK_INVOKE()
- {
- /* TEST CODE */
- bool emitted = false;
- _masterDetails.Appearing += (sender, args) => emitted = true;
- ((IPageController)_masterDetails).SendAppearing();
- Assert.IsTrue(emitted, "Value should be true");
- Assert.IsTrue(_masterDetails.MdOnAppearing, "Value should be true");
- Assert.IsFalse(_masterDetails.MdOnDisappearing, "Value should be false");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check if eventis raised when a detail disappears.")]
- [Property("SPEC", "Xamarin.Forms.MasterDetailPage.OnDisappearing M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void OnDisappearing_CHECK_INVOKE()
- {
- /* TEST CODE */
- bool emitted = false;
- ((IPageController)_masterDetails).SendAppearing();
- _masterDetails.Disappearing += (sender, args) => emitted = true;
- ((IPageController)_masterDetails).SendDisappearing();
- Assert.IsTrue(emitted, "emited Value should be true");
- Assert.IsTrue(_masterDetails.MdOnDisappearing, "Value should be true");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if this method is called when the Element.Parent property of this Xmarin.Forms.MasterDetailPage is set.")]
- [Property("SPEC", "Xamarin.Forms.MasterDetailPage.OnParentSet M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void OnParentSet_CHECK_INVOKE()
- {
- /* TEST CODE */
- var page = new ContentPage();
- //_masterDetails.
- var master = new ContentPage { Content = new Label(), Title = "Master" };
- _masterDetails.Master = master;
- var detail = new ContentPage { Content = new Label() };
- _masterDetails.Detail = detail;
- _masterDetails.Parent = page;
- Assert.IsTrue(_masterDetails.MdOnParentSet, "Value should be true");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if the event is raised when the visual element that is represented by the MasterDetailPage.Master property is presented or hidden.")]
- [Property("SPEC", "Xamarin.Forms.MasterDetailPage.IsPresentedChanged M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void IsPresentedChanged_CHECK_EVENT()
- {
- /* TEST CODE */
- int emitted = 0;
- _masterDetails.IsPresentedChanged += (sender, args) =>
- {
- emitted++;
- };
- _masterDetails.IsPresented = true;
- Assert.AreEqual(1, emitted, "IsPresentedChanged event should be raised when the element is presented.");
- _masterDetails.IsPresented = false;
- Assert.AreEqual(2, emitted, "IsPresentedChanged event should be raised when the element is hidden.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check return MasterDetailPage configuration")]
- [Property("SPEC", "Xamarin.Forms.MasterDetailPage.On<T> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void On_CONFIGURATION_METHOD()
- {
- /*TEST CODE*/
- var mResouce = new ResourceDictionary();
- _masterDetails.Resources = mResouce;
- var myConfig = _masterDetails.On<IConfigPlatform>();
- Assert.IsInstanceOf<IPlatformElementConfiguration<IConfigPlatform, MasterDetailPage>>(myConfig, "myConfig should be a instance of IPlatformElementConfiguration");
- Assert.IsInstanceOf<MasterDetailPage>(myConfig.Element, "myConfig.Element should be a instance of MasterDetailPage");
- Assert.AreEqual(mResouce, myConfig.Element.Resources, "Resources of myConfig.Element value & Resources of _masterDetails should be to equal");
- }
- }
-}
+++ /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.Windows.Input;
-using XamarinForTizen.Tizen;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class MenuItemTests
- {
- private MenuItem _menuItem;
- private string _appResourcePath = Program.Current.DirectoryInfo.Resource;
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("MenuItemTests --------------- SetUp()");
- _menuItem = new MenuItem();
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("MenuItemTests --------------- TearDown()");
- }
-
- public class SubIcommand : ICommand
- {
- public event EventHandler CanExecuteChanged;
-
- public bool CanExecute(object parameter)
- {
- return true;
- throw new NotImplementedException();
- }
-
- public void Execute(object parameter)
- {
- throw new NotImplementedException();
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a MenuItem instance. Check whether object is successfully created or not")]
- [Property("SPEC", "Xamarin.Forms.MenuItem.MenuItem C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void MenuItem_INIT()
- {
- /* TEST CODE */
- var menuItem = new MenuItem();
- Assert.IsNotNull(menuItem, "Creating a MenuItem object failed. It is set to null");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property CommandParameterProperty is readable")]
- [Property("SPEC", "Xamarin.Forms.MenuItem.CommandParameterProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void CommandParameterProperty_PROPERTY()
- {
- /* TEST CODE */
- var commandParameter1 = "CommandParameter 1";
- var menuItem1 = new MenuItem();
- menuItem1.CommandParameter = commandParameter1;
- var commandParameter2 = "Test CommandParameter 02";
- var menuItem2 = new MenuItem();
- menuItem2.CommandParameter = commandParameter2;
- Assert.AreNotEqual(menuItem1.CommandParameter, menuItem2.CommandParameter, "CommandParameter should be different between two MenuItem objects");
- menuItem1.BindingContext = menuItem2;
- menuItem1.SetBinding(MenuItem.CommandParameterProperty, "CommandParameter");
- Assert.AreEqual(menuItem1.CommandParameter, menuItem2.CommandParameter, "CommandParameter should be same between two MenuItem objects");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property CommandProperty is readable")]
- [Property("SPEC", "Xamarin.Forms.MenuItem.CommandProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void CommandProperty_PROPERTY()
- {
- /* TEST CODE */
- var getCommandProperty = MenuItem.CommandProperty;
- Assert.IsInstanceOf<BindableProperty>(getCommandProperty);
- Assert.IsFalse(getCommandProperty.IsReadOnly, "CommandProperty should be not readonly property");
- Assert.AreEqual("Command", getCommandProperty.PropertyName, "Name of Property should be Command");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property IconProperty is readable")]
- [Property("SPEC", "Xamarin.Forms.MenuItem.IconProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void IconProperty_PROPERTY()
- {
- /* TEST CODE */
- var strSource = _appResourcePath + "TED/thumbnail/a.jpg";
- var fileImageSource1 = new FileImageSource();
- fileImageSource1.File = strSource;
- var menuItem1 = new MenuItem();
- menuItem1.Icon = fileImageSource1;
- var menuItem2 = new MenuItem()
- {
- Icon = new FileImageSource().File = _appResourcePath + "TED/thumbnail/b.jpg",
- };
- Assert.AreNotEqual(menuItem1.Icon.File, menuItem2.Icon.File, "Icon should be different between two MenuItem objects");
- menuItem1.BindingContext = menuItem2;
- menuItem1.SetBinding(MenuItem.IconProperty, "Icon");
- Assert.AreEqual(menuItem1.Icon.File, menuItem2.Icon.File, "Icon should be same between two MenuItem objects");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property IsDestructiveProperty is readable")]
- [Property("SPEC", "Xamarin.Forms.MenuItem.IsDestructiveProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void IsDestructiveProperty_PROPERTY()
- {
- /* TEST CODE */
- var menuItem1 = new MenuItem();
- menuItem1.IsDestructive = true;
- var menuItem2 = new MenuItem();
- menuItem2.IsDestructive = false;
- Assert.AreNotEqual(menuItem1.IsDestructive, menuItem2.IsDestructive, "IsDestructive should be different between two MenuItem objects");
- menuItem1.BindingContext = menuItem2;
- menuItem1.SetBinding(MenuItem.IsDestructiveProperty, "IsDestructive");
- Assert.AreEqual(menuItem1.IsDestructive, menuItem2.IsDestructive, "IsDestructive should be same between two MenuItem objects");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property TextProperty is readable")]
- [Property("SPEC", "Xamarin.Forms.MenuItem.TextProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void TextProperty_PROPERTY()
- {
- /* TEST CODE */
- var text1 = "Text 1";
- var menuItem1 = new MenuItem();
- menuItem1.Text = text1;
- var text2 = "Test Text 02";
- var menuItem2 = new MenuItem();
- menuItem2.Text = text2;
- Assert.AreNotEqual(menuItem1.Text, menuItem2.Text, "Text should be different between two MenuItem objects");
- menuItem1.BindingContext = menuItem2;
- menuItem1.SetBinding(MenuItem.TextProperty, "Text");
- Assert.AreEqual(menuItem1.Text, menuItem2.Text, "Text should be same between two MenuItem objects");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Command is readable and settable with valid values")]
- [Property("SPEC", "Xamarin.Forms.MenuItem.Command A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void Command_PROPERTY_SET_GET()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- Assert.IsNotNull(_menuItem, "Creating a MenuItem object failed. It is set to null");
-
- /* TEST CODE */
- var command = new SubIcommand();
- _menuItem.Command = command;
- var getCommand = _menuItem.Command;
- Assert.IsNotNull(getCommand, "Set and get value of Command is not successful");
- Assert.IsTrue(getCommand.CanExecute(null));
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property CommandParameter is readable and settable with valid values")]
- [Property("SPEC", "Xamarin.Forms.MenuItem.CommandParameter A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void CommandParameter_PROPERTY_SET_GET()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- Assert.IsNotNull(_menuItem, "Creating a MenuItem object failed. It is set to null");
-
- /* TEST CODE */
- var commandParameter = "CommandParameter Test";
- _menuItem.CommandParameter = commandParameter;
- Assert.AreEqual(commandParameter, _menuItem.CommandParameter, "Set and get value of CommandParameter is not successful");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Icon is readable and settable with valid values")]
- [Property("SPEC", "Xamarin.Forms.MenuItem.Icon A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void Icon_PROPERTY_SET_GET()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- Assert.IsNotNull(_menuItem, "Creating a MenuItem object failed. It is set to null");
-
- /* TEST CODE */
- var strSource = _appResourcePath + "TED/thumbnail/a.jpg";
- var fileImageSource = new FileImageSource();
- fileImageSource.File = strSource;
- _menuItem.Icon = fileImageSource;
- var getIcon = _menuItem.Icon;
- Assert.IsNotNull(getIcon, "Got icon should be not null");
- Assert.AreEqual(strSource, getIcon.File, "Set and get value of Icon is not successful");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property IsDestructive is readable and settable with valid values")]
- [Property("SPEC", "Xamarin.Forms.MenuItem.IsDestructive A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void IsDestructive_PROPERTY_SET_GET()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- Assert.IsNotNull(_menuItem, "Creating a MenuItem object failed. It is set to null");
-
- /* TEST CODE */
- _menuItem.IsDestructive = true;
- Assert.IsTrue(_menuItem.IsDestructive);
- _menuItem.IsDestructive = false;
- Assert.IsFalse(_menuItem.IsDestructive);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Text is readable and settable with valid values")]
- [Property("SPEC", "Xamarin.Forms.MenuItem.Text A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void Text_PROPERTY_SET_GET()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- Assert.IsNotNull(_menuItem, "Creating a MenuItem object failed. It is set to null");
-
- /* TEST CODE */
- var text = "Text Property Test";
- _menuItem.Text = text;
- Assert.AreEqual(text, _menuItem.Text, "Set and get value of Text is not successful");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check whether OnClicked event is invoked or not")]
- [Property("SPEC", "Xamarin.Forms.MenuItem.OnClicked E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void OnClicked_EVENT()
- {
- /* TEST CODE */
- Assert.True(false, "[NA]Manual TC.");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check whether Clicked event is invoked or not")]
- [Property("SPEC", "Xamarin.Forms.MenuItem.Clicked E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void Clicked_EVENT()
- {
- /* TEST CODE */
- Assert.True(false, "[NA]Manual TC.");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-using NUnit.Framework.TUnit;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.MessagingCenter Tests")]
- public class MessagingCenterTests
- {
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("MessagingCenterTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("MessagingCenterTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Subscribe.")]
- [Property("SPEC", "Xamarin.Forms.MessagingCenter.Subscribe<TSender> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Property("COVPARAM", "object, string, System.Action<TSender>, TSender")]
- public void Subscribe_NO_ARGS_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- bool flagSubscribeMessage = false;
- MessagingCenter.Subscribe<MessagingCenterTests>(this, "SimpleTest", sender => flagSubscribeMessage = true);
- MessagingCenter.Send(this, "SimpleTest");
-
- Assert.IsTrue(flagSubscribeMessage, "Message is not subscribed successfully.");
-
- /*POSTCONDITION*/
- /*
- * 1. Unsubscribes the subscriber from the specified messages.
- */
- MessagingCenter.Unsubscribe<MessagingCenterTests>(this, "SimpleTest");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Subscribe.")]
- [Property("SPEC", "Xamarin.Forms.MessagingCenter.Subscribe<TSender,TArgs> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Property("COVPARAM", "object, string, System.Action<TSender,TArgs>, TSender")]
- public void Subscribe_WITH_ARGS_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- string subscribeMessage = null;
- MessagingCenter.Subscribe<MessagingCenterTests, string>(this, "SimpleTest", (sender, args) => subscribeMessage = args);
- MessagingCenter.Send(this, "SimpleTest", "My Message");
-
- Assert.IsTrue(subscribeMessage.Equals("My Message"), "Message is not subscribed successfully.");
-
- /*POSTCONDITION*/
- /*
- * 1. Unsubscribes the subscriber from the specified messages.
- */
- MessagingCenter.Unsubscribe<MessagingCenterTests, string>(this, "SimpleTest");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Subscribe.")]
- [Property("SPEC", "Xamarin.Forms.MessagingCenter.Subscribe<TSender,TArgs> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Property("COVPARAM", "object, string, System.Action<TSender,TArgs>, TSender")]
- public void Subscribe_MULTI_WITH_ARGS_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- var sub1 = new object();
- var sub2 = new object();
- string subscribeMessage1 = null;
- string subscribeMessage2 = null;
- MessagingCenter.Subscribe<MessagingCenterTests, string>(sub1, "SimpleTest", (sender, args) => subscribeMessage1 = args);
- MessagingCenter.Subscribe<MessagingCenterTests, string>(sub2, "SimpleTest", (sender, args) => subscribeMessage2 = args);
- MessagingCenter.Send(this, "SimpleTest", "My Message");
-
- Assert.IsTrue(subscribeMessage1.Equals("My Message"), "Message is not subscribed successfully.");
- Assert.IsTrue(subscribeMessage2.Equals("My Message"), "Message is not subscribed successfully.");
-
- /*POSTCONDITION*/
- /*
- * 1. Unsubscribes the subscriber from the specified messages.
- */
- MessagingCenter.Unsubscribe<MessagingCenterTests, string>(sub1, "SimpleTest");
- MessagingCenter.Unsubscribe<MessagingCenterTests, string>(sub2, "SimpleTest");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Subscribe.")]
- [Property("SPEC", "Xamarin.Forms.MessagingCenter.Subscribe<TSender> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Property("COVPARAM", "object, string, System.Action<TSender>, TSender")]
- public void Subscribe_MULTI_NO_ARGS_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- var sub1 = new object();
- var sub2 = new object();
- bool subscribeMessage1 = false;
- bool subscribeMessage2 = false;
- MessagingCenter.Subscribe<MessagingCenterTests>(sub1, "SimpleTest", (sender) => subscribeMessage1 = true);
- MessagingCenter.Subscribe<MessagingCenterTests>(sub2, "SimpleTest", (sender) => subscribeMessage2 = true);
- MessagingCenter.Send(this, "SimpleTest");
-
- Assert.IsTrue(subscribeMessage1, "Message is not subscribed successfully.");
- Assert.IsTrue(subscribeMessage2, "Message is not subscribed successfully.");
-
- /*POSTCONDITION*/
- /*
- * 1. Unsubscribes the subscriber from the specified messages.
- */
- MessagingCenter.Unsubscribe<MessagingCenterTests>(sub1, "SimpleTest");
- MessagingCenter.Unsubscribe<MessagingCenterTests>(sub2, "SimpleTest");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Unsubscribe.")]
- [Property("SPEC", "Xamarin.Forms.MessagingCenter.Unsubscribe<TSender> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Property("COVPARAM", "object, string")]
- public void Unsubscribe_NO_ARGS_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- bool flagUnsubscribeMessage = false;
- MessagingCenter.Subscribe<MessagingCenterTests>(this, "SimpleTest", (sender) => flagUnsubscribeMessage = true);
- MessagingCenter.Unsubscribe<MessagingCenterTests>(this, "SimpleTest");
- MessagingCenter.Send(this, "SimpleTest", "My Message");
-
- Assert.IsFalse(flagUnsubscribeMessage, "Message is not Unsubscribed successfully.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Unsubscribe.")]
- [Property("SPEC", "Xamarin.Forms.MessagingCenter.Unsubscribe<TSender,TArgs> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Property("COVPARAM", "object, string")]
- public void Unsubscribe_WITH_ARGS_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- string unSubscribeMessage = null;
- MessagingCenter.Subscribe<MessagingCenterTests, string>(this, "SimpleTest", (sender, args) => unSubscribeMessage = args);
- MessagingCenter.Unsubscribe<MessagingCenterTests, string>(this, "SimpleTest");
- MessagingCenter.Send(this, "SimpleTest", "My Message");
-
- Assert.IsNull(unSubscribeMessage, "Message is not Unsubscribed successfully.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Send.")]
- [Property("SPEC", "Xamarin.Forms.MessagingCenter.Send<TSender> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Property("COVPARAM", "TSender, string")]
- public void Send_NO_ARGS_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- bool flagSentMessage = false;
- MessagingCenter.Subscribe(this, "SimpleTest", (sender) => flagSentMessage = true, this);
- MessagingCenter.Send(new MessagingCenterTests(), "SimpleTest");
-
- Assert.IsFalse(flagSentMessage, "Message should not be sent.");
-
- MessagingCenter.Send(this, "SimpleTest");
-
- Assert.IsTrue(flagSentMessage, "Message should be sent.");
-
- /*POSTCONDITION*/
- /*
- * 1. Unsubscribes the subscriber from the specified messages.
- */
- MessagingCenter.Unsubscribe<MessagingCenterTests>(this, "SimpleTest");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Send.")]
- [Property("SPEC", "Xamarin.Forms.MessagingCenter.Send<TSender,TArgs> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Property("COVPARAM", "TSender, string, TArgs")]
- public void Send_WITH_ARGS_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- string sentMessage = null;
- MessagingCenter.Subscribe<MessagingCenterTests, string>(this, "SimpleTest", (sender, args) => sentMessage = args, this);
- MessagingCenter.Send(new MessagingCenterTests(), "SimpleTest", "My Message");
-
- Assert.IsNull(sentMessage, "Message should not be sent.");
-
- MessagingCenter.Send(this, "SimpleTest", "My Message");
-
- Assert.IsTrue(sentMessage.Equals("My Message"), "Message should be sent.");
-
- /*POSTCONDITION*/
- /*
- * 1. Unsubscribes the subscriber from the specified messages.
- */
- MessagingCenter.Unsubscribe<MessagingCenterTests, string>(this, "SimpleTest");
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.ModalEventArgs test")]
- public class ModalEventArgsTests
- {
- [SetUp]
- public void Setup()
- {
- Console.WriteLine("ModalEventArgsTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("ModalEventArgsTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create an ModalEventArgs object.")]
- [Property("SPEC", "Xamarin.Forms.ModalEventArgs.ModalEventArgs C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void ModalEventArgs_INIT()
- {
- /* TEST CODE */
- Page page = new Page();
- page.Title = "Tizen";
- ModalEventArgs modalEventArgs = new ModalPoppedEventArgs(page);
-
- Assert.IsNotNull(modalEventArgs, "ModalEventArgs Instance is null");
- Assert.IsInstanceOf<ModalEventArgs>(modalEventArgs, "Should be an instance of ModalEventArgs type.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the value for Modal.")]
- [Property("SPEC", "Xamarin.Forms.ModalEventArgs.Modal A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Modal_READ_ONLY()
- {
- /* TEST CODE */
- Page page = new Page();
- page.Title = "Tizen";
- ModalEventArgs modalEventArgs = new ModalPoppedEventArgs(page);
- Assert.AreEqual(modalEventArgs.Modal.Title, page.Title, "Not returning expected page title.");
- }
- }
-}
+++ /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 Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class ModalPoppedEventArgsTests
- {
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("ModalPoppedEventArgs --------------- SetUp()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("ModalPoppedEventArgs --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a ModalPoppedEventArgs instance. Check whether object is successfully created or not")]
- [Property("SPEC", "Xamarin.Forms.ModalPoppedEventArgs.ModalPoppedEventArgs C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void ModalPoppedEventArgs_INIT()
- {
- /* TEST CODE */
- var page = new Page()
- {
- Title = "page modal",
- };
- var modalPoppedEventArgs = new ModalPoppedEventArgs(page);
- Assert.IsNotNull(modalPoppedEventArgs, "Creating a ModalPoppedEventArgs object failed. It is set to null");
- Assert.IsInstanceOf<ModalPoppedEventArgs>(modalPoppedEventArgs);
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.ModalPoppingEventArgs Tests")]
- public class ModalPoppingEventArgsTests
- {
- private ModalPoppingEventArgs _modalPoppingEventArgs;
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("TSModalPoppingEventArgs --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("TSModalPoppingEventArgs --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a ModalPoppingEventArgs object")]
- [Property("SPEC", "Xamarin.Forms.ModalPoppingEventArgs.ModalPoppingEventArgs C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void ModalPoppingEventArgs_INIT()
- {
- /*TEST CODE*/
- Page pageDemo = new Page();
- _modalPoppingEventArgs = new ModalPoppingEventArgs(pageDemo);
- Assert.IsNotNull(_modalPoppingEventArgs, "Instance of ModalPoppingEventArgs is null");
- Assert.IsInstanceOf<ModalPoppingEventArgs>(_modalPoppingEventArgs, "Is not an instance of ModalPoppingEventArgs");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Cancel Property is writeable and readable.")]
- [Property("SPEC", "Xamarin.Forms.ModalPoppingEventArgs.Cancel A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Cancel_READ_WRITE()
- {
- /* TEST CODE */
- Page pageDemo = new Page();
- _modalPoppingEventArgs = new ModalPoppingEventArgs(pageDemo);
- _modalPoppingEventArgs.Cancel = true;
- Assert.IsNotNull(_modalPoppingEventArgs, "ModalPoppingEventArgs instance is null.");
- Assert.IsInstanceOf<ModalPoppingEventArgs>(_modalPoppingEventArgs, "Should be instance of ModalPoppingEventArgs Type.");
- Assert.IsTrue(_modalPoppingEventArgs.Cancel, "Returning false expected true.");
-
- _modalPoppingEventArgs.Cancel = false;
- Assert.IsFalse(_modalPoppingEventArgs.Cancel, "Returning true expected false.");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.ModalPushedEventArgs Tests")]
- public class ModalPushedEventArgsTests
- {
- [SetUp]
- public void Setup()
- {
- Console.WriteLine("ModalPushedEventArgsTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("ModalPushedEventArgsTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a ModalPushedEventArgs object")]
- [Property("SPEC", "Xamarin.Forms.ModalPushedEventArgs.ModalPushedEventArgs C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void ModalPushedEventArgs_INIT()
- {
- /* TEST CODE */
- Page page = new Page();
- page.Title = "Tizen";
- ModalPushedEventArgs modalPushedEventArgs = new ModalPushedEventArgs(page);
- Assert.IsNotNull(modalPushedEventArgs, "ModalPushedEventArgs instance is null");
- Assert.IsInstanceOf<ModalPushedEventArgs>(modalPushedEventArgs, "Not an instance of ModalPushedEventArgs.");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.ModalPushingEventArgs Tests")]
- public class ModalPushingEventArgsTests
- {
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("ModalPushingEventArgsTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("ModalPushingEventArgsTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a ModalPushingEventArgs instance.")]
- [Property("SPEC", "Xamarin.Forms.ModalPushingEventArgs.ModalPushingEventArgs C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void ModalPushingEventArgs_INIT()
- {
- /* TEST CODE */
- var modalPushingEventArgs = new ModalPushingEventArgs(new Page());
-
- Assert.IsNotNull(modalPushingEventArgs, "Object should be not null after initialize");
- Assert.IsInstanceOf<ModalPushingEventArgs>(modalPushingEventArgs, "Should be an instance of ModalPushingEventArgs.");
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System.Threading.Tasks;
-using System.Collections.Generic;
-using Xamarin.Forms;
-using System.Collections.Specialized;
-using System.Runtime.CompilerServices;
-using XamarinForTizen.Tizen;
-using XamarinForTizen;
-using AutoTemplate;
-using System.Threading;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class MultiPageTemplateTests
- {
- private static App _app = Program.getApp();
-
- internal class CustomizeMultiPage : MultiPage<Page>
- {
- public bool flagCreateDefault = false;
- public bool flagOnBackButtonPressed = false;
- public bool flagOnChildAdded = false;
- public bool flagOnCurrentPageChanged = false;
- public bool flagOnPagesChanged = false;
- public bool flagOnPropertyChanged_ItemsSourceProperty = false;
- public bool flagOnPropertyChanged_ItemTemplateProperty = false;
- public bool flagOnPropertyChanged_SelectedItemProperty = false;
- public int counterSetupContent = 0;
- public bool flagUnhookContent = false;
-
- protected override Page CreateDefault(object item)
- {
- flagCreateDefault = true;
- return new Page();
- }
-
- protected override bool OnBackButtonPressed()
- {
- flagOnBackButtonPressed = true;
- return base.OnBackButtonPressed();
- }
-
- protected override void OnChildAdded(Element child)
- {
- flagOnChildAdded = true;
- base.OnChildAdded(child);
- }
-
- protected override void OnCurrentPageChanged()
- {
- flagOnCurrentPageChanged = true;
- base.OnCurrentPageChanged();
- }
-
- protected override void OnPagesChanged(NotifyCollectionChangedEventArgs e)
- {
- flagOnPagesChanged = true;
- base.OnPagesChanged(e);
- }
-
- protected override void OnPropertyChanged([CallerMemberName] string propertyName = "")
- {
- if (propertyName.Equals(ItemsSourceProperty.PropertyName))
- {
- flagOnPropertyChanged_ItemsSourceProperty = true;
- }
-
- if (propertyName.Equals(ItemTemplateProperty.PropertyName))
- {
- flagOnPropertyChanged_ItemTemplateProperty = true;
- }
-
- if (propertyName.Equals(SelectedItemProperty.PropertyName))
- {
- flagOnPropertyChanged_SelectedItemProperty = true;
- }
-
- base.OnPropertyChanged(propertyName);
- }
-
- protected override void SetupContent(Page content, int index)
- {
- counterSetupContent++;
- base.SetupContent(content, index);
- }
-
- protected override void UnhookContent(Page content)
- {
- flagUnhookContent = true;
- base.UnhookContent(content);
- }
- }
-
- private CustomizeMultiPage _mMultiPage;
- private int _numListPage = 10;
- private List<Page> _listPage = new List<Page>();
-
- [SetUp]
- public void SetUp()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "MultiPage CLASS: Setup---------------------------------");
- _mMultiPage = new CustomizeMultiPage();
-
- for (int i = 0; i < _numListPage; i++)
- {
- _listPage.Add(new Page()
- {
- Title = i.ToString()
- });
- }
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "MultiPage CLASS: Teardown---------------------------------");
- _mMultiPage = null;
- _listPage.Clear();
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a MultiPage instance. Check whether object is successfully created or not.")]
- [Property("SPEC", "Xamarin.Forms.MultiPage<T>.MultiPage C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public void MultiPage_CONST()
- {
- Assert.IsNotNull(_mMultiPage, "Cannot successfully create MultiPage object");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of ItemsSourceProperty is correctly readable or not.")]
- [Property("SPEC", "Xamarin.Forms.MultiPage<T>.ItemsSourceProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public void ItemsSourceProperty_PROPERTY_READ_ONLY()
- {
- /*PRECONDITION*/
- /*
- * Create bind source.
- */
-
- List<Page> list1 = new List<Page>();
- list1.Add(_listPage[0]);
- List<Page> list2 = new List<Page>();
- list2.Add(_listPage[1]);
- list2.Add(_listPage[2]);
-
- var mSrc = new CustomizeMultiPage()
- {
- ItemsSource = list2
- };
-
- /*TEST CODE*/
- _mMultiPage.ItemsSource = list1;
- Assert.AreNotEqual(_mMultiPage.ItemsSource, mSrc.ItemsSource, "ItemsSource should be different from mSrc.ItemsSource.");
-
- var binding = new Binding("ItemsSource");
- binding.Source = mSrc;
- _mMultiPage.SetBinding(CustomizeMultiPage.ItemsSourceProperty, binding);
- Assert.AreEqual(_mMultiPage.ItemsSource, mSrc.ItemsSource, "ItemsSource should be the same with mSrc.ItemsSource after binding.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of ItemTemplateProperty is correctly readable or not.")]
- [Property("SPEC", "Xamarin.Forms.MultiPage<T>.ItemTemplateProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public void ItemTemplateProperty_PROPERTY_READ_ONLY()
- {
- /*PRECONDITION*/
- /*
- * Create bind source.
- */
-
- DataTemplate t1 = new DataTemplate();
- DataTemplate t2 = new DataTemplate();
-
- var mSrc = new CustomizeMultiPage()
- {
- ItemTemplate = t1
- };
-
- /*TEST CODE*/
- _mMultiPage.ItemTemplate = t2;
- Assert.AreNotEqual(_mMultiPage.ItemTemplate, mSrc.ItemTemplate, "ItemTemplate should be different from mSrc.ItemTemplate.");
-
- var binding = new Binding("ItemTemplate");
- binding.Source = mSrc;
- _mMultiPage.SetBinding(CustomizeMultiPage.ItemTemplateProperty, binding);
- Assert.AreEqual(_mMultiPage.ItemTemplate, mSrc.ItemTemplate, "ItemTemplate should be the same with mSrc.ItemTemplate after binding.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of SelectedItemProperty is correctly readable or not.")]
- [Property("SPEC", "Xamarin.Forms.MultiPage<T>.SelectedItemProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public void SelectedItemProperty_PROPERTY_READ_ONLY()
- {
- /*PRECONDITION*/
- /*
- * Create bind source.
- */
-
- var mSrc = new CustomizeMultiPage()
- {
- SelectedItem = _listPage[0]
- };
-
- /*TEST CODE*/
- _mMultiPage.SelectedItem = _listPage[1];
- Assert.AreNotEqual(_mMultiPage.SelectedItem, mSrc.SelectedItem, "SelectedItem should be different from mSrc.SelectedItem.");
-
- var binding = new Binding("SelectedItem");
- binding.Source = mSrc;
- _mMultiPage.SetBinding(CustomizeMultiPage.SelectedItemProperty, binding);
- Assert.AreEqual(_mMultiPage.SelectedItem, mSrc.SelectedItem, "SelectedItem should be the same with mSrc.SelectedItem after binding.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Add child view object to Children property, and check returned collection.")]
- [Property("SPEC", "Xamarin.Forms.MultiPage<T>.Children A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public void Children_PROPERTY_GET()
- {
- /*TEST CODE*/
- for (int i = 0; i < _numListPage; i++)
- {
- _mMultiPage.Children.Add(_listPage[i]);
- }
-
- Assert.AreEqual(_numListPage, _mMultiPage.Children.Count, "Children count shound be same with numPage");
- for (int i = 0; i < _numListPage; i++)
- {
- Assert.IsTrue(_mMultiPage.Children.IndexOf(_listPage[i]) >= 0, "Page[" + i + "=> " + _listPage[i].Title + "] should exist in _mMultiPage.Children");
- }
-
- for (int i = 0; i < _numListPage; i++)
- {
- _mMultiPage.Children.Remove(_listPage[i]);
- }
- Assert.AreEqual(0, _mMultiPage.Children.Count, "Children should be empty after remove all from list.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of CurrentPage are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.MultiPage<T>.CurrentPage A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public void CurrentPage_SET_GET()
- {
- /*TEST CODE*/
- for (int i = 0; i < _numListPage; i++)
- {
- _mMultiPage.Children.Add(_listPage[i]);
- }
-
- int selectedIndex = 2;
- _mMultiPage.CurrentPage = _mMultiPage.Children[_mMultiPage.Children.IndexOf(_listPage[selectedIndex])];
-
- Assert.AreEqual(_listPage[selectedIndex], _mMultiPage.CurrentPage, "CurrentPage should be same with selected Page in _listPage");
- Assert.AreEqual(_listPage[selectedIndex].Title, _mMultiPage.CurrentPage.Title, "Title of CurrentPage and selectedPage should be the same");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of ItemsSource are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.MultiPage<T>.ItemsSource A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public void ItemsSource_SET_GET()
- {
- /*TEST CODE*/
- _mMultiPage.ItemsSource = _listPage;
-
- Assert.AreEqual(_listPage, _mMultiPage.ItemsSource, "ItemsSource and _listPage should be the same");
- foreach (Page p in _mMultiPage.ItemsSource)
- {
- Assert.IsTrue(_listPage.IndexOf(p) >= 0, "Page with Title = [" + p.Title + "] isn't exist in _listPage");
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of ItemTemplate are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.MultiPage<T>.ItemTemplate A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public void ItemTemplate_SET_GET()
- {
- /*TEST CODE*/
- DataTemplate t1 = new DataTemplate();
- _mMultiPage.ItemTemplate = t1;
- Assert.AreEqual(t1, _mMultiPage.ItemTemplate, "ItemTemplate and DataTemplate t1 should be the same");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of SelectedItem are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.MultiPage<T>.SelectedItem A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public void SelectedItem_SET_GET()
- {
- /*TEST CODE*/
- for (int i = 0; i < _numListPage; i++)
- _mMultiPage.Children.Add(_listPage[i]);
-
- int selectedIndex = 2;
- _mMultiPage.SelectedItem = _listPage[selectedIndex];
- Assert.AreEqual(_listPage[selectedIndex], _mMultiPage.SelectedItem, "SelectedItem and Page selected from _listPage should be the same");
- Assert.AreEqual(_listPage[selectedIndex].Title, ((Page)_mMultiPage.SelectedItem).Title, "Title of SelectedItem and Page selected from _listPage should be the same");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether EventHandler CurrentPageChanged is invoked or not when CurrentPage is changed")]
- [Property("SPEC", "Xamarin.Forms.MultiPage<T>.CurrentPageChanged E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public void CurrentPageChanged_CHECK_EVENT()
- {
- /*TEST CODE*/
- for (int i = 0; i < _numListPage; i++)
- _mMultiPage.Children.Add(_listPage[i]);
-
- int firstIndex = 2;
- int secondIndex = 3;
- _mMultiPage.CurrentPage = _mMultiPage.Children[_mMultiPage.Children.IndexOf(_listPage[firstIndex])];
-
- bool flagChanged = false;
- _mMultiPage.CurrentPageChanged += (o, e) =>
- {
- flagChanged = true;
- };
- _mMultiPage.CurrentPage = _mMultiPage.Children[_mMultiPage.Children.IndexOf(_listPage[secondIndex])];
- Assert.IsTrue(flagChanged, "CurrentPageChanged event should be invoked.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether NotifyCollectionChangedEventHandler PagesChanged is invoked or not when Children add or remove Page")]
- [Property("SPEC", "Xamarin.Forms.MultiPage<T>.PagesChanged E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public void PagesChanged_CHECK_EVENT()
- {
- /*TEST CODE*/
- for (int i = 0; i < _numListPage; i++)
- _mMultiPage.Children.Add(_listPage[i]);
-
- bool flagChanged = false;
- _mMultiPage.PagesChanged += (o, e) =>
- {
- flagChanged = true;
- };
- _mMultiPage.Children.Remove(_mMultiPage.Children[_mMultiPage.Children.IndexOf(_listPage[0])]);
- Assert.IsTrue(flagChanged, "PagesChanged event should be invoked.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check override method CreateDefault is invoked.")]
- [Property("SPEC", "Xamarin.Forms.MultiPage<T>.CreateDefault M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public void CreateDefault_OVERRIDE_METHOD()
- {
- /*TEST CODE*/
- var mSrc = new CustomizeMultiPage()
- {
- ItemsSource = _listPage
- };
-
- var binder = new Binding("ItemsSource");
- binder.Source = mSrc;
- _mMultiPage.SetBinding(CustomizeMultiPage.ItemsSourceProperty, binder);
-
- Assert.True(_mMultiPage.flagCreateDefault, "CreateDefault overrided method isn't invoked.");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check override method OnBackButtonPressed is invoked.")]
- [Property("SPEC", "Xamarin.Forms.MultiPage<T>.OnBackButtonPressed M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public void OnBackButtonPressed_OVERRIDE_METHOD()
- {
- Assert.True(false, "[NA] Need to check via manual test");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check override method OnChildAdded is invoked.")]
- [Property("SPEC", "Xamarin.Forms.MultiPage<T>.OnChildAdded M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public void OnChildAdded_OVERRIDE_METHOD()
- {
- /*TEST CODE*/
- Assert.False(_mMultiPage.flagOnCurrentPageChanged, "flagOnChildAdded should be false before adding Page");
- _mMultiPage.Children.Add(_listPage[0]);
-
- Assert.True(_mMultiPage.flagOnChildAdded, "flagOnChildAdded should be true after adding Page");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check override method OnCurrentPageChanged is invoked.")]
- [Property("SPEC", "Xamarin.Forms.MultiPage<T>.OnCurrentPageChanged M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public void OnCurrentPageChanged_OVERRIDE_METHOD()
- {
- /*TEST CODE*/
- Assert.False(_mMultiPage.flagOnCurrentPageChanged, "flagOnCurrentPageChanged should be false before change CurrentPage");
- for (int i = 0; i < _numListPage; i++)
- _mMultiPage.Children.Add(_listPage[i]);
-
- _mMultiPage.CurrentPage = _mMultiPage.Children[_mMultiPage.Children.IndexOf(_listPage[0])];
- Assert.True(_mMultiPage.flagOnCurrentPageChanged, "flagOnCurrentPageChanged should be true after change CurrentPage");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check override method OnChildAdded is invoked.")]
- [Property("SPEC", "Xamarin.Forms.MultiPage<T>.OnPagesChanged M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public void OnPagesChanged_OVERRIDE_METHOD()
- {
- /*TEST CODE*/
- Assert.False(_mMultiPage.flagOnPagesChanged, "flagOnPagesChanged should be false before change Pages");
- _mMultiPage.Children.Add(_listPage[0]);
-
- Assert.True(_mMultiPage.flagOnChildAdded, "flagOnPagesChanged should be true after change Pages");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check override method OnPropertyChanged is invoked.")]
- [Property("SPEC", "Xamarin.Forms.MultiPage<T>.OnPropertyChanged M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public async Task OnPropertyChanged_OVERRIDE_METHOD()
- {
- /*TEST CODE*/
- var mSrc = new CustomizeMultiPage();
- _mMultiPage.BindingContext = mSrc;
- _mMultiPage.SetBinding(CustomizeMultiPage.ItemsSourceProperty, "ItemsSource");
- _mMultiPage.SetBinding(CustomizeMultiPage.ItemTemplateProperty, "ItemTemplate");
- _mMultiPage.SetBinding(CustomizeMultiPage.SelectedItemProperty, "SelectedItem");
-
- Assert.False(_mMultiPage.flagOnPropertyChanged_ItemsSourceProperty, "flagOnPropertyChanged_ItemsSourceProperty should be false before change Source");
- Assert.False(_mMultiPage.flagOnPropertyChanged_ItemTemplateProperty, "flagOnPropertyChanged_ItemTemplateProperty should be false before change Source");
- Assert.False(_mMultiPage.flagOnPropertyChanged_SelectedItemProperty, "flagOnPropertyChanged_SelectedItemProperty should be false before change Source");
-
- mSrc.ItemsSource = _listPage;
- await Task.Delay(500);
- Assert.True(_mMultiPage.flagOnPropertyChanged_ItemsSourceProperty, "flagOnPropertyChanged_ItemsSourceProperty should be true after change ItemsSource");
-
- mSrc.ItemTemplate = new DataTemplate(() => { return new Page(); });
- await Task.Delay(500);
- Assert.True(_mMultiPage.flagOnPropertyChanged_ItemTemplateProperty, "flagOnPropertyChanged_ItemTemplateProperty should be true after change ItemTemplate");
-
- mSrc.SelectedItem = mSrc.Children[0];
- await Task.Delay(500);
- Assert.True(_mMultiPage.flagOnPropertyChanged_SelectedItemProperty, "flagOnPropertyChanged_SelectedItemProperty should be true after change SelectedItem");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check override method SetupContent is invoked.")]
- [Property("SPEC", "Xamarin.Forms.MultiPage<T>.SetupContent M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public void SetupContent_OVERRIDE_METHOD()
- {
- /*TEST CODE*/
- var mSrc = new CustomizeMultiPage()
- {
- ItemsSource = _listPage
- };
- Assert.False(_mMultiPage.flagOnCurrentPageChanged, "flagOnCurrentPageChanged should be false before change CurrentPage");
-
- _mMultiPage.BindingContext = mSrc;
- _mMultiPage.SetBinding(CustomizeMultiPage.ItemsSourceProperty, "ItemsSource");
- Assert.AreEqual(_listPage.Count, _mMultiPage.counterSetupContent, "counterSetupContent should be equal with number item of _listPage");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check override method UnhookContent is invoked.")]
- [Property("SPEC", "Xamarin.Forms.MultiPage<T>.UnhookContent M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public async Task UnhookContent_OVERRIDE_METHOD()
- {
- /*TEST CODE*/
- var list = new List<Page>();
- var p1 = new Page();
- var p2 = new Page();
- list.Add(p1);
- list.Add(p2);
-
- var mSrc = new CustomizeMultiPage()
- {
- ItemsSource = list
- };
-
- _mMultiPage.BindingContext = mSrc;
- _mMultiPage.SetBinding(CustomizeMultiPage.ItemsSourceProperty, "ItemsSource");
- Assert.False(_mMultiPage.flagUnhookContent, "flagUnhookContent should be false before set ItemsSource = null");
-
- mSrc.ItemsSource = null;
- await Task.Delay(500);
- Assert.True(_mMultiPage.flagUnhookContent, "flagUnhookContent should true after set ItemsSource = null");
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System.Collections.Generic;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.MultiTrigger test")]
- public class MultiTriggerTest
- {
- private static MultiTrigger _multiTrigger;
-
- [SetUp]
- public void Setup()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "MultiTrigger: Setup---------------------------------");
- _multiTrigger = new MultiTrigger(typeof(Entry));
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "MultiTrigger: Teardown------------------------------");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a MultiTrigger instance. Check whether object is successfully created or not.")]
- [Property("SPEC", "Xamarin.Forms.MultiTrigger.MultiTrigger C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Ngo Van Hai, hai.nv3@samsung.com")]
- public void MultiTrigger_INIT()
- {
- /*TEST CODE*/
- MultiTrigger multiTrigger = new MultiTrigger(typeof(Entry));
- Assert.NotNull(multiTrigger);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Conditions is readable.")]
- [Property("SPEC", "Xamarin.Forms.MultiTrigger.Conditions A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Ngo Van Hai, hai.nv3@samsung.com")]
- public void Conditions_PROPERTY()
- {
- Assert.NotNull(_multiTrigger);
- /*TEST CODE*/
- var getConditions = _multiTrigger.Conditions;
- Assert.IsInstanceOf<IList<Condition>>(getConditions, "Conditions should be return an object IList<Condition>");
-
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Setters is readable.")]
- [Property("SPEC", "Xamarin.Forms.MultiTrigger.Setters A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Ngo Van Hai, hai.nv3@samsung.com")]
- public void Setters_PROPERTY()
- {
- Assert.NotNull(_multiTrigger);
- /*TEST CODE*/
- var getSetters = _multiTrigger.Setters;
- Assert.IsInstanceOf<IList<Setter>>(getSetters, "Setters should be return an object IList<Setter>");
-
- }
-
- }
-}
+++ /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 Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class NameScopeExtensionsTests
- {
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("NameScopeExtensions --------------- SetUp()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("NameScopeExtensions --------------- TearDown()");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check whether FindByName is working properly or not")]
- [Property("SPEC", "Xamarin.Forms.NameScopeExtensions.FindByName M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void FindByName_RETURN()
- {
- /* TEST CODE */
- //var label = new Label()
- //{
- //};
- //var get=NameScopeExtensions.FindByName<Label>(label, "abc");
- //Console.WriteLine("TUnit=========================22"+get.Id);
- //Console.WriteLine("TUnit=========================23" + get.FindByName<Label>("abc").Id);
- //Console.WriteLine("TUnit=========================24" + get.Text);
- Assert.True(false, "[NA] Need to check API behavior");
- }
- }
-}
+++ /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 Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class NavigationEventArgsTests
- {
- private NavigationEventArgs _navigationEventArgs;
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("NavigationEventArgs --------------- SetUp()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("NavigationEventArgs --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a NavigationEventArgs instance. Check whether object is successfully created or not")]
- [Property("SPEC", "Xamarin.Forms.NavigationEventArgs.NavigationEventArgs C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void NavigationEventArgs_INIT()
- {
- /* TEST CODE */
- var page = new Page()
- {
- Title = "Page One",
- };
- var navigationEventArgs = new NavigationEventArgs(page);
- Assert.IsNotNull(navigationEventArgs, "Creating a NavigationEventArgs object failed. It is set to null");
- Assert.AreEqual(page.Title, navigationEventArgs.Page.Title, "Object didn't create successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Page is readable correct or not")]
- [Property("SPEC", "Xamarin.Forms.NavigationEventArgs.Page A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void Page_PROPERTY_GET()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- var page = new Page()
- {
- Title = "Page Test",
- IsBusy = true,
- };
- _navigationEventArgs = new NavigationEventArgs(page);
- Assert.IsNotNull(_navigationEventArgs, "Creating a NavigationEventArgs object failed. It is set to null");
-
- /* TEST CODE */
- Assert.AreEqual(page.Title, _navigationEventArgs.Page.Title, "Get value of Page.Title is not correct");
- Assert.AreEqual(page.IsBusy, _navigationEventArgs.Page.IsBusy, "Get value of Page.IsBusy is not correct");
- }
- }
-}
+++ /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.Threading.Tasks;
-using XamarinForTizen.Tizen;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class NavigationPageTests
- {
- private NavigationPage _navigationPage;
- private string _appResourcePath = Program.Current.DirectoryInfo.Resource;
- private bool _flagPush, _flagPop, _flagPopToRoot;
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("NavigationPageTests --------------- SetUp()");
- _navigationPage = new NavigationPage();
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("NavigationPageTests --------------- TearDown()");
- }
-
- private void NavigationPage_Pushed(object sender, NavigationEventArgs e)
- {
- _flagPush = true;
- }
- private void NavigationPage_Popped(object sender, NavigationEventArgs e)
- {
- _flagPop = true;
- }
-
- private void NavigationPage_PoppedToRoot(object sender, NavigationEventArgs e)
- {
- _flagPopToRoot = true;
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a NavigationPage instance. Check whether object is successfully created or not")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.NavigationPage C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void NavigationPage_INIT()
- {
- /* TEST CODE */
- var navigationPage = new NavigationPage();
- Assert.IsNotNull(navigationPage, "Creating a NavigationPage object failed. It is set to null");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a NavigationPage instance with 1 parameter. Check whether object is successfully created or not")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.NavigationPage C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("COVPARAM", "Xamarin.Forms.Page")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void NavigationPage_INIT_WITH_PARAMETER()
- {
- /* TEST CODE */
- var page = new Page();
- var navigationPage = new NavigationPage(page);
- Assert.IsNotNull(navigationPage, "Creating a NavigationPage object failed. It is set to null");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property BarBackgroundColor is readable and settable with valid values")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.BarBackgroundColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void BarBackgroundColor_PROPERTY_SET_GET()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- Assert.IsNotNull(_navigationPage, "Creating a NavigationPage object failed. It is set to null");
-
- /* TEST CODE */
- _navigationPage.BarBackgroundColor = Color.Green;
- var getBarBackgroundColor = _navigationPage.BarBackgroundColor;
- Assert.AreEqual(Color.Green, getBarBackgroundColor, "Set and get value of BarBackgroundColor is not correct");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property BarTextColor is readable and settable with valid values")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.BarTextColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void BarTextColor_PROPERTY_SET_GET()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- Assert.IsNotNull(_navigationPage, "Creating a NavigationPage object failed. It is set to null");
-
- /* TEST CODE */
- _navigationPage.BarTextColor = Color.Yellow;
- var getBarTextColor = _navigationPage.BarTextColor;
- Assert.AreEqual(Color.Yellow, getBarTextColor, "Set and get value of BarTextColor is not correct");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Tint is readable and settable with valid values")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.Tint A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void Tint_PROPERTY_SET_GET()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- Assert.IsNotNull(_navigationPage, "Creating a NavigationPage object failed. It is set to null");
-
- /* TEST CODE */
- _navigationPage.Tint = Color.Red;
- var getTint = _navigationPage.Tint;
- Assert.AreEqual(Color.Red, getTint, "Set and get value of Tint is not correct");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property CurrentPage is readable")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.CurrentPage A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void CurrentPage_PROPERTY_GET()
- {
- /*PRECONDITION
- * 1, Create a page
- * 2, Add this page to a NavigationPage
- */
- var page = new Page()
- {
- Title = "This is a page",
- };
- var navigationPage = new NavigationPage(page);
- Assert.IsNotNull(navigationPage, "Creating a NavigationPage object failed. It is set to null");
-
- /* TEST CODE */
- var currentPage = navigationPage.CurrentPage;
- Assert.AreEqual(page.Title, currentPage.Title, "Get value of CurrentPage is not correct");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether BackButtonTitleProperty(BindableProperty) is working correctly or not.")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.BackButtonTitleProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void BackButtonTitleProperty_PROPERTY()
- {
- /* TEST CODE */
- var navigationPage1 = new NavigationPage();
- var value1 = "Title 01";
- NavigationPage.SetBackButtonTitle(navigationPage1, value1);
- var getBackButtonTitle1 = NavigationPage.GetBackButtonTitle(navigationPage1);
- var navigationPage2 = new NavigationPage();
- var value2 = "Title 2";
- NavigationPage.SetBackButtonTitle(navigationPage2, value2);
- var getBackButtonTitle2 = NavigationPage.GetBackButtonTitle(navigationPage2);
- Assert.AreNotEqual(getBackButtonTitle1, getBackButtonTitle2, "GetBackButtonTitle should be different between two NavigationPage objects");
- navigationPage1.SetValue(NavigationPage.BackButtonTitleProperty, value2);
- getBackButtonTitle1= NavigationPage.GetBackButtonTitle(navigationPage1);
- Assert.AreEqual(getBackButtonTitle1, getBackButtonTitle2, "GetBackButtonTitle should be same between two NavigationPage objects");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether BarBackgroundColorProperty(BindableProperty) is working correctly or not.")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.BarBackgroundColorProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void BarBackgroundColorProperty_PROPERTY()
- {
- /* TEST CODE */
- var navigationPage1 = new NavigationPage();
- navigationPage1.BarBackgroundColor = Color.Green;
- var navigationPage2 = new NavigationPage();
- navigationPage2.BarBackgroundColor = Color.Red;
- Assert.AreNotEqual(navigationPage1.BarBackgroundColor, navigationPage2.BarBackgroundColor, "BarBackgroundColor should be different between two NavigationPage objects");
- navigationPage1.BindingContext = navigationPage2;
- navigationPage1.SetBinding(NavigationPage.BarBackgroundColorProperty, "BarBackgroundColor");
- Assert.AreEqual(navigationPage1.BarBackgroundColor, navigationPage2.BarBackgroundColor, "BarBackgroundColor should be same between two NavigationPage objects");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether BarTextColorProperty(BindableProperty) is working correctly or not.")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.BarTextColorProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void BarTextColorProperty_PROPERTY()
- {
- /* TEST CODE */
- var navigationPage1 = new NavigationPage();
- navigationPage1.BarTextColor = Color.Yellow;
- var navigationPage2 = new NavigationPage();
- navigationPage2.BarTextColor = Color.Blue;
- Assert.AreNotEqual(navigationPage1.BarTextColor, navigationPage2.BarTextColor, "BarTextColor should be different between two NavigationPage objects");
- navigationPage1.BindingContext = navigationPage2;
- navigationPage1.SetBinding(NavigationPage.BarTextColorProperty, "BarTextColor");
- Assert.AreEqual(navigationPage1.BarTextColor, navigationPage2.BarTextColor, "BarTextColor should be same between two NavigationPage objects");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether HasBackButtonProperty(BindableProperty) is working correctly or not.")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.HasBackButtonProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void HasBackButtonProperty_PROPERTY()
- {
- /* TEST CODE */
- var navigationPage1 = new NavigationPage();
- NavigationPage.SetHasBackButton(navigationPage1, true);
- var getHasBackButton1 = NavigationPage.GetHasBackButton(navigationPage1);
- var navigationPage2 = new NavigationPage();
- NavigationPage.SetHasBackButton(navigationPage2, false);
- var getHasBackButton2 = NavigationPage.GetHasBackButton(navigationPage2);
- Assert.AreNotEqual(getHasBackButton1, getHasBackButton2, "GetHasBackButton should be different between two NavigationPage objects");
- navigationPage1.SetValue(NavigationPage.HasBackButtonProperty, false);
- getHasBackButton1 = NavigationPage.GetHasBackButton(navigationPage1);
- Assert.AreEqual(getHasBackButton1, getHasBackButton2, "GetHasBackButton should be same between two NavigationPage objects");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether HasNavigationBarProperty(BindableProperty) is working correctly or not.")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.HasNavigationBarProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void HasNavigationBarProperty_PROPERTY()
- {
- /* TEST CODE */
- var navigationPage1 = new NavigationPage();
- NavigationPage.SetHasNavigationBar(navigationPage1, true);
- var getHasNavigationBar1 = NavigationPage.GetHasNavigationBar(navigationPage1);
- var navigationPage2 = new NavigationPage();
- NavigationPage.SetHasNavigationBar(navigationPage2, false);
- var getHasNavigationBar2 = NavigationPage.GetHasNavigationBar(navigationPage2);
- Assert.AreNotEqual(getHasNavigationBar1, getHasNavigationBar2, "GetHasNavigationBar should be different between two NavigationPage objects");
- navigationPage1.SetValue(NavigationPage.HasNavigationBarProperty, false);
- getHasNavigationBar1 = NavigationPage.GetHasNavigationBar(navigationPage1);
- Assert.AreEqual(getHasNavigationBar1, getHasNavigationBar2, "GetHasNavigationBar should be same between two NavigationPage objects");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether TitleIconProperty(BindableProperty) is working correctly or not.")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.TitleIconProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void TitleIconProperty_PROPERTY()
- {
- /* TEST CODE */
- var page1 = new Page();
- var value1 = new FileImageSource();
- var file1 = _appResourcePath + "TED/thumbnail/a.jpg";
- value1.File = file1;
- NavigationPage.SetTitleIcon(page1, value1);
- var getTitleIcon1 = NavigationPage.GetTitleIcon(page1);
- var page2 = new Page();
- var value2 = new FileImageSource();
- var file2 = _appResourcePath + "TED/thumbnail/b.jpg";
- value2.File = file2;
- NavigationPage.SetTitleIcon(page2, value2);
- var getTitleIcon2 = NavigationPage.GetTitleIcon(page2);
- Assert.AreNotEqual(getTitleIcon1.File, getTitleIcon2.File, "GetTitleIcon should be different between two NavigationPage objects");
- page1.SetValue(NavigationPage.TitleIconProperty, value2);
- getTitleIcon1 = NavigationPage.GetTitleIcon(page1);
- Assert.AreEqual(getTitleIcon1.File, getTitleIcon2.File, "GetTitleIcon should be same between two NavigationPage objects");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether TintProperty(BindableProperty) is working correctly or not.")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.TintProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void TintProperty_PROPERTY()
- {
- /* TEST CODE */
- var navigationPage1 = new NavigationPage();
- navigationPage1.Tint = Color.Red;
- var navigationPage2 = new NavigationPage();
- navigationPage2.Tint = Color.Black;
- Assert.AreNotEqual(navigationPage1.Tint, navigationPage2.Tint, "Tint should be different between two NavigationPage objects");
- navigationPage1.BindingContext = navigationPage2;
- navigationPage1.SetBinding(NavigationPage.TintProperty, "Tint");
- Assert.AreEqual(navigationPage1.Tint, navigationPage2.Tint, "Tint should be same between two NavigationPage objects");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether CurrentPageProperty(BindableProperty) is working correctly or not.")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.CurrentPageProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void CurrentPageProperty_PROPERTY()
- {
-
-
- var getCurrentPageProperty = NavigationPage.CurrentPageProperty;
- Assert.IsInstanceOf<BindableProperty>(getCurrentPageProperty);
- Assert.IsTrue(getCurrentPageProperty.IsReadOnly, "CurrentPageProperty should be not readonly property");
- Assert.AreEqual("CurrentPage", getCurrentPageProperty.PropertyName, "Name of Property should be CurrentPage");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether SetBackButtonTitle is settable correct or not")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.SetBackButtonTitle M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void SetBackButtonTitle_SET_VALUE()
- {
- /* TEST CODE */
- var page = new Page();
- var getBackButtonTitleDefault = NavigationPage.GetBackButtonTitle(page);
- var value = "Title Test 2";
- NavigationPage.SetBackButtonTitle(page, value);
- var getBackButtonTitleAfterSetting = NavigationPage.GetBackButtonTitle(page);
- Assert.AreNotEqual(getBackButtonTitleDefault, getBackButtonTitleAfterSetting, "Set value of SetBackButtonTitle is not successful");
- Assert.AreEqual(value, getBackButtonTitleAfterSetting, "Set value of SetBackButtonTitle is not successful");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether GetBackButtonTitle is readable correct or not")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.GetBackButtonTitle M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void GetBackButtonTitle_GET_VALUE()
- {
- /* TEST CODE */
- var page = new Page();
- var value = "Title Test";
- NavigationPage.SetBackButtonTitle(page, value);
- var getBackButtonTitle = NavigationPage.GetBackButtonTitle(page);
- Assert.AreEqual(value, getBackButtonTitle, "Get value of GetBackButtonTitle is not successful");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether SetHasBackButton is settable correct or not")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.SetHasBackButton M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void SetHasBackButton_SET_VALUE()
- {
- /* TEST CODE */
- var page = new Page();
- var getHasBackButtonDefault = NavigationPage.GetHasBackButton(page);
- var value = false;
- NavigationPage.SetHasBackButton(page, value);
- var getHasBackButtonAfterSetting = NavigationPage.GetHasBackButton(page);
- Assert.AreNotEqual(getHasBackButtonDefault, getHasBackButtonAfterSetting, "Set value of SetHasBackButton is not successful");
- Assert.AreEqual(value, getHasBackButtonAfterSetting, "Set value of SetHasBackButton is not successful");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether GetHasBackButton is readable correct or not")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.GetHasBackButton M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void GetHasBackButton_GET_VALUE()
- {
- /* TEST CODE */
- var page = new Page();
- var value = false;
- NavigationPage.SetHasBackButton(page, value);
- var getHasBackButton = NavigationPage.GetHasBackButton(page);
- Assert.AreEqual(value, getHasBackButton, "Get value of GetHasBackButton is not successful");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether SetHasNavigationBar is settable correct or not")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.SetHasNavigationBar M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void SetHasNavigationBar_SET_VALUE()
- {
- /* TEST CODE */
- var page = new Page();
- var getHasNavigationBarDefault = NavigationPage.GetHasNavigationBar(page);
- var value = false;
- NavigationPage.SetHasNavigationBar(page, value);
- var getHasNavigationBarAfterSetting = NavigationPage.GetHasNavigationBar(page);
- Assert.AreNotEqual(getHasNavigationBarDefault, getHasNavigationBarAfterSetting, "Set value of SetHasNavigationBar is not successful");
- Assert.AreEqual(value, getHasNavigationBarAfterSetting, "Set value of SetHasNavigationBar is not successful");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether GetHasNavigationBar is readable correct or not")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.GetHasNavigationBar M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void GetHasNavigationBar_GET_VALUE()
- {
- /* TEST CODE */
- var page = new Page();
- var value = false;
- NavigationPage.SetHasNavigationBar(page, value);
- var getHasNavigationBar = NavigationPage.GetHasNavigationBar(page);
- Assert.AreEqual(value, getHasNavigationBar, "Get value of GetHasNavigationBar is not successful");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether SetTitleIcon is settable correct or not")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.SetTitleIcon M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void SetTitleIcon_SET_VALUE()
- {
- /* TEST CODE */
- var page = new Page();
- var value1 = new FileImageSource();
- var file1 = _appResourcePath + "TED/thumbnail/a.jpg";
- value1.File = file1;
- NavigationPage.SetTitleIcon(page, value1);
- var getTitleIcon1 = NavigationPage.GetTitleIcon(page);
- var value2 = new FileImageSource();
- var file2 = _appResourcePath + "TED/thumbnail/b.jpg";
- value2.File = file2;
- NavigationPage.SetTitleIcon(page, value2);
- var getTitleIcon2 = NavigationPage.GetTitleIcon(page);
- Assert.AreNotEqual(getTitleIcon1.File, getTitleIcon2.File, "Set value of SetTitleIcon is not successful");
- Assert.AreEqual(value2.File, getTitleIcon2.File, "Set value of SetTitleIcon is not successful");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether GetTitleIcon is readable correct or not")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.GetTitleIcon M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void GetTitleIcon_GET_VALUE()
- {
- /* TEST CODE */
- var page = new Page();
- var value = new FileImageSource();
- var file = _appResourcePath + "TED/thumbnail/a.jpg";
- value.File = file;
- NavigationPage.SetTitleIcon(page, value);
- var getTitleIcon = NavigationPage.GetTitleIcon(page);
- Assert.AreEqual(value.File, getTitleIcon.File, "Get value of GetTitleIcon is not successful");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether PushAsync Page is successful push or not")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.PushAsync M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- [Property("COVPARAM", "Xamarin.Forms.Page")]
- public async Task PushAsync_NO_ANIMATED()
- {
- /* TEST CODE */
- var navigationPage = new NavigationPage();
- var countDefault = navigationPage.Navigation.NavigationStack.Count;
- var page = new Page()
- {
- Title = "PushAsync",
- };
- await navigationPage.PushAsync(page);
- var count = navigationPage.Navigation.NavigationStack.Count;
- Assert.AreEqual(countDefault+1, count, "PushAsync is not successful");
- var getPage = new Page();
- foreach(Page item in navigationPage.Navigation.NavigationStack)
- {
- getPage = item;
- }
- Assert.AreEqual(page.Title, getPage.Title, "Get value of Title is not correct");
-
- /*POSTCONDITION
- * Pops all but the root Xamarin.Forms.Page off the navigation stack.
- */
- await navigationPage.PopToRootAsync();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether PushAsync Page with animated parameter is successful push or not")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.PushAsync M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- [Property("COVPARAM", "Xamarin.Forms.Page, bool")]
- public async Task PushAsync_WITH_ANIMATED()
- {
- /* TEST CODE */
- var navigationPage = new NavigationPage();
- var countDefault = navigationPage.Navigation.NavigationStack.Count;
- var page = new Page()
- {
- Title = "PushAsync with animated",
- };
- await navigationPage.PushAsync(page, true);
- var count = navigationPage.Navigation.NavigationStack.Count;
- Assert.AreEqual(countDefault + 1, count, "PushAsync with animated=true is not successful");
- var getPage = new Page();
- foreach (Page item in navigationPage.Navigation.NavigationStack)
- {
- getPage = item;
- }
- Assert.AreEqual(page.Title, getPage.Title, "Get value of Title is not correct");
-
- /*POSTCONDITION
- * Pops all but the root Xamarin.Forms.Page off the navigation stack.
- */
- await navigationPage.PopToRootAsync(true);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether PopAsync is successful pop or not")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.PopAsync M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public async Task PopAsync_NO_ANIMATED()
- {
- /*PRECONDITION
- * 1, PushAsync page2 to navigationPage after checking number of page in navigationPage
- * 2, PushAsync page3 to navigationPage after checking number of page in navigationPage
- */
- var page1 = new Page()
- {
- Title = "The first page",
- };
- var navigationPage = new NavigationPage(page1);
- var countDefault = navigationPage.Navigation.NavigationStack.Count;
- var page2 = new Page()
- {
- Title = "PushAsync page 1",
- };
- await navigationPage.PushAsync(page2);
- var count1 = navigationPage.Navigation.NavigationStack.Count;
- Assert.AreEqual(countDefault + 1, count1, "PushAsync is not successful");
- var page3 = new Page()
- {
- Title = "PushAsync page 2",
- };
- await navigationPage.PushAsync(page3);
- var count2 = navigationPage.Navigation.NavigationStack.Count;
- Assert.AreEqual(count1 + 1, count2, "PushAsync is not successful");
-
- /* TEST CODE */
- await navigationPage.PopAsync();
- var count21= navigationPage.Navigation.NavigationStack.Count;
- Assert.AreEqual(count1, count21, "PopAsync is not successful");
- await navigationPage.PopAsync();
- var count20 = navigationPage.Navigation.NavigationStack.Count;
- Assert.AreEqual(countDefault, count20, "PopAsync is not successful");
- var getPage = new Page();
- foreach (Page item in navigationPage.Navigation.NavigationStack)
- {
- getPage = item;
- }
- Assert.AreEqual(page1.Title, getPage.Title, "Get value of Title is not correct");
-
- /*POSTCONDITION
- * Pops all but the root Xamarin.Forms.Page off the navigation stack.
- */
- await navigationPage.PopToRootAsync();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether PopAsync with animated parameter is successful pop or not")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.PopAsync M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("COVPARAM", "bool")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public async Task PopAsync_WITH_ANIMATED()
- {
- /*PRECONDITION
- * 1, PushAsync page1 to navigationPage after checking number of page in navigationPage
- * 2, PushAsync page2 to navigationPage after checking number of page in navigationPage
- */
- var page = new Page()
- {
- Title = "The first page",
- };
- var navigationPage = new NavigationPage(page);
- var countDefault = navigationPage.Navigation.NavigationStack.Count;
- var page1 = new Page()
- {
- Title = "PushAsync page 1",
- };
- await navigationPage.PushAsync(page1);
- var count1 = navigationPage.Navigation.NavigationStack.Count;
- Assert.AreEqual(countDefault + 1, count1, "PushAsync is not successful");
- var getEndPage = new Page();
- foreach(Page item in navigationPage.Navigation.NavigationStack)
- {
- getEndPage = item;
- }
- Assert.AreEqual(page1.Title, getEndPage.Title, "Get value of title is not correct");
- var page2 = new Page()
- {
- Title = "PushAsync page 2 with animated parameter",
- };
- await navigationPage.PushAsync(page2, true);
- var count2 = navigationPage.Navigation.NavigationStack.Count;
- Assert.AreEqual(count1 + 1, count2, "PushAsync is not successful");
- foreach (Page item in navigationPage.Navigation.NavigationStack)
- {
- getEndPage = item;
- }
- Assert.AreEqual(page2.Title, getEndPage.Title, "Get value of title is not correct");
-
- /* TEST CODE */
- await navigationPage.PopAsync(true);
- var count21 = navigationPage.Navigation.NavigationStack.Count;
- Assert.AreEqual(count1, count21, "PopAsync is not successful");
- foreach (Page item in navigationPage.Navigation.NavigationStack)
- {
- getEndPage = item;
- }
- Assert.AreEqual(page1.Title, getEndPage.Title, "Get value of title is not correct");
-
- await navigationPage.PopAsync(true);
- var count20 = navigationPage.Navigation.NavigationStack.Count;
- Assert.AreEqual(countDefault, count20, "PopAsync is not successful");
- foreach (Page item in navigationPage.Navigation.NavigationStack)
- {
- getEndPage = item;
- }
- Assert.AreEqual(page.Title, getEndPage.Title, "Get value of Title is not correct");
-
- /*POSTCONDITION
- * Pops all but the root Xamarin.Forms.Page off the navigation stack.
- */
- await navigationPage.PopToRootAsync();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether PopToRootAsync is successful PopToRoot or not")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.PopToRootAsync M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public async Task PopToRootAsync_NO_ANIMATED()
- {
- /*PRECONDITION
- * 1, PushAsync page1 to navigationPage after checking number of page in navigationPage
- * 2, PushAsync page2 to navigationPage after checking number of page in navigationPage
- */
- var page = new Page()
- {
- Title = "Root Page",
- };
- var navigationPage = new NavigationPage(page);
- var countDefault = navigationPage.Navigation.NavigationStack.Count;
- var page1 = new Page()
- {
- Title = "PushAsync page 1",
- };
- await navigationPage.PushAsync(page1);
- var count1 = navigationPage.Navigation.NavigationStack.Count;
- Assert.AreEqual(countDefault + 1, count1, "PushAsync is not successful");
- var getEndPage = new Page();
- foreach (Page item in navigationPage.Navigation.NavigationStack)
- {
- getEndPage = item;
- }
- Assert.AreEqual(page1.Title, getEndPage.Title, "Get value of title is not correct");
- var page2 = new Page()
- {
- Title = "PushAsync page 2",
- };
- await navigationPage.PushAsync(page2);
- var count2 = navigationPage.Navigation.NavigationStack.Count;
- Assert.AreEqual(count1 + 1, count2, "PushAsync is not successful");
- foreach (Page item in navigationPage.Navigation.NavigationStack)
- {
- getEndPage = item;
- }
- Assert.AreEqual(page2.Title, getEndPage.Title, "Get value of title is not correct");
-
- /* TEST CODE */
- await navigationPage.PopToRootAsync();
- var count20 = navigationPage.Navigation.NavigationStack.Count;
- Assert.AreEqual(countDefault, count20, "PopToRootAsync is not successful");
- foreach (Page item in navigationPage.Navigation.NavigationStack)
- {
- getEndPage = item;
- }
- Assert.AreEqual(page.Title, getEndPage.Title, "Get value of title is not correct");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether PopToRootAsync with animated parameter is successful PopToRoot or not")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.PopToRootAsync M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("COVPARAM", "bool")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public async Task PopToRootAsync_WITH_ANIMATED()
- {
- /*PRECONDITION
- * 1, PushAsync page1 to navigationPage after checking number of page in navigationPage
- * 2, PushAsync page2 to navigationPage after checking number of page in navigationPage
- */
- var page = new Page()
- {
- Title = "Root Page",
- };
- var navigationPage = new NavigationPage(page);
- var countDefault = navigationPage.Navigation.NavigationStack.Count;
- var page1 = new Page()
- {
- Title = "PushAsync page 1 with animated parameter",
- };
- await navigationPage.PushAsync(page1, true);
- var count1 = navigationPage.Navigation.NavigationStack.Count;
- Assert.AreEqual(countDefault + 1, count1, "PushAsync is not successful");
- var getEndPage = new Page();
- foreach (Page item in navigationPage.Navigation.NavigationStack)
- {
- getEndPage = item;
- }
- Assert.AreEqual(page1.Title, getEndPage.Title, "Get value of title is not correct");
- var page2 = new Page()
- {
- Title = "PushAsync page 2 with animated parameter",
- };
- await navigationPage.PushAsync(page2, true);
- var count2 = navigationPage.Navigation.NavigationStack.Count;
- Assert.AreEqual(count1 + 1, count2, "PushAsync is not successful");
- foreach (Page item in navigationPage.Navigation.NavigationStack)
- {
- getEndPage = item;
- }
- Assert.AreEqual(page2.Title, getEndPage.Title, "Get value of title is not correct");
-
- /* TEST CODE */
- await navigationPage.PopToRootAsync(true);
- var count20 = navigationPage.Navigation.NavigationStack.Count;
- Assert.AreEqual(countDefault, count20, "PopToRootAsync is not successful");
- foreach (Page item in navigationPage.Navigation.NavigationStack)
- {
- getEndPage = item;
- }
- Assert.AreEqual(page.Title, getEndPage.Title, "Get value of title is not correct");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Pushed event is invoked when Page was pushed from NavigationPage.")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.Pushed E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public async Task Pushed_EVENT()
- {
- /* TEST CODE */
- var page1 = new Page()
- {
- Title = "Page One",
- };
- var navigationPage = new NavigationPage(page1);
- var page2 = new Page()
- {
- Title = "Push This Page",
- };
- _flagPush = false;
- Assert.IsFalse(_flagPush, "The first Flag Pushed should be False");
- navigationPage.Pushed += NavigationPage_Pushed;
- await navigationPage.PushAsync(page2);
- Assert.IsTrue(_flagPush, "Flag Pushed should be True after pushing");
-
- /*POSTCONDITION
- * Pops all but the root Xamarin.Forms.Page off the navigation stack.
- */
- await navigationPage.PopToRootAsync();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Popped event is invoked when Page was popped from NavigationPage.")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.Popped E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public async Task Popped_EVENT()
- {
- /* TEST CODE */
- var page1 = new Page()
- {
- Title = "Page One",
- };
- var navigationPage = new NavigationPage(page1);
- var page2 = new Page()
- {
- Title = "Push This Page",
- };
- await navigationPage.PushAsync(page2);
- var getPage = new Page();
- foreach(Page item in navigationPage.Navigation.NavigationStack)
- {
- getPage = item;
- }
- Assert.AreEqual(page2.Title, getPage.Title, "Get value of Title is not correct");
- _flagPop = false;
- Assert.IsFalse(_flagPop, "The first Flag Poped should be False");
- navigationPage.Popped += NavigationPage_Popped;
- await navigationPage.PopAsync();
- Assert.IsTrue(_flagPop, "Flag Poped should be True after popping");
-
- /*POSTCONDITION
- * Pops all but the root Xamarin.Forms.Page off the navigation stack.
- */
- await navigationPage.PopToRootAsync();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether PoppedToRoot event is invoked when Page was PoppedToRoot from NavigationPage.")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.PoppedToRoot E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public async Task PoppedToRoot_EVENT()
- {
- /* TEST CODE */
- var page1 = new Page()
- {
- Title = "Page One",
- };
- var navigationPage = new NavigationPage(page1);
- var page2 = new Page()
- {
- Title = "Push This Page",
- };
- await navigationPage.PushAsync(page2);
- var getPage = new Page();
- foreach (Page item in navigationPage.Navigation.NavigationStack)
- {
- getPage = item;
- }
- Assert.AreEqual(page2.Title, getPage.Title, "Get value of Title is not correct");
- _flagPopToRoot = false;
- Assert.IsFalse(_flagPopToRoot, "The first Flag PoppedToRoot should be False");
- navigationPage.PoppedToRoot += NavigationPage_PoppedToRoot;
- await navigationPage.PopToRootAsync();
- Assert.IsTrue(_flagPopToRoot, "Flag PoppedToRoot should be True after popping to root");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether On<IConfigPlatform> is readable correct or not")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.On<T> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void On_CONFIGURATION_METHOD()
- {
- /* TEST CODE */
- var page = new Page()
- {
- Title = "Page Test",
- };
- var navigationPage = new NavigationPage(page)
- {
- BarTextColor = Color.Gray,
- BarBackgroundColor = Color.Red,
- };
- var myConfig = navigationPage.On<IConfigPlatform>();
- Assert.IsInstanceOf<IPlatformElementConfiguration<IConfigPlatform, NavigationPage>>(myConfig, "myConfig should be a instance of IPlatformElementConfiguration");
- var getNavigationPage = myConfig.Element;
- Assert.IsInstanceOf<NavigationPage>(getNavigationPage, "myConfig.Element should be a instance of NavigationPage");
- Assert.AreEqual(page.Title, getNavigationPage.CurrentPage.Title, "Get Title value of NavigationPage is not correct");
- Assert.AreEqual(Color.Gray, getNavigationPage.BarTextColor, "Get BarTextColor value of NavigationPage is not correct");
- Assert.AreEqual(Color.Red, getNavigationPage.BarBackgroundColor, "Get BarBackgroundColor value of NavigationPage is not correct");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check whether OnBackButtonPressed event is invoked or not")]
- [Property("SPEC", "Xamarin.Forms.NavigationPage.OnBackButtonPressed E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void OnBackButtonPressed_EVENT()
- {
- /* TEST CODE */
- Assert.True(false, "[NA]Manual TC.");
- }
- }
-}
+++ /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;
-using Xamarin.Forms;
-using NUnit.Framework;
-using System.Collections.Generic;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.On Tests")]
- public class OnTests
- {
- private On _on;
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("OnTests --------------- Setup()");
- _on = new On();
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("OnTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create an On instance.")]
- [Property("SPEC", "Xamarin.Forms.On.On C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void On_INIT()
- {
- /* TEST CODE */
- var on = new On();
- Assert.IsNotNull(on, "Object is null after initialize");
- Assert.IsInstanceOf<On>(on);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Platform is readable and writable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.On.Platform A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Platform_READ_WRITE()
- {
- /* TEST CODE */
- _on.Platform = new List<string> { "SRBD"};
- Assert.IsInstanceOf<List<string>>(_on.Platform, "Should be instance of String.");
- Assert.AreEqual(new List<string> { "SRBD" }, _on.Platform, "String doesn't set and get successfully.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Value is readable and writable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.On.Value A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Value_READ_WRITE()
- {
- /* TEST CODE */
- _on.Value = "SRBD";
- Assert.IsInstanceOf<String>(_on.Value, "Should be instance of String.");
- Assert.AreEqual("SRBD", _on.Value, "String doesn't set and get successfully.");
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System.Collections.Generic;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.OnIdiomTemplate test")]
- public class OnIdiomTemplateTest
- {
- private OnIdiom<string> _onIdiomTemplate;
- [SetUp]
- public void Setup()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "OnIdiom: Setup---------------------------------");
- _onIdiomTemplate = new OnIdiom<string>();
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "OnIdiom: Teardown------------------------------");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a OnIdiom instance. Check whether object is successfully created or not.")]
- [Property("SPEC", "Xamarin.Forms.OnIdiom<T>.OnIdiom C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Ngo Van Hai, hai.nv3@samsung.com")]
- public void OnIdiom_INIT()
- {
- OnIdiom<string> onIdiom = new OnIdiom<string>();
- Assert.NotNull(onIdiom, "can't create an object OnIdiom");
- }
-
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Phone is readable and settable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.OnIdiom<T>.Phone A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ngo Van Hai, hai.nv3@samsung.com")]
- public void Phone_PROPERTY()
- {
- _onIdiomTemplate.Phone = "Test Phone";
- Assert.AreEqual("Test Phone", _onIdiomTemplate.Phone, "Phone should be 'Test' after set");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Tablet is readable and settable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.OnIdiom<T>.Tablet A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ngo Van Hai, hai.nv3@samsung.com")]
- public void Tablet_PROPERTY()
- {
- _onIdiomTemplate.Tablet = "Test Tablet";
- Assert.AreEqual("Test Tablet", _onIdiomTemplate.Tablet, "Tablet should be 'Test Tablet' after set");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Desktop is readable and settable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.OnIdiom<T>.Desktop A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ngo Van Hai, hai.nv3@samsung.com")]
- public void Desktop_PROPERTY()
- {
- _onIdiomTemplate.Desktop = "Test Desktop";
- Assert.AreEqual("Test Desktop", _onIdiomTemplate.Desktop, "Desktop should be 'Test Desktop' after set");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check casts a OnIdiom<T> to a T")]
- [Property("SPEC", "Xamarin.Forms.OnIdiom<T>.Implicit M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void Implicit_WITH_STRING()
- {
- if (Device.Idiom == TargetIdiom.TV)
- _onIdiomTemplate.TV = "tv";
- else if (Device.Idiom == TargetIdiom.Phone)
- _onIdiomTemplate.Phone = "phone";
- else if (Device.Idiom == TargetIdiom.Tablet)
- _onIdiomTemplate.Tablet = "tablet";
- else if (Device.Idiom == TargetIdiom.Desktop)
- _onIdiomTemplate.Desktop = "desktop";
- else if (Device.Idiom == TargetIdiom.Unsupported)
- Assert.Pass("Can not test due to TargetIdiom i sunsupported");
-
- /* TEST CODE */
- string T = _onIdiomTemplate;
- Assert.IsNotNull(T, "Value of T is null");
- Assert.IsInstanceOf<string>(T);
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-using System.Runtime.InteropServices;
-using System.Collections.Generic;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.OnPlatformTemplate Tests")]
- class OnPlatformTemplateTests
- {
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("OnPlatformTemplateTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("OnPlatformTemplateTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a new instance of OnPlatform type.")]
- [Property("SPEC", "Xamarin.Forms.OnPlatform<T>.OnPlatform C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void OnPlatform_INIT()
- {
- /*TEST CODE*/
- var onPlatform = new OnPlatform<string>();
- Assert.IsNotNull(onPlatform, "onPlatform should be not NULL");
- Assert.IsInstanceOf<OnPlatform<string>>(onPlatform, "onPlatform is not instance of OnPlatform<string>.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check Android property is readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.OnPlatform<T>.Android A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Android_READ_WRITE()
- {
- /*TEST CODE*/
- var onPlatformString = new OnPlatform<string>();
- onPlatformString.Android = "SRBD";
- Assert.AreEqual(onPlatformString.Android,"SRBD", "Android property should be equal.");
-
- var onPlatformInteger = new OnPlatform<int>();
- onPlatformInteger.Android = 12;
- Assert.AreEqual(onPlatformInteger.Android,12, "Android property should be equal.");
-
- var onPlatformDouble = new OnPlatform<double>();
- onPlatformDouble.Android = 15.12;
- Assert.AreEqual(onPlatformDouble.Android, 15.12, "Android property should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check iOS property is readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.OnPlatform<T>.iOS A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void iOS_READ_WRITE()
- {
- /*TEST CODE*/
- var onPlatformString = new OnPlatform<string>();
- onPlatformString.iOS = "SRBD";
- Assert.AreEqual(onPlatformString.iOS, "SRBD", "iOS property should be equal.");
-
- var onPlatformInteger = new OnPlatform<int>();
- onPlatformInteger.iOS = 12;
- Assert.AreEqual(onPlatformInteger.iOS, 12, "iOS property should be equal.");
-
- var onPlatformDouble = new OnPlatform<double>();
- onPlatformDouble.iOS = 15.12;
- Assert.AreEqual(onPlatformDouble.iOS, 15.12, "iOS property should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check WinPhone property is readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.OnPlatform<T>.WinPhone A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void WinPhone_READ_WRITE()
- {
- /*TEST CODE*/
- var onPlatformString = new OnPlatform<string>();
- onPlatformString.WinPhone = "SRBD";
- Assert.AreEqual(onPlatformString.WinPhone, "SRBD", "iOS property should be equal.");
-
- var onPlatformInteger = new OnPlatform<int>();
- onPlatformInteger.WinPhone = 12;
- Assert.AreEqual(onPlatformInteger.WinPhone, 12, "iOS property should be equal.");
-
- var onPlatformDouble = new OnPlatform<double>();
- onPlatformDouble.WinPhone = 15.12;
- Assert.AreEqual(onPlatformDouble.WinPhone, 15.12, "iOS property should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check Conversion to T operator Casts the type to the version that corresponds to the platform.")]
- [Property("SPEC", "Xamarin.Forms.OnPlatform<T>.implicit M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void Implicit_WITH_STRING()
- {
- /* PRECONDITION
- * 1. Create a OnPlatform<string>.
- */
- var onPlatform = new OnPlatform<string>();
- onPlatform.Android = "Android 7.0";
-
- /* TEST CODE */
- var T = onPlatform;
- Assert.IsNotNull(T, "Value of T is null");
- Assert.IsInstanceOf<string>(T.Android, "Should be is type of String");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Platforms is readable.")]
- [Property("SPEC", "Xamarin.Forms.OnPlatform<T>.Platforms A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Platforms_GET()
- {
- /* TEST CODE */
- var onPlatform = new OnPlatform<string>();
-
- Assert.IsNotNull(onPlatform.Platforms, "Platforms should not be NULL");
- Assert.IsInstanceOf<IList<On>>(onPlatform.Platforms, "Should be type of List of On");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-using System.Threading.Tasks;
-using System.Threading;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.OpenGLView Tests")]
- public class OpenGLViewTests
- {
- private OpenGLView _openGLView;
-
- [SetUp]
- public void SetUp()
- {
- _openGLView = new OpenGLView();
- Console.WriteLine("TSOpenGLViewTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- _openGLView = null;
- Console.WriteLine("TSOpenGLViewTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a OpenGLView object")]
- [Property("SPEC", "Xamarin.Forms.OpenGLView.OpenGLView C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void OpenGLView_INIT()
- {
- /*TEST CODE*/
- Assert.IsNotNull(_openGLView, "Instance of OpenGLView is null");
- Assert.IsInstanceOf<OpenGLView>(_openGLView, "Is not an instance of OpenGLView");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of HasRenderLoopProperty's bound or not.")]
- [Property("SPEC", "Xamarin.Forms.OpenGLView.HasRenderLoopProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void HasRenderLoopProperty_CHECK_BINDABLE()
- {
- /* TEST CODE */
- OpenGLView openGLViewNew = new OpenGLView();
- Boolean mFirstHasRenderLoopProperty = true;
- Boolean mSecondHasRenderLoopProperty = false;
-
- _openGLView.HasRenderLoop = mFirstHasRenderLoopProperty;
- openGLViewNew.HasRenderLoop = mSecondHasRenderLoopProperty;
-
- Assert.AreNotEqual(_openGLView.HasRenderLoop, openGLViewNew.HasRenderLoop, "HasRenderLoopProperty values must be different.");
- _openGLView.BindingContext = openGLViewNew;
- _openGLView.SetBinding(OpenGLView.HasRenderLoopProperty, "HasRenderLoop");
- Assert.AreEqual(_openGLView.HasRenderLoop, openGLViewNew.HasRenderLoop, "After binding, values should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether HasRenderLoop Property is writeable and readable.")]
- [Property("SPEC", "Xamarin.Forms.OpenGLView.HasRenderLoop A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void HasRenderLoop_READ_WRITE()
- {
- /* TEST CODE */
- _openGLView.HasRenderLoop = true;
- Assert.IsNotNull(_openGLView, "OpenGLView instance is null.");
- Assert.IsInstanceOf<OpenGLView>(_openGLView, "Should be instance of OpenGLView Type.");
- Assert.AreEqual(_openGLView.HasRenderLoop, true, "Returning false expected true.");
-
- _openGLView.HasRenderLoop = false;
- Assert.AreEqual(_openGLView.HasRenderLoop, false, "Returning true expected false.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OnDisplay Property is writeable and readable.")]
- [Property("SPEC", "Xamarin.Forms.OpenGLView.OnDisplay A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void OnDisplay_READ_WRITE()
- {
- /* TEST CODE */
- Action<Rectangle> demoRectangle = delegate (Rectangle rect)
- {
- rect.Height = 5.0;
- };
-
- _openGLView.OnDisplay = demoRectangle;
- Assert.IsNotNull(_openGLView, "OpenGLView instance is null.");
- Assert.IsInstanceOf<OpenGLView>(_openGLView, "Should be instance of OpenGLView Type.");
- Assert.IsTrue(_openGLView.OnDisplay.Equals(demoRectangle), "Returning false expected true.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether called prior to rendering works.")]
- [Property("SPEC", "Xamarin.Forms.OpenGLView.Display A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Display_CHECK()
- {
- /* TEST CODE */
- _openGLView = new OpenGLView();
- bool displayed = false;
-
- ((IOpenGlViewController)_openGLView).DisplayRequested += (s, o) => displayed = true;
-
- _openGLView.Display();
- Thread.Sleep(500);
- Assert.IsTrue(displayed, "Expected true but returned false.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether On<IConfigPlatform> is readable correct or not")]
- [Property("SPEC", "Xamarin.Forms.OpenGLView.On<T> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void On_CONFIGURATION_METHOD()
- {
- /* TEST CODE */
- var openGLView = new OpenGLView()
- {
- HasRenderLoop=true,
- };
- var myConfig = openGLView.On<IConfigPlatform>();
- Assert.IsInstanceOf<IPlatformElementConfiguration<IConfigPlatform, OpenGLView>>(myConfig, "myConfig should be a instance of IPlatformElementConfiguration");
- var getOpenGLView = myConfig.Element;
- Assert.IsInstanceOf<OpenGLView>(getOpenGLView, "myConfig.Element should be a instance of OpenGLView");
- Assert.AreEqual(openGLView.HasRenderLoop, getOpenGLView.HasRenderLoop, "Get HasRenderLoop value of OpenGLView is not correct");
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using XamarinForTizen.Tizen;
-using XamarinForTizen;
-using System.Threading.Tasks;
-using Xamarin.Forms.Platform.Tizen.Native;
-using AutoTemplate;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.Page test")]
- public class PageTests : ContentPage
- {
- private static App _app = Program.getApp();
- private static Page _page;
- private static SubPage _subPage;
- private static bool _flagAppearingEvent, _flagDisappearingEvent, _flagLayoutChangedEvent;
- private static bool _flagLayoutChildren, _flagOnAppearing, _flagOnDisappearing, _flagOnSizeAllocated, _flagOnParentSet, _flagOnChildMeasureInvalidated;
- private static bool _flagOnBindingContextChanged;
- public static bool _flagBackPress;
- private static string _appResourcePath = Tizen.Applications.Application.Current.DirectoryInfo.Resource;
- private static string _pathStaticImage = _appResourcePath + "TED/thumbnail/a.jpg";
-
- protected override void LayoutChildren(double x, double y, double width, double height)
- {
- _flagLayoutChildren = true;
- base.LayoutChildren(x, y, width, height);
- }
-
- protected override void OnAppearing()
- {
- _flagOnAppearing = true;
- base.OnAppearing();
- }
-
- protected override void OnDisappearing()
- {
- _flagOnDisappearing = true;
- base.OnDisappearing();
- }
-
- protected override void OnSizeAllocated(double width, double height)
- {
- _flagOnSizeAllocated = true;
- base.OnSizeAllocated(width, height);
- }
-
- protected override void OnParentSet()
- {
- _flagOnParentSet = true;
- base.OnParentSet();
- }
-
- protected override void OnChildMeasureInvalidated(object sender, EventArgs e)
- {
- _flagOnChildMeasureInvalidated = true;
- base.OnChildMeasureInvalidated(sender, e);
- }
-
- protected override void OnBindingContextChanged()
- {
- _flagOnBindingContextChanged = true;
- base.OnBindingContextChanged();
- }
-
- [SetUp]
- public void Setup()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Page CLASS: Setup---------------------------------");
- _page = new Page();
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Page CLASS: Teardown------------------------------");
- _page = null;
- _subPage = null;
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a Page instance. Check whether object is successfully created or not.")]
- [Property("SPEC", "Xamarin.Forms.Page.Page C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void Page_INIT()
- {
- /* TEST CODE */
- var page = new Page();
- Assert.IsNotNull(page, "Can't create a Page Object successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property BackgroundImageProperty is readable or not.")]
- [Property("SPEC", "Xamarin.Forms.Page.BackgroundImageProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void BackgroundImageProperty_GET()
- {
- /* PRECONDITION
- * 1. Initiate two Page.
- * 2. Set BackgroundImage for two Page is different.
- */
- Page page1 = new Page();
- page1.BackgroundImage = _appResourcePath + "TED/thumbnail/a.jpg";
- Page page2 = new Page();
- page2.BackgroundImage = _appResourcePath + "TED/thumbnail/b.jpg";
- Assert.AreNotEqual(page1.BackgroundImage, page2.BackgroundImage, "BackgroundImage of two Page should be different before set binding.");
- /*TEST CODE*/
- page1.BindingContext = page2;
- page1.SetBinding(Page.BackgroundImageProperty, "BackgroundImage");
- Assert.AreEqual(page1.BackgroundImage, page2.BackgroundImage, "BackgroundImage of two Page should be same after set binding.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property IconProperty is readable or not.")]
- [Property("SPEC", "Xamarin.Forms.Page.IconProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void IconProperty_GET()
- {
- /* PRECONDITION
- * 1. Initiate two Page.
- * 2. Set Icon for two Page is different.
- */
- Page page1 = new Page();
- var icon1 = new FileImageSource() { File = _appResourcePath + "icon/settings_about_pdevice.png" };
- page1.Icon = icon1;
- Page page2 = new Page();
- var icon2 = new FileImageSource() { File = _appResourcePath + "icon/settings_account.png" };
- page2.Icon = icon2;
- Assert.AreNotEqual(page1.Icon, page2.Icon, "Icon of two Page should be different before set binding.");
- /*TEST CODE*/
- page1.BindingContext = page2;
- page1.SetBinding(Page.IconProperty, "Icon");
- Assert.AreEqual(page1.BackgroundImage, page2.BackgroundImage, "Icon of two Page should be same after set binding.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property IsBusyProperty is readable or not.")]
- [Property("SPEC", "Xamarin.Forms.Page.IsBusyProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void IsBusyProperty_GET()
- {
- /* PRECONDITION
- * 1. Initiate two Page.
- * 2. Set IsBusy for two Page is different.
- */
- Page page1 = new Page();
- page1.IsBusy = true;
- Page page2 = new Page();
- page2.IsBusy = false;
- Assert.AreNotEqual(page1.IsBusy, page2.IsBusy, "IsBusy of two Page should be different before set binding.");
- /*TEST CODE*/
- page1.BindingContext = page2;
- page1.SetBinding(Page.IsBusyProperty, "IsBusy");
- Assert.AreEqual(page1.IsBusy, page2.IsBusy, "IsBusy of two Page should be same after set binding.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property PaddingProperty is readable or not.")]
- [Property("SPEC", "Xamarin.Forms.Page.PaddingProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void PaddingProperty_GET()
- {
- /* PRECONDITION
- * 1. Initiate two Page.
- * 2. Set Padding for two Page is different.
- */
- Page page1 = new Page();
- page1.Padding = new Thickness(100);
- Page page2 = new Page();
- page2.Padding = new Thickness(200);
- Assert.AreNotEqual(page1.Padding, page2.Padding, "Padding of two Page should be different before set binding.");
- /*TEST CODE*/
- page1.BindingContext = page2;
- page1.SetBinding(Page.PaddingProperty, "Padding");
- Assert.AreEqual(page1.Padding, page2.Padding, "Padding of two Page should be same after set binding.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property TitleProperty is readable or not.")]
- [Property("SPEC", "Xamarin.Forms.Page.TitleProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void TitleProperty_GET()
- {
- /* PRECONDITION
- * 1. Initiate two Page.
- * 2. Set Title for two Page is different.
- */
- Page page1 = new Page();
- page1.Title = "Page1 Title";
- Page page2 = new Page();
- page2.Title = "Page2 Title";
- Assert.AreNotEqual(page1.Title, page2.Title, "Title of two Page should be different before set binding.");
- /*TEST CODE*/
- page1.BindingContext = page2;
- page1.SetBinding(Page.TitleProperty, "Title");
- Assert.AreEqual(page1.Title, page2.Title, "Title of two Page should be same after set binding.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property BackgroundImage is readable and settable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.Page.BackgroundImage A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void BackgroundImage_GET_SET()
- {
- /* TEST CODE */
- _page.BackgroundImage = _pathStaticImage;
- Assert.AreEqual(_pathStaticImage, _page.BackgroundImage, "The property BackgroundImage is not readable and settable with valid values.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Icon is readable and settable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.Page.Icon A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void Icon_SET_GET()
- {
- /* TEST CODE */
- var iconUrl = _appResourcePath + "icon/settings_about_pdevice.png";
- var icon = new FileImageSource();
- icon.File = iconUrl;
- _page.Icon = icon;
- Assert.AreEqual(icon.File, _page.Icon.File, "The property Icon is not readable and settable with valid values.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property IsBusy is readable and settable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.Page.IsBusy A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void IsBusy_SET_GET()
- {
- /* TEST CODE */
- Assert.IsFalse(_page.IsBusy, "IsBusy should be false after Page is created");
- _page.IsBusy = true;
- Assert.IsTrue(_page.IsBusy, "IsBusy should be true after set value to true");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Padding is readable and settable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.Page.Padding A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void Padding_SET_GET()
- {
- /* TEST CODE */
- var padding = new Thickness(100)
- {
- Left = 2,
- Right = 4,
- Bottom = 6,
- Top = 8
- };
- _page.Padding = padding;
- Assert.AreEqual(padding.Left, _page.Padding.Left, "Set, get Padding is fail");
- Assert.AreEqual(padding.Right, _page.Padding.Right, "Set, get Padding is fail");
- Assert.AreEqual(padding.Bottom, _page.Padding.Bottom, "Set, get Padding is fail");
- Assert.AreEqual(padding.Top, _page.Padding.Top, "set, get Padding is fail");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Title is readable and settable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.Page.Title A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void Title_SET_GET()
- {
- /* TEST CODE */
- var title = "title test";
- _page.Title = title;
- Assert.AreEqual(title.ToString(), _page.Title.ToString(), "Set, Get title of Page is fail");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property ToolbarItems is readable.")]
- [Property("SPEC", "Xamarin.Forms.Page.ToolbarItems A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void ToolbarItems_CHECK()
- {
- /* TEST CODE */
- var getToolbarItems = _page.ToolbarItems;
- Assert.IsNotNull(getToolbarItems, "Return value ToolbarItems should not null");
- for (int i = 0; i < getToolbarItems.Count; i++)
- {
- Assert.IsNotNull(getToolbarItems[i]);
- Assert.IsInstanceOf<ToolbarItem>(getToolbarItems[i]);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Appearing event is called after page is displayed or not.")]
- [Property("SPEC", "Xamarin.Forms.Page.Appearing E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public async Task Appearing_CHECK_EVENT()
- {
- /* Precondition:
- - Create ContentPage that inherrit Page.
- */
- ContentPage testPage = new ContentPage();
- /* TEST CODE */
- _flagAppearingEvent = false;
- testPage.Appearing += (sender, e) =>
- {
- _flagAppearingEvent = true;
- };
- await _app.MainPage.Navigation.PushAsync(testPage);
- await Task.Delay(500);
- Assert.IsTrue(_flagAppearingEvent, "Flag should be true after Appearing event is called");
- /* Postcondition */
- await _app.MainPage.Navigation.PopToRootAsync();
- await Task.Delay(500);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Disappearing event is called after page is un-displayed or not.")]
- [Property("SPEC", "Xamarin.Forms.Page.Disappearing E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public async Task Disappearing_CHECK_EVENT()
- {
- /* Precondition:
- - Create ContentPage that inherrit Page.
- */
- ContentPage testPage = new ContentPage();
- /* TEST CODE */
- _flagDisappearingEvent = false;
- testPage.Disappearing += (sender, e) =>
- {
- _flagDisappearingEvent = true;
- };
- await _app.MainPage.Navigation.PushAsync(testPage);
- await Task.Delay(500);
- await _app.MainPage.Navigation.PopToRootAsync();
- await Task.Delay(500);
- Assert.IsTrue(_flagDisappearingEvent, "Flag should be true after Disappearing event is called");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether LayoutChanged event is called after layout is changed or not.")]
- [Property("SPEC", "Xamarin.Forms.Page.LayoutChanged E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public async Task LayoutChanged_CHECK_EVENT()
- {
- /* Precondition:
- - Create ContentPage that inherrit Page.
- */
- ContentPage testPage = new ContentPage();
- /* TEST CODE */
- _flagLayoutChangedEvent = false;
- testPage.LayoutChanged += (sender, e) =>
- {
- _flagLayoutChangedEvent = true;
- };
- await _app.MainPage.Navigation.PushAsync(testPage);
- await Task.Delay(500);
- testPage.Content = new Label { Text = "Change Layout" };
- await Task.Delay(500);
- Assert.IsTrue(_flagLayoutChangedEvent, "Flag should be true after LayoutChanged event is called");
- /* Postcondition */
- await _app.MainPage.Navigation.PopToRootAsync();
- await Task.Delay(500);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether LayoutChildren() is called after a child view is layout or not.")]
- [Property("SPEC", "Xamarin.Forms.Page.LayoutChildren M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public async Task LayoutChildren_CHECK()
- {
- /* Precondition:
- - Create ContentPage that inherrit Page.
- */
- PageTests testPage = new PageTests();
- /* TEST CODE */
- _flagLayoutChildren = false;
- await _app.MainPage.Navigation.PushAsync(testPage);
- await Task.Delay(500);
- testPage.Content = new Label { Text = "Change Layout" };
- await Task.Delay(500);
- Assert.IsTrue(_flagLayoutChildren, "Flag should be true after a child is drawn event is called");
- /* Postcondition */
- await _app.MainPage.Navigation.PopToRootAsync();
- await Task.Delay(500);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OnAppearing() is called after after page is displayed or not.")]
- [Property("SPEC", "Xamarin.Forms.Page.OnAppearing M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public async Task OnAppearing_CHECK()
- {
- /* Precondition:
- - Create ContentPage that inherrit Page.
- */
- PageTests testPage = new PageTests();
- /* TEST CODE */
- _flagOnAppearing = false;
- await _app.MainPage.Navigation.PushAsync(testPage);
- await Task.Delay(500);
- Assert.IsTrue(_flagOnAppearing, "Flag should be true after OnAppearing() is called after page is displayed.");
- /* Postcondition */
- await _app.MainPage.Navigation.PopToRootAsync();
- await Task.Delay(500);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OnDisappearing is called after page is un-displayed or not.")]
- [Property("SPEC", "Xamarin.Forms.Page.OnDisappearing M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public async Task OnDisappearing_CHECK()
- {
- /* Precondition:
- - Create ContentPage that inherrit Page.
- */
- PageTests testPage = new PageTests();
- /* TEST CODE */
- _flagOnDisappearing = false;
- await _app.MainPage.Navigation.PushAsync(testPage);
- await Task.Delay(500);
- await _app.MainPage.Navigation.PopToRootAsync();
- await Task.Delay(500);
- Assert.IsTrue(_flagOnDisappearing, "Flag should be true after OnDisappearing is called");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OnSizeAllocated is called when page is displayed or not.")]
- [Property("SPEC", "Xamarin.Forms.Page.OnSizeAllocated M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public async Task OnSizeAllocated_CHECK()
- {
- /* Precondition:
- - Create ContentPage that inherrit Page.
- */
- PageTests testPage = new PageTests();
- /* TEST CODE */
- _flagOnSizeAllocated = false;
- await _app.MainPage.Navigation.PushAsync(testPage);
- await Task.Delay(500);
- Assert.IsTrue(_flagOnSizeAllocated, "Flag should be true after OnSizeAllocated is called");
- /* Postcondition */
- await _app.MainPage.Navigation.PopToRootAsync();
- await Task.Delay(500);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OnParentSet is called when page is set parent or not.")]
- [Property("SPEC", "Xamarin.Forms.Page.OnParentSet M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void OnParentSet_CHECK()
- {
- /* Precondition:
- - Create ContentPage that inherrit Page.
- */
- PageTests testPage = new PageTests();
- /* TEST CODE */
- _flagOnParentSet = false;
- testPage.Parent = _app.MainPage;
- Assert.IsTrue(_flagOnParentSet, "Flag should be true after OnParentSet is called when page is set parent");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OnChildMeasureInvalidated is called when a child measure is invalidated or not.")]
- [Property("SPEC", "Xamarin.Forms.Page.OnChildMeasureInvalidated M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public async Task OnChildMeasureInvalidated_CHECK()
- {
- /* Precondition:
- - Create ContentPage that inherrit Page.
- */
- PageTests testPage = new PageTests();
- var textLb = new Label { Text = "Invalidated Label", HeightRequest = 5000, WidthRequest = 5000 };
- /* TEST CODE */
- _flagOnChildMeasureInvalidated = false;
- await _app.MainPage.Navigation.PushAsync(testPage);
- await Task.Delay(500);
- testPage.Content = textLb;
- await Task.Delay(500);
- Assert.IsTrue(_flagOnChildMeasureInvalidated, "Flag should be true after OnChildMeasureInvalidated is called when a child measure is invalidated.");
- /* Postcondition */
- await _app.MainPage.Navigation.PopToRootAsync();
- await Task.Delay(500);
- }
-
- [Test]
- [Category("P1")]
- [Description("Test On<T> configuration method of Page class")]
- [Property("SPEC", "Xamarin.Forms.Page.On<T> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void On_CONFIGURATION_METHOD()
- {
- /*TEST CODE*/
- _page.Title = "Page Title";
- _page.BackgroundImage = _pathStaticImage;
- var myConfig = _page.On<IConfigPlatform>();
- Assert.IsInstanceOf<IPlatformElementConfiguration<IConfigPlatform, Page>>(myConfig, "myConfig should be a instance of IPlatformElementConfiguration");
- Assert.IsInstanceOf<Page>(myConfig.Element, "myConfig.Element should be a instance of Page");
- Assert.AreEqual("Page Title", myConfig.Element.Title, "Title of myConfig.Element value & Title of _searchBar should be equal");
- Assert.AreEqual(_pathStaticImage, myConfig.Element.BackgroundImage, "BackgroundImage of myConfig.Element value & BackgroundImage of _searchBar should be equal");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OnBindingContextChanged() of Page class is called when binding context is changed or not.")]
- [Property("SPEC", "Xamarin.Forms.Page.OnBindingContextChanged M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public async Task OnBindingContextChanged_CHECK()
- {
- /* PRECONDITION
- * 1. Initiate two Switch.
- * 2. Set Title for two Switch is different.
- */
- PageTests testPage1 = new PageTests();
- testPage1.Title = "Title of Page1";
- PageTests testPage2 = new PageTests();
- testPage2.Title = "Title of Page2";
- /*TEST CODE*/
- await _app.MainPage.Navigation.PushAsync(testPage1);
- await Task.Delay(500);
- _flagOnBindingContextChanged = false;
- testPage1.BindingContext = testPage2;
- testPage1.SetBinding(Page.TitleProperty, "Title");
- Assert.IsTrue(_flagOnBindingContextChanged, "_flagOnBindingContextChanged should be true after OnBindingContextChanged() of Page class is called");
- /* Postcondition */
- await _app.MainPage.Navigation.PopToRootAsync();
- await Task.Delay(500);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether run SendBackButtonPressed() will call to OnBackButtonPressed.")]
- [Property("SPEC", "Xamarin.Forms.Page.SendBackButtonPressed M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void SendBackButtonPressed_CHECK()
- {
- /* PRECONDITION
- * 1. Initiate two Switch.
- * 2. Set Title for two Switch is different.
- */
- _subPage = new SubPage();
- _subPage.Title = "Title of SubPage";
- _flagBackPress = false;
-
- /*TEST CODE*/
- var result = _subPage.SendBackButtonPressed();
- Assert.True(_flagBackPress, "SendBackButtonPressed should be call to OnBackButtonPressed.");
- Assert.IsInstanceOf<bool>(result);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check after OnBackButtonPressed() is called then _flagBackPress change to true.")]
- [Property("SPEC", "Xamarin.Forms.Page.OnBackButtonPressed M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void OnBackButtonPressed_CHECK()
- {
- /* PRECONDITION
- * 1. Initiate two Switch.
- * 2. Set Title for two Switch is different.
- */
- _subPage = new SubPage();
- _subPage.Title = "Title of SubPage";
- _flagBackPress = false;
-
- /*TEST CODE*/
- var result = _subPage.SendBackButtonPressed();
- Assert.True(_flagBackPress, "SendBackButtonPressed should be call to OnBackButtonPressed.");
- Assert.IsInstanceOf<bool>(result);
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check whether children layout is updated after UpdateChildrenLayout() of Page class is called or not.")]
- [Property("SPEC", "Xamarin.Forms.Page.UpdateChildrenLayout M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void UpdateChildrenLayout_MANUAL_CHECK()
- {
- /*TEST CODE*/
- Assert.True(false, "[NA]This API is proteced can't override.");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check whether layout is update after ForceLayout of Page class is called or not.")]
- [Property("SPEC", "Xamarin.Forms.Page.ForceLayout M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void ForceLayout_MANUAL_CHECK()
- {
- /*TEST CODE*/
- Assert.True(false, "[NA]Need to reseacrh relatetion between layout and page.");
- }
-
- public class SubPage : Page
- {
- public SubPage() : base()
- {
- }
-
- protected override bool OnBackButtonPressed()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "OnBackButtonPressed");
- _flagBackPress = true;
- return base.OnBackButtonPressed();
- }
- }
- }
-
-
-}
+++ /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 NUnit.Framework.TUnit;
-using System.Collections.Generic;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.PanGestureRecognizer test")]
- public class PanGestureRecognizerTests
- {
- [SetUp]
- public void Setup()
- {
- Console.WriteLine("PanGestureRecognizerTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("PanGestureRecognizerTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create an PanGestureRecognizer object.")]
- [Property("SPEC", "Xamarin.Forms.PanGestureRecognizer.PanGestureRecognizer C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void PanGestureRecognizer_INIT()
- {
- /* TEST CODE */
- PanGestureRecognizer panGestureRecognizer = new PanGestureRecognizer();
- Assert.IsNotNull(panGestureRecognizer, "PanGestureRecognizer Instance is null");
- Assert.IsInstanceOf<PanGestureRecognizer>(panGestureRecognizer, "Should be an instance of PanGestureRecognizer type.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of TouchPointsProperty's bound or not.")]
- [Property("SPEC", "Xamarin.Forms.PanGestureRecognizer.TouchPointsProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void TouchPointsProperty_CHECK_BINDABLE()
- {
- /* TEST CODE */
- PanGestureRecognizer panGestureRecognizer = new PanGestureRecognizer();
- PanGestureRecognizer panGestureRecognizerNew = new PanGestureRecognizer();
- var mFirstTouchPointsProperty = 3;
- var mSecondTouchPointsProperty = 5;
-
- panGestureRecognizer.TouchPoints = mFirstTouchPointsProperty;
- panGestureRecognizerNew.TouchPoints = mSecondTouchPointsProperty;
-
- Assert.AreNotEqual(panGestureRecognizer.TouchPoints, panGestureRecognizerNew.TouchPoints, "TouchPointsProperty value must be different.");
- panGestureRecognizer.BindingContext = panGestureRecognizerNew;
- panGestureRecognizer.SetBinding(PanGestureRecognizer.TouchPointsProperty, "TouchPoints");
- Assert.AreEqual(panGestureRecognizer.TouchPoints, panGestureRecognizerNew.TouchPoints, "After binding, values should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether TouchPoints Property is writeable and readable.")]
- [Property("SPEC", "Xamarin.Forms.PanGestureRecognizer.TouchPoints A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void TouchPoints_READ_WRITE()
- {
- /* TEST CODE */
- PanGestureRecognizer panGestureRecognizer = new PanGestureRecognizer();
-
- panGestureRecognizer.TouchPoints = 5;
- Assert.AreEqual(panGestureRecognizer.TouchPoints, 5, "Not returning expected value for TouchPoints.");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check whether PanGestureRecognizer Event is raised when the pan gesture changes.")]
- [Property("SPEC", "Xamarin.Forms.PanGestureRecognizer.PanUpdated E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void PanUpdated_EVENT()
- {
- /* TEST CODE */
- Assert.True(false, "[NA] Need to do manual.");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-using System.Collections.Generic;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.PanUpdatedEventArgs Tests")]
-
- public class PanUpdatedEventArgsTests
- {
- private PanUpdatedEventArgs _panUpdatedEventArgs;
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("PanUpdatedEventArgsTests --------------- Setup()");
- _panUpdatedEventArgs = new PanUpdatedEventArgs(GestureStatus.Started, 1, 11.00, 12.00);
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("PanUpdatedEventArgsTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a PanUpdatedEventArgs instance.")]
- [Property("SPEC", "Xamarin.Forms.PanUpdatedEventArgs.PanUpdatedEventArgs C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Property("COVPARAM", "GestureStatus, int")]
- public void PanUpdatedEventArgs_INIT()
- {
- /* TEST CODE */
- var panUpdatedEventArgs = new PanUpdatedEventArgs(GestureStatus.Started, 1);
-
- Assert.IsNotNull(panUpdatedEventArgs, "Object should be not null after initialize");
- Assert.IsInstanceOf<PanUpdatedEventArgs>(panUpdatedEventArgs, "Should be instance of PanUpdatedEventArgs.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a PanUpdatedEventArgs instance.")]
- [Property("SPEC", "Xamarin.Forms.PanUpdatedEventArgs.PanUpdatedEventArgs C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Property("COVPARAM", "Xamarin.Forms.GestureStatus, int, double, double")]
- public void PanUpdatedEventArgs_INIT_WITH_DOUBLE()
- {
- /* TEST CODE */
- var panUpdatedEventArgs = new PanUpdatedEventArgs(GestureStatus.Started, 1, 10.00, 11.00);
-
- Assert.IsNotNull(panUpdatedEventArgs, "Object should be not null after initialize");
- Assert.IsInstanceOf<PanUpdatedEventArgs>(panUpdatedEventArgs, "Should be instance of PanUpdatedEventArgs.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property GestureId is readable.")]
- [Property("SPEC", "Xamarin.Forms.PanUpdatedEventArgs.GestureId A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void GestureId_READ_ONLY()
- {
- /* TEST CODE */
- var gestureId = _panUpdatedEventArgs.GestureId;
- Assert.IsNotNull(gestureId, "GestureId should not be null");
- Assert.IsInstanceOf<int>(gestureId, "Object should be an int type.");
- Assert.AreEqual(1, gestureId, "GestureId should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property StatusType is readable.")]
- [Property("SPEC", "Xamarin.Forms.PanUpdatedEventArgs.StatusType A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void StatusType_READ_ONLY()
- {
- /* TEST CODE */
- var statusType = _panUpdatedEventArgs.StatusType;
- Assert.IsNotNull(statusType, "StatusType should not be null");
- Assert.IsInstanceOf<GestureStatus>(statusType, "Object should be a GestureStatus type.");
- Assert.AreEqual(GestureStatus.Started, statusType, "StatusType should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property TotalX is readable.")]
- [Property("SPEC", "Xamarin.Forms.PanUpdatedEventArgs.TotalX A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void TotalX_READ_ONLY()
- {
- /* TEST CODE */
- var totalX = _panUpdatedEventArgs.TotalX;
- Assert.IsNotNull(totalX, "TotalX should not be null");
- Assert.IsInstanceOf<double>(totalX, "Object should be a double type.");
- Assert.AreEqual(11.00, totalX, "TotalX should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property TotalY is readable.")]
- [Property("SPEC", "Xamarin.Forms.PanUpdatedEventArgs.TotalY A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void TotalY_READ_ONLY()
- {
- /* TEST CODE */
- var totalY = _panUpdatedEventArgs.TotalY;
- Assert.IsNotNull(totalY, "TotalY should not be null");
- Assert.IsInstanceOf<double>(totalY, "Object should be a double type.");
- Assert.AreEqual(12.00, totalY, "TotalY should be equal.");
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System;
-using System.Collections.Generic;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.Picker test")]
- public class PickerTests
- {
- private Picker _picker;
- private bool _flagSelectedIndexEvent;
-
- private Dictionary<string, Color> CreateColorPicker()
- {
- Dictionary<string, Color> colorTable = new Dictionary<string, Color>()
- {
- { "Color.Aqua", Color.Aqua },
- { "Color.Blue", Color.Blue },
- { "Color.Fuchsia", Color.Fuchsia },
- { "Color.Green", Color.Green },
- { "Color.Lime", Color.Lime },
- { "Color.Maroon", Color.Maroon },
- { "Color.Pink", Color.Pink },
- { "Color.Teal", Color.Teal },
- { "Color.Yellow", Color.Yellow },
- };
- foreach (var color in colorTable.Keys)
- {
- _picker.Items.Add(color);
- }
- _picker.SelectedIndexChanged += (s, e) =>
- {
- _flagSelectedIndexEvent = true;
- };
- return colorTable;
- }
-
- [SetUp]
- public void Setup()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Picker CLASS: Setup---------------------------------");
- _picker = new Picker();
- _flagSelectedIndexEvent = false;
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Picker CLASS: Teardown------------------------------");
- _picker = null;
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a Picker instance. Check whether object is successfully created or not.")]
- [Property("SPEC", "Xamarin.Forms.Picker.Picker C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void Picker_INIT()
- {
- var picker = new Picker();
- Assert.IsNotNull(picker, "Picker object is not created successfully.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of ItemsSourceProperty's bound or not.")]
- [Property("SPEC", "Xamarin.Forms.Picker.ItemsSourceProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void ItemsSourceProperty_CHECK_BINDABLE()
- {
- /* TEST CODE */
- Label label = new Label();
- var mFirstItemsSourceProperty = new List<String>
- {
- "Tizen"
- };
- var mSecondItemsSourceProperty = new List<Label>
- {
- label
- };
- Picker picker = new Picker();
-
- _picker.ItemsSource = mFirstItemsSourceProperty;
- picker.ItemsSource = mSecondItemsSourceProperty;
-
- Assert.AreNotEqual(_picker.ItemsSource, picker.ItemsSource, "ItemsSourceProperty value must be different.");
- _picker.BindingContext = picker;
- _picker.SetBinding(Picker.ItemsSourceProperty, "ItemsSource");
- Assert.AreEqual(_picker.ItemsSource, picker.ItemsSource, "After binding, values should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property SelectedIndexProperty is readable or not.")]
- [Property("SPEC", "Xamarin.Forms.Picker.SelectedIndexProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void SelectedIndexProperty_GET()
- {
- /* PRECONDITION
- * 1. Initiate two Picker.
- * 2. Set SelectedIndex for two Picker is different.
- */
- Dictionary<string, Color> colorTable = CreateColorPicker();
- Picker picker1 = new Picker();
- foreach (var color in colorTable.Keys)
- {
- picker1.Items.Add(color);
- }
- picker1.SelectedIndex = 1;
- Picker picker2 = new Picker();
- foreach (var color in colorTable.Keys)
- {
- picker2.Items.Add(color);
- }
- picker1.SelectedIndex = 2;
- Assert.AreNotEqual(picker1.SelectedIndex, picker2.SelectedIndex, "SelectedIndex of two Picker should be different before set binding.");
- /*TEST CODE*/
- picker1.BindingContext = picker2;
- picker1.SetBinding(Picker.SelectedIndexProperty, "SelectedIndex");
- Assert.AreEqual(picker1.SelectedIndex, picker2.SelectedIndex, "SelectedIndex of two Picker should be same after set binding.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of SelectedItemProperty's bound or not.")]
- [Property("SPEC", "Xamarin.Forms.Picker.SelectedItemProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void SelectedItemProperty_CHECK_BINDABLE()
- {
- /* TEST CODE */
- Picker picker = new Picker();
- var mFirstSelectedItemProperty = "Tizen";
- var mSecondSelectedItemProperty = "Visual Studio";
-
- _picker.SelectedItem = mFirstSelectedItemProperty;
- picker.SelectedItem = mSecondSelectedItemProperty;
-
- Assert.AreNotEqual(_picker.SelectedItem, picker.SelectedItem, "SelectedItemProperty value must be different.");
- _picker.BindingContext = picker;
- _picker.SetBinding(Picker.SelectedItemProperty, "SelectedItem");
- Assert.AreEqual(_picker.SelectedItem, picker.SelectedItem, "After binding, values should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property TextColorProperty is readable.")]
- [Property("SPEC", "Xamarin.Forms.Picker.TextColorProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void TextColorProperty_GET()
- {
- /* PRECONDITION
- * 1. Initiate two Picker.
- * 2. Set TextColor for two Picker is different.
- */
- Picker picker1 = new Picker();
- picker1.TextColor = Color.Blue;
- Picker picker2 = new Picker();
- picker1.TextColor = Color.Black;
- Assert.AreNotEqual(picker1.TextColor, picker2.TextColor, "TextColor of two Picker should be different before set binding.");
- /*TEST CODE*/
- picker1.BindingContext = picker2;
- picker1.SetBinding(Picker.TextColorProperty, "TextColor");
- Assert.AreEqual(picker1.TextColor, picker2.TextColor, "TextColor of two Picker should be same after set binding.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property TitleProperty is readable.")]
- [Property("SPEC", "Xamarin.Forms.Picker.TitleProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void TitleProperty_GET()
- {
- /* PRECONDITION
- * 1. Initiate two Picker.
- * 2. Set Title for two Picker is different.
- */
- Picker picker1 = new Picker();
- picker1.Title = "Picker1 Title";
- Picker picker2 = new Picker();
- picker1.Title = "Picker2 Title";
- Assert.AreNotEqual(picker1.Title, picker2.Title, "Title of two Picker should be different before set binding.");
- /*TEST CODE*/
- picker1.BindingContext = picker2;
- picker1.SetBinding(Picker.TitleProperty, "Title");
- Assert.AreEqual(picker1.Title, picker2.Title, "Title of two Picker should be same after set binding.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property ItemDisplayBinding is readable and settable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.Picker.ItemDisplayBinding A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void ItemDisplayBinding_SET_GET()
- {
- /* TEST CODE */
- BindingBase bindingBase = new Binding();
- bindingBase.Mode = BindingMode.Default;
- _picker.ItemDisplayBinding = bindingBase;
- Assert.AreEqual(_picker.ItemDisplayBinding.Mode, BindingMode.Default, "BindingMode should be Default.");
-
- bindingBase.Mode = BindingMode.OneWay;
- _picker.ItemDisplayBinding = bindingBase;
- Assert.AreEqual(_picker.ItemDisplayBinding.Mode, BindingMode.OneWay, "BindingMode should be OneWay.");
-
- bindingBase.Mode = BindingMode.OneWayToSource;
- _picker.ItemDisplayBinding = bindingBase;
- Assert.AreEqual(_picker.ItemDisplayBinding.Mode, BindingMode.OneWayToSource, "BindingMode should be OneWayToSource.");
-
- bindingBase.Mode = BindingMode.TwoWay;
- _picker.ItemDisplayBinding = bindingBase;
- Assert.AreEqual(_picker.ItemDisplayBinding.Mode, BindingMode.TwoWay, "BindingMode should be TwoWay.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property SelectedIndex is readable and settable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.Picker.SelectedIndex A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void SelectedIndex_SET_GET()
- {
- /* PRECONDITION
- * Create Color Picker
- * */
- CreateColorPicker();
- /* TEST CODE */
- _picker.SelectedIndex = 1;
- Assert.AreEqual(_picker.SelectedIndex, 1, "SelectedIndex should equals 1");
- _picker.SelectedIndex = 2;
- Assert.AreEqual(_picker.SelectedIndex, 2, "SelectedIndex should equals 2");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property SelectedItem is readable and settable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.Picker.SelectedItem A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void SelectedItem_SET_GET()
- {
- /* TEST CODE */
- _picker.SelectedItem = "Tizen";
- Assert.AreEqual(_picker.SelectedItem, "Tizen", "SelectedIndex should equals 1");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property TextColor is readable and settable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.Picker.TextColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void TextColor_SET_GET()
- {
- /* TEST CODE */
- var color = Color.Blue;
- _picker.TextColor = color;
- Assert.AreEqual(_picker.TextColor.R, color.R, "R value should equal");
- Assert.AreEqual(_picker.TextColor.G, color.G, "G value should equal");
- Assert.AreEqual(_picker.TextColor.B, color.B, "B value should equal");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Title is readable and settable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.Picker.Title A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void Title_SET_GET()
- {
- /* TEST CODE */
- string title = "Picker Title";
- _picker.Title = title;
- Assert.AreEqual(_picker.Title, title, "Picker Title should be equal to set value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Items is readable.")]
- [Property("SPEC", "Xamarin.Forms.Picker.Items A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void Items_GET()
- {
- /* PRECONDITION
- * Create Color Picker
- * */
- Dictionary<string, Color> colorTable = CreateColorPicker();
- /* TEST CODE */
- var items = _picker.Items;
- Assert.IsNotNull(items, "Items should be not null");
- Assert.AreEqual(items.Count, 9, "Items count is not correct");
- foreach (var color in colorTable.Keys)
- {
- Assert.IsTrue(items.Contains(color), "Value of element in Items is not correct.");
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property ItemsSource is readable and settable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.Picker.ItemsSource A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void ItemsSource_SET_GET()
- {
- /* TEST CODE */
- var list = new List<String>
- {
- "Tizen",
- "Visual Studio"
- };
-
- _picker.ItemsSource = list;
- Assert.AreEqual(_picker.ItemsSource, list, "Not returning expected value.");
- Assert.AreEqual(_picker.ItemsSource.Count, 2, "Item count should be 2.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether SelectedIndexChanged event is invoked when the SelectedIndex property is changed.")]
- [Property("SPEC", "Xamarin.Forms.Picker.SelectedIndexChanged E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void SelectedIndexChanged_EVENT_CHECK()
- {
- /* PRECONDITION
- * Create Color Picker
- * */
- CreateColorPicker();
- /* TEST CODE */
- _picker.SelectedIndex = 1;
- _flagSelectedIndexEvent = false;
- _picker.SelectedIndex = 2;
- Assert.IsTrue(_flagSelectedIndexEvent, "_flagSelectedIndexEvent should be true after changing selected index");
- }
-
- [Test]
- [Category("P1")]
- [Description("Test On<T> configuration method of Picker class")]
- [Property("SPEC", "Xamarin.Forms.Picker.On<T> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void On_CONFIGURATION_METHOD()
- {
- /*TEST CODE*/
- _picker.Title = "Picker Title";
- var myConfig = _picker.On<IConfigPlatform>();
- Assert.IsInstanceOf<IPlatformElementConfiguration<IConfigPlatform, Picker>>(myConfig, "myConfig should be a instance of IPlatformElementConfiguration");
- Assert.IsInstanceOf<Picker>(myConfig.Element, "myConfig.Element should be a instance of Picker");
- Assert.AreEqual("Picker Title", myConfig.Element.Title, "Title of myConfig.Element value & Title of _picker should be equal");
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System.Collections.Generic;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.PinchGestureRecognizer test")]
- public class PinchGestureRecognizerTests
- {
- [SetUp]
- public void Setup()
- {
- Console.WriteLine("PinchGestureRecognizerTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("PinchGestureRecognizerTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create an PinchGestureRecognizer object.")]
- [Property("SPEC", "Xamarin.Forms.PinchGestureRecognizer.PinchGestureRecognizer C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void PinchGestureRecognizer_INIT()
- {
- /* TEST CODE */
- PinchGestureRecognizer pinchGestureRecognizer = new PinchGestureRecognizer();
- Assert.IsNotNull(pinchGestureRecognizer, "PinchGestureRecognizer Instance is null");
- Assert.IsInstanceOf<PinchGestureRecognizer>(pinchGestureRecognizer, "Should be an instance of PinchGestureRecognizer type.");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check whether PinchUpdated Event is raised when a pinch gesture updates.")]
- [Property("SPEC", "Xamarin.Forms.PinchGestureRecognizer.PinchUpdated E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void PinchUpdated_EVENT()
- {
- /* TEST CODE */
- Assert.IsTrue(false, "[NA] Need to do manual.");
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.PinchGestureUpdatedEventArgs test")]
- public class PinchGestureUpdatedEventArgsTests
- {
- [SetUp]
- public void Setup()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "PinchGestureUpdatedEventArgs CLASS: Setup---------------------------------");
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "PinchGestureUpdatedEventArgs CLASS: Teardown------------------------------");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether PinchGestureUpdatedEventArgs object is created or not")]
- [Property("SPEC", "Xamarin.Forms.PinchGestureUpdatedEventArgs.PinchGestureUpdatedEventArgs C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- [Property("COVPARAM", "Xamarin.Forms.GestureStatus")]
- public void PinchGestureUpdatedEventArgs_INIT_ONEPARAM()
- {
- /* TEST CODE */
- PinchGestureUpdatedEventArgs mPinchGestureUpdatedEventArgs = new PinchGestureUpdatedEventArgs(GestureStatus.Started);
- Assert.IsNotNull(mPinchGestureUpdatedEventArgs, "Object should be not null after initializing");
- Assert.IsInstanceOf<PinchGestureUpdatedEventArgs>(mPinchGestureUpdatedEventArgs, "Object should be PinchGestureUpdatedEventArgs");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether PinchGestureUpdatedEventArgs object is created or not")]
- [Property("SPEC", "Xamarin.Forms.PinchGestureUpdatedEventArgs.PinchGestureUpdatedEventArgs C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- [Property("COVPARAM", "Xamarin.Forms.GestureStatus, Double, Xamarin.Forms.Point")]
- public void PinchGestureUpdatedEventArgs_INIT_THREEPARAMS()
- {
- /* TEST CODE */
- PinchGestureUpdatedEventArgs mPinchGestureUpdatedEventArgs = new PinchGestureUpdatedEventArgs(GestureStatus.Running, 1.5, new Point(100, 100));
- Assert.IsNotNull(mPinchGestureUpdatedEventArgs, "Object should be not null after initializing");
- Assert.IsInstanceOf<PinchGestureUpdatedEventArgs>(mPinchGestureUpdatedEventArgs, "Object should be PinchGestureUpdatedEventArgs");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of Status can be readable or not.")]
- [Property("SPEC", "Xamarin.Forms.PinchGestureUpdatedEventArgs.Status A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void Status_GET()
- {
- /* TEST CODE */
- PinchGestureUpdatedEventArgs mPinchGestureUpdatedEventArgs = new PinchGestureUpdatedEventArgs(GestureStatus.Started);
- Assert.AreEqual(GestureStatus.Started, mPinchGestureUpdatedEventArgs.Status, "Status values should be equal to GestureStatus.Started which was set.");
- mPinchGestureUpdatedEventArgs = new PinchGestureUpdatedEventArgs(GestureStatus.Running);
- Assert.AreEqual(GestureStatus.Running, mPinchGestureUpdatedEventArgs.Status, "Status values should be equal to GestureStatus.Running which was set.");
- mPinchGestureUpdatedEventArgs = new PinchGestureUpdatedEventArgs(GestureStatus.Completed);
- Assert.AreEqual(GestureStatus.Completed, mPinchGestureUpdatedEventArgs.Status, "Status values should be equal to GestureStatus.Completed which was set.");
- mPinchGestureUpdatedEventArgs = new PinchGestureUpdatedEventArgs(GestureStatus.Canceled);
- Assert.AreEqual(GestureStatus.Canceled, mPinchGestureUpdatedEventArgs.Status, "Status values should be equal to GestureStatus.Canceled which was set.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of Scale can be readable or not.")]
- [Property("SPEC", "Xamarin.Forms.PinchGestureUpdatedEventArgs.Scale A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void Scale_GET()
- {
- /* TEST CODE */
- PinchGestureUpdatedEventArgs mPinchGestureUpdatedEventArgs = new PinchGestureUpdatedEventArgs(GestureStatus.Started, 1.5, new Point(100, 100));
- Assert.AreEqual(1.5, mPinchGestureUpdatedEventArgs.Scale, "Scale values should be equal to value which was set.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of ScaleOrigin can be readable or not.")]
- [Property("SPEC", "Xamarin.Forms.PinchGestureUpdatedEventArgs.ScaleOrigin A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void ScaleOrigin_GET()
- {
- /* TEST CODE */
- PinchGestureUpdatedEventArgs mPinchGestureUpdatedEventArgs = new PinchGestureUpdatedEventArgs(GestureStatus.Started, 1.5, new Point(100, 200));
- Assert.AreEqual(100, mPinchGestureUpdatedEventArgs.ScaleOrigin.X, "ScaleOrigin X values should be equal to value which was set.");
- Assert.AreEqual(200, mPinchGestureUpdatedEventArgs.ScaleOrigin.Y, "ScaleOrigin Y values should be equal to value which was 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 NUnit.Framework;
-using NUnit.Framework.TUnit;
-using System.Collections.Generic;
-using System;
-using System.Threading.Tasks;
-using XamarinForTizen.Tizen;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.PlatformEffect test")]
- public class PlatformEffectTemplateTest
- {
- internal class SubPlatformEffect : PlatformEffect<ContentPage, Entry>
- {
-
- protected override void OnAttached()
- {
- }
-
- protected override void OnDetached()
- {
- }
-
- }
-
- // Following XamarinForTizen.Tizen.common.MockEffect
- public class CustomPlatformEffect : Xamarin.Forms.Platform.Tizen.PlatformEffect
- {
- protected override void OnAttached()
- {
- Container.Color = ElmSharp.Color.Red;
- Control.Color = ElmSharp.Color.Blue;
- }
-
- protected override void OnDetached()
- {
-
- }
- }
-
- private static SubPlatformEffect _platformEffect;
-
- [SetUp]
- public void Setup()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "PlatformEffect: Setup---------------------------------");
- _platformEffect = new SubPlatformEffect();
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "PlatformEffect: Teardown------------------------------");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a PlatformEffect<> instance. Check whether object is successfully created or not.")]
- [Property("SPEC", "Xamarin.Forms.PlatformEffect<TContainer,TControl>.PlatformEffect C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Ngo Van Hai, hai.nv3@samsung.com")]
- public void PlatformEffect_INIT()
- {
- /*TEST CODE*/
- SubPlatformEffect platformEffect = new SubPlatformEffect();
- Assert.NotNull(platformEffect, "Create PlatformEffect don't successfully");
- Assert.IsInstanceOf<SubPlatformEffect>(platformEffect);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Container is readable.")]
- [Property("SPEC", "Xamarin.Forms.PlatformEffect<TContainer,TControl>.Container A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Ngo Van Hai, hai.nv3@samsung.com")]
- public async Task Container_PROPERTY()
- {
- NavigationPage mainPage = (NavigationPage)Program.getApp().MainPage;
- ContentPage contentPage = new ContentPage();
- contentPage.Content = new StackLayout
- {
- Children =
- {
- new Button { Text = "Button" }
- }
- };
- await mainPage.PushAsync(contentPage);
- var customPlatformEffect = new CustomPlatformEffect();
- contentPage.Content.Effects.Add(customPlatformEffect);
- var getContainer = customPlatformEffect.Container;
- Assert.IsNotNull(getContainer, "Container should not null");
- Assert.IsInstanceOf<ElmSharp.EvasObject>(getContainer, "Container should be return a object EvasObject");
- Assert.AreEqual(getContainer.Color, ElmSharp.Color.Red, "Get value is not equal to set value");
- /* Postcondition:
- - Pop layout*/
- await mainPage.PopAsync();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Control is readable.")]
- [Property("SPEC", "Xamarin.Forms.PlatformEffect<TContainer,TControl>.Control A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Ngo Van Hai, hai.nv3@samsung.com")]
- public async Task Control_PROPERTY()
- {
- NavigationPage mainPage = (NavigationPage)Program.getApp().MainPage;
- /*TEST CODE*/
- ContentPage contentPage = new ContentPage();
- await mainPage.PushAsync(contentPage);
- var customPlatformEffect = new CustomPlatformEffect();
- contentPage.Effects.Add(customPlatformEffect);
- var getControl = customPlatformEffect.Control;
- Assert.IsNotNull(getControl, "Control should not null");
- Assert.IsInstanceOf<ElmSharp.EvasObject>(getControl, "Control should be return a object EvasObject");
- Assert.AreEqual(getControl.Color, ElmSharp.Color.Blue, "Get value is not equal to set value");
- /* Postcondition:
- - Pop layout*/
- await mainPage.PopAsync();
- }
-
- }
-}
+++ /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 System.Globalization;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.Point Tests")]
- public class PointTests
- {
- [SetUp]
- public void Setup()
- {
- Console.WriteLine("PointTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("PointTests --------------- TearDown()");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Create a Point object")]
- [Property("SPEC", "Xamarin.Forms.Point.Point C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void Point_INIT()
- {
- /* TEST CODE */
- var point = new Point();
- Assert.IsNotNull(point, "Point instance is null");
- Assert.IsInstanceOf<Point>(point, "Object should be as Point type.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a Point object")]
- [Property("SPEC", "Xamarin.Forms.Point.Point C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Property("COVPARAM", "Xamarin.Forms.Size")]
- public void Point_WITH_SIZE_INIT()
- {
- /* TEST CODE */
-
- var size = new Size(2.1, 3.1);
- var pointWithSingelParam = new Point(size);
-
- Assert.IsNotNull(pointWithSingelParam, "Point with single parameter instance is null");
-
- Assert.IsInstanceOf<Point>(pointWithSingelParam, "Object should be as Point type.");
-
- Assert.AreEqual(2.1, pointWithSingelParam.X, "X position is not not same as the provided value for poit with size parameter.");
- Assert.AreEqual(3.1, pointWithSingelParam.Y, "Y position is not not same as the provided value for poit with size parameter.");
-
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a Point object")]
- [Property("SPEC", "Xamarin.Forms.Point.Point C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Property("COVPARAM", "Double, Double")]
- public void Point_WITH_XY_INIT()
- {
- /* TEST CODE */
-
- var pointWithDoubleParam = new Point(1.0, 2.0);
- Assert.IsNotNull(pointWithDoubleParam, "Point with double parameter instance is null");
-
- Assert.IsInstanceOf<Point>(pointWithDoubleParam, "Object should be as Point type.");
-
- Assert.AreEqual(1.0, pointWithDoubleParam.X, "X position is not not same as the provided value for poit with (x,y) paramter.");
- Assert.AreEqual(2.0, pointWithDoubleParam.Y, "Y position is not not same as the provided value for poit with (x,y) paramter.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check wheather Zero return a Point with {0,0} position")]
- [Property("SPEC", "Xamarin.Forms.Point.Zero A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void Zero_READ_WRITE()
- {
- /* TEST CODE */
-
- var zero = Point.Zero;
- Assert.IsNotNull(zero, "Object should not be NULL.");
-
- Assert.IsInstanceOf<Point>(zero, "Object should be as Point type.");
- Assert.AreEqual(0.0, zero.X, "X position should be 0.0.");
- Assert.AreEqual(0.0, zero.Y, "Y position should be 0.0.");
- Point.Zero = new Point();
- Assert.AreEqual(0.0, Point.Zero.X, "X position should be 0.0.");
- Assert.AreEqual(0.0, Point.Zero.Y, "Y position should be 0.0.");
-
- }
-
- [Test]
- [Category("P1")]
- [Description("Check wheather IsEmpty returns true or false")]
- [Property("SPEC", "Xamarin.Forms.Point.IsEmpty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void IsEmpty_READ()
- {
- /* TEST CODE */
-
- var point1 = new Point();
- point1.X = 0.0;
- point1.Y = 0.0;
- Assert.IsNotNull(point1, "Object should not be NULL.");
- Assert.IsInstanceOf<Point>(point1, "Object should be as Point type.");
- Assert.IsTrue(point1.IsEmpty, "IsEmpty should return true");
-
- var point2 = new Point(1.0,2.0);
- Assert.IsNotNull(point2, "Object should not be NULL.");
- Assert.IsInstanceOf<Point>(point2, "Object should be as Point type.");
- Assert.IsFalse(point2.IsEmpty, "IsEmpty should return false");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check wheather X returns X position of the point")]
- [Property("SPEC", "Xamarin.Forms.Point.X A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void X_READ_WRITE()
- {
- /* TEST CODE */
-
- var point = new Point(2.0,3.0);
- Assert.IsNotNull(point, "Object should not be NULL.");
- Assert.IsInstanceOf<Point>(point, "Object should be as Point type.");
- Assert.AreEqual(2.0,point.X, "X should be same as 2.0");
- point.X = 1.0;
- Assert.AreEqual(1.0, point.X, "X should be same as 1.0");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check wheather Y returns Y position of the point")]
- [Property("SPEC", "Xamarin.Forms.Point.Y A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void Y_READ_WRITE()
- {
- /* TEST CODE */
-
- var point = new Point(2.0, 3.0);
- Assert.IsNotNull(point, "Object should not be NULL.");
- Assert.IsInstanceOf<Point>(point, "Object should be as Point type.");
- Assert.AreEqual(3.0, point.Y, "Y should be same as 3.0");
- point.Y = 4.0;
- Assert.AreEqual(4.0, point.Y, "Y should be same as 4.0");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check wheather Distance return correct value ")]
- [Property("SPEC", "Xamarin.Forms.Point.Distance M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void Distance_CHECK_RETURN()
- {
- /* TEST CODE */
-
- double x1 = 2.5;
- double y1 = 5.5;
-
- double x2 = 1.5;
- double y2 = 2.5;
-
- var distance = Math.Sqrt(Math.Pow(x1 - x2, 2) + Math.Pow(y1 - y2, 2)); // distance calculation.
-
- var point1 = new Point(x1, y1);
- var point2 = new Point(x2, y2);
-
- var pointDistance = point1.Distance(point2);
-
- Assert.IsInstanceOf<double>(pointDistance, "Distance should be double type.");
- Assert.AreEqual(distance, pointDistance, "Distance should be same as calculated distace");
-
- }
-
- [Test]
- [Category("P1")]
- [Description("Check wheather Equals can compare 2 pointer")]
- [Property("SPEC", "Xamarin.Forms.Point.Equals M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void Equals_CHECK_RETURN()
- {
- /* TEST CODE */
-
- double x1 = 2.5;
- double y1 = 5.5;
-
- double x2 = 1.5;
- double y2 = 2.5;
-
-
-
- var point1 = new Point(x1, y1);
- var point2 = new Point(x2, y2);
-
- var point1Same = new Point(x1, y1);
-
- Assert.IsTrue(point1.Equals(point1Same), "Two point should be equal");
- Assert.IsFalse(point1.Equals(point2), "Two point should not be equal");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check wheather GetHashCode can retuen a Int32 object")]
- [Property("SPEC", "Xamarin.Forms.Point.GetHashCode M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void GetHashCode_CHECK_RETURN()
- {
- /* TEST CODE */
-
- double x1 = 2.5;
- double y1 = 5.5;
-
- var point = new Point(x1, y1);
-
- var hashCode = point.GetHashCode();
-
- Assert.IsNotNull(hashCode, "Hash code should not be NULL.");
- Assert.IsInstanceOf<Int32>(hashCode, "GetHashCode should return a Int32 type object.");
-
- }
-
- [Test]
- [Category("P1")]
- [Description("Check wheather Offset can retuen a point object")]
- [Property("SPEC", "Xamarin.Forms.Point.Offset M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void Offset_CHECK_RETURN()
- {
- /* TEST CODE */
-
- var point = new Point(2, 2);
-
- point = point.Offset(10, 20);
-
-
- Assert.AreEqual(new Point(12, 22), point,"Point should retrun a point object by adding offset value with given point object.");
-
- }
-
- [Test]
- [Category("P1")]
- [Description("Check wheather Round can return a point object with rounded to the nearest integral value for X and Y")]
- [Property("SPEC", "Xamarin.Forms.Point.Round M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void Round_CHECK_RETURN()
- {
- /* TEST CODE */
-
- var point = new Point(2.4, 2.7);
- point = point.Round();
-
- Assert.AreEqual(Math.Round(2.4), point.X,"X vale shoud be rounded.");
- Assert.AreEqual(Math.Round(2.7), point.Y, "Y vale shoud be rounded.");
-
- }
-
- [Test]
- [Category("P1")]
- [Description("Check wheather ToString returns a human-readable representation of the Point.")]
- [Property("SPEC", "Xamarin.Forms.Point.ToString M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void ToString_CHECK_RETURN()
- {
- /* TEST CODE */
-
- double x = 2.4;
- double y = 5.8;
-
- var redablePoint = string.Format("{{X={0} Y={1}}}", x.ToString(CultureInfo.InvariantCulture), y.ToString(CultureInfo.InvariantCulture));
- var point = new Point(x, y);
- var pointStr = point.ToString();
-
- Assert.IsNotNull(pointStr, "ToString should not be NULL.");
- Assert.IsInstanceOf<String>(pointStr, "ToString should return a String type object.");
- Assert.AreEqual(redablePoint, pointStr, "ToString should return correct value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check wheather Addition returns a a new Point by adding a Size to a Point.")]
- [Property("SPEC", "Xamarin.Forms.Point.Addition M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void Addition_CHECK_RETURN()
- {
- /* TEST CODE */
- var point = new Point(2, 3) + new Size(3, 2);
- Assert.AreEqual(new Point(5, 5), point,"Addition should return a new point with updated X & Y value.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check wheather Equality check the two Points are equal.")]
- [Property("SPEC", "Xamarin.Forms.Point.== M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void Equality_CHECK_RETURN()
- {
- /* TEST CODE */
- Assert.IsTrue(new Point(5, 5) == new Point(5, 5),"Two point should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check wheather Inequality check the two Points are not equal.")]
- [Property("SPEC", "Xamarin.Forms.Point.!= M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void Inequality_CHECK_RETURN()
- {
- /* TEST CODE */
- Assert.IsTrue(new Point(0, 1) != new Point(1, 0), "Two point should be not be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check wheather Subtraction returns a a new Point by subtracting a Size from a Point.")]
- [Property("SPEC", "Xamarin.Forms.Point.Subtraction M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void Subtraction_CHECK_RETURN()
- {
- /* TEST CODE */
- var point = new Point(3, 4) - new Size(2, 3);
- Assert.AreEqual(new Point(1, 1), point, "Subtraction should return a new point with updated X & Y value.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check wheather Size Explicit operator returns a new Size whose Size.Width and Size.Height and equivalent to the pt's Point.X and Point.Y properties.")]
- [Property("SPEC", "Xamarin.Forms.Point.Explicit M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void Explicit_SIZE_CHECK_RETURN()
- {
- /* TEST CODE */
- var point = new Point(2, 4);
- var size = (Size)point;
-
- Assert.AreEqual(new Size(2, 4), size,"Point should convert the to Size and value shoud be equal.");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-using System.Collections;
-using System.Collections.Generic;
-using NUnit.Framework.TUnit;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.PointTypeConverter Tests")]
- public class PointTypeConverterTests
- {
- public PointTypeConverter _pointTypeConverter;
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("PointTypeConverterTests --------------- Setup()");
- _pointTypeConverter = new PointTypeConverter();
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("PointTypeConverterTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a new PointTypeConverter instance.")]
- [Property("SPEC", "Xamarin.Forms.PointTypeConverter.PointTypeConverter C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void PointTypeConverter_INIT()
- {
- /* TEST CODE */
- PointTypeConverter pointTypeConverter = new PointTypeConverter();
- Assert.IsNotNull(pointTypeConverter, "Object should be not null after initialize");
- Assert.IsInstanceOf<PointTypeConverter>(pointTypeConverter);
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check the return value of CanConvertFrom.")]
- [Property("SPEC", "Xamarin.Forms.PointTypeConverter.CanConvertFrom M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void CanConvertFrom_CHECK_RETURN()
- {
- /* TEST CODE */
- Assert.IsInstanceOf<bool>(_pointTypeConverter.CanConvertFrom(typeof(string)), "CanCorvertForm's return value should be boolean.");
- Assert.True(_pointTypeConverter.CanConvertFrom(typeof(string)));
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the ConvertFromInvariantString converts the value into Point.")]
- [Property("SPEC", "Xamarin.Forms.PointTypeConverter.ConvertFromInvariantString M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void ConvertFromInvariantString_CHECK_RETURN()
- {
- /* TEST CODE */
- Assert.AreEqual(new Point(1, 2), _pointTypeConverter.ConvertFromInvariantString("1,2"));
- Assert.AreEqual(new Point(1, 2), _pointTypeConverter.ConvertFromInvariantString("1, 2"));
- Assert.AreEqual(new Point(1, 2), _pointTypeConverter.ConvertFromInvariantString(" 1 , 2 "));
- Assert.AreEqual(new Point(1.1, 2), _pointTypeConverter.ConvertFromInvariantString("1.1,2"));
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if use invalid parameter, should be throw exception.")]
- [Property("SPEC", "Xamarin.Forms.PointTypeConverter.ConvertFromInvariantString M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MEX")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void ConvertFromInvariantString_CHECK_EXCEPTION()
- {
- /* TEST CODE */
- Assert.Throws<InvalidOperationException>(() => _pointTypeConverter.ConvertFromInvariantString(""));
- }
- }
-}
+++ /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 Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class PoppedToRootEventArgsTests
- {
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("PoppedToRootEventArgs --------------- SetUp()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("PoppedToRootEventArgs --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a PoppedToRootEventArgs instance. Check whether object is successfully created or not")]
- [Property("SPEC", "Xamarin.Forms.PoppedToRootEventArgs.PoppedToRootEventArgs C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public async Task PoppedToRootEventArgs_INIT()
- {
- /*PRECONDITION
- * 1, PushAsync page2 to navigationPage after checking number of page in navigationPage
- * 2, PushAsync page3 to navigationPage after checking number of page in navigationPage
- */
- var page1 = new Page()
- {
- Title = "The first page",
- };
- var navigationPage = new NavigationPage(page1);
- var countDefault = navigationPage.Navigation.NavigationStack.Count;
- var page2 = new Page()
- {
- Title = "PushAsync page 1",
- };
- await navigationPage.PushAsync(page2);
- var count1 = navigationPage.Navigation.NavigationStack.Count;
- Assert.AreEqual(countDefault + 1, count1, "PushAsync is not successful");
- var page3 = new Page()
- {
- Title = "PushAsync page 2",
- };
- await navigationPage.PushAsync(page3);
- var count2 = navigationPage.Navigation.NavigationStack.Count;
- Assert.AreEqual(count1 + 1, count2, "PushAsync is not successful");
-
- /* TEST CODE */
- var poppedPages = (IEnumerable<Page>)navigationPage.Navigation.NavigationStack;
- var poppedToRootEventArgs = new PoppedToRootEventArgs(page3, poppedPages);
- Assert.IsNotNull(poppedToRootEventArgs, "Creating a PoppedToRootEventArgs object failed. It is set to null");
- Assert.IsInstanceOf<PoppedToRootEventArgs>(poppedToRootEventArgs);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property PoppedPages is readable correct or not")]
- [Property("SPEC", "Xamarin.Forms.PoppedToRootEventArgs.PoppedPages A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public async Task PoppedPages_PROPERTY_GET()
- {
- /*PRECONDITION
- * 1, PushAsync page1 to navigationPage after checking number of page in navigationPage
- * 2, PushAsync page2 to navigationPage after checking number of page in navigationPage
- */
- var pageRoot = new Page()
- {
- Title = "Page Root",
- };
- var navigationPage = new NavigationPage(pageRoot);
- var countDefault = navigationPage.Navigation.NavigationStack.Count;
- var page1 = new Page()
- {
- Title = "PushAsync page 1",
- };
- await navigationPage.PushAsync(page1);
- var count1 = navigationPage.Navigation.NavigationStack.Count;
- Assert.AreEqual(countDefault + 1, count1, "PushAsync is not successful");
- var page2 = new Page()
- {
- Title = "PushAsync page 2",
- };
- await navigationPage.PushAsync(page2);
- var count2 = navigationPage.Navigation.NavigationStack.Count;
- Assert.AreEqual(count1 + 1, count2, "PushAsync is not successful");
-
- /* TEST CODE */
- List<Page> poppedPages = null;
- navigationPage.PoppedToRoot += (s, o) =>
- poppedPages = (o as PoppedToRootEventArgs).PoppedPages.ToList();
- await navigationPage.PopToRootAsync();
- var countPopped = 0;
- var getPape = new Page();
- foreach(Page item in poppedPages)
- {
- ++countPopped;
- getPape = item;
- }
- Assert.AreEqual(countPopped, 2, "Number of page in PoppedPages should be 2");
- Assert.AreEqual(page2.Title, getPape.Title, "Page title returned not correct");
- Assert.AreEqual(pageRoot.Title, navigationPage.CurrentPage.Title, "Page Title should be return title of root page");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-using System.Threading.Tasks;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.ProgressBar Tests")]
- public class ProgressBarTests
- {
- private ProgressBar _progressBar;
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("ProgressBarTests --------------- Setup()");
- _progressBar = new ProgressBar();
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("ProgressBarTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a ProgressBar instance.")]
- [Property("SPEC", "Xamarin.Forms.ProgressBar.ProgressBar C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void ProgressBar_INIT()
- {
- /* TEST CODE */
- var progressBar = new ProgressBar();
- Assert.IsNotNull(progressBar, "Object is null after initialize");
- Assert.IsInstanceOf<ProgressBar>(progressBar);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Progress is readable and writable with valid values from 0(min) to 1(max).")]
- [Property("SPEC", "Xamarin.Forms.ProgressBar.Progress A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Progress_READ_WRITE()
- {
- /* TEST CODE */
- var progressValue = 0.5;
- _progressBar.Progress = progressValue;
- Assert.IsInstanceOf<double>(_progressBar.Progress);
- Assert.AreEqual(progressValue, _progressBar.Progress, "Progress property doesn't set and get successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ProgressProperty property bound or not")]
- [Property("SPEC", "Xamarin.Forms.ProgressBar.ProgressProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void ProgressProperty_READ_ONLY()
- {
- /* TEST CODE */
- _progressBar.Progress = 0.8;
- ProgressBar mProgressBar = new ProgressBar();
- mProgressBar.Progress = 0.5;
- Assert.AreNotEqual(mProgressBar.Progress, _progressBar.Progress, "ProgressProperty value must be different.");
- _progressBar.BindingContext = mProgressBar;
- _progressBar.SetBinding(ProgressBar.ProgressProperty, "Progress");
- Assert.AreEqual(mProgressBar.Progress, _progressBar.Progress, "After binding, should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check return value of ProgressTo.")]
- [Property("SPEC", "Xamarin.Forms.ProgressBar.ProgressTo M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void ProgressTo_CHECK_RETURN()
- {
- /* TEST CODE */
- _progressBar.Progress = 0.2;
- var task = _progressBar.ProgressTo(0.8, 250, Easing.Linear);
-
- Assert.IsInstanceOf<Task<bool>>(task, "Should be Task type.");
- Assert.IsNotNull(task, "Should be not null");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check return ProgressBar configuration")]
- [Property("SPEC", "Xamarin.Forms.ProgressBar.On<T> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void On_CONFIGURATION_METHOD()
- {
- /*TEST CODE*/
- var mResouce = new ResourceDictionary();
- _progressBar.Resources = mResouce;
- var myConfig = _progressBar.On<IConfigPlatform>();
- Assert.IsInstanceOf<IPlatformElementConfiguration<IConfigPlatform, ProgressBar>>(myConfig, "Should be an instance of IPlatformElementConfiguration");
- Assert.IsInstanceOf<ProgressBar>(myConfig.Element, "Should be an instance of ProgressBar");
- Assert.AreEqual(mResouce, myConfig.Element.Resources, "Resources of myConfig.Element value & Resources of _progressBar should be to equal");
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.PropertyChangingEventArgs test")]
- public class PropertyChangingEventArgsTests
- {
- [SetUp]
- public void Setup()
- {
- Console.WriteLine("PropertyChangingEventArgsTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("PropertyChangingEventArgsTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create an PropertyChangingEventArgs object.")]
- [Property("SPEC", "Xamarin.Forms.PropertyChangingEventArgs.PropertyChangingEventArgs C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void PropertyChangingEventArgs_INIT()
- {
- /* TEST CODE */
- PropertyChangingEventArgs propertyChangingEventArgs = new PropertyChangingEventArgs("Tizen");
- Assert.IsNotNull(propertyChangingEventArgs, "PropertyChangingEventArgs Instance is null");
- Assert.IsInstanceOf<PropertyChangingEventArgs>(propertyChangingEventArgs, "Should be an instance of PropertyChangingEventArgs type.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the value for PropertyName.")]
- [Property("SPEC", "Xamarin.Forms.PropertyChangingEventArgs.PropertyName A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void PropertyName_READ_ONLY()
- {
- /* TEST CODE */
- PropertyChangingEventArgs propertyChangingEventArgs = new PropertyChangingEventArgs("Tizen");
- Assert.AreEqual(propertyChangingEventArgs.PropertyName, "Tizen", "Not returning expected PropertyName.");
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.PropertyChangingEventHandler test")]
- public class PropertyChangingEventHandlerTests
- {
- [SetUp]
- public void Setup()
- {
- Console.WriteLine("PropertyChangingEventHandlerDelegateTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("PropertyChangingEventHandlerDelegateTests --------------- TearDown()");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Create an PropertyChangingEventHandler object.")]
- [Property("SPEC", "Xamarin.Forms.PropertyChangingEventHandler.PropertyChangingEventHandler C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void PropertyChangingEventHandler_INIT()
- {
- /* TEST CODE */
- Assert.True(false, "[NA] Need to check API behavior");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check return value.")]
- [Property("SPEC", "Xamarin.Forms.PropertyChangingEventHandler.BeginInvoke M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void BeginInvoke_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- Assert.True(false, "[NA] Need to check API behavior");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check return value.")]
- [Property("SPEC", "Xamarin.Forms.PropertyChangingEventHandler.EndInvoke M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void EndInvoke_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- Assert.True(false, "[NA] Need to check API behavior");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check return value.")]
- [Property("SPEC", "Xamarin.Forms.PropertyChangingEventHandler.Invoke M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Invoke_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- Assert.True(false, "[NA] Need to check API behavior");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-using NUnit.Framework.TUnit;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.PropertyCondition Tests")]
- public class PropertyConditionTests
- {
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("PropertyConditionTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("PropertyConditionTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a PropertyCondition instance.")]
- [Property("SPEC", "Xamarin.Forms.PropertyCondition.PropertyCondition C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void PropertyCondition_INIT()
- {
- /* TEST CODE */
- PropertyCondition propertyCondition = new PropertyCondition();
-
- Assert.IsNotNull(propertyCondition, "Object should be not null after initialize");
- Assert.IsInstanceOf<PropertyCondition>(propertyCondition, "Object should be instance of PropertyCondition");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the Value property is readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.PropertyCondition.Value A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Value_READ_WRITE()
- {
- /* TEST CODE */
- String text = "Text";
- PropertyCondition propertyCondition = new PropertyCondition();
-
- propertyCondition.Value = text;
- var getValue = propertyCondition.Value;
-
- Assert.IsInstanceOf<string>(getValue, "Get Value should return object string.");
- Assert.IsTrue(text.Equals(propertyCondition.Value), "Should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the Property property is readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.PropertyCondition.Property A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Property_RAED_WRITE()
- {
- /* TEST CODE */
- PropertyCondition propertyCondition = new PropertyCondition();
- propertyCondition.Property = Label.BackgroundColorProperty;
-
- Assert.IsInstanceOf<BindableProperty>(propertyCondition.Property, "Should be instance of BindableProperty.");
- Assert.AreEqual(Label.BackgroundColorProperty, propertyCondition.Property, "Property should be same");
- }
- }
-}
+++ /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;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class RectangleTests
- {
- private Rectangle _rectangle;
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("RectangleTests --------------- Setup()");
- _rectangle = new Rectangle();
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("RectangleTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a Rectangle instance with point and size.")]
- [Property("SPEC", "Xamarin.Forms.Rectangle.Rectangle C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Property("COVPARAM", "Xamarin.Forms.Point, Xamarin.Forms.Size")]
- public void Rectangle_POINT_SIZE_INIT()
- {
- /*TEST CODE*/
- var rectangle = new Rectangle(new Point(2, 3), new Size(4, 5));
- Assert.AreEqual(2, rectangle.X);
- Assert.AreEqual(3, rectangle.Y);
- Assert.AreEqual(4, rectangle.Width);
- Assert.AreEqual(5, rectangle.Height);
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a Rectangle instance with double.")]
- [Property("SPEC", "Xamarin.Forms.Rectangle.Rectangle C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Property("COVPARAM", "Double, Double, Double, Double")]
- public void Rectangle_DOUBLE_INIT()
- {
- /*TEST CODE*/
- var rect = new Rectangle(2.0, 3.0, 4.0, 5.0);
- Assert.AreEqual(2.0, rect.X);
- Assert.AreEqual(3.0, rect.Y);
- Assert.AreEqual(4.0, rect.Width);
- Assert.AreEqual(5.0, rect.Height);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check Bottom is readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.Rectangle.Bottom A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Bottom_READ_WRITE()
- {
- /* TEST CODE */
- double bottom = 4.0;
- _rectangle.Bottom = bottom;
- Assert.AreEqual(bottom, _rectangle.Bottom, "Bottom property should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check Height is readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.Rectangle.Height A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Height_READ_WRITE()
- {
- /* TEST CODE */
- double height = 12.0;
- _rectangle.Height = height;
- Assert.AreEqual(height, _rectangle.Height, "Height property should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check Left is readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.Rectangle.Left A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Left_READ_WRITE()
- {
- /* TEST CODE */
- double left = 5.0;
- _rectangle.Left = left;
- Assert.AreEqual(left, _rectangle.Left, "Left property should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check Right is readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.Rectangle.Right A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Right_READ_WRITE()
- {
- /* TEST CODE */
- double right = 6.0;
- _rectangle.Right = right;
- Assert.AreEqual(right, _rectangle.Right, "Right property should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check Top is readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.Rectangle.Top A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Top_READ_WRITE()
- {
- /* TEST CODE */
- double top = 10.0;
- _rectangle.Top = top;
- Assert.AreEqual(top, _rectangle.Top, "Top property should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check Width is readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.Rectangle.Width A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Width_READ_WRITE()
- {
- /* TEST CODE */
- double width = 20.0;
- _rectangle.Width = width;
- Assert.AreEqual(width, _rectangle.Width, "Width property should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check X is readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.Rectangle.X A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void X_READ_WRITE()
- {
- /* TEST CODE */
- double x = 15.0;
- _rectangle.X = x;
- Assert.AreEqual(x, _rectangle.X, "X property should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check Y is readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.Rectangle.Y A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Y_READ_WRITE()
- {
- /* TEST CODE */
- double y = 17.0;
- _rectangle.Y = y;
- Assert.AreEqual(y, _rectangle.Y, "Y property should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check IsEmpty is readable.")]
- [Property("SPEC", "Xamarin.Forms.Rectangle.IsEmpty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PR0")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void IsEmpty_READ_ONLY()
- {
- /* TEST CODE */
- var rect = new Rectangle(2, 3, 0, 0);
- Assert.IsTrue(rect.IsEmpty, "IsEmpty property should return true.");
- rect.Height = 4.0;
- rect.Width = 5.0;
- Assert.IsFalse(rect.IsEmpty, "IsEmpty property should return false.");
-
- }
-
- [Test]
- [Category("P1")]
- [Description("Check Location is readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.Rectangle.Location A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Location_READ_WRITE()
- {
- /* TEST CODE */
- var rect = new Rectangle(2, 3, 4, 5);
- Assert.AreEqual(2, rect.Left, "Rectangle Left property should be same.");
- Assert.AreEqual(3, rect.Top, "Rectangle Top property should be same.");
- Assert.AreEqual(new Point(2, 3), rect.Location, "Loaction property should be equal Left and Top.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check Size is readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.Rectangle.Size A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Size_READ_WRITE()
- {
- /* TEST CODE */
- var rect = new Rectangle();
- rect.Size = new Size(10, 20);
-
- Assert.AreEqual(new Rectangle(0, 0, 10, 20), rect, "Size property should be equal to given Size.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check Center is readable.")]
- [Property("SPEC", "Xamarin.Forms.Rectangle.Center A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PR0")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Center_READ_ONLY()
- {
- /* TEST CODE */
- var rect = new Rectangle(2, 3, 4, 5);
- Assert.AreEqual(2, rect.Left, "Left property should set as given in rect.");
- Assert.AreEqual(6, rect.Right, "Right property should set as given in rect.");
- Assert.AreEqual(3, rect.Top, "Top property should set as given in rect.");
- Assert.AreEqual(8, rect.Bottom, "Bottom property should set as given in rect.");
- Assert.AreEqual(new Point(4, 5.5), rect.Center, "Center property should equal half way between Left and Right as well Top and Bottom.");
- }
-
-
- [Test]
- [Category("P1")]
- [Description("Check return of Contains method with point.")]
- [Property("SPEC", "Xamarin.Forms.Rectangle.Contains M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Property("COVPARAM", "Xamarin.Forms.Point")]
- public void Contains_POINT_RETURN_CHECK()
- {
- /* TEST CODE */
- var rect = new Rectangle(0, 0, 10, 10);
- Assert.True(rect.Contains(new Point(5, 5)), "Given point is not within the rectanagle.");
- //Assert.True(rect.Contains(0, 0),"Given point is not within the rectanagle.");
- Assert.False(rect.Contains(new Point(10, 10)), "Given point is not within the rectanagle.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check return of Contains method with rectangle.")]
- [Property("SPEC", "Xamarin.Forms.Rectangle.Contains M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Property("COVPARAM", "Xamarin.Forms.Rectangle")]
- public void Contains_RECTANGLE_RETURN_CHECK()
- {
- /* TEST CODE */
- var rect = new Rectangle(0, 0, 10, 10);
- rect.Contains(new Rectangle(1, 1, 3, 3));
- Assert.True(rect.Contains(0, 0), "Contains method should return true as given point is within rectangle.");
- Assert.False(rect.Contains(10, 10), "Contains method should return false as given point is out side rectangle.");
-
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the Zero property is readable.")]
- [Property("SPEC", "Xamarin.Forms.Rectangle.Zero A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Zero_READ()
- {
- /* TEST CODE */
- Rectangle rect = Rectangle.Zero;
-
- Assert.AreEqual(rect.Width, (double)0.0, "Width should be 0.");
- Assert.AreEqual(rect.Height, (double)0.0, "Height should be 0.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Equality.")]
- [Property("SPEC", "Xamarin.Forms.Rectangle.== M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Equality_CHECK_RETURN()
- {
- /* TEST CODE */
- Assert.True(new Rectangle(new Point(2, 3), new Size(4, 5)) == new Rectangle(new Point(2, 3), new Size(4, 5)), "Two Rectangle's should be equal.");
- Assert.True(new Rectangle(2.00, 3.00, 4.00, 5.5) == new Rectangle(2.00, 3.00, 4.00, 5.5), "Two Rectangle's should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Inequality.")]
- [Property("SPEC", "Xamarin.Forms.Rectangle.!= M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Inequality_CHECK_RETURN()
- {
- /* TEST CODE */
- Assert.True(new Rectangle(new Point(2, 3), new Size(4, 5)) != new Rectangle(new Point(2, 5), new Size(4, 6)), "Two Rectangle's should not be equal.");
- Assert.True(new Rectangle(2.00, 3.00, 4.9, 5.5) != new Rectangle(2.00, 3.00, 4.00, 5.5), "Two Rectangle's should not be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check return of Contains method with double.")]
- [Property("SPEC", "Xamarin.Forms.Rectangle.Contains M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Property("COVPARAM", "Double, Double")]
- public void Contains_DOUBLE_RETURN_CHECK()
- {
- /* TEST CODE */
- var rect = new Rectangle(0, 0, 10, 10);
- Assert.True(rect.Contains(5, 5), "Contains method should return true as given point is within rectangle.");
- Assert.False(rect.Contains(15, 15), "Contains method should return false as given point is out side rectangle.");
-
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Equals.")]
- [Property("SPEC", "Xamarin.Forms.Rectangle.Equals M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Property("COVPARAM", "Xamarin.Forms.Rectangle")]
- public void Equals_CHECK_RETURN()
- {
- /* TEST CODE */
- Assert.True(new Rectangle(new Point(2, 3), new Size(4, 5)).Equals(new Rectangle(new Point(2, 3), new Size(4, 5))), "Should be equal.");
- Assert.True(new Rectangle(2.00, 3.00, 8.00, 9.00).Equals(new Rectangle(2.00, 3.00, 8.00, 9.00)), "Should be equal.");
- Assert.False(new Rectangle(0, 0, 10, 10).Equals("Rectangle"), "Should not be equal.");
- Assert.False(new Rectangle(0, 0, 10, 10).Equals(null), "Should not be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Equals.")]
- [Property("SPEC", "Xamarin.Forms.Rectangle.Equals M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Property("COVPARAM", "object")]
- public void Equals_CHECK_RETURN_OBJ()
- {
- /* TEST CODE */
- var obj = new Rectangle(new Point(2, 3), new Size(4, 5));
- Assert.True(new Rectangle(new Point(2, 3), new Size(4, 5)).Equals(obj), "Should be equal.");
- Assert.True(new Rectangle(2.00, 3.00, 8.00, 9.00).Equals(new Rectangle(2.00, 3.00, 8.00, 9.00)), "Should be equal.");
- Assert.False(new Rectangle(0, 0, 10, 10).Equals("Rectangle"), "Should not be equal.");
- Assert.False(new Rectangle(0, 0, 10, 10).Equals(null), "Should not be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Equals.")]
- [Property("SPEC", "Xamarin.Forms.Rectangle.FromLTRB M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void FromLTRB_CHECK_RETURN()
- {
- /* TEST CODE */
- var rect = Rectangle.FromLTRB(10, 10, 30, 40);
- Assert.IsInstanceOf<Rectangle>(rect, "Should return an instance of Rectangle.");
- Assert.AreEqual(new Rectangle(10, 10, 20, 30), rect, "Should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of GetHashCode.")]
- [Property("SPEC", "Xamarin.Forms.Rectangle.GetHashCode M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void GetHashCode_CHECK_RETURN()
- {
- /* TEST CODE */
- var result = new Rectangle(2.00, 3.00, 8.00, 9.00).GetHashCode();
- Assert.IsNotNull(result, "Should not be null.");
- Assert.IsInstanceOf<Int32>(result, "Should be instance of int32.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of ToString.")]
- [Property("SPEC", "Xamarin.Forms.Rectangle.ToString M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void ToString_CHECK_RETURN()
- {
- /* TEST CODE */
- var result = new Rectangle(2.00, 3.00, 8.00, 9.00).ToString();
- Assert.IsNotNull(result, "Should not be null.");
- Assert.IsInstanceOf<string>(result, "Should be instance of string.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Inflate.")]
- [Property("SPEC", "Xamarin.Forms.Rectangle.Inflate M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Property("COVPARAM", "Double, Double")]
- public void Inflate_DOUBLE_CHECK_RETURN()
- {
- /* TEST CODE */
- var rect = new Rectangle(0.00, 0.00, 10.00, 10.00);
- rect = rect.Inflate(5.00, 5.00);
-
- Assert.AreEqual(new Rectangle(-5.00, -5.00, 20.00, 20.00), rect, "Should be equal after inflate");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Inflate.")]
- [Property("SPEC", "Xamarin.Forms.Rectangle.Inflate M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Property("COVPARAM", "Xamarin.Forms.Size")]
- public void Inflate_SIZE_CHECK_RETURN()
- {
- /* TEST CODE */
- var rect = new Rectangle(-5, -5, 20, 20);
- rect = rect.Inflate(new Size(-5.00, -5.00));
- Assert.AreEqual(new Rectangle(0.00, 0.00, 10.00, 10.00), rect, "Should be equal after inflate");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Intersect.")]
- [Property("SPEC", "Xamarin.Forms.Rectangle.Intersect M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Property("COVPARAM", "Xamarin.Forms.Rectangle")]
- public void Intersect_CHECK_RETURN()
- {
- /* TEST CODE */
- var rect1 = new Rectangle(0.00, 0.00, 10.00, 10.00);
- var rect2 = new Rectangle(2.00, 2.00, 6.00, 6.00);
-
- var intersection = rect1.Intersect(rect2);
- Assert.AreEqual(rect2, intersection, "Should be equal after intersect.");
-
- rect2 = new Rectangle(2.00, 2.00, 12.00, 12.00);
- intersection = rect1.Intersect(rect2);
- Assert.AreEqual(new Rectangle(2.00, 2.00, 8.00, 8.00), intersection, "Should be equal after intersect.");
-
- rect2 = new Rectangle(20.00, 20.00, 2.00, 2.00);
- intersection = rect1.Intersect(rect2);
- Assert.AreEqual(Rectangle.Zero, intersection, "Should be equal after intersect.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Intersect.")]
- [Property("SPEC", "Xamarin.Forms.Rectangle.Intersect M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Property("COVPARAM", "Xamarin.Forms.Rectangle, Xamarin.Forms.Rectangle")]
- public void Intersect_STATIC_CHECK_RETURN()
- {
- /* TEST CODE */
- Assert.AreEqual(new Rectangle(2.00, 2.00, 6.00, 6.00), Rectangle.Intersect(new Rectangle(0.00, 0.00, 10.00, 10.00), new Rectangle(2.00, 2.00, 6.00, 6.00)));
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of IntersectsWith.")]
- [Property("SPEC", "Xamarin.Forms.Rectangle.IntersectsWith M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void IntersectsWith_CHECK_RETURN()
- {
- /* TEST CODE */
- Assert.IsTrue(new Rectangle(0.00, 0.00, 8.00, 8.00).IntersectsWith(new Rectangle(0.00, 0.00, 5.00, 5.00)));
- Assert.IsFalse(new Rectangle(0.00, 0.00, 5.00, 5.00).IntersectsWith(new Rectangle(5.00, 5.00, 5.00, 5.00)));
- Assert.IsFalse(new Rectangle(0.00, 0.00, 2.00, 2.00).IntersectsWith(new Rectangle(3.00, 0.00, 5.00, 5.00)));
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Offset.")]
- [Property("SPEC", "Xamarin.Forms.Rectangle.Offset M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Property("COVPARAM", "Xamarin.Forms.Point")]
- public void Offset_POINT_CHECK_RETURN()
- {
- /* TEST CODE */
- var rect = new Rectangle(10.00, 10.00, 10.00, 10.00);
- rect = rect.Offset(new Point(-10.00, -10.00));
-
- Assert.AreEqual(new Rectangle(0.00, 0.00, 10.00, 10.00), rect, "Should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Offset.")]
- [Property("SPEC", "Xamarin.Forms.Rectangle.Offset M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Property("COVPARAM", "Double, Double")]
- public void Offset_DOUBLE_CHECK_RETURN()
- {
- /* TEST CODE */
- var rect = new Rectangle(0.00, 0.00, 10.00, 10.00);
- rect = rect.Offset(10.00, 10.00);
-
- Assert.AreEqual(new Rectangle(10.00, 10.00, 10.00, 10.00), rect, "Should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Round.")]
- [Property("SPEC", "Xamarin.Forms.Rectangle.Round M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Round_CHECK_RETURN()
- {
- /* TEST CODE */
- var rect = new Rectangle(0.2, 0.3, 0.6, 0.7);
-
- Assert.AreEqual(new Rectangle(0, 0, 1, 1), rect.Round(), "Should be equal");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Union.")]
- [Property("SPEC", "Xamarin.Forms.Rectangle.Union M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Property("COVPARAM", "Xamarin.Forms.Rectangle")]
- public void Union_CHECK_RETURN()
- {
- /* TEST CODE */
- Assert.AreEqual(new Rectangle(0, 3, 13, 10), new Rectangle(3, 3, 10, 10).Union(new Rectangle(0, 5, 2, 2)));
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Union.")]
- [Property("SPEC", "Xamarin.Forms.Rectangle.Union M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Property("COVPARAM", "Xamarin.Forms.Rectangle, Xamarin.Forms.Rectangle")]
- public void Union_STATIC_CHECK_RETURN()
- {
- /* TEST CODE */
- Assert.AreEqual(new Rectangle(0, 3, 13, 10), Rectangle.Union(new Rectangle(3, 3, 10, 10), new Rectangle(0, 5, 2, 2)));
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-using NUnit.Framework.TUnit;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.RectangleTypeConverter test")]
- public class RectangleTypeConverterTests
- {
- [SetUp]
- public void Setup()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "RectangleTypeConverter CLASS: Setup---------------------------------");
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "RectangleTypeConverter CLASS: Teardown------------------------------");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a RectangleTypeConverter instance. Check whether object is successfully created or not.")]
- [Property("SPEC", "Xamarin.Forms.RectangleTypeConverter.RectangleTypeConverter C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void RectangleTypeConverter_INIT()
- {
- /* TEST CODE */
- var rectangleTypeConverter = new RectangleTypeConverter();
- Assert.IsNotNull(rectangleTypeConverter, "RectangleTypeConverter object is not created successfully.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ConvertFromInvariantString can converts a string to a Xamarin.Forms.Rectangle or not")]
- [Property("SPEC", "Xamarin.Forms.RectangleTypeConverter.ConvertFromInvariantString M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void ConvertFromInvariantString_OVERRIDE_METHOD()
- {
- /* TEST CODE */
- var rectangleTypeConverter = new RectangleTypeConverter();
- string invariantString = "10,20,30,40";
- var rectangle = (Rectangle)rectangleTypeConverter.ConvertFromInvariantString(invariantString);
- Assert.AreEqual(10, rectangle.X, "X value of rectangle after convert from invariant string is not correct");
- Assert.AreEqual(20, rectangle.Y, "Y value of rectangle after convert from invariant string is not correct");
- Assert.AreEqual(30, rectangle.Width, "Width value of rectangle after convert from invariant string is not correct");
- Assert.AreEqual(40, rectangle.Height, "Height value of rectangle after convert from invariant string is not correct");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-using NUnit.Framework.TUnit;
-using System.Linq.Expressions;
-using System.Threading.Tasks;
-using XamarinForTizen.Tizen;
-using XamarinForTizen;
-using AutoTemplate;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.RelativeLayout test")]
- public class RelativeLayoutTest : RelativeLayout
- {
- private static App _app = Program.getApp();
- private static RelativeLayout _relativeLayout;
- private static bool _flagOnAdded, _flagOnRemoved, _flagLayoutChildren, _flagOnSizeRequest;
-
- protected override void OnAdded(View view)
- {
- _flagOnAdded = true;
- base.OnAdded(view);
- }
-
- protected override void OnRemoved(View view)
- {
- _flagOnRemoved = true;
- base.OnRemoved(view);
- }
-
- protected override void LayoutChildren(double x, double y, double width, double height)
- {
- _flagLayoutChildren = true;
- base.LayoutChildren(x, y, width, height);
- }
-
- protected override SizeRequest OnSizeRequest(double widthConstraint, double heightConstraint)
- {
- _flagOnSizeRequest = true;
- return base.OnSizeRequest(widthConstraint, heightConstraint);
- }
-
- [SetUp]
- public void Setup()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "RelativeLayout CLASS: Setup---------------------------------");
- _relativeLayout = new RelativeLayout();
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "RelativeLayout CLASS: Teardown------------------------------");
- _relativeLayout = null;
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a RelativeLayout instance. Check whether object is successfully created or not.")]
- [Property("SPEC", "Xamarin.Forms.RelativeLayout.RelativeLayout C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void RelativeLayout_INIT()
- {
- /* TEST CODE */
- var relativeLayout = new RelativeLayout();
- Assert.IsNotNull(relativeLayout, "RelativeLayout object is not created successfully.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property BoundsConstraintProperty is readable or not.")]
- [Property("SPEC", "Xamarin.Forms.RelativeLayout.BoundsConstraintProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void BoundsConstraintProperty_GET()
- {
- /* TEST CODE */
- var getProperty = RelativeLayout.BoundsConstraintProperty;
- Assert.IsNotNull(getProperty, "BoundsConstraintProperty should not null");
- Assert.IsInstanceOf<BindableProperty>(getProperty, "BoundsConstraintProperty should be return a BindableProperty object");
- Assert.AreEqual("BoundsConstraint", getProperty.PropertyName, "PropertyName should be BoundsConstraint");
- Assert.AreEqual(getProperty.ReturnType, typeof(BoundsConstraint), "ReturnType of BoundsConstraintProperty should be BoundsConstraint");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property HeightConstraintProperty is readable or not.")]
- [Property("SPEC", "Xamarin.Forms.RelativeLayout.HeightConstraintProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void HeightConstraintProperty_GET()
- {
- /* TEST CODE */
- var getProperty = RelativeLayout.HeightConstraintProperty;
- Assert.IsNotNull(getProperty, "HeightConstraintProperty should not null");
- Assert.IsInstanceOf<BindableProperty>(getProperty, "HeightConstraintProperty should be return a BindableProperty object");
- Assert.AreEqual("HeightConstraint", getProperty.PropertyName, "PropertyName should be HeightConstraint");
- Assert.AreEqual(getProperty.ReturnType, typeof(Constraint), "ReturnType of HeightConstraintProperty should be Constraint");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property WidthConstraintProperty is readable or not.")]
- [Property("SPEC", "Xamarin.Forms.RelativeLayout.WidthConstraintProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void WidthConstraintProperty_GET()
- {
- /* TEST CODE */
- var getProperty = RelativeLayout.WidthConstraintProperty;
- Assert.IsNotNull(getProperty, "WidthConstraintProperty should not null");
- Assert.IsInstanceOf<BindableProperty>(getProperty, "WidthConstraintProperty should be return a BindableProperty object");
- Assert.AreEqual("WidthConstraint", getProperty.PropertyName, "PropertyName should be WidthConstraint");
- Assert.AreEqual(getProperty.ReturnType, typeof(Constraint), "ReturnType of WidthConstraintProperty should be Constraint");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property XConstraintProperty is readable or not.")]
- [Property("SPEC", "Xamarin.Forms.RelativeLayout.XConstraintProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void XConstraintProperty_GET()
- {
- /* TEST CODE */
- var getProperty = RelativeLayout.XConstraintProperty;
- Assert.IsNotNull(getProperty, "XConstraintProperty should not null");
- Assert.IsInstanceOf<BindableProperty>(getProperty, "XConstraintProperty should be return a BindableProperty object");
- Assert.AreEqual("XConstraint", getProperty.PropertyName, "PropertyName should be XConstraint");
- Assert.AreEqual(getProperty.ReturnType, typeof(Constraint), "ReturnType of XConstraintProperty should be Constraint");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property YConstraintProperty is readable or not.")]
- [Property("SPEC", "Xamarin.Forms.RelativeLayout.YConstraintProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void YConstraintProperty_GET()
- {
- /* TEST CODE */
- var getProperty = RelativeLayout.YConstraintProperty;
-
- Assert.IsNotNull(getProperty, "YConstraintProperty should not null");
- Assert.IsInstanceOf<BindableProperty>(getProperty, "YConstraintProperty should be return a BindableProperty object");
- Assert.AreEqual("YConstraint", getProperty.PropertyName, "PropertyName should be YConstraint");
- Assert.AreEqual(getProperty.ReturnType, typeof(Constraint), "ReturnType of YConstraintProperty should be Constraint");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Children is readable.")]
- [Property("SPEC", "Xamarin.Forms.RelativeLayout.Children A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void Children_GET()
- {
- var label1 = new Label()
- {
- Text = "label1 test",
- TextColor = new Color(0.1, 0, 0.2),
- FontSize = 10
- };
- var label2 = new Label()
- {
- Text = "label2 test",
- TextColor = new Color(0.1, 0.2, 0.3),
- FontSize = 10
- };
- _relativeLayout.Children.Add(label1, Constraint.Constant(0), Constraint.Constant(0), Constraint.Constant(100), Constraint.Constant(100));
- _relativeLayout.Children.Add(label2, Constraint.Constant(100), Constraint.Constant(0), Constraint.Constant(100), Constraint.Constant(100));
- var getChildren = _relativeLayout.Children;
- Assert.AreEqual(2, getChildren.Count, "Get Children is fail, _count should be 2 after adding 2 views into relativeLayout");
- Assert.IsTrue(getChildren.Contains(label1), "RelativeLayout should contains child view that added");
- Assert.IsTrue(getChildren.Contains(label2), "RelativeLayout should contains child view that added");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether on method works properly or not.")]
- [Property("SPEC", "Xamarin.Forms.RelativeLayout.On<T> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void On_METHOD()
- {
- var label1 = new Label()
- {
- Text = "label1 test",
- TextColor = new Color(0.1, 0, 0.2),
- FontSize = 10
- };
- var label2 = new Label()
- {
- Text = "label2 test",
- TextColor = new Color(0.1, 0.2, 0.3),
- FontSize = 10
- };
- _relativeLayout.Children.Add(label1, Constraint.Constant(0), Constraint.Constant(0), Constraint.Constant(100), Constraint.Constant(100));
- _relativeLayout.Children.Add(label2, Constraint.Constant(100), Constraint.Constant(0), Constraint.Constant(100), Constraint.Constant(100));
- var config = _relativeLayout.On<Xamarin.Forms.PlatformConfiguration.Tizen>();
- Assert.IsInstanceOf<IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Tizen, Xamarin.Forms.RelativeLayout>>(config, "config is not RelativeLayout");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OnAdded() is called after after a view is added to relative layout or not.")]
- [Property("SPEC", "Xamarin.Forms.RelativeLayout.OnAdded M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void OnAdded_CHECK()
- {
- /* TEST CODE */
- RelativeLayoutTest relativeLayout = new RelativeLayoutTest();
- var label1 = new Label { Text = "label1 test" };
- _flagOnAdded = false;
- relativeLayout.Children.Add(label1, Constraint.Constant(0), Constraint.Constant(0), Constraint.Constant(100), Constraint.Constant(100));
- Assert.IsTrue(_flagOnAdded, "_flagOnAdded should be true after a child view is added");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OnRemoved() is called after after a view is removed from relative layout or not.")]
- [Property("SPEC", "Xamarin.Forms.RelativeLayout.OnRemoved M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void OnRemoved_CHECK()
- {
- /* TEST CODE */
- RelativeLayoutTest relativeLayout = new RelativeLayoutTest();
- var label1 = new Label { Text = "label1 test" };
- _flagOnRemoved = false;
- relativeLayout.Children.Add(label1, Constraint.Constant(0), Constraint.Constant(0), Constraint.Constant(100), Constraint.Constant(100));
- relativeLayout.Children.Clear();
- Assert.IsTrue(_flagOnRemoved, "_flagOnAdded should be true after a child view is removed.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check GetBoundsConstraint() will return value equal to set value or not.")]
- [Property("SPEC", "Xamarin.Forms.RelativeLayout.GetBoundsConstraint M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void GetBoundsConstraint_RECTANGLE_VALUE()
- {
- /* TEST CODE */
- var labelTest = new Label { Text = "label test" };
- var mRectangle = new Rectangle(115, 159, 100, 100);
- Expression<Func<Rectangle>> mExpression = () => mRectangle;
- BoundsConstraint mBeforeBoundsConstraint = BoundsConstraint.FromExpression(mExpression, _relativeLayout.Children);
- RelativeLayout.SetBoundsConstraint(labelTest, mBeforeBoundsConstraint);
-
- var mAfterBoundsConstraint = RelativeLayout.GetBoundsConstraint(labelTest);
- Assert.IsNotNull(mAfterBoundsConstraint, "Getted boundsconstraint should be not null");
- Assert.IsInstanceOf<BoundsConstraint>(mAfterBoundsConstraint, "return object should be BoundsConstraint");
- Assert.IsTrue(BoundsConstraint.Equals(mBeforeBoundsConstraint, mAfterBoundsConstraint), "mAfterBoundsConstraint should equal to mBeforeBoundsConstraint.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether GetHeightConstraint() will return correct height value of BindableObject or not.")]
- [Property("SPEC", "Xamarin.Forms.RelativeLayout.GetHeightConstraint M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void GetHeightConstraint_CHECK_VALUE()
- {
- /* TEST CODE */
- RelativeLayoutTest mRelativeLayoutTest = new RelativeLayoutTest();
- var child = new WebView
- {
- IsPlatformEnabled = true
- };
- mRelativeLayoutTest.Children.Add(child,
- Constraint.Constant(30),
- Constraint.Constant(20),
- Constraint.RelativeToParent(parent => parent.Height / 2),
- Constraint.RelativeToParent(parent => parent.Height / 4));
- mRelativeLayoutTest.Layout(new Rectangle(0, 0, 100, 100));
- RelativeLayout.SetHeightConstraint(child, Constraint.RelativeToParent(parent => parent.Height / 2));
-
- Constraint mHeightContraint = RelativeLayout.GetHeightConstraint(child);
-
- Assert.IsNotNull(mHeightContraint, "HeightContraint should be not null");
- Assert.IsInstanceOf<Constraint>(mHeightContraint, "Returned object should be Constraint");
- Assert.AreEqual(new Rectangle(30, 20, 50, 50), child.Bounds, "Child bounds should return Height of 50");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether GetWidthConstraint() will return correct width value of BindableObject or not.")]
- [Property("SPEC", "Xamarin.Forms.RelativeLayout.GetWidthConstraint M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void GetWidthConstraint_CHECK_VALUE()
- {
- /* TEST CODE */
- RelativeLayoutTest mRelativeLayoutTest = new RelativeLayoutTest();
- var child = new WebView
- {
- IsPlatformEnabled = true
- };
- mRelativeLayoutTest.Children.Add(child,
- Constraint.Constant(30),
- Constraint.Constant(20),
- Constraint.RelativeToParent(parent => parent.Height / 2),
- Constraint.RelativeToParent(parent => parent.Height / 4));
- mRelativeLayoutTest.Layout(new Rectangle(0, 0, 100, 100));
- RelativeLayout.SetWidthConstraint(child, Constraint.RelativeToParent(parent => parent.Height / 2));
-
- var mWidthContraint = RelativeLayout.GetWidthConstraint(child);
-
- Assert.IsNotNull(mWidthContraint, "WidthContraint should be not null");
- Assert.IsInstanceOf<Constraint>(mWidthContraint, "Returned object should be Constraint");
- Assert.AreEqual(new Rectangle(30, 20, 50, 25), child.Bounds, "Child bounds should return Width of 50");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether GetXConstraint() will return correct X value of BindableObject or not.")]
- [Property("SPEC", "Xamarin.Forms.RelativeLayout.GetXConstraint M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void GetXConstraint_CHECK_VALUE()
- {
- /* TEST CODE */
- RelativeLayoutTest mRelativeLayoutTest = new RelativeLayoutTest();
- var child = new WebView
- {
- IsPlatformEnabled = true
- };
- mRelativeLayoutTest.Children.Add(child,
- Constraint.Constant(30),
- Constraint.Constant(20),
- Constraint.RelativeToParent(parent => parent.Height / 2),
- Constraint.RelativeToParent(parent => parent.Height / 4));
- mRelativeLayoutTest.Layout(new Rectangle(0, 0, 100, 100));
- RelativeLayout.SetXConstraint(child, Constraint.Constant(40));
-
- var mXContraint = RelativeLayout.GetXConstraint(child);
-
- Assert.IsNotNull(mXContraint, "XContraint should be not null");
- Assert.IsInstanceOf<Constraint>(mXContraint, "Returned object should be Constraint");
- Assert.AreEqual(new Rectangle(40, 20, 50, 25), child.Bounds, "Child bounds should return X of 40");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether GetYConstraint() will return correct Y value of BindableObject or not.")]
- [Property("SPEC", "Xamarin.Forms.RelativeLayout.GetYConstraint M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void GetYConstraint_CHECK_VALUE()
- {
- /* TEST CODE */
- RelativeLayoutTest mRelativeLayoutTest = new RelativeLayoutTest();
- var child = new WebView
- {
- IsPlatformEnabled = true
- };
- mRelativeLayoutTest.Children.Add(child,
- Constraint.Constant(30),
- Constraint.Constant(20),
- Constraint.RelativeToParent(parent => parent.Height / 2),
- Constraint.RelativeToParent(parent => parent.Height / 4));
- mRelativeLayoutTest.Layout(new Rectangle(0, 0, 100, 100));
- RelativeLayout.SetYConstraint(child, Constraint.Constant(40));
-
- var mYContraint = RelativeLayout.GetHeightConstraint(child);
-
- Assert.IsNotNull(mYContraint, "YContraint should be not null");
- Assert.IsInstanceOf<Constraint>(mYContraint, "Returned object should be Constraint");
- Assert.AreEqual(new Rectangle(30, 40, 50, 25), child.Bounds, "Child bounds should return Y of 40");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether SetBoundsConstraint() able to set bounds constraint to a BindableObject or not")]
- [Property("SPEC", "Xamarin.Forms.RelativeLayout.SetBoundsConstraint M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void SetBoundsConstraint_RECTANGLE_VALUE()
- {
- /* TEST CODE */
- var labelTest = new Label { Text = "label test" };
- var mRectangle = new Rectangle(0, 0, 100, 100);
- Expression<Func<Rectangle>> mExpression = () => mRectangle;
- BoundsConstraint mBeforeBoundsConstraint = BoundsConstraint.FromExpression(mExpression, _relativeLayout.Children);
-
- RelativeLayout.SetBoundsConstraint(labelTest, mBeforeBoundsConstraint);
- var mAfterBoundsConstraint = RelativeLayout.GetBoundsConstraint(labelTest);
- Assert.IsNotNull(mAfterBoundsConstraint, "Getted boundsconstraint should be not null");
- Assert.IsInstanceOf<BoundsConstraint>(mAfterBoundsConstraint, "return object should be BoundsConstraint");
- Assert.IsTrue(BoundsConstraint.Equals(mBeforeBoundsConstraint, mAfterBoundsConstraint), "mAfterBoundsConstraint should equal to mBeforeBoundsConstraint.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether LayoutChildren() is called when children is layout or not")]
- [Property("SPEC", "Xamarin.Forms.RelativeLayout.LayoutChildren M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public async Task LayoutChildren_CHECK()
- {
- /* TEST CODE */
- RelativeLayoutTest mRelativeLayoutTest = new RelativeLayoutTest();
- var labelTest = new Label { Text = "label test" };
- ContentPage mContentPage = new ContentPage { Content = mRelativeLayoutTest };
- await _app.MainPage.Navigation.PushAsync(mContentPage);
- await Task.Delay(500);
- //
- _flagLayoutChildren = false;
- mRelativeLayoutTest.Children.Add(labelTest, Constraint.Constant(100), Constraint.Constant(200), Constraint.Constant(300), Constraint.Constant(400));
- Assert.IsTrue(_flagLayoutChildren, "_flagLayoutChildren should be true after LayoutChildren() is called");
- /* Postcondition */
- await _app.MainPage.Navigation.PopToRootAsync();
- await Task.Delay(500);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OnSizeRequest() is called when relative layout is drawn or not")]
- [Property("SPEC", "Xamarin.Forms.RelativeLayout.OnSizeRequest M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public async Task OnSizeRequest_CHECK()
- {
- /* TEST CODE */
- RelativeLayoutTest mRelativeLayoutTest = new RelativeLayoutTest();
- var labelTest = new Label { Text = "label test" };
- mRelativeLayoutTest.Children.Add(labelTest, Constraint.Constant(100), Constraint.Constant(200), Constraint.Constant(300), Constraint.Constant(400));
- ContentPage mContentPage = new ContentPage { Content = mRelativeLayoutTest };
- await _app.MainPage.Navigation.PushAsync(mContentPage);
- await Task.Delay(500);
- //
- _flagOnSizeRequest = false;
- mRelativeLayoutTest.Measure(500, 500, MeasureFlags.IncludeMargins);
- Assert.IsTrue(_flagOnSizeRequest, "_flagOnSizeRequest should be true after OnSizeRequest() is called");
- /* Postcondition */
- await _app.MainPage.Navigation.PopAsync();
- await Task.Delay(500);
- }
- }
-}
+++ /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 Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class RenderWithAttributeTests
- {
- private RenderWithAttribute _renderWithAttribute;
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("RenderWithAttribute --------------- SetUp()");
- _renderWithAttribute = new RenderWithAttribute(typeof(Type));
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("RenderWithAttribute --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a RenderWithAttribute instance. Check whether object is successfully created or not")]
- [Property("SPEC", "Xamarin.Forms.RenderWithAttribute.RenderWithAttribute C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void RenderWithAttribute_INIT()
- {
- /* TEST CODE */
- var renderWithAttribute = new RenderWithAttribute(typeof(Type));
- Assert.IsNotNull(renderWithAttribute, "Creating a RenderWithAttribute object failed. It is set to null");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Type is readable correct or not")]
- [Property("SPEC", "Xamarin.Forms.RenderWithAttribute.Type A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void Type_PROPERTY_GET()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- Assert.IsNotNull(_renderWithAttribute, "Creating a RenderWithAttribute object failed. It is set to null");
-
- /* TEST CODE */
- var name = "Type";
- var nameSpace = "System";
- var fullName = "System.Type";
- var getType = _renderWithAttribute.Type;
- Assert.AreEqual(name, getType.Name, "Get value of Type.Name is not correct");
- Assert.AreEqual(nameSpace, getType.Namespace, "Get value of Type.Namespace is not correct");
- Assert.AreEqual(fullName, getType.FullName, "Get value of Type.FullName is not correct");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.ResolutionGroupNameAttribute Tests")]
- public class ResolutionGroupNameAttributeTests
- {
- [SetUp]
- public void Setup()
- {
- Console.WriteLine("ResolutionGroupNameAttributeTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("ResolutionGroupNameAttributeTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a ResolutionGroupNameAttribute object")]
- [Property("SPEC", "Xamarin.Forms.ResolutionGroupNameAttribute.ResolutionGroupNameAttribute C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void ResolutionGroupNameAttribute_INIT()
- {
- /* TEST CODE */
- ResolutionGroupNameAttribute resolutionGroupNameAttribute = new ResolutionGroupNameAttribute("Tizen");
- Assert.IsNotNull(resolutionGroupNameAttribute, "ResolutionGroupNameAttribute instance is null.");
- Assert.IsInstanceOf<ResolutionGroupNameAttribute>(resolutionGroupNameAttribute, "Not an instance of ResolutionGroupNameAttribute.");
- }
- }
-}
+++ /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 System.Collections;
-using System.Collections.Generic;
-
-namespace Xamarin.Forms.Core.UnitTestss
-{
- [TestFixture]
- public class ResourceDictionaryTests
- {
- private static ResourceDictionary resourceDictionary;
-
- [SetUp]
- public void Setup()
- {
- Console.WriteLine("ResourceDictionaryTests --------------- Setup()");
- resourceDictionary = new ResourceDictionary();
- }
-
- [TearDown]
- public void TearDown()
- {
- resourceDictionary = new ResourceDictionary();
- Console.WriteLine("ResourceDictionaryTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create an empty ResourceDictionary object")]
- [Property("SPEC", "Xamarin.Forms.ResourceDictionary.ResourceDictionary C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void ResourceDictionary_INIT()
- {
- /* TEST CODE */
- Assert.IsNotNull(resourceDictionary, "ResourceDictionary Instance is null");
- Assert.IsInstanceOf<ResourceDictionary>(resourceDictionary, "Should be an instance of ResourceDictionary type.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the number of entries in the ResourceDictionary")]
- [Property("SPEC", "Xamarin.Forms.ResourceDictionary.Count A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Count_READ_ONLY()
- {
- /* TEST CODE */
- var initialCount = resourceDictionary.Count;
- resourceDictionary.Add("foo", "bar");
- Assert.AreEqual(resourceDictionary.Count, initialCount + 1, "Count should be increased by one.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if retrieves the Object value associated with the key.")]
- [Property("SPEC", "Xamarin.Forms.ResourceDictionary.this[string] A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void this_READ_ONLY()
- {
- /* TEST CODE */
- Object returnValue = null;
- resourceDictionary.Add("foo", "bar");
- returnValue = resourceDictionary["foo"];
- Assert.AreEqual(returnValue, "bar", "Retrived values is not expexted one.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if retrieves the Object value associated with the non exist key.")]
- [Property("SPEC", "Xamarin.Forms.ResourceDictionary.Item[string] A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Item_READ_NON_EXIST_KEY()
- {
- /* TEST CODE */
- Object returnValue = null;
- resourceDictionary.Add("foo", "bar");
-
- try {
- returnValue = resourceDictionary["none"];
- }
- catch (Exception ex)
- {
- Assert.IsInstanceOf<KeyNotFoundException>(ex, "Should be throw KeyNotFoundException.");
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the collection of identifier strings that are keys in the ResourceDictionary")]
- [Property("SPEC", "Xamarin.Forms.ResourceDictionary.Keys A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Keys_READ_ONLY()
- {
- /* TEST CODE */
- resourceDictionary = new ResourceDictionary {
- new Style (typeof(Label)) {
- Setters = {
- new Setter { Property = Label.TextColorProperty, Value = Color.Pink },
- }
- },
- { "foo", "FOO" },
- {"labelStyle", new Style (typeof(Label)) {
- Setters = {
- new Setter { Property = Label.TextColorProperty, Value = Color.Purple }
- }
- }
- }
- };
- Assert.Contains("Xamarin.Forms.Label", (System.Collections.ICollection)resourceDictionary.Keys, "Not retuning expected type.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if retrieves the values of the ResourceDictionary.")]
- [Property("SPEC", "Xamarin.Forms.ResourceDictionary.Values A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Values_READ_ONLY()
- {
- /* TEST CODE */
- resourceDictionary = new ResourceDictionary {
- new Style (typeof(Label)) {
- Setters = {
- new Setter { Property = Label.TextColorProperty, Value = Color.Pink },
- }
- }
- };
-
- ICollection collection = (ICollection)resourceDictionary.Values;
-
- foreach (Style style in collection)
- {
- Assert.AreEqual(style.GetType().ToString(), "Xamarin.Forms.Style", "Not returning Style object.");
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if add an implicit Style to the ResourceDictionary.")]
- [Property("SPEC", "Xamarin.Forms.ResourceDictionary.Add M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Property("COVPARAM", "Xamarin.Forms.Style")]
- public void Add_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- var initialCount = resourceDictionary.Count;
- var style = new Style(typeof(VisualElement))
- {
- Setters = {
- new Setter { Property = Label.TextProperty, Value = "foo" },
- new Setter { Property = VisualElement.BackgroundColorProperty, Value = Color.Pink },
- }
- };
-
- Assert.AreEqual(resourceDictionary.Count, initialCount, "Count should be zero.");
- resourceDictionary.Add(style);
- Assert.AreEqual(resourceDictionary.Count, initialCount + 1, "Count should be increased by one.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if adds key and value to the ResourceDictionary as a key-value pair.")]
- [Property("SPEC", "Xamarin.Forms.ResourceDictionary.Add M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Property("COVPARAM", "string, object")]
- public void Add_CHECK_RETURN_VALUE_OBJECT()
- {
- /* TEST CODE */
- resourceDictionary.Add("foo", "bar");
- Assert.AreEqual("bar", resourceDictionary["foo"], "Add function is not returning expected value.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ResourceDictionary is cleared or not.")]
- [Property("SPEC", "Xamarin.Forms.ResourceDictionary.Clear M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Clear_CHECK()
- {
- /* TEST CODE */
- var initialCount = resourceDictionary.Count;
- resourceDictionary.Add("foo", "bar");
-
- Assert.AreEqual(resourceDictionary.Count, initialCount + 1, "Count should be increased by one.");
- resourceDictionary.Clear();
- Assert.AreEqual(resourceDictionary.Count, 0, "Count should be zero.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the ResourceDictionary contains a key-value pair identified by key.")]
- [Property("SPEC", "Xamarin.Forms.ResourceDictionary.ContainsKey M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void ContainsKey_CHECK()
- {
- /* TEST CODE */
- Assert.IsFalse(resourceDictionary.ContainsKey("foo"), "Expected false but returned true.");
-
- resourceDictionary = new ResourceDictionary {
- new Style (typeof(Label)) {
- Setters = {
- new Setter { Property = Label.TextColorProperty, Value = Color.Pink },
- }
- },
- { "foo", "FOO" },
- {"labelStyle", new Style (typeof(Label)) {
- Setters = {
- new Setter { Property = Label.TextColorProperty, Value = Color.Purple }
- }
- }
- }
- };
- Assert.IsTrue(resourceDictionary.ContainsKey("foo"), "Expected true but returned false.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if returns a IEnumerator of the ResourceDictionary's KeyValuePair`1s.")]
- [Property("SPEC", "Xamarin.Forms.ResourceDictionary.GetEnumerator M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void GetEnumerator_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- resourceDictionary.Add("foo", "bar");
- resourceDictionary.Add("fooNew", "barSecond");
-
- Assert.IsInstanceOf<IEnumerator>(resourceDictionary.GetEnumerator(), "Instance is not of type IEnumerator.");
- IEnumerator<KeyValuePair<string, object>> enumerator = resourceDictionary.GetEnumerator();
-
- enumerator.MoveNext();
- Assert.AreEqual(enumerator.Current.Value, "bar", "Not returning expected value(bar).");
- enumerator.MoveNext();
- Assert.AreEqual(enumerator.Current.Value, "barSecond", "Not returning expected value(barSecond).");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if removes the key and value identified by key from the ResourceDictionary.")]
- [Property("SPEC", "Xamarin.Forms.ResourceDictionary.Remove M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Remove_CHECK()
- {
- /* TEST CODE */
- var initialCount = resourceDictionary.Count;
- resourceDictionary.Add("foo", "bar");
- resourceDictionary.Add("fooNew", "barNew");
-
- Assert.AreEqual(resourceDictionary.Count, initialCount + 2, "Count should be increased by two.");
- resourceDictionary.Remove("foo");
- Assert.AreEqual(resourceDictionary.Count, initialCount + 1, "Count should be decreased by one.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if retrieves the object specified by key or, if not present, the default value of null.")]
- [Property("SPEC", "Xamarin.Forms.ResourceDictionary.TryGetValue M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void TryGetValue_CHECK()
- {
- /* TEST CODE */
- var initialCount = resourceDictionary.Count;
- resourceDictionary.Add("foo", "bar");
- resourceDictionary.Add("fooNew", "secondBar");
- Assert.AreEqual(resourceDictionary.Count, initialCount + 2, "Count should be increased by two.");
-
- object retValue = null;
- resourceDictionary.TryGetValue("fooNew", out retValue);
- Assert.AreEqual(retValue, "secondBar", "Returned value should be secondBar.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property MergedWith is readable and settable with valid values")]
- [Property("SPEC", "Xamarin.Forms.ResourceDictionary.MergedWith A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void MergedWith_PROPERTY_SET_GET()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- var resourceDic = new ResourceDictionary();
- Assert.IsNotNull(resourceDic, "Creating a ResourceDictionary object failed. It is set to null");
-
- /* TEST CODE */
- String []myType = new String[5];
- var type = Type.GetType("myType[]");
- resourceDic.MergedWith = type;
- var getType = resourceDic.MergedWith;
- Assert.AreEqual(type, getType, "Set and get value of MergedWith is not correct");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether MergedDictionaries works properly")]
- [Property("SPEC", "Xamarin.Forms.ResourceDictionary.MergedDictionaries A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void MergedDictionaries_SET_GET()
- {
- var rd = new ResourceDictionary();
- rd.MergedDictionaries.Add(new ResourceDictionary() { { "hello", "bar11" } });
- rd.MergedDictionaries.Add(new ResourceDictionary() { { "hello", "bar12" } });
- rd.MergedDictionaries.Add(new ResourceDictionary() { { "hello", "bar13" } });
-
- Assert.AreNotEqual(0, rd.MergedDictionaries.Count);
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System.Threading;
-using System.Threading.Tasks;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class RoutingEffectTests
- {
- static bool _flagOnAttached, _flagOnDetached;
- internal class subRoutingEffect : RoutingEffect
- {
- public subRoutingEffect(string effectId) : base(effectId)
- {
- }
- protected override void OnAttached()
- {
- base.OnAttached();
- _flagOnAttached = true;
- }
- protected override void OnDetached()
- {
- base.OnDetached();
- _flagOnDetached = true;
- }
- }
- [SetUp]
- public void Init()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Setup-------------------------");
- _flagOnAttached = false;
- }
-
- [TearDown]
- public void Destroy()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Teardown-------------------------");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a RoutingEffect object.")]
- [Property("SPEC", "Xamarin.Forms.RoutingEffect.RoutingEffect C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void RoutingEffect_INIT()
- {
- /* TEST CODE */
- var routingEffect = new subRoutingEffect("RoutingEffect");
- Assert.IsNotNull(routingEffect, "Instance Switch is null");
- Assert.IsInstanceOf<RoutingEffect>(routingEffect);
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check override method OnAttached is invoked when it is changed.")]
- [Property("SPEC", "Xamarin.Forms.RoutingEffect.OnAttached E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void OnAttached_OVERRIDE_METHOD()
- {
- /*PRE CONDITION
- * _flagOnAttached flag is initialize false value
- * Create a instance routingEffect
- */
- Assert.False(_flagOnAttached, "_flagOnAttached should false initial");
- var routingEffect = new subRoutingEffect("RoutingEffect");
- Assert.IsNotNull(routingEffect, "Instance WebView1 is null");
-
- /**TEST CODE**/
- var button = new Button { Text = "A Button" };
- button.Effects.Add(routingEffect);
- Thread.Sleep(300);
- Assert.True(_flagOnAttached, "_flagOnAttached overrided method not invoked.");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check override method OnDetached is invoked when it is changed.")]
- [Property("SPEC", "Xamarin.Forms.RoutingEffect.OnDetached E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void OnDetached_OVERRIDE_METHOD()
- {
- /*PRE CONDITION
- * _flagOnDetached flag is initialize false value
- * Create a instance routingEffect
- */
- Assert.False(_flagOnDetached, "_flagOnDetached should false initial");
- var routingEffect = new subRoutingEffect("RoutingEffect");
- Assert.IsNotNull(routingEffect, "Instance WebView1 is null");
-
- /**TEST CODE**/
- var button = new Button { Text = "A Button" };
- button.Effects.Add(routingEffect);
- Thread.Sleep(300);
- button.Effects.Remove(routingEffect);
- Thread.Sleep(300);
- Assert.True(_flagOnDetached, "OnOnDetached overrided method not invoked.");
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System.Collections.Generic;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.RowDefinition test")]
- public class RowDefinitionTest
- {
- private static RowDefinition _rowDefinition;
-
- [SetUp]
- public void Setup()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "RowDefinition: Setup---------------------------------");
- _rowDefinition = new RowDefinition();
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "RowDefinition: Teardown------------------------------");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a RowDefinition instance. Check whether object is successfully created or not.")]
- [Property("SPEC", "Xamarin.Forms.RowDefinition.RowDefinition C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Ngo Van Hai, hai.nv3@samsung.com")]
- public void RowDefinition_INIT()
- {
- /*TEST CODE*/
- RowDefinition rowDefinition = new RowDefinition();
- Assert.NotNull(rowDefinition, "rowDefinition should be not null after created");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property HeightProperty is readable")]
- [Property("SPEC", "Xamarin.Forms.RowDefinition.HeightProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Ngo Van Hai, hai.nv3@samsung.com")]
- public void HeightProperty_PROPERTY()
- {
- /*TEST CODE*/
- var getHeightProperty = RowDefinition.HeightProperty;
- Assert.IsInstanceOf<BindableProperty>(getHeightProperty, "HeightProperty should be return a BindableProperty object");
- Assert.IsFalse(getHeightProperty.IsReadOnly, "IsReadOnly should be return false");
- Assert.AreEqual("Height", getHeightProperty.PropertyName, "PropertyName should be return 'Height'");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Height is readable and settable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.RowDefinition.Height A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ngo Van Hai, hai.nv3@samsung.com")]
- public void Height_PROPERTY()
- {
- /*TEST CODE*/
- var gridLength = new GridLength(100.1);
- _rowDefinition.Height = gridLength;
- Assert.AreEqual(gridLength, _rowDefinition.Height, " Set, Get property Height is fail");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether SizeChanged events can be invoked or not when date of the Size object is changed.")]
- [Property("SPEC", "Xamarin.Forms.RowDefinition.SizeChanged E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Ngo Van Hai, hai.nv3@samsung.com")]
- public void SizeChanged_CHECK_EVENT()
- {
- /*PRECONDITION*/
- var gridLength = new GridLength(10.1);
- var flagSizeChanged = false;
- /*TEST CODE*/
- _rowDefinition.SizeChanged += (s, e) =>
- {
- flagSizeChanged = true;
- };
- _rowDefinition.Height = gridLength;
- Assert.IsTrue(flagSizeChanged, "SizeChanged events should be invoked.");
- }
-
-
- }
-}
+++ /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 Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class RowDefinitionCollectionTests
- {
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("RowDefinitionCollection --------------- SetUp()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("RowDefinitionCollection --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a RowDefinitionCollection instance. Check whether object is successfully created or not")]
- [Property("SPEC", "Xamarin.Forms.RowDefinitionCollection.RowDefinitionCollection C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void RowDefinitionCollection_INIT()
- {
- /* TEST CODE */
- var rowDefinitionCollection = new RowDefinitionCollection();
- Assert.IsNotNull(rowDefinitionCollection, "Creating a RowDefinitionCollection object failed. It is set to null");
- Assert.IsInstanceOf<RowDefinitionCollection>(rowDefinitionCollection);
- }
- }
-}
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns="http://tizen.org/ns/packages" api-version="6" package="Tizen.XamarinForms4.Tests" version="1.0.0">
- <profile name="common" />
- <ui-application appid="Tizen.XamarinForms4.Tests"
- exec="Tizen.XamarinForms4.Tests.dll"
- type="dotnet"
- multiple="false"
- taskmanage="true"
- launch_mode="single">
- <icon>Tizen.XamarinForms4.Tests.png</icon>
- <label>Tizen.XamarinForms4.Tests</label>
- </ui-application>
- <privileges>
- <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
- </privileges>
-</manifest>
+++ /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.Platform.Tizen.Forms.Init(app);
- app.Run(args);
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-<Project Sdk="Microsoft.NET.Sdk">
-
- <!-- Property Group for .NET Core Project -->
- <PropertyGroup>
- <OutputType>Exe</OutputType>
- <TargetFramework>tizen60</TargetFramework>
- </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>
- <PackageReference Include="Tizen.NET.Sdk" Version="$(TizenNETSdkVersion)" />
- </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.XamarinForms5.Tests", "Tizen.XamarinForms5.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 System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Xamarin.Forms;
-using Xamarin.Forms.Platform.Tizen;
-using XamarinForTizen.Tizen.common;
-
-[assembly: ResolutionGroupName("Samsung")]
-[assembly: ExportEffect(typeof(MockEffect), "MockEffect")]
-namespace XamarinForTizen.Tizen.common
-{
- class MockEffect : PlatformEffect
- {
-
- protected override void OnAttached()
- {
- Container.Color = ElmSharp.Color.Red;
- }
-
- protected override void OnDetached()
- {
-
- }
- }
-}
\ 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 Xamarin.Forms;
-using NUnit.Framework;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.ScrollToRequestedEventArgs Tests")]
- public class ScrollToRequestedEventArgsTests
- {
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("TSScrollToRequestedEventArgs --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("TSScrollToRequestedEventArgs --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Element property Read Only or not")]
- [Property("SPEC", "Xamarin.Forms.ScrollToRequestedEventArgs.Element A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Element_READ_ONLY()
- {
- /*TEST CODE*/
- var scrollView = new ScrollView();
- var label = new Label { Text = "Test" };
- scrollView.Content = new StackLayout { Children = { label } };
- bool requested = false;
-
- ((IScrollViewController)scrollView).ScrollToRequested += (sender, args) =>
- {
- requested = true;
- Assert.AreEqual(args.Element, label, "Expected and returned element are not equal.");
- };
-
- scrollView.ScrollToAsync(label, ScrollToPosition.Center, true);
- Assert.IsTrue(requested, "Expected true but returned false.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Mode property Read Only or not")]
- [Property("SPEC", "Xamarin.Forms.ScrollToRequestedEventArgs.Mode A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Mode_READ_ONLY()
- {
- /*TEST CODE*/
- var scrollView = new ScrollView();
- var label = new Label { Text = "Test" };
- scrollView.Content = new StackLayout { Children = { label } };
- bool requested = false;
-
- ((IScrollViewController)scrollView).ScrollToRequested += (sender, args) =>
- {
- requested = true;
- Assert.AreEqual(args.Mode, ScrollToMode.Position, "Not returning expected Scrolling Mode.");
- };
- scrollView.ScrollToAsync(5.0, 5.0, true);
- Assert.IsTrue(requested, "Expected true but returned false.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Position property Read Only or not")]
- [Property("SPEC", "Xamarin.Forms.ScrollToRequestedEventArgs.Position A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Position_READ_ONLY()
- {
- /*TEST CODE*/
- var scrollView = new ScrollView();
- var label = new Label { Text = "Test" };
- scrollView.Content = new StackLayout { Children = { label } };
- bool requested = false;
-
- ((IScrollViewController)scrollView).ScrollToRequested += (sender, args) =>
- {
- requested = true;
- Assert.AreEqual(args.Position, ScrollToPosition.Center, "Not returning expected Scrolled Position.");
- };
-
- scrollView.ScrollToAsync(label, ScrollToPosition.Center, true);
- Assert.IsTrue(requested, "Expected true but returned false.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ScrollX property Read Only or not")]
- [Property("SPEC", "Xamarin.Forms.ScrollToRequestedEventArgs.ScrollX A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void ScrollX_READ_ONLY()
- {
- /*TEST CODE*/
- var scrollView = new ScrollView();
- var label = new Label { Text = "Test" };
- scrollView.Content = new StackLayout { Children = { label } };
- bool requested = false;
-
- ((IScrollViewController)scrollView).ScrollToRequested += (sender, args) =>
- {
- requested = true;
- Assert.AreEqual(args.ScrollX, 5.0, "Not returning expected ScrollX value.");
- };
- scrollView.ScrollToAsync(5.0, 7.0, true);
- Assert.IsTrue(requested, "Expected true but returned false.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ScrollY property Read Only or not")]
- [Property("SPEC", "Xamarin.Forms.ScrollToRequestedEventArgs.ScrollY A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void ScrollY_READ_ONLY()
- {
- /*TEST CODE*/
- var scrollView = new ScrollView();
- var label = new Label { Text = "Test" };
- scrollView.Content = new StackLayout { Children = { label } };
- bool requested = false;
-
- ((IScrollViewController)scrollView).ScrollToRequested += (sender, args) =>
- {
- requested = true;
- Assert.AreEqual(args.ScrollY, 7.0, "Not returning expected ScrollY value.");
- };
- scrollView.ScrollToAsync(5.0, 7.0, true);
- Assert.IsTrue(requested, "Expected true but returned false.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ShouldAnimate property Read Only or not")]
- [Property("SPEC", "Xamarin.Forms.ScrollToRequestedEventArgs.ShouldAnimate A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void ShouldAnimate_READ_ONLY()
- {
- /*TEST CODE*/
- var scrollView = new ScrollView();
- var label = new Label { Text = "Test" };
- scrollView.Content = new StackLayout { Children = { label } };
- bool requested = false;
-
- ((IScrollViewController)scrollView).ScrollToRequested += (sender, args) =>
- {
- requested = true;
- Assert.AreEqual(args.ShouldAnimate, true, "Expected true but returned false.");
- };
- scrollView.ScrollToAsync(5.0, 7.0, true);
- Assert.IsTrue(requested, "Expected true but returned false.");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-using System.Threading.Tasks;
-using XamarinForTizen.Tizen;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- public class CustomScrollView : ScrollView
- {
- public Boolean isOnSizeRequest = false, flagLayoutChildren;
- protected override SizeRequest OnSizeRequest(double widthConstraint, double heightConstraint)
- {
- isOnSizeRequest = true;
- return base.OnSizeRequest(widthConstraint, heightConstraint);
- }
- protected override void LayoutChildren(double x, double y, double width, double height)
- {
- flagLayoutChildren = true;
- base.LayoutChildren(x, y, width, height);
- }
- }
-
- [TestFixture]
- public class ScrollViewTests
- {
- private ScrollView _scrollView;
- private Boolean isScrolled;
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("ScrollViewTests --------------- Setup()");
- _scrollView = new ScrollView();
- }
-
- [TearDown]
- public void TearDown()
- {
- _scrollView = null;
- Console.WriteLine("ScrollViewTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a ScrollView instance.")]
- [Property("SPEC", "Xamarin.Forms.ScrollView.ScrollView C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void ScrollView_INIT()
- {
- /*TEST CODE*/
- var scrollView = new ScrollView();
- Assert.IsNotNull(scrollView, "ScrollView should be not NULL");
- Assert.IsInstanceOf<ScrollView>(scrollView);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property Content is readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.ScrollView.Content A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Content_READ_WRITE()
- {
- /*TEST CODE*/
- var label = new Label()
- {
- Text = " Test Label",
- TextColor = new Color(255, 0, 255),
- FontSize = 10
- };
- _scrollView.Content = label;
- var getContent = (Label)_scrollView.Content;
- Assert.AreEqual(label.Text.ToString(), getContent.Text.ToString(), "Can't get and set content of ScrollView successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property ContentSize is readable.")]
- [Property("SPEC", "Xamarin.Forms.ScrollView.ContentSize A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void ContentSize_READ_ONLY()
- {
- /*TEST CODE*/
- var getProperty = _scrollView.ContentSize;
- Assert.IsNotNull(getProperty, "getProperty should be not NULL");
- Assert.IsInstanceOf<Size>(getProperty, "getProperty should be an instance of Size type.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property Orientation is readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.ScrollView.Orientation A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Orientation_READ_WRITE()
- {
- /*TEST CODE*/
- var hor = ScrollOrientation.Horizontal;
- var ver = ScrollOrientation.Vertical;
- var both = ScrollOrientation.Both;
-
- _scrollView.Orientation = hor;
- Assert.IsInstanceOf<ScrollOrientation>(_scrollView.Orientation);
- Assert.AreEqual((int)hor, (int)_scrollView.Orientation, "Can't get and set the Horizontal scrolling direction of ScrollView");
- _scrollView.Orientation = ver;
- Assert.IsInstanceOf<ScrollOrientation>(_scrollView.Orientation);
- Assert.AreEqual((int)ver, (int)_scrollView.Orientation, "Can't get and set the Vertical scrolling direction of ScrollView");
- _scrollView.Orientation = both;
- Assert.IsInstanceOf<ScrollOrientation>(_scrollView.Orientation);
- Assert.AreEqual((int)both, (int)_scrollView.Orientation, "Can't get and set both scrolling direction of ScrollView");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property ScrollX is readable.")]
- [Property("SPEC", "Xamarin.Forms.ScrollView.ScrollX A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void ScrollX_READ_ONLY()
- {
- /*TEST CODE*/
- var curXPosition = _scrollView.ScrollX;
- Assert.IsInstanceOf<double>(curXPosition, "Don't return double style");
- Assert.AreEqual(_scrollView.X, (double)curXPosition, "ScrollX is fail");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property ScrollX is readable.")]
- [Property("SPEC", "Xamarin.Forms.ScrollView.ScrollY A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void ScrollY_READ_ONLY()
- {
- /*TEST CODE*/
- var curYPosition = _scrollView.ScrollY;
- Assert.IsInstanceOf<double>(curYPosition, "Don't return double style");
- Assert.AreEqual(_scrollView.Y, (double)curYPosition, "ScrollY is fail");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of OrientationProperty's bound or not")]
- [Property("SPEC", "Xamarin.Forms.ScrollView.OrientationProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void OrientationProperty_CHECK_BINDABLE()
- {
- /*TEST CODE*/
- var mFirstori = ScrollOrientation.Horizontal;
- var mSecondor = ScrollOrientation.Vertical;
-
- _scrollView.SetValue(ScrollView.OrientationProperty, mFirstori);
-
- ScrollView mScroll = new ScrollView();
- mScroll.SetValue(ScrollView.OrientationProperty, mSecondor);
-
- Assert.AreNotEqual(mScroll.Orientation, _scrollView.Orientation, "OrientationProperty of mScroll value must be different form OrientationProperty of _sScrollView value");
- _scrollView.BindingContext = mScroll;
- _scrollView.SetBinding(ScrollView.OrientationProperty, "Orientation");
- Assert.AreEqual(mScroll.Orientation, _scrollView.Orientation, "OrientationProperty of mScroll value & OrientationProperty of _sScrollView value should be same");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ContentSizeProperty is readable.")]
- [Property("SPEC", "Xamarin.Forms.ScrollView.ContentSizeProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void ContentSizeProperty_READ_ONLY()
- {
- /*TEST CODE*/
- var getProperty = ScrollView.ContentSizeProperty;
- Assert.IsInstanceOf<BindableProperty>(getProperty, "ContentSize shoulde be return object BindableProperty");
- Assert.AreEqual("ContentSize", getProperty.PropertyName, "PropertyName should be ContentSize");
- Assert.IsTrue(getProperty.IsReadOnly, "ContentSize property should be ReadOnly");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ScrollXProperty is readable.")]
- [Property("SPEC", "Xamarin.Forms.ScrollView.ScrollXProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void ScrollXProperty_READ_ONLY()
- {
- /*TEST CODE*/
- var getProperty = ScrollView.ScrollXProperty;
- Assert.IsInstanceOf<BindableProperty>(getProperty, "ScrollXProperty shoulde return object BindableProperty");
- Assert.AreEqual("ScrollX", getProperty.PropertyName, "PropertyName should be ScrollX");
- Assert.IsTrue(getProperty.IsReadOnly, "ScrollXProperty should be ReadOnly");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ScrollYProperty is readable.")]
- [Property("SPEC", "Xamarin.Forms.ScrollView.ScrollYProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void ScrollYProperty_READ_ONLY()
- {
- /*TEST CODE*/
- var getProperty = ScrollView.ScrollYProperty;
- Assert.IsInstanceOf<BindableProperty>(getProperty, "ScrollYProperty shoulde return object BindableProperty");
- Assert.AreEqual("ScrollY", getProperty.PropertyName, "PropertyName should be ScrollX");
- Assert.IsTrue(getProperty.IsReadOnly, "ScrollYProperty should be ReadOnly");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Scrolled Event is raised when a scroll completes.")]
- [Property("SPEC", "Xamarin.Forms.ScrollView.Scrolled E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Scrolled_EVENT()
- {
- /* TEST CODE */
- isScrolled = false;
- _scrollView.Scrolled += (sender, args) =>
- {
- isScrolled = true;
- };
-
- IScrollViewController controller = _scrollView;
- controller.SetScrolledPosition(3.5, 4.5);
-
- Assert.IsTrue(isScrolled, "Event value changed should be handled.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ScrollToAsync is invoked or not.")]
- [Property("SPEC", "Xamarin.Forms.ScrollView.ScrollToAsync M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Property("COVPARAM", "Double, Double, bool")]
- public void ScrollToAsync_CHECK_STATUS()
- {
- /*TEST CODE*/
- var item = new Label();
- _scrollView.Content = new StackLayout { Children = { item } };
-
- bool requested = false;
- ((IScrollViewController)_scrollView).ScrollToRequested += (sender, args) => {
- requested = true;
- Assert.AreEqual(args.ScrollY, 100, "ScrollY should be 100");
- Assert.AreEqual(args.ScrollX, 0, "ScrollX should be 0");
- };
-
- _scrollView.ScrollToAsync(0, 100, true);
- Assert.IsTrue(requested, "ScrollToAsync should work.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ScrollToAsync is invoked or not.")]
- [Property("SPEC", "Xamarin.Forms.ScrollView.ScrollToAsync M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Property("COVPARAM", "Element, ScrollToPosition, bool")]
- public void ScrollToAsync_CHECK_STATUS_ELEMENT()
- {
- /*TEST CODE*/
- var item = new Label();
- item.Text = "Tizen";
- _scrollView.Content = new StackLayout { Children = { item } };
-
- bool requested = false;
- ((IScrollViewController)_scrollView).ScrollToRequested += (sender, args) => {
- requested = true;
- Assert.AreEqual(args.Element, item, "Not returning expected element.");
- Assert.AreEqual(args.Position, ScrollToPosition.Center, "Not returning expected ScrollToPosition.");
- };
-
- _scrollView.ScrollToAsync(item, ScrollToPosition.Center, true);
- Assert.IsTrue(requested, "ScrollToAsync should work.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OnSizeRequest is invoked or not.")]
- [Property("SPEC", "Xamarin.Forms.ScrollView.OnSizeRequest M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void OnSizeRequest_INVOKED_CHECK()
- {
- /*TEST CODE*/
- CustomScrollView customScrollListView = new CustomScrollView();
- customScrollListView.GetSizeRequest(double.PositiveInfinity, double.PositiveInfinity);
- Assert.IsTrue(customScrollListView.isOnSizeRequest, "OnSizeRequest method didn't invoke.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check return ScrollView configuration")]
- [Property("SPEC", "Xamarin.Forms.ScrollView.On<T> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void On_CONFIGURATION_METHOD()
- {
- /*TEST CODE*/
- _scrollView.Orientation = ScrollOrientation.Horizontal;
- var myConfig = _scrollView.On<IConfigPlatform>();
- Assert.IsInstanceOf<IPlatformElementConfiguration<IConfigPlatform, ScrollView>>(myConfig, "myConfig should be a instance of IPlatformElementConfiguration");
- Assert.IsInstanceOf<ScrollView>(myConfig.Element, "myConfig.Element should be a instance of ScrollView");
- Assert.AreEqual(_scrollView.Orientation, myConfig.Element.Orientation, "Orientation of myConfig.Element value & Orientation of _sScrollView should be equal");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether LayoutChildren is invoked or not.")]
- [Property("SPEC", "Xamarin.Forms.ScrollView.LayoutChildren M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public async Task LayoutChildren_INVOKED_CHECK()
- {
- /*TEST CODE*/
- var layout = new StackLayout();
- for (var i = 0; i < 100; i++)
- layout.Children.Add(new Button { Text = "Foo" });
- var customScrollView = new CustomScrollView()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- Orientation = ScrollOrientation.Vertical,
- HeightRequest=100,
- };
- var stackLayout = new StackLayout()
- {
- IsVisible = true,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- };
- ContentPage mContentPage = new ContentPage
- {
- Content = stackLayout
- };
- await Program.getApp().MainPage.Navigation.PushAsync(mContentPage);
- await Task.Delay(500);
- customScrollView.flagLayoutChildren = false;
- Assert.IsFalse(customScrollView.flagLayoutChildren, "The first Flag LayoutChildren should be False");
- customScrollView.Content = layout;
- customScrollView.HeightRequest = 300;
- stackLayout.Children.Add(customScrollView);
- Assert.IsTrue(customScrollView.flagLayoutChildren, "flagLayoutChildren should be True after LayoutChildren() is called");
- /* Postcondition */
- await Program.getApp().MainPage.Navigation.PopToRootAsync();
- await Task.Delay(500);
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class ScrolledEventArgsTests
- {
- public const double X = 0.5, Y = 0.6;
- private ScrolledEventArgs _scrolledEventArgs;
- [SetUp]
- public void Init()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Setup-------------------------");
- _scrolledEventArgs = new ScrolledEventArgs(X, Y);
- }
-
- [TearDown]
- public void Destroy()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Teardown-------------------------");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a ScrolledEventArgs object with two value is double")]
- [Property("SPEC", "Xamarin.Forms.ScrolledEventArgs.ScrolledEventArgs C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void ScrolledEventArgs_INIT()
- {
- /* TEST CODE */
- var scrolledEventArgs = new ScrolledEventArgs(X, Y);
- Assert.IsNotNull(scrolledEventArgs, "Instance Switch is null");
- Assert.IsInstanceOf<ScrolledEventArgs>(scrolledEventArgs);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property ScrollX.")]
- [Property("SPEC", "Xamarin.Forms.ScrolledEventArgs.ScrollX A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void ScrollX_READONLY()
- {
- /* TEST CODE */
- Assert.AreEqual(Math.Round(X,3), Math.Round(_scrolledEventArgs.ScrollX,3), "Property ScrollX should same that value used to initialize.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check property ScrollY.")]
- [Property("SPEC", "Xamarin.Forms.ScrolledEventArgs.ScrollY A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void ScrollY_READONLY()
- {
- /* TEST CODE */
- Assert.AreEqual(Math.Round(Y,3), Math.Round(_scrolledEventArgs.ScrollY,3), "Property ScrollY should same that value used to initialize.");
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System.Windows.Input;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.SearchBar test")]
- public class SearchBarTests
- {
- private static SearchBar _searchBar;
- private static bool _flagTextChanged;
-
- [SetUp]
- public void Setup()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Page CLASS: Setup---------------------------------");
- _searchBar = new SearchBar();
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Page CLASS: Teardown------------------------------");
- }
-
- public class SubICommand : ICommand
- {
- public event EventHandler CanExecuteChanged;
-
- public void Execute(object parameter)
- {
- }
-
- public bool CanExecute(object parameter)
- {
- return true;
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a SearchBar instance. Check whether object is successfully created or not.")]
- [Property("SPEC", "Xamarin.Forms.SearchBar.SearchBar C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void SearchBar_INIT()
- {
- /* TEST CODE */
- var searchBar = new SearchBar();
- Assert.IsNotNull(searchBar, "SearchBar object should be Not Null after initializing");
- Assert.IsInstanceOf<SearchBar>(searchBar);
- }
-
- [Test]
- [Category("P1")]
- [Description("Test CancelButtonColorProperty of SearchBar class")]
- [Property("SPEC", "Xamarin.Forms.SearchBar.CancelButtonColorProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void CancelButtonColorProperty_GET()
- {
- /* PRECONDITION
- * 1. Initiate two SearchBar.
- * 2. Set CancelButtonColor for two SearchBar is different.
- */
- SearchBar searchBar1 = new SearchBar();
- searchBar1.CancelButtonColor = Color.Black;
- SearchBar searchBar2 = new SearchBar();
- searchBar2.CancelButtonColor = Color.Blue;
- Assert.AreNotEqual(searchBar1.CancelButtonColor, searchBar2.CancelButtonColor, "CancelButtonColor of two SearchBar should be different before set binding.");
- /*TEST CODE*/
- searchBar1.BindingContext = searchBar2;
- searchBar1.SetBinding(SearchBar.CancelButtonColorProperty, "CancelButtonColor");
- Assert.AreEqual(searchBar1.CancelButtonColor, searchBar2.CancelButtonColor, "CancelButtonColor of two SearchBar should be same after set binding.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Test FontAttributesProperty of SearchBar class")]
- [Property("SPEC", "Xamarin.Forms.SearchBar.FontAttributesProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void FontAttributesProperty_GET()
- {
- /* PRECONDITION
- * 1. Initiate two SearchBar.
- * 2. Set FontAttributes for two SearchBar is different.
- */
- SearchBar searchBar1 = new SearchBar();
- searchBar1.FontAttributes = FontAttributes.Bold;
- SearchBar searchBar2 = new SearchBar();
- searchBar2.FontAttributes = FontAttributes.Italic;
- Assert.AreNotEqual(searchBar1.FontAttributes, searchBar2.FontAttributes, "FontAttributes of two SearchBar should be different before set binding.");
- /*TEST CODE*/
- searchBar1.BindingContext = searchBar2;
- searchBar1.SetBinding(SearchBar.FontAttributesProperty, "FontAttributes");
- Assert.AreEqual(searchBar1.FontAttributes, searchBar2.FontAttributes, "FontAttributes of two SearchBar should be same after set binding.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Test FontFamilyProperty of SearchBar class")]
- [Property("SPEC", "Xamarin.Forms.SearchBar.FontFamilyProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void FontFamilyProperty_GET()
- {
- /* PRECONDITION
- * 1. Initiate two SearchBar.
- * 2. Set FontFamily for two SearchBar is different.
- */
- SearchBar searchBar1 = new SearchBar();
- searchBar1.FontFamily = "Time New Roman";
- SearchBar searchBar2 = new SearchBar();
- searchBar2.FontFamily = "Arial";
- Assert.AreNotEqual(searchBar1.FontFamily, searchBar2.FontFamily, "FontFamily of two SearchBar should be different before set binding.");
- /*TEST CODE*/
- searchBar1.BindingContext = searchBar2;
- searchBar1.SetBinding(SearchBar.FontFamilyProperty, "FontFamily");
- Assert.AreEqual(searchBar1.FontFamily, searchBar2.FontFamily, "FontFamily of two SearchBar should be same after set binding.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Test FontSizeProperty of SearchBar class")]
- [Property("SPEC", "Xamarin.Forms.SearchBar.FontSizeProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void FontSizeProperty_GET()
- {
- /* PRECONDITION
- * 1. Initiate two SearchBar.
- * 2. Set FontSize for two SearchBar is different.
- */
- SearchBar searchBar1 = new SearchBar();
- searchBar1.FontSize = 13.5;
- SearchBar searchBar2 = new SearchBar();
- searchBar2.FontSize = 14;
- Assert.AreNotEqual(searchBar1.FontSize, searchBar2.FontSize, "FontSize of two SearchBar should be different before set binding.");
- /*TEST CODE*/
- searchBar1.BindingContext = searchBar2;
- searchBar1.SetBinding(SearchBar.FontSizeProperty, "FontSize");
- Assert.AreEqual(searchBar1.FontSize, searchBar2.FontSize, "FontSize of two SearchBar should be same after set binding.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Test HorizontalTextAlignmentProperty of SearchBar class")]
- [Property("SPEC", "Xamarin.Forms.SearchBar.HorizontalTextAlignmentProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void HorizontalTextAlignmentProperty_GET()
- {
- /* PRECONDITION
- * 1. Initiate two SearchBar.
- * 2. Set HorizontalTextAlignment for two SearchBar is different.
- */
- SearchBar searchBar1 = new SearchBar();
- searchBar1.HorizontalTextAlignment = TextAlignment.Start;
- SearchBar searchBar2 = new SearchBar();
- searchBar2.HorizontalTextAlignment = TextAlignment.End;
- Assert.AreNotEqual(searchBar1.HorizontalTextAlignment, searchBar2.HorizontalTextAlignment, "HorizontalTextAlignment of two SearchBar should be different before set binding.");
- /*TEST CODE*/
- searchBar1.BindingContext = searchBar2;
- searchBar1.SetBinding(SearchBar.HorizontalTextAlignmentProperty, "HorizontalTextAlignment");
- Assert.AreEqual(searchBar1.HorizontalTextAlignment, searchBar2.HorizontalTextAlignment, "HorizontalTextAlignment of two SearchBar should be same after set binding.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Test PlaceholderColorProperty of SearchBar class")]
- [Property("SPEC", "Xamarin.Forms.SearchBar.PlaceholderColorProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void PlaceholderColorProperty_GET()
- {
- /* PRECONDITION
- * 1. Initiate two SearchBar.
- * 2. Set PlaceholderColor for two SearchBar is different.
- */
- SearchBar searchBar1 = new SearchBar();
- searchBar1.PlaceholderColor = Color.Black;
- SearchBar searchBar2 = new SearchBar();
- searchBar2.PlaceholderColor = Color.Blue;
- Assert.AreNotEqual(searchBar1.PlaceholderColor, searchBar2.PlaceholderColor, "PlaceholderColor of two SearchBar should be different before set binding.");
- /*TEST CODE*/
- searchBar1.BindingContext = searchBar2;
- searchBar1.SetBinding(SearchBar.PlaceholderColorProperty, "PlaceholderColor");
- Assert.AreEqual(searchBar1.PlaceholderColor, searchBar2.PlaceholderColor, "PlaceholderColor of two SearchBar should be same after set binding.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Test PlaceholderProperty of SearchBar class")]
- [Property("SPEC", "Xamarin.Forms.SearchBar.PlaceholderProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void PlaceholderProperty_GET()
- {
- /* PRECONDITION
- * 1. Initiate two SearchBar.
- * 2. Set Placeholder for two SearchBar is different.
- */
- SearchBar searchBar1 = new SearchBar();
- searchBar1.Placeholder = "SearchBar1 Placeholder";
- SearchBar searchBar2 = new SearchBar();
- searchBar2.Placeholder = "SearchBar2 Placeholder";
- Assert.AreNotEqual(searchBar1.Placeholder, searchBar2.Placeholder, "Placeholder of two SearchBar should be different before set binding.");
- /*TEST CODE*/
- searchBar1.BindingContext = searchBar2;
- searchBar1.SetBinding(SearchBar.PlaceholderProperty, "Placeholder");
- Assert.AreEqual(searchBar1.Placeholder, searchBar2.Placeholder, "Placeholder of two SearchBar should be same after set binding.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Test SearchCommandParameterProperty of SearchBar class")]
- [Property("SPEC", "Xamarin.Forms.SearchBar.SearchCommandParameterProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void SearchCommandParameterProperty_GET()
- {
- /* PRECONDITION
- * 1. Initiate two SearchBar.
- * 2. Set SearchCommandParameter for two SearchBar is different.
- */
- SearchBar searchBar1 = new SearchBar();
- searchBar1.SearchCommandParameter = "SearchBar1 SearchCommandParameter";
- SearchBar searchBar2 = new SearchBar();
- searchBar2.SearchCommandParameter = "SearchBar2 SearchCommandParameter";
- Assert.AreNotEqual(searchBar1.SearchCommandParameter, searchBar2.SearchCommandParameter, "SearchCommandParameter of two SearchBar should be different before set binding.");
- /*TEST CODE*/
- searchBar1.BindingContext = searchBar2;
- searchBar1.SetBinding(SearchBar.SearchCommandParameterProperty, "SearchCommandParameter");
- Assert.AreEqual(searchBar1.SearchCommandParameter, searchBar2.SearchCommandParameter, "SearchCommandParameter of two SearchBar should be same after set binding.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Test SearchCommandProperty of SearchBar class")]
- [Property("SPEC", "Xamarin.Forms.SearchBar.SearchCommandProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void SearchCommandProperty_GET()
- {
- /* PRECONDITION
- * 1. Initiate two SearchBar.
- * 2. Set SearchCommand for two SearchBar is different.
- */
- SearchBar searchBar1 = new SearchBar();
- ICommand subICommand1 = new SubICommand();
- searchBar1.SearchCommand = subICommand1;
- SearchBar searchBar2 = new SearchBar();
- ICommand subICommand2 = new SubICommand();
- searchBar2.SearchCommand = subICommand2;
- Assert.AreNotEqual(searchBar1.SearchCommand, searchBar2.SearchCommand, "SearchCommand of two SearchBar should be different before set binding.");
- /*TEST CODE*/
- searchBar1.BindingContext = searchBar2;
- searchBar1.SetBinding(SearchBar.SearchCommandProperty, "SearchCommand");
- Assert.AreEqual(searchBar1.SearchCommand, searchBar2.SearchCommand, "SearchCommand of two SearchBar should be same after set binding.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Test TextColorProperty of SearchBar class")]
- [Property("SPEC", "Xamarin.Forms.SearchBar.TextColorProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void TextColorProperty_GET()
- {
- /* PRECONDITION
- * 1. Initiate two SearchBar.
- * 2. Set TextColor for two SearchBar is different.
- */
- SearchBar searchBar1 = new SearchBar();
- searchBar1.TextColor = Color.Black;
- SearchBar searchBar2 = new SearchBar();
- searchBar2.TextColor = Color.Blue;
- Assert.AreNotEqual(searchBar1.TextColor, searchBar2.TextColor, "TextColor of two SearchBar should be different before set binding.");
- /*TEST CODE*/
- searchBar1.BindingContext = searchBar2;
- searchBar1.SetBinding(SearchBar.TextColorProperty, "TextColor");
- Assert.AreEqual(searchBar1.TextColor, searchBar2.TextColor, "TextColor of two SearchBar should be same after set binding.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Test TextProperty of SearchBar class")]
- [Property("SPEC", "Xamarin.Forms.SearchBar.TextProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void TextProperty_GET()
- {
- /* PRECONDITION
- * 1. Initiate two SearchBar.
- * 2. Set Text for two SearchBar is different.
- */
- SearchBar searchBar1 = new SearchBar();
- searchBar1.Text = "SearchBar1 Text";
- SearchBar searchBar2 = new SearchBar();
- searchBar2.Text = "SearchBar2 Text";
- Assert.AreNotEqual(searchBar1.Text, searchBar2.Text, "Text of two SearchBar should be different before set binding.");
- /*TEST CODE*/
- searchBar1.BindingContext = searchBar2;
- searchBar1.SetBinding(SearchBar.TextProperty, "Text");
- Assert.AreEqual(searchBar1.Text, searchBar2.Text, "Text of two SearchBar should be same after set binding.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether CancelButtonColor property of SearchBar class can readable and writable or not")]
- [Property("SPEC", "Xamarin.Forms.SearchBar.CancelButtonColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void CancelButtonColor_SET_GET()
- {
- /* TEST CODE */
- var red = 0.1;
- var green = 0.2;
- var blue = 0.3;
- var alpha = 100;
- var color = new Color(red, green, blue, alpha);
- _searchBar.CancelButtonColor = color;
- var getCancelButtonColor = _searchBar.CancelButtonColor;
- Assert.AreEqual(color.R, getCancelButtonColor.R, "CancelButtonColor doesn't return R value after initializing");
- Assert.AreEqual(color.G, getCancelButtonColor.G, "CancelButtonColor doesn't return G value after initializing");
- Assert.AreEqual(color.B, getCancelButtonColor.B, "CancelButtonColor doesn't return B value after initializing");
- Assert.AreEqual(color.A, getCancelButtonColor.A, "CancelButtonColor doesn't return A value after initializing");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether FontAttributes property of SearchBar class can readable and writable or not")]
- [Property("SPEC", "Xamarin.Forms.SearchBar.FontAttributes A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void FontAttributes_SET_GET()
- {
- /* TEST CODE */
- _searchBar.FontAttributes = FontAttributes.None;
- Assert.AreEqual((int)(FontAttributes.None), (int)(_searchBar.FontAttributes), "FontAttributes doesn't set and get None successfully");
- _searchBar.FontAttributes = FontAttributes.Bold;
- Assert.AreEqual((int)(FontAttributes.Bold), (int)(_searchBar.FontAttributes), "FontAttributes doesn't set and get Bold successfully");
- _searchBar.FontAttributes = FontAttributes.Italic;
- Assert.AreEqual((int)(FontAttributes.Italic), (int)(_searchBar.FontAttributes), "FontAttributes doesn't set and get Italic successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether FontFamily property of SearchBar class can readable and writable or not")]
- [Property("SPEC", "Xamarin.Forms.SearchBar.FontFamily A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void FontFamily_SET_GET()
- {
- /* TEST CODE */
- var fontFamily = "Time New Roman";
- _searchBar.FontFamily = fontFamily;
- var getFontFamily = _searchBar.FontFamily;
- Assert.AreEqual(fontFamily, getFontFamily, "FontFamily doesn't set and get successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether FontSize property of SearchBar class can readable and writable or not")]
- [Property("SPEC", "Xamarin.Forms.SearchBar.FontSize A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void FontSize_SET_GET()
- {
- /* TEST CODE */
- var fontSize = 13.5;
- _searchBar.FontSize = fontSize;
- Assert.AreEqual(fontSize, _searchBar.FontSize);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether HorizontalTextAlignment property of SearchBar class can readable and writable or not")]
- [Property("SPEC", "Xamarin.Forms.SearchBar.HorizontalTextAlignment A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void HorizontalTextAlignment_SET_GET()
- {
- /* TEST CODE */
- _searchBar.HorizontalTextAlignment = TextAlignment.Center;
- Assert.AreEqual((int)(TextAlignment.Center), (int)(_searchBar.HorizontalTextAlignment), "HorizontalTextAlignment doesn't set and get Center successfully");
- _searchBar.HorizontalTextAlignment = TextAlignment.End;
- Assert.AreEqual((int)(TextAlignment.End), (int)(_searchBar.HorizontalTextAlignment), "HorizontalTextAlignment doesn't set and get End successfully");
- _searchBar.HorizontalTextAlignment = TextAlignment.Start;
- Assert.AreEqual((int)(TextAlignment.Start), (int)(_searchBar.HorizontalTextAlignment), "HorizontalTextAlignment doesn't set and get Start successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Placeholder property of SearchBar class can readable and writable or not")]
- [Property("SPEC", "Xamarin.Forms.SearchBar.Placeholder A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void Placeholder_SET_GET()
- {
- /* TEST CODE */
- var placeholder = "test placeholder";
- _searchBar.Placeholder = placeholder;
- var getPlaceholder = _searchBar.Placeholder;
- Assert.AreEqual(placeholder, getPlaceholder, "Placeholder property doesn't set and get successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether PlaceholderColor property of SearchBar class can readable and writable or not")]
- [Property("SPEC", "Xamarin.Forms.SearchBar.PlaceholderColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void PlaceholderColor_SET_GET()
- {
- /* TEST CODE */
- var red = 100;
- var green = 150;
- var blue = 200;
- var alpha = 100;
- var color = new Color(red, green, blue, alpha);
- _searchBar.PlaceholderColor = color;
- var getPlaceholderColor = _searchBar.PlaceholderColor;
- Assert.AreEqual(color.R, getPlaceholderColor.R, "PlaceholderColor doesn't return R value after initializing");
- Assert.AreEqual(color.G, getPlaceholderColor.G, "PlaceholderColor doesn't return G value after initializing");
- Assert.AreEqual(color.B, getPlaceholderColor.B, "PlaceholderColor doesn't return B value after initializing");
- Assert.AreEqual(color.A, getPlaceholderColor.A, "PlaceholderColor doesn't return A value after initializing");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether SearchCommand property of SearchBar class can readable and writable or not")]
- [Property("SPEC", "Xamarin.Forms.SearchBar.SearchCommand A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void SearchCommand_SET_GET()
- {
- /* TEST CODE */
- var subICommand = new SubICommand();
- _searchBar.SearchCommand = subICommand;
- var getCommand = _searchBar.SearchCommand;
- Assert.IsTrue(getCommand.CanExecute(null), "SearchCommand.CanExecute(null) should be return True");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether SearchCommandParameter property of SearchBar class can readable and writable or not")]
- [Property("SPEC", "Xamarin.Forms.SearchBar.SearchCommandParameter A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void SearchCommandParameter_SET_GET()
- {
- /* TEST CODE */
- var commandParameter = "SearchCommandParameter Test";
- _searchBar.SearchCommandParameter = commandParameter;
- var getSearchCommandParameter = _searchBar.SearchCommandParameter;
- Assert.AreEqual(commandParameter, getSearchCommandParameter, "SearchCommandParameter property doesn't set and get successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Text property of SearchBar class can readable and writable or not")]
- [Property("SPEC", "Xamarin.Forms.SearchBar.Text A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void Text_SET_GET()
- {
- /* TEST CODE */
- var text = "This is a SearchBar";
- _searchBar.Text = text;
- var getText = _searchBar.Text;
- Assert.AreEqual(text, getText, "Text property doesn't set and get successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether TextColor property of SearchBar class can readable and writable or not")]
- [Property("SPEC", "Xamarin.Forms.SearchBar.TextColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void TextColor_SET_GET()
- {
- /* TEST CODE */
- var red = 100;
- var green = 150;
- var blue = 200;
- var alpha = 100;
- var color = new Color(red, green, blue, alpha);
- _searchBar.TextColor = color;
- var getTextColor = _searchBar.TextColor;
- Assert.AreEqual(color.R, getTextColor.R, "TextColor doesn't return R value after initializing");
- Assert.AreEqual(color.G, getTextColor.G, "TextColor doesn't return G value after initializing");
- Assert.AreEqual(color.B, getTextColor.B, "TextColor doesn't return B value after initializing");
- Assert.AreEqual(color.A, getTextColor.A, "TextColor doesn't return A value after initializing");
- }
-
- [Test]
- [Category("P1")]
- [Description("Test TextChanged event of SearchBar class")]
- [Property("SPEC", "Xamarin.Forms.SearchBar.TextChanged E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void TextChanged_EVENT()
- {
- /* TEST CODE */
- var searchBar = new SearchBar()
- {
- Text = "This is a SearchBar",
- };
- _flagTextChanged = false;
- searchBar.TextChanged += (sender, e) =>
- {
- _flagTextChanged = true;
- };
- searchBar.Text = "Text Change";
- Assert.IsTrue(_flagTextChanged, "Flag TextChanged should be True after changing text");
- }
-
- [Test]
- [Category("P1")]
- [Description("Test On<T> configuration method of SearchBar class")]
- [Property("SPEC", "Xamarin.Forms.SearchBar.On<T> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void On_CONFIGURATION_METHOD()
- {
- /*TEST CODE*/
- _searchBar.Text = "Test SearchBar";
- _searchBar.FontSize = 12.3;
- _searchBar.FontFamily = "Time New Roman";
- var myConfig = _searchBar.On<IConfigPlatform>();
- Assert.IsInstanceOf<IPlatformElementConfiguration<IConfigPlatform, SearchBar>>(myConfig, "myConfig should be a instance of IPlatformElementConfiguration");
- Assert.IsInstanceOf<SearchBar>(myConfig.Element, "myConfig.Element should be a instance of SearchBar");
- Assert.AreEqual("Test SearchBar", myConfig.Element.Text, "Text of myConfig.Element value & Text of _searchBar should be equal");
- Assert.AreEqual(12.3, Math.Round(myConfig.Element.FontSize, 1), "FontSize of myConfig.Element value & FontSize of _searchBar should be equal");
- Assert.AreEqual("Time New Roman", myConfig.Element.FontFamily, "FontFamily of myConfig.Element value & FontFamily of _searchBar should be equal");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check whether SearchButtonPressed event is called after press search button or not.")]
- [Property("SPEC", "Xamarin.Forms.SearchBar.SearchButtonPressed E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void SearchButtonPressed_EVENT_CHECK()
- {
- /*TEST CODE*/
- Assert.True(false, "[NA]This API will be checked in manual.");
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.SelectedItemChangedEventArgs test")]
- public class SelectedItemChangedEventArgsTests
- {
- [SetUp]
- public void Setup()
- {
- Console.WriteLine("SelectedItemChangedEventArgsTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("SelectedItemChangedEventArgsTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create an SelectedItemChangedEventArgs object.")]
- [Property("SPEC", "Xamarin.Forms.SelectedItemChangedEventArgs.SelectedItemChangedEventArgs C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void SelectedItemChangedEventArgs_INIT()
- {
- /* TEST CODE */
- SelectedItemChangedEventArgs selectedItemChangedEventArgs = new SelectedItemChangedEventArgs("Tizen");
- Assert.IsNotNull(selectedItemChangedEventArgs, "SelectedItemChangedEventArgs Instance is null");
- Assert.IsInstanceOf<SelectedItemChangedEventArgs>(selectedItemChangedEventArgs, "Should be an instance of SelectedItemChangedEventArgs type.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the value for SelectedItem.")]
- [Property("SPEC", "Xamarin.Forms.SelectedItemChangedEventArgs.SelectedItem A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void SelectedItem_READ_ONLY()
- {
- /* TEST CODE */
- SelectedItemChangedEventArgs selectedItemChangedEventArgs = new SelectedItemChangedEventArgs("Tizen");
- Assert.AreEqual(selectedItemChangedEventArgs.SelectedItem, "Tizen", "Not returning expected object.");
- }
- }
-}
+++ /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 Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class SelectedPositionChangedEventArgsTests
- {
- private SelectedPositionChangedEventArgs _selectedPositionChangedEventArgs;
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("SelectedPositionChangedEventArgs --------------- SetUp()");
- _selectedPositionChangedEventArgs = new SelectedPositionChangedEventArgs(2);
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("SelectedPositionChangedEventArgs --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a SelectedPositionChangedEventArgs instance. Check whether object is successfully created or not")]
- [Property("SPEC", "Xamarin.Forms.SelectedPositionChangedEventArgs.SelectedPositionChangedEventArgs C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void SelectedPositionChangedEventArgs_INIT()
- {
- /* TEST CODE */
- var selectedPosition = 5;
- var selectedPositionChangedEventArgs = new SelectedPositionChangedEventArgs(selectedPosition);
- Assert.IsNotNull(selectedPositionChangedEventArgs, "Creating a SelectedPositionChangedEventArgs object failed. It is set to null");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property SelectedPosition is readable correct or not")]
- [Property("SPEC", "Xamarin.Forms.SelectedPositionChangedEventArgs.SelectedPosition A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void SelectedPosition_PROPERTY_GET()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- Assert.IsNotNull(_selectedPositionChangedEventArgs, "Creating a SelectedPositionChangedEventArgs object failed. It is set to null");
-
- /* TEST CODE */
- var value = 2;
- Assert.AreEqual(value, _selectedPositionChangedEventArgs.SelectedPosition, "Get value of SelectedPosition is not correct");
- }
- }
-}
+++ /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 Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class SetterTests
- {
- private Setter _setter;
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("Setter --------------- SetUp()");
- _setter = new Setter();
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("Setter --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a Setter instance. Check whether object is successfully created or not")]
- [Property("SPEC", "Xamarin.Forms.Setter.Setter C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void Setter_INIT()
- {
- /* TEST CODE */
- var setter = new Setter();
- Assert.IsNotNull(setter, "Creating a Setter object failed. It is set to null");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Value is readable and settable with valid values")]
- [Property("SPEC", "Xamarin.Forms.Setter.Value A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void Value_PROPERTY_SET_GET()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- Assert.IsNotNull(_setter, "Creating a Setter object failed. It is set to null");
-
- /* TEST CODE */
- var grid = new Grid()
- {
- ColumnSpacing = 5.5,
- };
- _setter.Value = grid;
- var getValue =(Grid) _setter.Value;
- Assert.AreEqual(grid.ColumnSpacing, getValue.ColumnSpacing, "Set and get value of Value=ColumnSpacing is not correct");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Property is readable and settable with valid values")]
- [Property("SPEC", "Xamarin.Forms.Setter.Property A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void Property_PROPERTY_SET_GET()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- Assert.IsNotNull(_setter, "Creating a Setter object failed. It is set to null");
-
- /* TEST CODE */
- _setter.Property = Grid.ColumnSpacingProperty;
- var getProperty = _setter.Property;
- Assert.AreEqual("ColumnSpacing", getProperty.PropertyName, "Set and get value of Property is not correct");
- Assert.IsFalse(getProperty.IsReadOnly, "Set and get value of Property is not correct");
- }
- }
-}
+++ /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 Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class SettersExtensionsTests
- {
- private IList<Setter> lstSetter;
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("SettersExtensions --------------- SetUp()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("SettersExtensions --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Add method is added correct or not")]
- [Property("SPEC", "Xamarin.Forms.SettersExtensions.Add M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void Add_CHECK()
- {
- /* TEST CODE */
- lstSetter = new Style(typeof(Type)).Setters;
- var value = 2.4;
- SettersExtensions.Add(lstSetter, Grid.ColumnSpacingProperty, value);
- var count = 0;
- var getSetter = new Setter();
- foreach(Setter item in lstSetter)
- {
- ++count;
- getSetter = item;
- }
- Assert.AreEqual(1, count, "Number of setter in IList<Setter> should be 1");
- Assert.AreEqual(value, getSetter.Value, "Value should return same set");
- Assert.AreEqual("ColumnSpacing", getSetter.Property.PropertyName, "PropertyName should return same set");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether AddBinding method is added correct or not")]
- [Property("SPEC", "Xamarin.Forms.SettersExtensions.AddBinding M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void AddBinding_CHECK()
- {
- /* TEST CODE */
- lstSetter = new Style(typeof(Type)).Setters;
- var path= "Xamarin.Forms.Grid.ColumnSpacing";
- var binding = new Binding();
- binding.Path = path;
- SettersExtensions.AddBinding(lstSetter, Grid.ColumnSpacingProperty, binding);
- var count = 0;
- var getSetter = new Setter();
- foreach (Setter item in lstSetter)
- {
- ++count;
- getSetter = item;
- }
- var getBinding = (Binding)getSetter.Value;
- Assert.AreEqual(1, count, "Number of setter should return 1");
- Assert.AreEqual(path, getBinding.Path, "Value should return same set");
- Assert.AreEqual("ColumnSpacing", getSetter.Property.PropertyName, "PropertyName should return same set");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether AddDynamicResource method is added correct or not")]
- [Property("SPEC", "Xamarin.Forms.SettersExtensions.AddDynamicResource M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void AddDynamicResource_CHECK()
- {
- /* TEST CODE */
- lstSetter = new Style(typeof(Type)).Setters;
- var key = "Xamarin.Forms.Internals.DynamicResource";
- SettersExtensions.AddDynamicResource(lstSetter, Grid.ColumnSpacingProperty, key);
- var count = 0;
- var getSetter = new Setter();
- foreach (Setter item in lstSetter)
- {
- ++count;
- getSetter = item;
- }
- Assert.AreEqual(1, count, "Number of setter should return 1");
- Assert.AreEqual(key, getSetter.Value.ToString(), "Value should return same set");
- Assert.AreEqual("ColumnSpacing", getSetter.Property.PropertyName, "PropertyName should return same 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;
-using Xamarin.Forms;
-using NUnit.Framework;
-using System.Collections;
-using System.Collections.Generic;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.Size Tests")]
- public class SizeTests
- {
- private Size _size;
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("SizeTests --------------- Setup()");
- _size = new Size();
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("SizeTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a Size instance.")]
- [Property("SPEC", "Xamarin.Forms.Size.Size C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Size_INIT()
- {
- /* TEST CODE */
- var size = new Size(10.00, 20.00);
- Assert.IsNotNull(size, "Object should be not null after initialize");
- Assert.IsInstanceOf<Size>(size);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the Height property is readable and writable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.Size.Height A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Height_READ_WRITE()
- {
- /* TEST CODE */
- _size.Height = 15.00;
- Assert.AreEqual(15.00, _size.Height, "Height property doesn't set and get successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the Width property is readable and writable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.Size.Width A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Width_READ_WRITE()
- {
- /* TEST CODE */
- _size.Width = 12.00;
- Assert.AreEqual(12.00, _size.Width, "Width property doesn't set and get successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the IsZero property is readable.")]
- [Property("SPEC", "Xamarin.Forms.Size.IsZero A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void IsZero_READ()
- {
- /* TEST CODE */
- Assert.IsInstanceOf<bool>(_size.IsZero, "Get IsZero should return object bool.");
- Assert.IsTrue(_size.IsZero, "Should be true.");
- var size = new Size(10.00, 20.00);
- Assert.IsFalse(size.IsZero, "Should be false.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the Zero property is readable.")]
- [Property("SPEC", "Xamarin.Forms.Size.Zero A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Zero_READ()
- {
- /* TEST CODE */
- Size size = Size.Zero;
-
- Assert.AreEqual(size.Width, (double)0.0, "Width should be 0.");
- Assert.AreEqual(size.Height, (double)0.0, "Height should be 0.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Addition.")]
- [Property("SPEC", "Xamarin.Forms.Size.Addition M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Addition_CHECK_RETURN()
- {
- /* TEST CODE */
- var size1 = new Size(10.00, 10.00);
- var size2 = new Size(20.00, 20.00);
-
- var result = size1 + size2;
-
- Assert.AreEqual(new Size(30.00, 30.00), result, "addition of two size are not correct.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Equality.")]
- [Property("SPEC", "Xamarin.Forms.Size.== M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Equality_CHECK_RETURN()
- {
- /* TEST CODE */
- Assert.True(new Size(2, 3) == new Size(2, 3), "Two size's should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Inequality.")]
- [Property("SPEC", "Xamarin.Forms.Size.!= M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Inequality_CHECK_RETURN()
- {
- /* TEST CODE */
- Assert.True(new Size(2, 3) != new Size(3, 2), "Two size's should not be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Subtraction.")]
- [Property("SPEC", "Xamarin.Forms.Size.Subtraction M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Subtraction_CHECK_RETURN()
- {
- /* TEST CODE */
- var size1 = new Size(15.00, 15.00);
- var size2 = new Size(5.00, 5.00);
-
- var result = size1 - size2;
-
- Assert.AreEqual(new Size(10.00, 10.00), result, "Subtraction of two size are not correct.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Multiply.")]
- [Property("SPEC", "Xamarin.Forms.Size.Multiply M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Multiply_CHECK_RETURN()
- {
- /* TEST CODE */
- var size = new Size(5.00, 5.00);
- double scale = 6.00;
-
- var result = size * scale;
-
- Assert.AreEqual(size.Width * scale, result.Width, "width of two size's should be same after multiply");
- Assert.AreEqual(size.Height * scale, result.Height, "height of two size's should be same after multiply");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Point.")]
- [Property("SPEC", "Xamarin.Forms.Size.Explicit M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Explicit_SIZE_TO_POINT_CHECK_RETURN()
- {
- /* TEST CODE */
- var size = new Size(10.00, 20.00);
- var point = (Point)size;
-
- Assert.AreEqual(size.Width, point.X, "width of size and point should be same after conversion.");
- Assert.AreEqual(size.Height, point.Y, "height of size and point should be same after conversion.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Equals.")]
- [Property("SPEC", "Xamarin.Forms.Size.Equals M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Property("COVPARAM", "object")]
- public void Equals_CHECK_RETURN()
- {
- /* TEST CODE */
- Assert.False(new Size().Equals(null), "Should not be equal.");
- Assert.False(new Size().Equals("Size"), "Should not be equal.");
- var sizeobj = new Size(2, 3);
- Assert.True(new Size(2, 3).Equals(sizeobj), "Should be equal.");
- sizeobj = new Size(5, 6);
- Assert.False(new Size(2, 3).Equals(sizeobj), "Should not be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Equals.")]
- [Property("SPEC", "Xamarin.Forms.Size.Equals M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Property("COVPARAM", "Xamarin.Forms.Size")]
- public void Equals_CHECK_RETURN_OBJ()
- {
- /* TEST CODE */
- Assert.False(new Size().Equals(null), "Should not be equal.");
- Assert.False(new Size().Equals("Size"), "Should not be equal.");
- Assert.True(new Size(2, 3).Equals(new Size(2, 3)), "Should be equal.");
- Assert.False(new Size(2, 3).Equals(new Size(5, 6)), "Should not be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of GetHashCode.")]
- [Property("SPEC", "Xamarin.Forms.Size.GetHashCode M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void GetHashCode_CHECK_RETURN()
- {
- /* TEST CODE */
- var result = new Size(2.00, 3.00).GetHashCode();
- Assert.IsNotNull(result, "Should not be null.");
- Assert.IsInstanceOf<Int32>(result, "Should be instance of int32.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of ToString.")]
- [Property("SPEC", "Xamarin.Forms.Size.ToString M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void ToString_CHECK_RETURN()
- {
- /* TEST CODE */
- var result = new Size(2.00, 3.00).ToString();
- Assert.IsNotNull(result, "Should not be null.");
- Assert.IsInstanceOf<string>(result, "Should be instance of string.");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.SizeRequest Tests")]
- public class SizeRequestTests
- {
- private SizeRequest sizeRequest;
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("SizeRequestTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("SizeRequestTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a SizeRequest instance.")]
- [Property("SPEC", "Xamarin.Forms.SizeRequest.SizeRequest C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Property("COVPARAM", "Xamarin.Forms.Size")]
- public void SizeRequest_INIT()
- {
- /* TEST CODE */
- var size = new Size(10.00, 20.00);
- sizeRequest = new SizeRequest(size);
- Assert.IsNotNull(sizeRequest, "SizeRequest instance is null");
- Assert.IsInstanceOf<SizeRequest>(sizeRequest, "Not an instance of SizeRequest.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a SizeRequest instance.")]
- [Property("SPEC", "Xamarin.Forms.SizeRequest.SizeRequest C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Property("COVPARAM", "Xamarin.Forms.Size, Xamarin.Forms.Size")]
- public void SizeRequest_INIT_WITH_SIZE()
- {
- /* TEST CODE */
- var size = new Size(10.00, 20.00);
- var sizeNew = new Size(20.00, 30.00);
- sizeRequest = new SizeRequest(size, sizeNew);
- Assert.IsNotNull(sizeRequest, "SizeRequest instance is null");
- Assert.IsInstanceOf<SizeRequest>(sizeRequest, "Not an instance of SizeRequest.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the Minimum property is readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.SizeRequest.Minimum A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Minimum_READ_WRITE()
- {
- /* TEST CODE */
- var size = new Size(10.00, 20.00);
- var sizeNew = new Size(20.00, 30.00);
-
- sizeRequest = new SizeRequest(size);
- Assert.AreEqual(sizeRequest.Minimum, size, "Not returning expect Size.");
-
- sizeRequest.Minimum = sizeNew;
- Assert.AreEqual(sizeRequest.Minimum, sizeNew, "Not returning expect Size.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the Request property is readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.SizeRequest.Request A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Request_READ_WRITE()
- {
- /* TEST CODE */
- var size = new Size(10.00, 20.00);
- var sizeNew = new Size(20.00, 30.00);
-
- sizeRequest = new SizeRequest(size);
- Assert.AreEqual(sizeRequest.Request, size, "Not returning expect Size.");
-
- sizeRequest.Request = sizeNew;
- Assert.AreEqual(sizeRequest.Request, sizeNew, "Not returning expect Size.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether returns a string representation of the size request.")]
- [Property("SPEC", "Xamarin.Forms.SizeRequest.ToString M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void ToString_CHECK_RETURN()
- {
- /* TEST CODE */
- Size size = new Size(2.00, 3.00);
- sizeRequest = new SizeRequest(size);
- var toString = sizeRequest.ToString();
-
- Assert.IsNotNull(toString, "String representation should not be null.");
- Assert.IsInstanceOf<string>(toString, "Should be instance of string.");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class SliderTests
- {
- private Slider slider;
- public Boolean isValueChanged;
-
- [SetUp]
- public void Setup()
- {
- Console.WriteLine("SliderTests --------------- Setup()");
- slider = new Slider();
- }
-
- [TearDown]
- public void TearDown()
- {
- slider = null;
- Console.WriteLine("SliderTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a Slider object")]
- [Property("SPEC", "Xamarin.Forms.Slider.Slider C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Slider_INIT_WITHOUT_PARAMETER()
- {
- /* TEST CODE */
- Assert.IsNotNull(slider, "Instance Slider is null");
- Assert.IsInstanceOf<Slider>(slider);
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a Slider object")]
- [Property("SPEC", "Xamarin.Forms.Slider.Slider C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Property("COVPARAM", "double, double, double")]
- public void Slider_INIT_WITH_PARAMETER()
- {
- /* TEST CODE */
- Slider sliderNew = new Slider(1.0, 5.0, 1.0);
- Assert.IsNotNull(sliderNew, "Instance Slider is null");
- Assert.IsInstanceOf<Slider>(sliderNew);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of MaximumProperty's bound or not.")]
- [Property("SPEC", "Xamarin.Forms.Slider.MaximumProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void MaximumProperty_CHECK_BINDABLE()
- {
- /* TEST CODE */
- var mFirstMaximumProperty = 2.0;
- var mSecondMaximumProperty = 3.0;
- Stepper stepper = new Stepper();
-
- slider.Maximum = mFirstMaximumProperty;
- stepper.Maximum = mSecondMaximumProperty;
-
- Assert.AreNotEqual(slider.Maximum, stepper.Maximum, "MaximumProperty value must be different.");
- slider.BindingContext = stepper;
- slider.SetBinding(Slider.MaximumProperty, "Maximum");
- Assert.AreEqual(slider.Maximum, stepper.Maximum, "After binding, values should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of MinimumProperty's bound or not.")]
- [Property("SPEC", "Xamarin.Forms.Slider.MinimumProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void MinimumProperty_CHECK_BINDABLE()
- {
- /* TEST CODE */
- var mFirstMinimumProperty = 2.0;
- var mSecondMinimumProperty = 3.0;
- Stepper stepper = new Stepper();
-
- slider.Maximum = 10.0;
- stepper.Maximum = 10.0;
- slider.Minimum = mFirstMinimumProperty;
- stepper.Minimum = mSecondMinimumProperty;
-
- Assert.AreNotEqual(slider.Minimum, stepper.Minimum, "MinimumProperty value must be different.");
- slider.BindingContext = stepper;
- slider.SetBinding(Slider.MinimumProperty, "Minimum");
- Assert.AreEqual(slider.Minimum, stepper.Minimum, "After binding, values should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of ValueProperty's bound or not.")]
- [Property("SPEC", "Xamarin.Forms.Slider.ValueProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void ValueProperty_CHECK_BINDABLE()
- {
- /* TEST CODE */
- var mFirstValueProperty = 2.0;
- var mSecondValueProperty = 3.0;
- Stepper stepper = new Stepper();
-
- slider.Maximum = 10.0;
- stepper.Maximum = 10.0;
- slider.Value = mFirstValueProperty;
- stepper.Value = mSecondValueProperty;
-
- Assert.AreNotEqual(slider.Value, stepper.Value, "ValueProperty value must be different.");
- slider.BindingContext = stepper;
- slider.SetBinding(Slider.ValueProperty, "Value");
- Assert.AreEqual(slider.Value, stepper.Value, "After binding, values should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Sets or gets the maximum value for the slider.")]
- [Property("SPEC", "Xamarin.Forms.Slider.Maximum A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Maximum_READ_WRITE()
- {
- /* TEST CODE */
- double value = 10.0;
- slider.Maximum = value;
- Assert.IsTrue(slider.Maximum.Equals(value), "Set and get values are not equal");
- }
-
- [Test]
- [Category("P1")]
- [Description("Sets or gets the minimum value for the slider.")]
- [Property("SPEC", "Xamarin.Forms.Slider.Minimum A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Minimum_READ_WRITE()
- {
- /* TEST CODE */
- double value = 1.0;
- slider.Maximum = 10.0;
- slider.Minimum = value;
- Assert.IsTrue(slider.Minimum.Equals(value), "Set and get values are not equal");
- }
-
- [Test]
- [Category("P1")]
- [Description("Sets or gets the value for the slider.")]
- [Property("SPEC", "Xamarin.Forms.Slider.Value A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Value_READ_WRITE()
- {
- /* TEST CODE */
- double value = 1.0;
- slider.Maximum = 10.0;
- slider.Value = value;
- Assert.IsTrue(slider.Value.Equals(value), "Set and get values are not equal");
- }
-
- public void ValueChangedCallback(object sender, System.EventArgs e)
- {
- isValueChanged = true;
- }
-
- [Test]
- [Category("P1")]
- [Description("The ValueChanged event is fired when the Value property changes.")]
- [Property("SPEC", "Xamarin.Forms.Slider.ValueChanged C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void ValueChanged_EVENT()
- {
- /* TEST CODE */
- isValueChanged = false;
- slider.Maximum = 10.0;
- slider.Value = 1.0;
- slider.ValueChanged += ValueChangedCallback;
- slider.Value = slider.Value + 1;
-
- Assert.IsTrue(isValueChanged, "Event value changed should be handled.");
- slider.ValueChanged -= ValueChangedCallback;
- }
-
- [Test]
- [Category("P1")]
- [Description("Check return label configuration")]
- [Property("SPEC", "Xamarin.Forms.Slider.On<T> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Md. Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void On_CONFIGURATION_METHOD()
- {
- /*TEST CODE*/
- slider.Maximum = 10.0;
- slider.Value = 5.0;
- var myConfig = slider.On<IConfigPlatform>();
- Assert.IsInstanceOf<IPlatformElementConfiguration<IConfigPlatform, Slider>>(myConfig, "myConfig should be a instance of IPlatformElementConfiguration");
- Assert.IsInstanceOf<Slider>(myConfig.Element, "myConfig.Element should be a instance of Slider");
- Assert.AreEqual(10.0, myConfig.Element.Maximum, "Maximum of myConfig.Element value & Maximum of slider should be equal");
- Assert.AreEqual(5.0, myConfig.Element.Value, "Value of myConfig.Element value & Value of slider should be equal");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-using NUnit.Framework.TUnit;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class SpanTests
- {
- private Span _span;
- public Boolean isPropertyChanged;
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("SpanTests --------------- Setup()");
- _span = new Span();
- }
-
- [TearDown]
- public void TearDown()
- {
- _span = null;
- Console.WriteLine("SpanTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P0")]
- [Description("Create a Span Instance")]
- [Property("SPEC", "Xamarin.Forms.Span.Span C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Span_INIT()
- {
- /* TEST CODE */
- var span = new Span();
- Assert.IsNotNull(span, "Object is null after initialize");
- Assert.IsInstanceOf<Span>(span);
- }
-
- public void PropertyChangedCallback(object sender, System.EventArgs e)
- {
- isPropertyChanged = true;
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether PropertyChanged Event is raised when a property is changed.")]
- [Property("SPEC", "Xamarin.Forms.Span.PropertyChanged E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void PropertyChanged_EVENT()
- {
- /* TEST CODE */
- isPropertyChanged = false;
- var span = new Span();
- span.FontSize = 12.0;
- span.PropertyChanged += PropertyChangedCallback;
- span.FontSize = span.FontSize + 2.0;
- Assert.IsTrue(isPropertyChanged, "Event value changed should be handled.");
- span.PropertyChanged -= PropertyChangedCallback;
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether BackgroundColor is readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.Span.BackgroundColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void BackgroundColor_READ_WRITE()
- {
- /* TEST CODE */
- _span.BackgroundColor = Color.Pink;
- Assert.IsInstanceOf<Color>(_span.BackgroundColor, "Should be instance of Color.");
- Assert.AreEqual(Color.Pink, _span.BackgroundColor, "BackgroundColor doesn't set and get successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ForegroundColor is readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.Span.ForegroundColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void ForegroundColor_READ_WRITE()
- {
- /* TEST CODE */
- _span.ForegroundColor = Color.Pink;
- Assert.IsInstanceOf<Color>(_span.ForegroundColor, "Should be instance of Color.");
- Assert.AreEqual(Color.Pink, _span.ForegroundColor, "ForegroundColor doesn't set and get successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether FontAttributes is readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.Span.FontAttributes A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void FontAttributes_READ_WRITE()
- {
- /* TEST CODE */
- _span.FontAttributes = FontAttributes.None;
- Assert.IsInstanceOf<FontAttributes>(_span.FontAttributes);
- Assert.AreEqual((int)FontAttributes.None, (int)_span.FontAttributes, "Property \"FontAttributes\": the set value and the get value should be equal(None)");
-
- _span.FontAttributes = FontAttributes.Bold;
- Assert.IsInstanceOf<FontAttributes>(_span.FontAttributes);
- Assert.AreEqual((int)FontAttributes.Bold, (int)_span.FontAttributes, "Property \"FontAttributes\": the set value and the get value should be equal(Bold)");
-
- _span.FontAttributes = FontAttributes.Italic;
- Assert.IsInstanceOf<FontAttributes>(_span.FontAttributes);
- Assert.AreEqual((int)FontAttributes.Italic, (int)_span.FontAttributes, "Property \"FontAttributes\": the set value and the get value should be equal(Italic)");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether FontSize is readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.Span.FontSize A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void FontSize_READ_WRITE()
- {
- /* TEST CODE */
- const double fontSize = 12.00;
- _span.FontSize = fontSize;
- Assert.IsInstanceOf<double>(_span.FontSize);
- Assert.AreEqual(fontSize, _span.FontSize);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether FontFamily is readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.Span.FontFamily A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void FontFamily_READ_WRITE()
- {
- /* TEST CODE */
- const string fontFamily = "Times New Roman";
- _span.FontFamily = fontFamily;
- Assert.IsInstanceOf<string>(_span.FontFamily);
- Assert.AreEqual(fontFamily, _span.FontFamily);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Text is readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.Span.Text A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Text_READ_WRITE()
- {
- /* TEST CODE */
- const string txt = "SRBD";
- _span.Text = txt;
- Assert.IsInstanceOf<string>(_span.Text);
- Assert.AreEqual(txt, _span.Text);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Font is readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.Span.Font A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Font_READ_WRITE()
- {
- /* TEST CODE */
- var font = new Font();
- _span.Font = font;
- Assert.AreEqual(font , _span.Font, "Font property should be equal.");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-using System.Threading.Tasks;
-using XamarinForTizen.Tizen;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class StackLayoutTests
- {
- private StackLayout _stackLayout;
- private static bool _flagLayoutChildren;
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("StackLayoutTests --------------- Setup()");
- _stackLayout = new StackLayout();
- }
-
- [TearDown]
- public void TearDown()
- {
- _stackLayout = null;
- Console.WriteLine("StackLayoutTests --------------- TearDown()");
- }
-
- public class CustomStackLayout : StackLayout
- {
- public Boolean isOnSizeRequest = false;
-
- protected override SizeRequest OnSizeRequest(double widthConstraint, double heightConstraint)
- {
- isOnSizeRequest = true;
- return base.OnSizeRequest(widthConstraint, heightConstraint);
- }
-
- protected override void LayoutChildren(double x, double y, double width, double height)
- {
- _flagLayoutChildren = true;
- base.LayoutChildren(x, y, width, height);
- }
-
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a StackLayout instance.")]
- [Property("SPEC", "Xamarin.Forms.StackLayout.StackLayout C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void StackLayout_INIT()
- {
- /* TEST CODE */
- var stackLayout = new StackLayout();
- Assert.IsNotNull(stackLayout, "Object is null after initialize");
- Assert.IsInstanceOf<StackLayout>(stackLayout);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property Orientation is readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.StackLayout.Orientation A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Orientation_READ_WRITE()
- {
- /* TEST CODE */
- _stackLayout.Orientation = StackOrientation.Horizontal;
- Assert.IsTrue(_stackLayout.Orientation.Equals(StackOrientation.Horizontal), "Orientation property is not set to Horizontal.");
-
- _stackLayout.Orientation = StackOrientation.Vertical;
- Assert.IsTrue(_stackLayout.Orientation.Equals(StackOrientation.Vertical), "Orientation property is not set to Vertical.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Spacing is readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.StackLayout.Spacing A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Spacing_READ_WRITE()
- {
- /* TEST CODE */
- int spacing = 15;
- _stackLayout.Spacing = spacing;
- Assert.AreEqual(_stackLayout.Spacing, spacing, "Spacing property is not set.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OrientationProperty is bound or not.")]
- [Property("SPEC", "Xamarin.Forms.StackLayout.OrientationProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void OrientationProperty_CHECK_BINDABLE()
- {
- /* TEST CODE */
- var mFirstori = StackOrientation.Horizontal;
- var mSecondori = StackOrientation.Vertical;
- _stackLayout.Orientation = mFirstori;
- StackLayout bindingObject = new StackLayout();
- bindingObject.Orientation = mSecondori;
- Assert.AreNotEqual(_stackLayout.Orientation, bindingObject.Orientation, "Orientation of StackLayout must be different from bindingObject's orientation.");
- _stackLayout.BindingContext = bindingObject;
- _stackLayout.SetBinding(StackLayout.OrientationProperty, "Orientation");
- Assert.AreEqual(_stackLayout.Orientation, bindingObject.Orientation, "Orientation of bindingObject & orientation of StackLayout should be same.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether SpacingProperty is bound or not.")]
- [Property("SPEC", "Xamarin.Forms.StackLayout.SpacingProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void SpacingProperty_CHECK_BINDABLE()
- {
- /* TEST CODE */
- double mFirstSpacing = 12.0;
- double mSecondSpacing = 15.0;
- _stackLayout.Spacing = mFirstSpacing;
- StackLayout bindingObject = new StackLayout();
- bindingObject.Spacing = mSecondSpacing;
- Assert.AreNotEqual(_stackLayout.Spacing, bindingObject.Spacing, "Spacing of StackLayout must be different from bindingObject's orientation.");
- _stackLayout.BindingContext = bindingObject;
- _stackLayout.SetBinding(StackLayout.SpacingProperty, "Spacing");
- Assert.AreEqual(_stackLayout.Spacing, bindingObject.Spacing, "Spacing of bindingObject & Spacing of StackLayout should be same.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OnSizeRequest is invoked or not.")]
- [Property("SPEC", "Xamarin.Forms.StackLayout.OnSizeRequest M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void OnSizeRequest_INVOKED_CHECK()
- {
- /*TEST CODE*/
- CustomStackLayout customStackLayout = new CustomStackLayout();
- customStackLayout.GetSizeRequest(double.PositiveInfinity, double.PositiveInfinity);
- Assert.IsTrue(customStackLayout.isOnSizeRequest, "OnSizeRequest method didn't invoke.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether LayoutChildren is invoked or not.")]
- [Property("SPEC", "Xamarin.Forms.StackLayout.LayoutChildren M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public async Task LayoutChildren_INVOKED_CHECK()
- {
- /*TEST CODE*/
- var subStackLayout = new CustomStackLayout();
- var label = new Label()
- {
- Text = "Label Test"
- };
- ContentPage mContentPage = new ContentPage
- {
- Content = subStackLayout
- };
- await Program.getApp().MainPage.Navigation.PushAsync(mContentPage);
- await Task.Delay(500);
- _flagLayoutChildren = false;
- Assert.IsFalse(_flagLayoutChildren, "The first Flag LayoutChildren should be False");
- subStackLayout.Children.Add(label);
- Assert.IsTrue(_flagLayoutChildren, "_flagLayoutChildren should be True after LayoutChildren() is called");
- /* Postcondition */
- await Program.getApp().MainPage.Navigation.PopToRootAsync();
- await Task.Delay(500);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether on method works properly or not.")]
- [Property("SPEC", "Xamarin.Forms.StackLayout.On<T> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void On_METHOD()
- {
- var subStackLayout = new CustomStackLayout();
- var label = new Label()
- {
- Text = "Label Test"
- };
- ContentPage mContentPage = new ContentPage
- {
- Content = subStackLayout
- };
- var config = subStackLayout.On<Xamarin.Forms.PlatformConfiguration.Tizen>();
- Assert.IsInstanceOf<IPlatformElementConfiguration <Xamarin.Forms.PlatformConfiguration.Tizen, Xamarin.Forms.StackLayout>> (config, "config is not IPlatformElementConfiguration");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class StepperTests
- {
- private Stepper _stepper;
- public Boolean isValueChanged;
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("StepperTests --------------- Setup()");
- _stepper = new Stepper();
- }
-
- [TearDown]
- public void TearDown()
- {
- _stepper = null;
- Console.WriteLine("StepperTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Initializes a Stepper instance without parameter.")]
- [Property("SPEC", "Xamarin.Forms.Stepper.Stepper C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Stepper_INIT()
- {
- /* TEST CODE */
- var stepper = new Stepper();
- Assert.IsNotNull(stepper, "Object is null after initialize");
- Assert.IsInstanceOf<Stepper>(stepper);
- }
-
- [Test]
- [Category("P1")]
- [Description("Initializes a Stepper instance with parameter.")]
- [Property("SPEC", "Xamarin.Forms.Stepper.Stepper C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("COVPARAM", "double, double, double, double")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Stepper_INIT_WITH_PARAMETER()
- {
- /* TEST CODE */
- var stepper = new Stepper(120, 200, 150, 2);
- Assert.AreEqual(120, stepper.Minimum);
- Assert.AreEqual(200, stepper.Maximum);
- Assert.AreEqual(150, stepper.Value);
- Assert.AreEqual(2, stepper.Increment);
- }
-
- public void ValueChangedCallback(object sender, System.EventArgs e)
- {
- isValueChanged = true;
- }
-
-
- [Test]
- [Category("P1")]
- [Description("Check whether ValueChanged Event is raised when a Value is changed.")]
- [Property("SPEC", "Xamarin.Forms.Stepper.ValueChanged E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void ValueChanged_EVENT()
- {
- /* TEST CODE */
- isValueChanged = false;
- var stepper = new Stepper();
- stepper.Value = 1.0;
- stepper.ValueChanged += ValueChangedCallback;
- stepper.Value = stepper.Value + 1;
- Assert.IsTrue(isValueChanged, "ValueChanged didn't catch event.");
- stepper.ValueChanged -= ValueChangedCallback;
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether IncrementProperty is bound or not.")]
- [Property("SPEC", "Xamarin.Forms.Stepper.IncrementProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void IncrementProperty_CHECK_BINDABLE()
- {
- /* TEST CODE */
- double mFirstIncrement = 12.0;
- double mSecondIncrement = 15.0;
- _stepper.Increment = mFirstIncrement;
- Stepper bindingObject = new Stepper();
- bindingObject.Increment = mSecondIncrement;
- Assert.AreNotEqual(_stepper.Increment, bindingObject.Increment, "Increment of Stepper must be different from bindingObject's Increment.");
- _stepper.BindingContext = bindingObject;
- _stepper.SetBinding(Stepper.IncrementProperty, "Increment");
- Assert.AreEqual(_stepper.Increment, bindingObject.Increment, "Spacing of bindingObject & Spacing of Stepper should be same.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether MaximumProperty is bound or not.")]
- [Property("SPEC", "Xamarin.Forms.Stepper.MaximumProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void MaximumProperty_CHECK_BINDABLE()
- {
- /* TEST CODE */
- double mFirstMaximum = 22.0;
- double mSecondMaximum = 25.0;
- _stepper.Maximum = mFirstMaximum;
- Stepper bindingObject = new Stepper();
- bindingObject.Maximum = mSecondMaximum;
- Assert.AreNotEqual(_stepper.Maximum, bindingObject.Maximum, "Maximum of Stepper must be different from bindingObject's Maximum.");
- _stepper.BindingContext = bindingObject;
- _stepper.SetBinding(Stepper.MaximumProperty, "Maximum");
- Assert.AreEqual(_stepper.Maximum, bindingObject.Maximum, "Maximum of bindingObject & Maximum of Stepper should be same.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether MinimumProperty is bound or not.")]
- [Property("SPEC", "Xamarin.Forms.Stepper.MinimumProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void MinimumProperty_CHECK_BINDABLE()
- {
- /* TEST CODE */
- double mFirstMinimum = 22.0;
- double mSecondMinimum = 25.0;
- _stepper.Minimum = mFirstMinimum;
- Stepper bindingObject = new Stepper();
- bindingObject.Minimum = mSecondMinimum;
- Assert.AreNotEqual(_stepper.Minimum, bindingObject.Minimum, "Minimum of Stepper must be different from bindingObject's Minimum.");
- _stepper.BindingContext = bindingObject;
- _stepper.SetBinding(Stepper.MinimumProperty, "Minimum");
- Assert.AreEqual(_stepper.Minimum, bindingObject.Minimum, "Minimum of bindingObject & Minimum of Stepper should be same.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ValueProperty is is bound or not.")]
- [Property("SPEC", "Xamarin.Forms.Stepper.ValueProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void ValueProperty_CHECK_BINDABLE()
- {
- /* TEST CODE */
- double mFirstValue = 22.0;
- double mSecondValue = 25.0;
- _stepper.Value = mFirstValue;
- Stepper bindingObject = new Stepper();
- bindingObject.Value = mSecondValue;
- Assert.AreNotEqual(_stepper.Value, bindingObject.Value, "Value of Stepper must be different from bindingObject's Value.");
- _stepper.BindingContext = bindingObject;
- _stepper.SetBinding(Stepper.ValueProperty, "Value");
- Assert.AreEqual(_stepper.Value, bindingObject.Value, "Value of bindingObject & Value of Stepper should be same.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property Increment is readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.Stepper.Increment A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Increment_READ_WRITE()
- {
- /* TEST CODE */
- _stepper.Increment = 3.0;
- Assert.AreEqual(3.0, _stepper.Increment);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property Maximum is readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.Stepper.Maximum A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Maximum_READ_WRITE()
- {
- /* TEST CODE */
- _stepper.Maximum = 5.0;
- Assert.AreEqual(5.0, _stepper.Maximum);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property Minimum is readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.Stepper.Minimum A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Minimum_READ_WRITE()
- {
- /* TEST CODE */
- _stepper.Minimum = 5.0;
- Assert.AreEqual(5.0, _stepper.Minimum);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property Value is readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.Stepper.Value A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void Value_READ_WRITE()
- {
- /* TEST CODE */
- _stepper.Value = 5.0;
- Assert.AreEqual(5.0, _stepper.Value);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check return Stepper configuration")]
- [Property("SPEC", "Xamarin.Forms.Stepper.On<T> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void On_CONFIGURATION_METHOD()
- {
- /*TEST CODE*/
- _stepper.Value = 12.3;
- var myConfig = _stepper.On<IConfigPlatform>();
- Assert.IsInstanceOf<IPlatformElementConfiguration<IConfigPlatform, Stepper>>(myConfig, "myConfig should be a instance of IPlatformElementConfiguration");
- Assert.IsInstanceOf<Stepper>(myConfig.Element, "myConfig.Element should be a instance of Stepper");
- Assert.AreEqual(12.3, myConfig.Element.Value, "Value of myConfig.Element value & Value of _sStepper should be equal");
- }
- }
-}
-
+++ /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 NUnit.Framework.TUnit;
-using System.IO;
-using System.Threading;
-using System.Threading.Tasks;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.StreamImageSource test")]
- public class StreamImageSourceTests : StreamImageSource
- {
-
- private static StreamImageSource _streamImageSource;
- private static bool _flagOnPropertyChanged, _flagStreamFunction;
-
- protected override void OnPropertyChanged(string propertyName)
- {
- _flagOnPropertyChanged = true;
- base.OnPropertyChanged(propertyName);
- }
-
- private static Task<Stream> StreamFunction(CancellationToken cancelToken)
- {
- _flagStreamFunction = true;
- return null;
- }
-
- private static Task<Stream> StreamFunction2(CancellationToken cancelToken)
- {
- return null;
- }
-
- [SetUp]
- public void Setup()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Page CLASS: Setup---------------------------------");
- _streamImageSource = new StreamImageSource();
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Page CLASS: Teardown------------------------------");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a StreamImageSource instance. Check whether object is successfully created or not.")]
- [Property("SPEC", "Xamarin.Forms.StreamImageSource.StreamImageSource C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void StreamImageSource_INIT()
- {
- /* TEST CODE */
- var streamImageSource = new StreamImageSource();
- Assert.IsNotNull(streamImageSource, "StreamImageSource object should be Not Null after initializing");
- Assert.IsInstanceOf<StreamImageSource>(streamImageSource);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the StreamProperty is readable.")]
- [Property("SPEC", "Xamarin.Forms.StreamImageSource.StreamProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void StreamProperty_GET()
- {
- /* PRECONDITION
- * 1. Initiate two StreamImageSource.
- * 2. Set Stream for two StreamImageSource is different.
- */
- StreamImageSource streamImageSource1 = new StreamImageSource();
- streamImageSource1.Stream = StreamFunction;
- StreamImageSource streamImageSource2 = new StreamImageSource();
- streamImageSource2.Stream = StreamFunction2;
- Assert.AreNotEqual(streamImageSource1.Stream, streamImageSource2.Stream, "Stream of two StreamImageSource should be different before set binding.");
- /*TEST CODE*/
- streamImageSource1.BindingContext = streamImageSource2;
- streamImageSource1.SetBinding(StreamImageSource.StreamProperty, "Stream");
- Assert.AreEqual(streamImageSource1.Stream, streamImageSource2.Stream, "Stream of two StreamImageSource should be same after set binding.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the Stream is readable and writable or not")]
- [Property("SPEC", "Xamarin.Forms.StreamImageSource.Stream A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void Stream_SET_GET()
- {
- /* TEST CODE */
- _streamImageSource.Stream = StreamFunction;
- var stream = _streamImageSource.Stream;
- _flagStreamFunction = false;
- stream(new CancellationToken());
- Assert.IsTrue(_flagStreamFunction, "_flagStreamFunction should be true after StreamFunction is called.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the OnPropertyChanged is called after change value of stream or not")]
- [Property("SPEC", "Xamarin.Forms.StreamImageSource.OnPropertyChanged A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void OnPropertyChanged_CHECK()
- {
- /* TEST CODE */
- StreamImageSourceTests streamImageSource = new StreamImageSourceTests();
- _flagOnPropertyChanged = false;
- streamImageSource.Stream = StreamFunction;
- Assert.IsTrue(_flagOnPropertyChanged, "_flagOnPropertyChanged should be true after change Stream property");
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System.Collections.Generic;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.SearchBar test")]
- public class StyleTests
- {
- private static Style _style;
-
- [SetUp]
- public void Setup()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Page CLASS: Setup---------------------------------");
- var typeTypeConverter = new TypeTypeConverter();
- _style = new Style(typeTypeConverter.GetType());
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Page CLASS: Teardown------------------------------");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a Style instance. Check whether object is successfully created or not.")]
- [Property("SPEC", "Xamarin.Forms.Style.Style C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void Style_INIT()
- {
- /* TEST CODE */
- var typeTypeConverter = new TypeTypeConverter();
- var style = new Style(typeTypeConverter.GetType());
- Assert.IsNotNull(style, "Style object should be Not Null after initializing");
- Assert.IsInstanceOf<Style>(style);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ApplyToDerivedTypes property is readable and writable or not")]
- [Property("SPEC", "Xamarin.Forms.Style.ApplyToDerivedTypes A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void ApplyToDerivedTypes_SET_GET()
- {
- /* TEST CODE */
- _style.ApplyToDerivedTypes = false;
- Assert.IsFalse(_style.ApplyToDerivedTypes, "_style.ApplyToDerivedTypes should be false after set false");
- _style.ApplyToDerivedTypes = true;
- Assert.IsTrue(_style.ApplyToDerivedTypes, "_style.ApplyToDerivedTypes should be true after set true");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether BaseResourceKey property is readable and writable or not")]
- [Property("SPEC", "Xamarin.Forms.Style.BaseResourceKey A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void BaseResourceKey_SET_GET()
- {
- /* TEST CODE */
- _style.BaseResourceKey = "Base Resource Key";
- Assert.AreEqual("Base Resource Key", _style.BaseResourceKey, "_style.BaseResourceKey should equal to set value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether CanCascade property is readable and writable or not")]
- [Property("SPEC", "Xamarin.Forms.Style.CanCascade A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void CanCascade_SET_GET()
- {
- /* TEST CODE */
- _style.CanCascade = false;
- Assert.IsFalse(_style.CanCascade, "_style.CanCascade should be false after set false");
- _style.CanCascade = true;
- Assert.IsTrue(_style.CanCascade, "_style.CanCascade should be true after set true");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Class property is readable and writable or not")]
- [Property("SPEC", "Xamarin.Forms.Style.Class A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void Class_SET_GET()
- {
- /* TEST CODE */
- _style.Class = "StyleTests";
- Assert.AreEqual("StyleTests", _style.Class, "_style.Class should equal to set value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether BasedOn property is readable and writable or not")]
- [Property("SPEC", "Xamarin.Forms.Style.BasedOn A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void BasedOn_SET_GET()
- {
- /* TEST CODE */
- _style.BaseResourceKey = "Base Resource Key";
- var typeTypeConverter = new TypeTypeConverter();
- var style = new Style(typeTypeConverter.GetType());
- style.BasedOn = _style;
- Assert.AreEqual("Base Resource Key", style.BasedOn.BaseResourceKey, "style.BasedOn should equal to set Style.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Behaviors property is readable or not")]
- [Property("SPEC", "Xamarin.Forms.Style.Behaviors A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void Behaviors_GET()
- {
- /* TEST CODE */
- var behaviors = _style.Behaviors;
- Assert.IsNotNull(behaviors, "_style.Behaviors should not null");
- Assert.IsInstanceOf<IList<Behavior>>(behaviors, "_style.Behaviors should be List of Behavior");
- foreach (Behavior bh in behaviors)
- {
- Assert.IsNotNull(bh, "Each Behavior in list should not null");
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Setters property is readable or not")]
- [Property("SPEC", "Xamarin.Forms.Style.Setters A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void Setters_GET()
- {
- /* TEST CODE */
- var setters = _style.Setters;
- Assert.IsNotNull(setters, "_style.Setters should not null");
- Assert.IsInstanceOf<IList<Setter>>(setters, "_style.Setters should be List of Setter");
- foreach (var setter in setters)
- {
- Assert.IsNotNull(setter, "Each Setter in list should not null");
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Triggers property is readable or not")]
- [Property("SPEC", "Xamarin.Forms.Style.Triggers A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void Triggers_GET()
- {
- /* TEST CODE */
- var triggers = _style.Triggers;
- Assert.IsNotNull(triggers, "_style.Triggers should not null");
- Assert.IsInstanceOf<IList<TriggerBase>>(triggers, "_style.Triggers should be List of TriggerBase");
- foreach (var trigger in triggers)
- {
- Assert.IsNotNull(trigger, "Each Trigger in list should not null");
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether TargetType property is readable or not")]
- [Property("SPEC", "Xamarin.Forms.Style.TargetType A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")]
- public void TargetType_GET()
- {
- /* TEST CODE */
- var typeTypeConverter = new TypeTypeConverter();
- var style = new Style(typeTypeConverter.GetType());
- var targetType = style.TargetType;
- Assert.IsNotNull(targetType, "_style.TargetType should not null.");
- Assert.AreEqual(targetType, typeTypeConverter.GetType(), "style.TargetType should equal to set value.");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-using System.Collections.Generic;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.Device.Styles Tests")]
-
- public class StylesTests
- {
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("StylesTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("StylesTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property BodyStyle is readable.")]
- [Property("SPEC", "Xamarin.Forms.Device.Styles.BodyStyle A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void BodyStyle_READ_ONLY()
- {
- /* TEST CODE */
- var style = Device.Styles.BodyStyle;
-
- Assert.IsInstanceOf<Style>(Device.Styles.BodyStyle, "Should be instance of Style.");
- Assert.AreEqual(Device.Styles.BodyStyleKey, style.BaseResourceKey, "Base resource key shoud be BodyStyle");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property BodyStyleKey is readable.")]
- [Property("SPEC", "Xamarin.Forms.Device.Styles.BodyStyleKey A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void BodyStyleKey_READ_ONLY()
- {
- /* TEST CODE */
- var styleKey = Device.Styles.BodyStyleKey;
-
- Assert.IsInstanceOf<string>(Device.Styles.BodyStyleKey, "Should be instance of String.");
- Assert.AreEqual(Device.Styles.BodyStyleKey, "BodyStyle", "Base resource key shoud be BodyStyle");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property CaptionStyle is readable.")]
- [Property("SPEC", "Xamarin.Forms.Device.Styles.CaptionStyle A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void CaptionStyle_READ_ONLY()
- {
- /* TEST CODE */
- var style = Device.Styles.CaptionStyle;
-
- Assert.IsInstanceOf<Style>(Device.Styles.CaptionStyle, "Should be instance of Style.");
- Assert.AreEqual(Device.Styles.CaptionStyleKey, style.BaseResourceKey, "Base resource key shoud be CaptionStyle");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property CaptionStyleKey is readable.")]
- [Property("SPEC", "Xamarin.Forms.Device.Styles.CaptionStyleKey A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void CaptionStyleKey_READ_ONLY()
- {
- /* TEST CODE */
- var styleKey = Device.Styles.CaptionStyleKey;
-
- Assert.IsInstanceOf<string>(Device.Styles.CaptionStyleKey, "Should be instance of String.");
- Assert.AreEqual(Device.Styles.CaptionStyleKey, "CaptionStyle", "Base resource key shoud be CaptionStyle");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property ListItemDetailTextStyle is readable.")]
- [Property("SPEC", "Xamarin.Forms.Device.Styles.ListItemDetailTextStyle A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void ListItemDetailTextStyle_READ_ONLY()
- {
- /* TEST CODE */
- var style = Device.Styles.ListItemDetailTextStyle;
-
- Assert.IsInstanceOf<Style>(Device.Styles.ListItemDetailTextStyle, "Should be instance of Style.");
- Assert.AreEqual(Device.Styles.ListItemDetailTextStyleKey, style.BaseResourceKey, "Base resource key shoud be ListItemDetailTextStyle");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property ListItemDetailTextStyleKey is readable.")]
- [Property("SPEC", "Xamarin.Forms.Device.Styles.ListItemDetailTextStyleKey A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void ListItemDetailTextStyleKey_READ_ONLY()
- {
- /* TEST CODE */
- var styleKey = Device.Styles.ListItemDetailTextStyleKey;
-
- Assert.IsInstanceOf<string>(Device.Styles.ListItemDetailTextStyleKey, "Should be instance of String.");
- Assert.AreEqual(Device.Styles.ListItemDetailTextStyleKey, "ListItemDetailTextStyle", "Base resource key shoud be ListItemDetailTextStyle");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property ListItemTextStyle is readable.")]
- [Property("SPEC", "Xamarin.Forms.Device.Styles.ListItemTextStyle A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void ListItemTextStyle_READ_ONLY()
- {
- /* TEST CODE */
- var style = Device.Styles.ListItemTextStyle;
-
- Assert.IsInstanceOf<Style>(Device.Styles.ListItemTextStyle, "Should be instance of Style.");
- Assert.AreEqual(Device.Styles.ListItemTextStyleKey, style.BaseResourceKey, "Base resource key shoud be ListItemTextStyle");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property ListItemTextStyleKey is readable.")]
- [Property("SPEC", "Xamarin.Forms.Device.Styles.ListItemTextStyleKey A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void ListItemTextStyleKey_READ_ONLY()
- {
- /* TEST CODE */
- var styleKey = Device.Styles.ListItemTextStyleKey;
-
- Assert.IsInstanceOf<string>(Device.Styles.ListItemTextStyleKey, "Should be instance of String.");
- Assert.AreEqual(Device.Styles.ListItemTextStyleKey, "ListItemTextStyle", "Base resource key shoud be ListItemTextStyle");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property SubtitleStyle is readable.")]
- [Property("SPEC", "Xamarin.Forms.Device.Styles.SubtitleStyle A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void SubtitleStyle_READ_ONLY()
- {
- /* TEST CODE */
- var style = Device.Styles.SubtitleStyle;
-
- Assert.IsInstanceOf<Style>(Device.Styles.SubtitleStyle, "Should be instance of Style.");
- Assert.AreEqual(Device.Styles.SubtitleStyleKey, style.BaseResourceKey, "Base resource key shoud be SubtitleStyle");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property SubtitleStyleKey is readable.")]
- [Property("SPEC", "Xamarin.Forms.Device.Styles.SubtitleStyleKey A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void SubtitleStyleKey_READ_ONLY()
- {
- /* TEST CODE */
- var styleKey = Device.Styles.SubtitleStyleKey;
-
- Assert.IsInstanceOf<string>(Device.Styles.SubtitleStyleKey, "Should be instance of String.");
- Assert.AreEqual(Device.Styles.SubtitleStyleKey, "SubtitleStyle", "Base resource key shoud be SubtitleStyle");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property TitleStyle is readable.")]
- [Property("SPEC", "Xamarin.Forms.Device.Styles.TitleStyle A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void TitleStyle_READ_ONLY()
- {
- /* TEST CODE */
- var style = Device.Styles.TitleStyle;
-
- Assert.IsInstanceOf<Style>(Device.Styles.TitleStyle, "Should be instance of Style.");
- Assert.AreEqual(Device.Styles.TitleStyleKey, style.BaseResourceKey, "Base resource key shoud be TitleStyle");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property TitleStyleKey is readable.")]
- [Property("SPEC", "Xamarin.Forms.Device.Styles.TitleStyleKey A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void TitleStyleKey_READ_ONLY()
- {
- /* TEST CODE */
- var styleKey = Device.Styles.TitleStyleKey;
-
- Assert.IsInstanceOf<string>(Device.Styles.TitleStyleKey, "Should be instance of String.");
- Assert.AreEqual(Device.Styles.TitleStyleKey, "TitleStyle", "Base resource key shoud be TitleStyle");
- }
- }
-}
+++ /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.Threading;
-using System.Threading.Tasks;
-using NUnit.Framework;
-using NUnit.Framework.TUnit;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class SwitchTests
- {
- private bool _flagToggled;
- [SetUp]
- public void Init()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Setup-------------------------");
- }
-
- [TearDown]
- public void Destroy()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Teardown-------------------------");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a Switch object")]
- [Property("SPEC", "Xamarin.Forms.Switch.Switch C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void Switch_INIT()
- {
- /* TEST CODE */
- var mySwitch = new Switch();
- Assert.IsNotNull(mySwitch, "Instance Switch is null");
- Assert.IsInstanceOf<Switch>(mySwitch);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property IsToggled is readable and settable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.Switch.IsToggled A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void IsToggled_SET_GET()
- {
- /* PRECONDITION
- * 1. Initiate a Switch
- */
- var mySwitch = new Switch();
- Assert.IsNotNull(mySwitch, "Instance Switch is null");
-
- /* TEST CODE */
- mySwitch.IsToggled = true;
- Assert.AreEqual(true, mySwitch.IsToggled, "IsToggled should be same with value set.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check value of IsToggled of two other Switch after set binding.")]
- [Property("SPEC", "Xamarin.Forms.Switch.IsToggledProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void IsToggledProperty_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Initiate two Switch.
- * 2. Set IsToggled for two Switch is different.
- */
- var mySwitch1 = new Switch();
- Assert.IsNotNull(mySwitch1, "Instance Switch is null");
- mySwitch1.IsToggled = true;
- var mySwitch2 = new Switch();
- Assert.IsNotNull(mySwitch2, "Instance Switch is null");
- mySwitch2.IsToggled = false;
- Assert.AreNotEqual(mySwitch2.IsToggled, mySwitch1.IsToggled, "IsToggled of two TextCells should be different befor set binding.");
-
- /* TEST CODE */
- mySwitch1.BindingContext = mySwitch2;
- mySwitch1.SetBinding(Switch.IsToggledProperty, "IsToggled");
- Assert.AreEqual(mySwitch2.IsToggled, mySwitch2.IsToggled, "IsToggled of two TextCells should be same after set binding.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check type and value return of method On<IConfigPlatform>().")]
- [Property("SPEC", "Xamarin.Forms.Switch.On<T> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void On_CONFIGURATION_METHOD()
- {
- /* PRECONDITION
- * 1. Initiate a Switch
- */
- var mySwitch = new Switch();
- Assert.IsNotNull(mySwitch, "Instance Switch is null");
-
- /*TEST CODE*/
- mySwitch.IsToggled = true;
- var myConfig = mySwitch.On<IConfigPlatform>();
- Assert.IsInstanceOf<IPlatformElementConfiguration<IConfigPlatform, Switch>>(myConfig, "myConfig should be a instance of IPlatformElementConfiguration");
- Assert.IsInstanceOf<Switch>(myConfig.Element, "myConfig.Element should be a instance of Switch");
- Assert.AreEqual(true, myConfig.Element.IsToggled, "IsToggled of myConfig.Element value & source of Switch should be equal");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Toggled event is called after change IsToggled.")]
- [Property("SPEC", "Xamarin.Forms.Switch.Toggled E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void Toggled_CHECK_EVENT()
- {
- /* PRECONDITION
- * 1. Initiate a Switch
- */
- var mySwitch = new Switch();
- /* TEST CODE */
- _flagToggled = false;
- mySwitch.IsToggled = false;
- mySwitch.Toggled += (sender, e) =>
- {
- _flagToggled = true;
- };
- mySwitch.IsToggled = true;
-
- Thread.Sleep(1000);
- Assert.IsTrue(_flagToggled, "Flag should be true after Toggled event is called");
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class SwitchCellTests
- {
- SwitchCell _switchcell;
- [SetUp]
- public void SetUp()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "SwitchCell CLASS: Setup---------------------------------");
- _switchcell = new SwitchCell();
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "SwitchCell CLASS: TearDown---------------------------------");
- _switchcell = null;
- }
-
- [Test]
- [Category("P1")]
- [Description(" Create an SwitchCell instance. Check whether object is successfully created or not.")]
- [Property("SPEC", "Xamarin.Forms.SwitchCell.SwitchCell C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void SwitchCell_CONST()
- {
- _switchcell = new SwitchCell();
- Assert.IsInstanceOf<SwitchCell>(_switchcell, "_switchcell is an intance of SwitchCell");
- Assert.IsNotNull(_switchcell, "Can't successfully create SwitchCell object.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of On are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.SwitchCell.On A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void On_PROPERTY_SET_GET()
- {
- /*TEST CODE*/
- _switchcell.On = true;
- Assert.True(_switchcell.On, "Retrieved On value is not equal to set value");
- _switchcell.On = false;
- Assert.False(_switchcell.On, "Retrieved On value is not equal to set value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of Text are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.SwitchCell.Text A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void Text_PROPERTY_SET_GET()
- {
- /*TEST CODE*/
- var mText01 = "Vietnamese";
- var mText02 = "Calibri";
- _switchcell.Text = mText01;
- Assert.AreEqual(mText01, _switchcell.Text, "Retrieved Text value is not equal to set value");
- _switchcell.Text = mText02;
- Assert.AreEqual(mText02, _switchcell.Text, "Retrieved Text value is not equal to set value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether TextProperty(BindableProperty) is working correctly or not")]
- [Property("SPEC", "Xamarin.Forms.SwitchCell.TextProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void TextProperty_PROPERTY_READ_ONLY()
- {
- /*TEST CODE*/
- var mTextVietNam = "Vietnamese";
- var mTextEnglish = "English";
- _switchcell.Text = mTextVietNam;
- var mButton = new Button()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- Text = mTextEnglish
- };
- Assert.AreNotEqual(mButton.Text, _switchcell.Text, "Text of _switchcell value must be different form Text of mButton value");
- _switchcell.BindingContext = mButton;
- _switchcell.SetBinding(SwitchCell.TextProperty, "Text");
- Assert.AreEqual(mButton.Text, _switchcell.Text, "Text of mButton value & Text of _switchcell value should be same");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether TextProperty(BindableProperty) is working correctly or not")]
- [Property("SPEC", "Xamarin.Forms.SwitchCell.OnProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void OnProperty_PROPERTY_READ_ONLY()
- {
- /*TEST CODE*/
- var mTextEnglish = "English";
- _switchcell.On = false;
- var mSwitchCell = new SwitchCell()
- {
- On = true,
- Text = mTextEnglish
- };
- Assert.AreNotEqual(mSwitchCell.On, _switchcell.On, "On of _switchcell value must be different form On of mSwitchCell value");
- _switchcell.BindingContext = mSwitchCell;
- _switchcell.SetBinding(SwitchCell.OnProperty, "On");
- Assert.AreEqual(mSwitchCell.On, _switchcell.On, "On of mSwitchCell value & On of _switchcell value should be same");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether flagOnChanged invoke or not when text of editor is changed")]
- [Property("SPEC", "Xamarin.Forms.SwitchCell.OnChanged E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void OnChanged_CHECK_EVENT()
- {
- /*TEST CODE*/
- _switchcell.On = false;
- bool flagChanged = false;
- _switchcell.OnChanged += (o, e) =>
- {
- flagChanged = true;
- };
- _switchcell.On = true;
- Assert.True(flagChanged, "OnChanged event should be invoked.");
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class TabbedPageTests
- {
- TabbedPage _tablepage;
- internal class MyTabbedPage : TabbedPage
- {
- protected override Page CreateDefault(object item)
- {
- return base.CreateDefault(item);
- }
-
- public Page testCreateDefault()
- {
- return CreateDefault("Hello");
- }
- }
-
- [SetUp]
- public void SetUp()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "TabbedPage CLASS: Setup---------------------------------");
- _tablepage = new TabbedPage();
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "TabbedPage CLASS: TearDown---------------------------------");
- _tablepage = null;
- }
-
- [Test]
- [Category("P1")]
- [Description(" Create an TabbedPage instance. Check whether object is successfully created or not.")]
- [Property("SPEC", "Xamarin.Forms.TabbedPage.TabbedPage C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void TabbedPage_CONST()
- {
- _tablepage = new TabbedPage();
- Assert.IsInstanceOf<TabbedPage>(_tablepage, "_switchcell is an intance of TabbedPage");
- Assert.IsNotNull(_tablepage, "Can't successfully create SwitchCell object.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of BarBackgroundColor are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.TabbedPage.BarBackgroundColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void BarBackgroundColor_PROPERTY_SET_GET()
- {
- /*TEST CODE*/
- var mColorRed = Color.Red;
- var mColorBlue = Color.Blue;
- _tablepage.BarBackgroundColor = mColorRed;
- Assert.AreEqual(mColorRed, _tablepage.BarBackgroundColor, "Retrieved BarBackgroundColor value is not equal to set value");
- _tablepage.BarBackgroundColor = mColorBlue;
- Assert.AreEqual(mColorBlue, _tablepage.BarBackgroundColor, "Retrieved BarBackgroundColor value is not equal to set value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of BarTextColor are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.TabbedPage.BarTextColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void BarTextColor_PROPERTY_SET_GET()
- {
- /*TEST CODE*/
- var mColorGreend = Color.Green;
- var mColorGray = Color.Gray;
- _tablepage.BarTextColor = mColorGreend;
- Assert.AreEqual(mColorGreend, _tablepage.BarTextColor, "Retrieved BarTextColor value is not equal to set value");
- _tablepage.BarTextColor = mColorGray;
- Assert.AreEqual(mColorGray, _tablepage.BarTextColor, "Retrieved BarTextColor value is not equal to set value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether BarBackgroundColorProperty(BindableProperty) is working correctly or not")]
- [Property("SPEC", "Xamarin.Forms.TabbedPage.BarBackgroundColorProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void BarBackgroundColorProperty_PROPERTY_READ_ONLY()
- {
- /*TEST CODE*/
- var mColor1 = Color.Yellow;
- var mColor2 = Color.Pink;
- _tablepage.BarBackgroundColor = mColor1;
- var mTablePage = new TabbedPage()
- {
- BarBackgroundColor = mColor2
- };
- Assert.AreNotEqual(mTablePage.BarBackgroundColor, _tablepage.BarBackgroundColor, "BarBackgroundColor of _tablepage value must be different form BarBackgroundColor of mTablePage value");
- _tablepage.BindingContext = mTablePage;
- _tablepage.SetBinding(TabbedPage.BarBackgroundColorProperty, "BarBackgroundColor");
- Assert.AreEqual(mTablePage.BarBackgroundColor, _tablepage.BarBackgroundColor, "BarBackgroundColor of mTablePage value & BarBackgroundColor of _tablepage value should be same");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether BarTextColorProperty(BindableProperty) is working correctly or not")]
- [Property("SPEC", "Xamarin.Forms.TabbedPage.BarTextColorProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void BarTextColorProperty_PROPERTY_READ_ONLY()
- {
- /*TEST CODE*/
- var mColor1 = Color.Teal;
- var mColor2 = Color.Accent;
- _tablepage.BarTextColor = mColor1;
- var mTablePage = new TabbedPage()
- {
- BarTextColor = mColor2
- };
- Assert.AreNotEqual(mTablePage.BarTextColor, _tablepage.BarTextColor, "BarTextColor of _tablepage value must be different form BarTextColor of mTablePage value");
- _tablepage.BindingContext = mTablePage;
- _tablepage.SetBinding(TabbedPage.BarTextColorProperty, "BarTextColor");
- Assert.AreEqual(mTablePage.BarTextColor, _tablepage.BarTextColor, "BarTextColor of mTablePage value & BarTextColor of _tablepage value should be same");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check return TabbedPage configuration")]
- [Property("SPEC", "Xamarin.Forms.TabbedPage.On<T> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void On_CONFIGURATION_METHOD()
- {
- /*TEST CODE*/
- var mColor = Color.Red;
- _tablepage.BarTextColor = mColor;
- var myConfig = _tablepage.On<IConfigPlatform>();
- Assert.IsInstanceOf<IPlatformElementConfiguration<IConfigPlatform, TabbedPage>>(myConfig, "myConfig should be a instance of IPlatformElementConfiguration");
- Assert.IsInstanceOf<TabbedPage>(myConfig.Element, "myConfig.Element should be a instance of TabbedPage");
- Assert.AreEqual(mColor, myConfig.Element.BarTextColor, "BarTextColor of myConfig.Element value & BarTextColor of _editor should be to equal");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check override method CreateDefault is invoked when it is changed.")]
- [Property("SPEC", "Xamarin.Forms.TabbedPage.CreateDefault M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void CreateDefault_OVERRIDE_METHOD()
- {
- /**TEST CODE**/
- var mMyTabbedPage = new MyTabbedPage();
- Assert.AreEqual("Hello", mMyTabbedPage.testCreateDefault().Title);
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class TableRootTests
- {
- [SetUp]
- public void Init()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Setup-------------------------");
- }
-
- [TearDown]
- public void Destroy()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Teardown-------------------------");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a TableRoot object")]
- [Property("SPEC", "Xamarin.Forms.TableRoot.TableRoot C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void TableRoot_INIT()
- {
- /* TEST CODE */
- var tableRoot = new TableRoot();
- Assert.IsNotNull(tableRoot, "Instance TableRoot is null");
- Assert.IsInstanceOf<TableRoot>(tableRoot);
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a TableRoot object")]
- [Property("SPEC", "Xamarin.Forms.TableRoot.TableRoot C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("COVPARAM", "string")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void TableRoot_INIT_WITH_PRAMETER()
- {
- /* TEST CODE */
- var tableRoot = new TableRoot("Title");
- Assert.IsNotNull(tableRoot, "Instance TableRoot is null");
- Assert.IsInstanceOf<TableRoot>(tableRoot);
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class TableSectionTests
- {
- [SetUp]
- public void Init()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Setup-------------------------");
- }
-
- [TearDown]
- public void Destroy()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Teardown-------------------------");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a TableSection object")]
- [Property("SPEC", "Xamarin.Forms.TableSection.TableSection C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void TableSection_INIT()
- {
- /* TEST CODE */
- var tableSection = new TableSection();
- Assert.IsNotNull(tableSection, "Instance TableRoot is null");
- Assert.IsInstanceOf<TableSection>(tableSection);
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a TableSection object")]
- [Property("SPEC", "Xamarin.Forms.TableSection.TableSection C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("COVPARAM", "string")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void TableSection_INIT_WITH_PRAMETER()
- {
- /* TEST CODE */
- var tableSection = new TableSection("Title");
- Assert.IsNotNull(tableSection, "Instance TableRoot is null");
- Assert.IsInstanceOf<TableSection>(tableSection);
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.TableSectionBase test")]
- public class TableSectionBaseTests
- {
- [SetUp]
- public void Setup()
- {
- Console.WriteLine("PropertyChangingEventArgsTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("PropertyChangingEventArgsTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create an TableSectionBase object.")]
- [Property("SPEC", "Xamarin.Forms.TableSectionBase.TableSectionBase C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void TableSectionBase_INIT()
- {
- /* TEST CODE */
- TableSectionBase tableSectionBase = new TableSection();
- Assert.IsNotNull(tableSectionBase, "TableSectionBase Instance is null");
- Assert.IsInstanceOf<TableSectionBase>(tableSectionBase, "Should be an instance of TableSectionBase type.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create an TableSectionBase object.")]
- [Property("SPEC", "Xamarin.Forms.TableSectionBase.TableSectionBase C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- [Property("COVPARAM", "string")]
- public void TableSectionBase_INIT_WITH_STRING()
- {
- /* TEST CODE */
- TableSectionBase tableSectionBase = new TableSection("Tizen");
- Assert.IsNotNull(tableSectionBase, "TableSectionBase Instance is null");
- Assert.IsInstanceOf<TableSectionBase>(tableSectionBase, "Should be an instance of TableSectionBase type.");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check whether property of TitleProperty's bound or not.")]
- [Property("SPEC", "Xamarin.Forms.TableSectionBase.TouchPointsProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void TouchPointsProperty_CHECK_BINDABLE()
- {
- /* TEST CODE */
- TableSectionBase tableSectionBase = new TableSection();
- Page page = new Page();
- var mFirstTitleProperty = "Tizen";
- var mSecondTitleProperty = "TizenNew";
-
- tableSectionBase.Title = mFirstTitleProperty;
- page.Title = mSecondTitleProperty;
-
- Assert.AreNotEqual(tableSectionBase.Title, page.Title, "TitleProperty value must be different.");
- tableSectionBase.BindingContext = page;
- tableSectionBase.SetBinding(TableSectionBase.TitleProperty, "Title");
- Assert.AreEqual(tableSectionBase.Title, page.Title, "After binding, values should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Title Property is writeable and readable.")]
- [Property("SPEC", "Xamarin.Forms.TableSectionBase.Title A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Title_READ_WRITE()
- {
- /* TEST CODE */
- TableSectionBase tableSectionBase = new TableSection();
-
- tableSectionBase.Title = "Tizen";
- Assert.AreEqual(tableSectionBase.Title, "Tizen", "Not returning expect title(Tizen).");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether TitleProperty(BindableProperty) is working correctly or not.")]
- [Property("SPEC", "Xamarin.Forms.TableSectionBase.TitleProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void TitleProperty_PROPERTY()
- {
- /* TEST CODE */
- TableSectionBase tableSectionBase1 = new TableSection();
- tableSectionBase1.Title = "Title 1";
- TableSectionBase tableSectionBase2 = new TableSection()
- {
- Title = "Title 2"
- };
- Assert.AreNotEqual(tableSectionBase1.Title, tableSectionBase2.Title, "Title should be different between two TableSectionBase objects");
- tableSectionBase1.BindingContext = tableSectionBase2;
- tableSectionBase1.SetBinding(TableSectionBase.TitleProperty, "Title");
- Assert.AreEqual(tableSectionBase1.Title, tableSectionBase2.Title, "Title should be same between two TableSectionBase objects");
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System.Collections.Generic;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
-
-
- [TestFixture]
- class TableSectionBaseTemplateTests
- {
- private int _numListPage = 10;
- private List<Page> _listPage = new List<Page>();
-
- internal class CustomizeTableSectionBase : TableSectionBase<Page>
- {
- public bool flagOnBindingContextChanged = false;
- public CustomizeTableSectionBase() : base()
- {
- }
-
- public CustomizeTableSectionBase(string title) : base(title)
- {
- }
-
- protected override void OnBindingContextChanged()
- {
- flagOnBindingContextChanged = true;
- base.OnBindingContextChanged();
- }
- }
-
- private CustomizeTableSectionBase _mTableSectionBase;
-
- [SetUp]
- public void SetUp()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "MultiPage CLASS: Setup---------------------------------");
- _mTableSectionBase = new CustomizeTableSectionBase();
- for (int i = 0; i < _numListPage; i++)
- _listPage.Add(new Page()
- {
- Title = i.ToString()
- });
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "MultiPage CLASS: Teardown---------------------------------");
- _mTableSectionBase = null;
- _listPage.Clear();
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a TableSectionBase instance. Check whether object is successfully created or not.")]
- [Property("SPEC", "Xamarin.Forms.TableSectionBase<T>.TableSectionBase C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public void TableSectionBase_INIT()
- {
- Assert.IsNotNull(_mTableSectionBase, "Cannot successfully create TableSectionBase object");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a TableSectionBase instance. Check whether object is successfully created with String argument or not.")]
- [Property("SPEC", "Xamarin.Forms.TableSectionBase<T>.TableSectionBase C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("COVPARAM", "string")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public void TableSectionBase_INIT_STRING()
- {
- var instance = new CustomizeTableSectionBase("TableSection name");
- Assert.IsNotNull(instance, "Cannot successfully create TableSectionBase object with string argument");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get and set T object via index working normally.")]
- [Property("SPEC", "Xamarin.Forms.TableSectionBase<T>.this[int] A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public void this_SET_GET()
- {
- /*TEST CODE*/
- string title1 = "Title1";
- string title2 = "Title2";
- var page1 = new Page()
- {
- Title = title1
- };
- var page2 = new Page()
- {
- Title = title2
- };
- _mTableSectionBase.Add(page1);
- Assert.AreEqual(page1, _mTableSectionBase[0], "Page object get via index should same with page1");
- Assert.AreEqual(title1, _mTableSectionBase[0].Title, "Title of Page object when get via index should equal to \"Title1\"");
-
- _mTableSectionBase[0] = page2;
- Assert.AreEqual(page2, _mTableSectionBase[0], "Page object get via index should same with page2");
- Assert.AreEqual(title2, _mTableSectionBase[0].Title, "Title of Page object when get via index should equal to \"Title2\"");
- }
-
- [Test]
- [Category("P1")]
- [Description("Add, remove child object, and check Count value.")]
- [Property("SPEC", "Xamarin.Forms.TableSectionBase<T>.Count A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public void Count_PROPERTY_GET()
- {
- /*TEST CODE*/
- for (int i = 0; i < _numListPage; i++)
- {
- _mTableSectionBase.Add(_listPage[i]);
- }
-
- Assert.AreEqual(_numListPage, _mTableSectionBase.Count, "Count should be same with _numListPage");
- for (int i = 0; i < _numListPage; i++)
- {
- _mTableSectionBase.Remove(_listPage[i]);
- }
- Assert.AreEqual(0, _mTableSectionBase.Count, "Count should equal 0 after remove all child object");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether NotifyCollectionChangedEventHandler CollectionChanged is invoked or not when add or remove child object")]
- [Property("SPEC", "Xamarin.Forms.TableSectionBase<T>.CollectionChanged E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public void CollectionChanged_CHECK_EVENT()
- {
- /*TEST CODE*/
- bool flagCollectionChanged = false;
- _mTableSectionBase.CollectionChanged += (o, e) =>
- {
- flagCollectionChanged = true;
- };
-
- _mTableSectionBase.Add(_listPage[0]);
- Assert.IsTrue(flagCollectionChanged, "flagCollectionChanged should be true after add child object.");
-
- flagCollectionChanged = false;
- _mTableSectionBase.Remove(_listPage[0]);
- Assert.IsTrue(flagCollectionChanged, "flagCollectionChanged should be true after remove child object.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether method Add working normally when add new child object")]
- [Property("SPEC", "Xamarin.Forms.TableSectionBase<T>.Add M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- [Property("COVPARAM", "T")]
- public void Add_METHOD()
- {
- /*TEST CODE*/
- _mTableSectionBase.Add(_listPage[0]);
- Assert.AreEqual(1, _mTableSectionBase.Count, "Count should equal to 1 after adding first child.");
-
- _mTableSectionBase.Add(_listPage[1]);
- Assert.AreEqual(2, _mTableSectionBase.Count, "Count should equal to 1 after adding second child.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether method Add with IEnumerable argument working normally")]
- [Property("SPEC", "Xamarin.Forms.TableSectionBase<T>.Add M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- [Property("COVPARAM", "System.Collections.Generic.IEnumerable<T>")]
- public void Add_METHOD_IENUMERABLE()
- {
- /*TEST CODE*/
- _mTableSectionBase.Add(new List<Page>());
- Assert.AreEqual(0, _mTableSectionBase.Count, "Count should equal to 0 after adding an empty List<Page>.");
-
- _mTableSectionBase.Add(_listPage);
- Assert.AreEqual(_numListPage, _mTableSectionBase.Count, "Count should equal to _numListPage after adding all element of _listPage.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether method Clear working normally")]
- [Property("SPEC", "Xamarin.Forms.TableSectionBase<T>.Clear M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public void Clear_METHOD()
- {
- /*TEST CODE*/
- _mTableSectionBase.Add(_listPage);
- Assert.AreEqual(_numListPage, _mTableSectionBase.Count, "Count should equal to _numListPage after adding all element of _listPage.");
-
- _mTableSectionBase.Clear();
- Assert.AreEqual(0, _mTableSectionBase.Count, "Count should equal to 0 after using Clear.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether method Contains working normally after ")]
- [Property("SPEC", "Xamarin.Forms.TableSectionBase<T>.Contains M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public void Contains_METHOD()
- {
- /*TEST CODE*/
- foreach (Page p in _listPage)
- {
- Assert.IsFalse(_mTableSectionBase.Contains(p), "_mTableSectionBase shouldn't contain the page before add that page");
- }
-
- _mTableSectionBase.Add(_listPage);
- foreach (Page p in _listPage)
- {
- Assert.IsTrue(_mTableSectionBase.Contains(p), "_mTableSectionBase should contain all Page in _listPage");
- _mTableSectionBase.Remove(p);
- Assert.IsFalse(_mTableSectionBase.Contains(p), "_mTableSectionBase shouldn't contain the page after remove that page from _mTableSectionBase");
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether method CopyTo working normally")]
- [Property("SPEC", "Xamarin.Forms.TableSectionBase<T>.CopyTo M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public void CopyTo_METHOD()
- {
- /*TEST CODE*/
- _mTableSectionBase.Add(_listPage);
-
- Page[] arrPage = new Page[100];
- int startIndex = 5;
- _mTableSectionBase.CopyTo(arrPage, startIndex);
-
- for (int i = 0; i < _listPage.Count; i++)
- {
- Assert.AreEqual(_listPage[i], arrPage[startIndex + i], "object number " + i + " of _listPage should equal to object number " + (startIndex + i) + " of arrPage after CopyTo arrPage");
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether method GetEnumerator working normally with foreach statement")]
- [Property("SPEC", "Xamarin.Forms.TableSectionBase<T>.GetEnumerator M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public void GetEnumerator_METHOD()
- {
- /*TEST CODE*/
- _mTableSectionBase.Add(_listPage);
- int numChild = 0;
- foreach (Page p in _mTableSectionBase)
- {
- numChild++;
- Assert.IsTrue(_listPage.Contains(p), "_listPage should contains the Page object when Enumerat");
- }
- Assert.AreEqual(_numListPage, numChild, "number child of _mTableSectionBase should equal with number element of _listPage");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether method IndexOf return valid index of each child objects")]
- [Property("SPEC", "Xamarin.Forms.TableSectionBase<T>.IndexOf M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public void IndexOf_METHOD()
- {
- /*TEST CODE*/
- Assert.IsTrue(_mTableSectionBase.IndexOf(_listPage[0]) < 0, "IndexOf should return negative number before adding child object to _mTableSectionBase");
-
- _mTableSectionBase.Add(_listPage);
- for (int i = 0; i < _listPage.Count; i++)
- {
- Assert.AreEqual(i, _mTableSectionBase.IndexOf(_listPage[i]), "Index of child object in _mTableSectionBase and _listPage should be the same");
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether method Insert working normally when insert child to specified index")]
- [Property("SPEC", "Xamarin.Forms.TableSectionBase<T>.Insert M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public void Insert_METHOD()
- {
- /*TEST CODE*/
- Assert.IsTrue(_mTableSectionBase.IndexOf(_listPage[0]) < 0, "IndexOf should return negative number before adding child object to _mTableSectionBase");
-
- _mTableSectionBase.Add(_listPage);
- for (int i = 0; i < _listPage.Count; i++)
- {
- Assert.AreEqual(_listPage[i].Title, _mTableSectionBase[i].Title, "Title of child object at index " + i + " in _mTableSectionBase and _listPage should be the same");
- }
- Assert.AreEqual(_listPage.Count, _mTableSectionBase.Count, "_mTableSectionBase and _listPage should have the same Count value");
-
- int numOriginal = _listPage.Count;
- int insertIndex = 5;
- string insertTitle = "New Title";
- Page insertPage = new Page()
- {
- Title = insertTitle
- };
- _mTableSectionBase.Insert(insertIndex, insertPage);
-
- Assert.AreEqual(numOriginal + 1, _mTableSectionBase.Count, "number of child object in _mTableSectionBase should increase by 1");
- Assert.AreEqual(insertPage, _mTableSectionBase[insertIndex], "child object at insertIndex and original object should be the same");
- Assert.AreEqual(insertPage.Title, _mTableSectionBase[insertIndex].Title, "child object at insertIndex and original object should have same Title");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether method Remove working normally when remove child")]
- [Property("SPEC", "Xamarin.Forms.TableSectionBase<T>.Remove M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public void Remove_METHOD()
- {
- /*TEST CODE*/
- Assert.IsFalse(_mTableSectionBase.Remove(_listPage[0]), "Remove should return false when remove the object isn't an child object");
-
- _mTableSectionBase.Add(_listPage);
- Assert.AreEqual(_listPage.Count, _mTableSectionBase.Count, "_mTableSectionBase and _listPage should have the same Count value");
-
- int numOriginal = _listPage.Count;
- _mTableSectionBase.Remove(_listPage[0]);
- Assert.AreEqual(numOriginal - 1, _mTableSectionBase.Count, "number of child object in _mTableSectionBase should decrease by 1");
- Assert.IsTrue(_mTableSectionBase.IndexOf(_listPage[0]) < 0, "The object that is removed shouldn't exist in the child objets");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether method RemoveAt working normally when remove child at specified index")]
- [Property("SPEC", "Xamarin.Forms.TableSectionBase<T>.RemoveAt M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public void RemoveAt_METHOD()
- {
- /*TEST CODE*/
- _mTableSectionBase.Add(_listPage);
- Assert.AreEqual(_listPage.Count, _mTableSectionBase.Count, "_mTableSectionBase and _listPage should have the same Count value");
-
- int numOriginal = _listPage.Count;
- int indexRemove = 5;
- Page removedPage = _listPage[indexRemove];
-
- _mTableSectionBase.RemoveAt(indexRemove);
- Assert.AreEqual(numOriginal - 1, _mTableSectionBase.Count, "number of child object in _mTableSectionBase should decrease by 1");
- Assert.IsTrue(_mTableSectionBase.IndexOf(removedPage) < 0, "The object that is removed shouldn't exist in the child objets");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check override method OnBindingContextChanged is invoked.")]
- [Property("SPEC", "Xamarin.Forms.TableSectionBase<T>.OnBindingContextChanged M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public void OnBindingContextChanged_OVERRIDE_METHOD()
- {
- /*TEST CODE*/
- Assert.False(_mTableSectionBase.flagOnBindingContextChanged, "flagOnBindingContextChanged should be false before set binding context");
- var mSrc = new CustomizeTableSectionBase();
- _mTableSectionBase.BindingContext = mSrc;
- Assert.True(_mTableSectionBase.flagOnBindingContextChanged, "flagOnBindingContextChanged should be true after set binding context");
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class TableViewTests
- {
- TableView _tableview;
- static bool _flagOnBindingContextChanged, _flagOnModelChanged, _flagOnSizeRequest;
- internal class SubTableView : TableView
- {
- protected override void OnBindingContextChanged()
- {
- _flagOnBindingContextChanged = true;
- base.OnBindingContextChanged();
- }
-
- protected override void OnModelChanged()
- {
- _flagOnModelChanged = true;
- base.OnModelChanged();
- }
-
- protected override SizeRequest OnSizeRequest(double widthConstraint, double heightConstraint)
- {
- _flagOnSizeRequest = true;
- return base.OnSizeRequest(widthConstraint, heightConstraint);
- }
- }
- [SetUp]
- public void SetUp()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "TableView CLASS: Setup---------------------------------");
- _tableview = new TableView();
- _flagOnBindingContextChanged = _flagOnModelChanged = _flagOnSizeRequest = false;
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "TableView CLASS: Teardown---------------------------------");
- _tableview = null;
- }
-
- [Test]
- [Category("P1")]
- [Description(" Create a TableView instance. Check whether object is successfully created or not.")]
- [Property("SPEC", "Xamarin.Forms.TableView.TableView C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void TableView_CONST()
- {
- /*TEST CODE*/
- _tableview = new TableView();
- Assert.IsInstanceOf<TableView>(_tableview, "_tableview should be an instance of TableView");
- Assert.IsNotNull(_tableview, "Can't create success object TableView");
- }
-
- [Test]
- [Category("P1")]
- [Description(" Create a TableView instance. Check whether object is successfully created or not.")]
- [Property("SPEC", "Xamarin.Forms.TableView.TableView C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("COVPARAM", "TableRoot")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void TableView_ROOT_CONST()
- {
- /*TEST CODE*/
- var mRoot = new TableRoot();
- _tableview = new TableView(mRoot);
- Assert.IsInstanceOf<TableView>(_tableview, "_tableview should be an instance of TableView");
- Assert.IsNotNull(_tableview, "Can't create success object TableView");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of HasUnevenRows are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.TableView.HasUnevenRows A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void HasUnevenRows_PROPERTY_SET_GET()
- {
- /*TEST CODE*/
- _tableview.HasUnevenRows = true;
- Assert.True(_tableview.HasUnevenRows, "Retrieved HasUnevenRows value is not equal to set value");
- _tableview.HasUnevenRows = false;
- Assert.False(_tableview.HasUnevenRows, "Retrieved HasUnevenRows value is not equal to set value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of Intent are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.TableView.Intent A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void Intent_PROPERTY_SET_GET()
- {
- /*TEST CODE*/
- _tableview.Intent = TableIntent.Data;
- Assert.AreEqual(TableIntent.Data, _tableview.Intent, "Retrieved Intent value is not equal to set value");
- _tableview.Intent = TableIntent.Form;
- Assert.AreEqual(TableIntent.Form, _tableview.Intent, "Retrieved Intent value is not equal to set value");
- _tableview.Intent = TableIntent.Menu;
- Assert.AreEqual(TableIntent.Menu, _tableview.Intent, "Retrieved Intent value is not equal to set value");
- _tableview.Intent = TableIntent.Settings;
- Assert.AreEqual(TableIntent.Settings, _tableview.Intent, "Retrieved Intent value is not equal to set value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of Root are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.TableView.Root A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void Root_PROPERTY_SET_GET()
- {
- /*TEST CODE*/
- var mRoot01 = new TableRoot();
- var mRoot02 = new TableRoot("Test01");
- _tableview.Root = mRoot01;
- Assert.AreEqual(mRoot01, _tableview.Root, "Retrieved Root value is not equal to set value");
- _tableview.Root = mRoot02;
- Assert.AreEqual(mRoot02, _tableview.Root, "Retrieved Root value is not equal to set value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get value of RowHeight are identical with the set value or not.")]
- [Property("SPEC", "Xamarin.Forms.TableView.RowHeight A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void RowHeight_PROPERTY_SET_GET()
- {
- /*TEST CODE*/
- var mRowHeight01 = 1;
- var mRowHeight02 = 12;
- _tableview.RowHeight = mRowHeight01;
- Assert.AreEqual(mRowHeight01, _tableview.RowHeight, "Retrieved RowHeight value is not equal to set value");
- _tableview.RowHeight = mRowHeight02;
- Assert.AreEqual(mRowHeight02, _tableview.RowHeight, "Retrieved RowHeight value is not equal to set value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check return TableView configuration")]
- [Property("SPEC", "Xamarin.Forms.TableView.On<T> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void On_CONFIGURATION_METHOD()
- {
- /*TEST CODE*/
- var mRoot = new TableRoot();
- _tableview.Root = mRoot;
- var myConfig = _tableview.On<IConfigPlatform>();
- Assert.IsInstanceOf<IPlatformElementConfiguration<IConfigPlatform, TableView>>(myConfig, "myConfig should be a instance of IPlatformElementConfiguration");
- Assert.IsInstanceOf<TableView>(myConfig.Element, "myConfig.Element should be a instance of TableView");
- Assert.AreEqual(mRoot, myConfig.Element.Root, "Root of myConfig.Element value & Root of _tableview should be to equal");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether RowHeightProperty(BindableProperty) is working correctly or not")]
- [Property("SPEC", "Xamarin.Forms.TableView.RowHeightProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void RowHeightProperty_PROPERTY_READ_ONLY()
- {
- /*TEST CODE*/
- var mHeight01 = 12;
- var mHeight02 = 23;
- _tableview.RowHeight = mHeight01;
- var mTableView = new TableView()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- RowHeight = mHeight02
- };
- Assert.AreNotEqual(mTableView.RowHeight, _tableview.RowHeight, "RowHeight of _tableview value must be different form RowHeight of RowHeight value");
- _tableview.BindingContext = mTableView;
- _tableview.SetBinding(TableView.RowHeightProperty, "RowHeight");
- Assert.AreEqual(mTableView.RowHeight, _tableview.RowHeight, "RowHeight of mLabel value & RowHeight of _tableview value should be same");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether HasUnevenRowsProperty(BindableProperty) is working correctly or not")]
- [Property("SPEC", "Xamarin.Forms.TableView.HasUnevenRowsProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void HasUnevenRowsProperty_PROPERTY_READ_ONLY()
- {
- /*TEST CODE*/
- var mHasUnevenRowst01 = false;
- var mHasUnevenRowst02 = true;
- _tableview.HasUnevenRows = mHasUnevenRowst01;
- var mTableView = new TableView()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- HasUnevenRows = mHasUnevenRowst02
- };
- Assert.AreNotEqual(mTableView.HasUnevenRows, _tableview.HasUnevenRows, "HasUnevenRows of _tableview value must be different form HasUnevenRows of mTableView value");
- _tableview.BindingContext = mTableView;
- _tableview.SetBinding(TableView.HasUnevenRowsProperty, "HasUnevenRows");
- Assert.AreEqual(mTableView.HasUnevenRows, _tableview.HasUnevenRows, "HasUnevenRows of mTableView value & RowHeight of _tableview value should be same");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check override method OnBindingContextChanged is invoked when it is bound.")]
- [Property("SPEC", "Xamarin.Forms.TableView.OnBindingContextChanged M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void OnBindingContextChanged_OVERRIDE_METHOD()
- {
- /*PRE CONDITION
- * _flagOnBindingContext flag is initialize false value
- * Create a instance subButton
- */
- Assert.False(_flagOnBindingContextChanged, "_flagOnSizeRequest should false initial");
- /*TEST CODE*/
- var mHasUnevenRowst01 = false;
- var mHasUnevenRowst02 = true;
- _tableview = new SubTableView();
- _tableview.HasUnevenRows = mHasUnevenRowst01;
- var mTableView = new SubTableView()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- HasUnevenRows = mHasUnevenRowst02
- };
-
- _tableview.BindingContext = mTableView;
- _tableview.SetBinding(TableView.HasUnevenRowsProperty, "HasUnevenRows");
- Assert.True(_flagOnBindingContextChanged, "OnBindingContextChanged overrided method not invoked.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check override method OnSizeRequest is invoked when it is measured .")]
- [Property("SPEC", "Xamarin.Forms.TableView.OnSizeRequest M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void OnSizeRequest_OVERRIDE_METHOD()
- {
- /*PRE CONDITION
- * _flagOnSizeRequest flag is initialize false value
- * Create a instance SubTableView
- */
- Assert.False(_flagOnSizeRequest, "_flagOnSizeRequest should false initial");
- /**TEST CODE**/
- var msubTableViews = new SubTableView()
- {
- };
- msubTableViews.Measure(100, 200, MeasureFlags.None);
- Assert.True(_flagOnSizeRequest, "OnSizeRequest overrided method not invoked.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check override method OnModelChanged is invoked when it is measured .")]
- [Property("SPEC", "Xamarin.Forms.TableView.OnModelChanged M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- public void OnModelChanged_OVERRIDE_METHOD()
- {
- /*PRE CONDITION
- * _flagOnSizeRequest flag is initialize false value
- * Create a instance SubTableView
- */
- Assert.False(_flagOnModelChanged, "_flagOnModelChanged should false initial");
- /**TEST CODE**/
- var msubTableViews = new SubTableView()
- {
- BackgroundColor = Color.Red
- };
- msubTableViews.BackgroundColor = Color.Silver;
- msubTableViews.Measure(100, 200, MeasureFlags.None);
- Assert.True(_flagOnSizeRequest, "OnModelChanged overrided method not invoked.");
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System.Threading.Tasks;
-using System.Collections.Generic;
-using Xamarin.Forms;
-using System.Collections.Specialized;
-using System.Runtime.CompilerServices;
-using XamarinForTizen.Tizen;
-using XamarinForTizen;
-using System.Windows.Input;
-using AutoTemplate;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
-
-
- [TestFixture]
- class TapGestureRecognizerTests
- {
- private TapGestureRecognizer _mTapGestureRecognizer;
- private App _app = Program.getApp();
-
- [SetUp]
- public void SetUp()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "TapGestureRecognizer CLASS: Setup---------------------------------");
- _mTapGestureRecognizer = new TapGestureRecognizer();
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "TapGestureRecognizer CLASS: Teardown---------------------------------");
- _mTapGestureRecognizer = null;
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a TapGestureRecognizer instance. Check whether object is successfully created or not.")]
- [Property("SPEC", "Xamarin.Forms.TapGestureRecognizer.TapGestureRecognizer C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public void TapGestureRecognizer_CONST()
- {
- Assert.IsNotNull(_mTapGestureRecognizer, "Cannot successfully create TapGestureRecognizer object");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a TapGestureRecognizer instance with parameter Action create with 2 arguments View and object . Check whether object is successfully created or not.")]
- [Property("SPEC", "Xamarin.Forms.TapGestureRecognizer.TapGestureRecognizer C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("COVPARAM", "Action<Xamarin.Forms.View,object>")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public void TapGestureRecognizer_CONST_ACTION_VIEW_OBJECT()
- {
- Action<View, object> action = delegate (View view, object o) { };
- var instance = new TapGestureRecognizer(action);
- Assert.IsNotNull(_mTapGestureRecognizer, "Cannot successfully create TapGestureRecognizer object");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a TapGestureRecognizer instance with parameter Action create with argument View . Check whether object is successfully created or not.")]
- [Property("SPEC", "Xamarin.Forms.TapGestureRecognizer.TapGestureRecognizer C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("COVPARAM", "Action<Xamarin.Forms.View>")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public void TapGestureRecognizer_CONST_ACTION_VIEW()
- {
- Action<View> action = delegate (View view) { };
- var instance = new TapGestureRecognizer(action);
- Assert.IsNotNull(_mTapGestureRecognizer, "Cannot successfully create TapGestureRecognizer object");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of CommandParameterProperty is correctly readable or not.")]
- [Property("SPEC", "Xamarin.Forms.TapGestureRecognizer.CommandParameterProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public void CommandParameterProperty_PROPERTY_READ_ONLY()
- {
- /*PRECONDITION*/
- /*
- * Create bind source.
- */
-
- string strCommandParameter = "prams";
- var mSrc = new TapGestureRecognizer()
- {
- CommandParameter = strCommandParameter
- };
-
- /*TEST CODE*/
- _mTapGestureRecognizer.BindingContext = mSrc;
- _mTapGestureRecognizer.SetBinding(TapGestureRecognizer.CommandParameterProperty, "CommandParameter");
- Assert.AreEqual(mSrc.CommandParameter, _mTapGestureRecognizer.CommandParameter, "CommandParameter of _mTapGestureRecognizer and Binding Source should be the same.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of CommandProperty is correctly readable or not.")]
- [Property("SPEC", "Xamarin.Forms.TapGestureRecognizer.CommandProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public void CommandProperty_PROPERTY_READ_ONLY()
- {
- /*PRECONDITION*/
- /*
- * Create bind source.
- */
-
- bool flagActionInvoked = false;
- ICommand cmd = new Command(new Action(() => flagActionInvoked = true));
- var mSrc = new TapGestureRecognizer()
- {
- Command = cmd
- };
-
- /*TEST CODE*/
- _mTapGestureRecognizer.BindingContext = mSrc;
- _mTapGestureRecognizer.SetBinding(TapGestureRecognizer.CommandProperty, "Command");
- Assert.AreEqual(mSrc.Command, _mTapGestureRecognizer.Command, "Command of _mTapGestureRecognizer and Binding Source should be the same.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of NumberOfTapsRequiredProperty is correctly readable or not.")]
- [Property("SPEC", "Xamarin.Forms.TapGestureRecognizer.NumberOfTapsRequiredProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public void NumberOfTapsRequiredProperty_PROPERTY_READ_ONLY()
- {
- /*PRECONDITION*/
- /*
- * Create bind source.
- */
-
- int numTap = 10;
- var mSrc = new TapGestureRecognizer()
- {
- NumberOfTapsRequired = numTap
- };
-
- /*TEST CODE*/
- _mTapGestureRecognizer.BindingContext = mSrc;
- _mTapGestureRecognizer.SetBinding(TapGestureRecognizer.NumberOfTapsRequiredProperty, "NumberOfTapsRequired");
- Assert.AreEqual(mSrc.NumberOfTapsRequired, _mTapGestureRecognizer.NumberOfTapsRequired, "NumberOfTapsRequired of _mTapGestureRecognizer and Binding Source should be the same.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of TappedCallbackParameterProperty is correctly readable or not.")]
- [Property("SPEC", "Xamarin.Forms.TapGestureRecognizer.TappedCallbackParameterProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public void TappedCallbackParameterProperty_PROPERTY_READ_ONLY()
- {
- /*PRECONDITION*/
- /*
- * Create bind source.
- */
-
- string parameter = "parameters";
- var mSrc = new TapGestureRecognizer()
- {
- TappedCallbackParameter = parameter
- };
-
- /*TEST CODE*/
- _mTapGestureRecognizer.BindingContext = mSrc;
- _mTapGestureRecognizer.SetBinding(TapGestureRecognizer.TappedCallbackParameterProperty, "TappedCallbackParameter");
- Assert.AreEqual(mSrc.TappedCallbackParameter, _mTapGestureRecognizer.TappedCallbackParameter, "TappedCallbackParameter of _mTapGestureRecognizer and Binding Source should be the same.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of TappedCallbackProperty is correctly readable or not.")]
- [Property("SPEC", "Xamarin.Forms.TapGestureRecognizer.TappedCallbackProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public void TappedCallbackProperty_PROPERTY_READ_ONLY()
- {
- /*PRECONDITION*/
- /*
- * Create bind source.
- */
-
- Action<View, object> action = delegate (View view, object o)
- {
-
- };
- var mSrc = new TapGestureRecognizer()
- {
- TappedCallback = action
- };
-
- /*TEST CODE*/
- _mTapGestureRecognizer.BindingContext = mSrc;
- _mTapGestureRecognizer.SetBinding(TapGestureRecognizer.TappedCallbackProperty, "TappedCallback");
- Assert.AreEqual(mSrc.TappedCallback, _mTapGestureRecognizer.TappedCallback, "TappedCallback of _mTapGestureRecognizer and Binding Source should be the same.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get and set Command working normally.")]
- [Property("SPEC", "Xamarin.Forms.TapGestureRecognizer.Command A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public void Command_SET_GET()
- {
- /*TEST CODE*/
- bool flagActionInvoked = false;
- ICommand cmd1 = new Command(new Action(() => flagActionInvoked = true));
- ICommand cmd2 = new Command(new Action(() => flagActionInvoked = true));
-
- _mTapGestureRecognizer.Command = cmd1;
- Assert.AreEqual(cmd1, _mTapGestureRecognizer.Command, "_mTapGestureRecognizer.Command should equal with cmd1");
-
- _mTapGestureRecognizer.Command = cmd2;
- Assert.AreNotEqual(cmd1, _mTapGestureRecognizer.Command, "_mTapGestureRecognizer.Command shouldn't equal with cmd1");
- Assert.AreEqual(cmd2, _mTapGestureRecognizer.Command, "_mTapGestureRecognizer.Command should equal with cmd2");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get and set CommandParameter working normally.")]
- [Property("SPEC", "Xamarin.Forms.TapGestureRecognizer.CommandParameter A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public void CommandParameter_SET_GET()
- {
- /*TEST CODE*/
- string params1 = "params1";
- string params2 = "params2";
-
- _mTapGestureRecognizer.CommandParameter = params1;
- Assert.AreEqual(params1, _mTapGestureRecognizer.CommandParameter, "_mTapGestureRecognizer.CommandParameter should equal with params1");
-
- _mTapGestureRecognizer.CommandParameter = params2;
- Assert.AreEqual(params2, _mTapGestureRecognizer.CommandParameter, "_mTapGestureRecognizer.CommandParameter should equal with params2");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get and set NumberOfTapsRequired working normally.")]
- [Property("SPEC", "Xamarin.Forms.TapGestureRecognizer.NumberOfTapsRequired A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public void NumberOfTapsRequired_SET_GET()
- {
- /*TEST CODE*/
- int num1 = 1;
- int num2 = 2;
-
- _mTapGestureRecognizer.NumberOfTapsRequired = num1;
- Assert.AreEqual(num1, _mTapGestureRecognizer.NumberOfTapsRequired, "_mTapGestureRecognizer.NumberOfTapsRequired should equal with num1");
-
- _mTapGestureRecognizer.NumberOfTapsRequired = num2;
- Assert.AreEqual(num2, _mTapGestureRecognizer.NumberOfTapsRequired, "_mTapGestureRecognizer.NumberOfTapsRequired should equal with num2");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get and set TappedCallback working normally.")]
- [Property("SPEC", "Xamarin.Forms.TapGestureRecognizer.TappedCallback A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public void TappedCallback_SET_GET()
- {
- /*TEST CODE*/
- Action<View, object> action1 = delegate (View view, object o) { };
- Action<View, object> action2 = delegate (View view, object o) { };
-
- _mTapGestureRecognizer.TappedCallback = action1;
- Assert.AreEqual(action1, _mTapGestureRecognizer.TappedCallback, "_mTapGestureRecognizer.TappedCallback should equal with action1");
-
- _mTapGestureRecognizer.TappedCallback = action2;
- Assert.AreNotEqual(action1, _mTapGestureRecognizer.TappedCallback, "_mTapGestureRecognizer.TappedCallback shouldn't equal with action1");
- Assert.AreEqual(action2, _mTapGestureRecognizer.TappedCallback, "_mTapGestureRecognizer.TappedCallback should equal with action2");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether get and set TappedCallbackParameter working normally.")]
- [Property("SPEC", "Xamarin.Forms.TapGestureRecognizer.TappedCallbackParameter A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public void TappedCallbackParameter_SET_GET()
- {
- /*TEST CODE*/
- string params1 = "params1";
- string params2 = "params2";
-
- _mTapGestureRecognizer.TappedCallbackParameter = params1;
- Assert.AreEqual(params1, _mTapGestureRecognizer.TappedCallbackParameter, "_mTapGestureRecognizer.TappedCallbackParameter should equal with params1");
-
- _mTapGestureRecognizer.TappedCallbackParameter = params2;
- Assert.AreEqual(params2, _mTapGestureRecognizer.TappedCallbackParameter, "_mTapGestureRecognizer.TappedCallbackParameter should equal with params2");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check whether EventHandler Tapped is invoked or not when tap on the view")]
- [Property("SPEC", "Xamarin.Forms.TapGestureRecognizer.Tapped E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Trinh Tien Son, tien.son@samsung.com")]
- public void Tapped_CHECK_EVENT()
- {
- Assert.True(false, "[NA] Need to check via manual test");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.TappedEventArgs Tests")]
- public class TappedEventArgsTests
- {
- private static TappedEventArgs tappedEventArgs;
-
- [SetUp]
- public void Setup()
- {
- Console.WriteLine("TappedEventArgsTests --------------- Setup()");
- tappedEventArgs = new TappedEventArgs("Tizen");
- }
-
- [TearDown]
- public void TearDown()
- {
- tappedEventArgs = null;
- Console.WriteLine("TappedEventArgsTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a TappedEventArgs object")]
- [Property("SPEC", "Xamarin.Forms.TappedEventArgs.TappedEventArgs C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void TappedEventArgs_INIT()
- {
- /* TEST CODE */
- Assert.IsNotNull(tappedEventArgs, "TappedEventArgs instance is null");
- Assert.IsInstanceOf<TappedEventArgs>(tappedEventArgs, "Not an instance of TappedEventArgs.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the value for Parameter.")]
- [Property("SPEC", "Xamarin.Forms.TappedEventArgs.Parameter A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Parameter_READ_ONLY()
- {
- /* TEST CODE */
- tappedEventArgs = new TappedEventArgs("TizenNew");
- Assert.AreEqual(tappedEventArgs.Parameter, "TizenNew", "Parameter not returning expected value.");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-using NUnit.Framework.TUnit;
-using System.Globalization;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.TemplateBinding Tests")]
- public class TemplateBindingTests
- {
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("TemplateBindingTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("TemplateBindingTests --------------- TearDown()");
- }
- public class CustomColor
- {
- public CustomColor(Color color)
- {
- FColor = color;
- }
-
- public Color FColor
- {
- get;
- set;
- }
- }
-
- class CustomIValueConverter : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- if (value is Color)
- return new CustomColor((Color)value);
- return value;
- }
-
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- if (value is CustomColor)
- return ((CustomColor)value).FColor;
- return value;
-
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a TemplateBinding instance.")]
- [Property("SPEC", "Xamarin.Forms.TemplateBinding.TemplateBinding C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void TemplateBinding_INIT()
- {
- /* TEST CODE */
- TemplateBinding templateBinding = new TemplateBinding();
-
- Assert.IsNotNull(templateBinding, "Object should be not null after initialize");
- Assert.IsInstanceOf<TemplateBinding>(templateBinding, "Object should be instance of TemplateBinding");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a TemplateBinding instance.")]
- [Property("SPEC", "Xamarin.Forms.TemplateBinding.TemplateBinding C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("COVPARAM", "string, BindingMode, IValueConverter, object, string")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void TemplateBinding_INIT_MULTI_PARAM()
- {
- /* TEST CODE */
- CustomIValueConverter customIValueConverter = new CustomIValueConverter();
- TemplateBinding templateBinding = new TemplateBinding("PathName",BindingMode.OneWay, customIValueConverter, "ConverterParam", "StringName");
-
- Assert.IsNotNull(templateBinding, "Object should be not null after initialize");
- Assert.IsInstanceOf<TemplateBinding>(templateBinding, "Object should be instance of TemplateBinding");
- }
-
- [Test]
- [Category("P1")]
- [Description("Sets or gets the converter to be used for this TemplateBinding.")]
- [Property("SPEC", "Xamarin.Forms.TemplateBinding.Converter A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Converter_READ_WRITE()
- {
- /* TEST CODE */
- TemplateBinding binding = new TemplateBinding("Tizen", BindingMode.TwoWay);
- CustomIValueConverter customIValueConverter = new CustomIValueConverter();
- binding.Converter = customIValueConverter;
- Assert.IsNotNull(binding, "Instance of Binding is null");
- Assert.IsInstanceOf<CustomIValueConverter>(binding.Converter, "Not an instance of CustomIValueConverter.");
- Assert.AreEqual(binding.Converter, customIValueConverter, "Set and get values are not equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ConverterParameter Property is writeable and readable.")]
- [Property("SPEC", "Xamarin.Forms.TemplateBinding.ConverterParameter A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void ConverterParameter_READ_WRITE()
- {
- /* TEST CODE */
- Label label = new Label();
- label.Text = "Tizen";
- TemplateBinding binding = new TemplateBinding("Tizen", BindingMode.TwoWay);
- binding.ConverterParameter = label;
- Assert.IsNotNull(binding, "Instance of Binding is null");
- Assert.IsInstanceOf<Label>(binding.ConverterParameter, "Instance should be of Label type.");
- Assert.AreEqual(binding.ConverterParameter, label, "Set and get values are not equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Path Property is writeable and readable.")]
- [Property("SPEC", "Xamarin.Forms.TemplateBinding.Path A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Path_READ_WRITE()
- {
- /* TEST CODE */
- TemplateBinding binding = new TemplateBinding("Tizen", BindingMode.TwoWay);
- binding.Path = "Tizen";
- Assert.IsNotNull(binding, "Instance of Binding is null");
- Assert.IsInstanceOf<String>(binding.Path, "Not an instance of String.");
- Assert.AreEqual(binding.Path, "Tizen", "Set and get values are not equal.");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-using System.Collections.Generic;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.TemplateExtensions Tests")]
-
- public class TemplateExtensionsTests
- {
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("TemplateExtensionsTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("TemplateExtensionsTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Creates and applies a binding to a bindable property.")]
- [Property("SPEC", "Xamarin.Forms.TemplateExtensions.SetBinding M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void SetBinding_CHECK()
- {
- /* TEST CODE */
- var dataTemplate = new DataTemplate();
-
- VisualElement visualElement = new ContentPage();
- var mFirstHeightRequestProperty = 22.00;
- visualElement.HeightRequest = mFirstHeightRequestProperty;
-
- try
- {
- TemplateExtensions.SetBinding(dataTemplate, VisualElement.HeightRequestProperty, "Tizen");
- Assert.IsTrue(true, "Set Binding shoud not throw exception.");
- }
- catch (Exception ex)
- {
- Assert.IsTrue(false, "Set Binding shoud not throw exception. Exception: " + ex.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 Xamarin.Forms;
-using NUnit.Framework;
-using NUnit.Framework.TUnit;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.TemplatedPage Tests")]
- public class TemplatedPageTests
- {
- class SimpleTemplate : StackLayout
- {
- public SimpleTemplate()
- {
- Children.Add(new Label());
- Children.Add(new ContentPresenter());
- }
- }
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("TemplatedPageTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("TemplatedPageTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a TemplatedPage instance.")]
- [Property("SPEC", "Xamarin.Forms.TemplatedPage.TemplatedPage C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void TemplatedPage_INIT()
- {
- /* TEST CODE */
- TemplatedPage templatedPage = new TemplatedPage();
-
- Assert.IsNotNull(templatedPage, "Object should be not null after initialize");
- Assert.IsInstanceOf<TemplatedPage>(templatedPage, "Object should be instance of TemplatedPage");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the ControlTemplate property is readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.TemplatedPage.ControlTemplate A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void ControlTemplate_READ_WRITE()
- {
- /* TEST CODE */
- TemplatedPage templatedPage = new TemplatedPage();
- ControlTemplate controlTemplate = new ControlTemplate(typeof(SimpleTemplate));
- templatedPage.ControlTemplate = controlTemplate;
-
- Assert.IsInstanceOf<ControlTemplate>(templatedPage.ControlTemplate, "Should be instance of ControlTemplate.");
- Assert.AreEqual(templatedPage.ControlTemplate, controlTemplate, "Should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the ControlTemplateProperty property is bound or not.")]
- [Property("SPEC", "Xamarin.Forms.TemplatedPage.ControlTemplateProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void ControlTemplateProperty_RAED_ONLY()
- {
- /* TEST CODE */
- var mFirstWidthProperty = new ControlTemplate(typeof(StackLayout));
- var mSecondWidthProperty = new ControlTemplate(typeof(ScrollView));
-
- TemplatedPage templatedPage = new TemplatedPage();
- templatedPage.ControlTemplate = mFirstWidthProperty;
-
- TemplatedPage mTemplatedPage = new TemplatedPage();
- mTemplatedPage.ControlTemplate = mSecondWidthProperty;
-
- Assert.AreNotEqual(templatedPage.ControlTemplate, mTemplatedPage.ControlTemplate, "ControlTemplateProperty value must be different.");
- templatedPage.BindingContext = mTemplatedPage;
- templatedPage.SetBinding(TemplatedPage.ControlTemplateProperty, "ControlTemplate");
- Assert.AreEqual(templatedPage.ControlTemplate, mTemplatedPage.ControlTemplate, "After binding, Value should be equal.");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-using XamarinForTizen.Tizen;
-using System.Threading.Tasks;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- public class CustomTemplatedView : TemplatedView
- {
- public Boolean isOnSizeRequestTemplatedView = false, flagLayoutChildren = false;
- protected override SizeRequest OnSizeRequest(double widthConstraint, double heightConstraint)
- {
- isOnSizeRequestTemplatedView = true;
- return base.OnSizeRequest(widthConstraint, heightConstraint);
- }
- protected override void LayoutChildren(double x, double y, double width, double height)
- {
- flagLayoutChildren = true;
- base.LayoutChildren(x, y, width, height);
- }
- }
-
- [TestFixture]
- public class TSTemplatedView
- {
- class SimpleTemplate : StackLayout
- {
- public SimpleTemplate()
- {
- Children.Add(new Label());
- Children.Add(new ContentPresenter());
- }
- }
-
- private TemplatedView sTemplatedView;
-
- [SetUp]
- public void setUp()
- {
- Console.WriteLine("TSTemplatedView --------------- Setup()");
- sTemplatedView = new TemplatedView();
- }
-
- [TearDown]
- public void tearDown()
- {
- sTemplatedView = null;
- Console.WriteLine("TSTemplatedView --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a new empty templated view.")]
- [Property("SPEC", "Xamarin.Forms.TemplatedView.TemplatedView C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void TemplatedView_INIT()
- {
- /*TEST CODE*/
- var templatedView = new TemplatedView();
- Assert.IsNotNull(templatedView, "templatedView should be not NULL");
- Assert.IsInstanceOf<TemplatedView>(templatedView, "templatedView is not instance of TemplatedView.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property ControlTemplate is readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.TemplatedView.ControlTemplate A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void ControlTemplate_READ_WRITE()
- {
- /*TEST CODE*/
- ControlTemplate controlTemplate = new ControlTemplate(typeof(SimpleTemplate));
- sTemplatedView.ControlTemplate = controlTemplate;
- Assert.IsInstanceOf<ControlTemplate>(sTemplatedView.ControlTemplate, "sTemplatedView.ControlTemplate is not instance of ControlTemplate.");
- Assert.AreEqual(sTemplatedView.ControlTemplate, controlTemplate, "sTemplatedView.ControlTemplate and controlTemplate should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property ControlTemplateProperty is bound or not.")]
- [Property("SPEC", "Xamarin.Forms.TemplatedView.ControlTemplateProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void ControlTemplateProperty_CHECK_BINDABLE()
- {
- /*TEST CODE*/
- var mFirstWidthProperty = new ControlTemplate(typeof(StackLayout));
- var mSecondWidthProperty = new ControlTemplate(typeof(ScrollView));
- sTemplatedView.ControlTemplate = mFirstWidthProperty;
-
- TemplatedView bindingObject = new TemplatedView();
- bindingObject.ControlTemplate = mSecondWidthProperty;
-
- Assert.AreNotEqual(sTemplatedView.ControlTemplate, bindingObject.ControlTemplate, "ControlTemplate of sTemplatedView value must be different form ControlTemplate of bindingObject value");
- sTemplatedView.BindingContext = bindingObject;
- sTemplatedView.SetBinding(TemplatedView.ControlTemplateProperty, "ControlTemplate");
- Assert.AreEqual(sTemplatedView.ControlTemplate, bindingObject.ControlTemplate, "ControlTemplate of bindingObject value & ControlTemplate of sTemplatedView value should be same");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OnSizeRequest is invoked or not.")]
- [Property("SPEC", "Xamarin.Forms.TemplatedView.OnSizeRequest M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- public void OnSizeRequest_INVOKED_CHECK()
- {
- /*TEST CODE*/
- CustomTemplatedView customTemplatedView = new CustomTemplatedView();
- customTemplatedView.GetSizeRequest(double.PositiveInfinity, double.PositiveInfinity);
- Assert.IsTrue(customTemplatedView.isOnSizeRequestTemplatedView, "OnSizeRequest method didn't invoke.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether LayoutChildren is invoked or not.")]
- [Property("SPEC", "Xamarin.Forms.TemplatedView.LayoutChildren M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public async Task LayoutChildren_INVOKED_CHECK()
- {
- /*TEST CODE*/
- NavigationPage mainPage = (NavigationPage)Program.getApp().MainPage;
- var customTemplatedView = new CustomTemplatedView();
-
- await mainPage.PushAsync(new ContentPage { Content = customTemplatedView });
- customTemplatedView.ControlTemplate = new ControlTemplate(typeof(SimpleTemplate));
- customTemplatedView.Layout(new Rectangle() { X = 0, Y = 0, Width = 300, Height = 400 });
- Assert.IsTrue(customTemplatedView.flagLayoutChildren, "LayoutChildren is not invoked!");
-
- /* Postcondition:
- -Pop CustomContentPresenter */
- await mainPage.PopAsync();
- }
- }
-}
-
+++ /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.Windows.Input;
-using NUnit.Framework.TUnit;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class TextCellTests
- {
- public Color MyColor = Color.Green;
- public const String TextTest = "Text for test";
- private TextCell _textCell;
- internal class MyCommand : ICommand
- {
- public event EventHandler CanExecuteChanged;
- public bool CanExecute(object parameter)
- {
- return true;
- }
- public void Execute(object parameter)
- {
- return;
- }
- }
- [SetUp]
- public void Init()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "TextCell CLASS: Setup-------------------------");
- _textCell = new TextCell();
- }
-
- [TearDown]
- public void Destroy()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "TextCell CLASS: Teardown-------------------------");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a TextCell object")]
- [Property("SPEC", "Xamarin.Forms.TextCell.TextCell C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void TextCell_INIT()
- {
- /* TEST CODE */
- var textCell = new TextCell();
- Assert.IsNotNull(textCell, "Instance TextCell is null");
- Assert.IsInstanceOf<TextCell>(textCell);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Detail is readable and settable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.TextCell.Detail A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void Detail_SET_GET()
- {
- /* PRECONDITION
- * 1. Initiate a TextCell
- */
- TextCell textCell = new TextCell();
- Assert.IsNotNull(textCell, "Instance TextCell is null");
-
- /* TEST CODE */
- textCell.Detail = TextTest;
- Assert.AreEqual(TextTest, textCell.Detail, "Detail value of get is different with set.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Text is readable and settable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.TextCell.Text A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void Text_SET_GET()
- {
- /* PRECONDITION
- * 1. Initiate a TextCell
- */
- TextCell textCell = new TextCell();
- Assert.IsNotNull(textCell, "Instance TextCell is null");
-
- /* TEST CODE */
- textCell.Text = TextTest;
- Assert.AreEqual(TextTest, textCell.Text, "Text value of get is different set.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property TextColor is readable and settable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.TextCell.TextColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void TextColor_SET_GET()
- {
- /* PRECONDITION
- * 1. Initiate a TextCell
- */
- TextCell textCell = new TextCell();
- Assert.IsNotNull(textCell, "Instance TextCell is null");
-
- /* TEST CODE */
- textCell.TextColor = MyColor;
- Assert.AreEqual(MyColor, textCell.TextColor, "Color value of get is different with set.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property DetailColor is readable and settable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.TextCell.DetailColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void DetailColor_SET_GET()
- {
- /* PRECONDITION
- * 1. Initiate a TextCell
- */
- TextCell textCell = new TextCell();
- Assert.IsNotNull(textCell, "Instance TextCell is null");
-
- /* TEST CODE */
- textCell.DetailColor = MyColor;
- Assert.AreEqual(MyColor, textCell.DetailColor, "Color value of get is different with set.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property CommandParameter is readable and settable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.TextCell.CommandParameter A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void CommandParameter_SET_GET()
- {
- /* PRECONDITION
- * 1. Initiate a TextCell
- */
- TextCell textCell = new TextCell();
- Assert.IsNotNull(textCell, "Instance TextCell is null");
- object commandParameter = new object();
-
- /* TEST CODE */
- textCell.CommandParameter = commandParameter;
- Assert.True(commandParameter.Equals(textCell.CommandParameter), "CommandParameter value of get is different with set.");
- Assert.AreEqual(commandParameter.ToString(), textCell.CommandParameter.ToString(), "String of CommandParameter get is different with set.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check value of Detail of two other TextCells after set binding.")]
- [Property("SPEC", "Xamarin.Forms.TextCell.DetailProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void DetailProperty_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Initiate two TextCells.
- * 2. Set Detail for two TextCells is different.
- */
- _textCell.Detail = TextTest;
- TextCell textCell = new TextCell();
- textCell.Detail = "Text Modify";
-
- /* TEST CODE */
- _textCell.BindingContext = textCell;
- _textCell.SetBinding(TextCell.DetailProperty, "Detail");
- Assert.AreEqual(textCell.Detail, _textCell.Detail, "Detail of two TextCells should be same.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check value of Text of two other TextCells after set binding.")]
- [Property("SPEC", "Xamarin.Forms.TextCell.TextProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void TextProperty_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Initiate two TextCells.
- * 2. Set Text for two TextCells is different.
- */
- _textCell.Text = TextTest;
- TextCell textCell = new TextCell();
- textCell.Text = "Text Modify";
-
- /* TEST CODE */
- _textCell.BindingContext = textCell;
- _textCell.SetBinding(TextCell.TextProperty, "Text");
- Assert.AreEqual(textCell.Text, _textCell.Text, "Text of two TextCells should be same.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check value of DetailColor of two other TextCells after set binding.")]
- [Property("SPEC", "Xamarin.Forms.TextCell.DetailColorProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void DetailColorProperty_PROPERTY_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Initiate two TextCells.
- * 2. Set DetailColor for two TextCells is different.
- */
- _textCell.DetailColor = MyColor;
- TextCell textCell = new TextCell();
- textCell.DetailColor = Color.Black;
-
- /* TEST CODE */
- _textCell.BindingContext = textCell;
- _textCell.SetBinding(TextCell.DetailColorProperty, "DetailColor");
- Assert.AreEqual(textCell.DetailColor, _textCell.DetailColor, "DetaiColor of two TextCells should be same.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check value of TextColor of two other TextCells after set binding.")]
- [Property("SPEC", "Xamarin.Forms.TextCell.TextColorProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void TextColorProperty_PROPERTY_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Initiate two TextCells.
- * 2. Set TextColor for two TextCells is different.
- */
- _textCell.TextColor = MyColor;
- TextCell textCell = new TextCell();
- textCell.TextColor = Color.Black;
-
- /* TEST CODE */
- _textCell.BindingContext = textCell;
- _textCell.SetBinding(TextCell.TextColorProperty, "TextColor");
- Assert.AreEqual(textCell.TextColor, _textCell.TextColor, "TextColor of two TextCells should be same.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Command is readable and settable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.TextCell.Command A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void Command_SET_GET()
- {
- /* TEST CODE */
- MyCommand _myCommand1 = new MyCommand();
- _textCell.Command = _myCommand1;
- Assert.AreEqual(_myCommand1, _textCell.Command, "Command value of get is different with set.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check value of Command of two other TextCells after set binding.")]
- [Property("SPEC", "Xamarin.Forms.TextCell.CommandProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void CommandProperty_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Initiate two TextCells.
- * 2. Set Command for two TextCells is different.
- */
- MyCommand _myCommand1 = new MyCommand();
- //_myCommand.CanExecute(true);
- _textCell.Command = _myCommand1;
- TextCell textCell = new TextCell();
- MyCommand _myCommand2 = new MyCommand();
- textCell.Command = _myCommand2;
- Assert.AreNotEqual(textCell.Command, _textCell.Command, "Command of two TextCells should be different befor set binding before set binding.");
-
- /* TEST CODE */
- _textCell.BindingContext = textCell;
- _textCell.SetBinding(TextCell.CommandProperty, "Command");
- Assert.AreEqual(textCell.Command, _textCell.Command, "Command of two TextCells should be same after set binding after set binding.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check value of CommandParameter of two other TextCells after set binding.")]
- [Property("SPEC", "Xamarin.Forms.TextCell.CommandParameterProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void CommandParameterProperty_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Initiate two TextCell
- */
- TextCell _textCell = new TextCell();
- object commandParameter1 = new object();
- _textCell.CommandParameter = commandParameter1;
- TextCell textCell = new TextCell();
- object commandParameter2 = new object();
- textCell.CommandParameter = commandParameter2;
- Assert.AreNotEqual(textCell.CommandParameter, _textCell.CommandParameter, "CommandParameter of two TextCells should be different befor set binding.");
-
- /* TEST CODE */
- _textCell.BindingContext = textCell;
- _textCell.SetBinding(TextCell.CommandParameterProperty, "CommandParameter");
- Assert.AreEqual(textCell.CommandParameter, _textCell.CommandParameter, "CommandParameter of two TextCells should be same after set binding.");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-using NUnit.Framework.TUnit;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.TextChangedEventArgs Tests")]
- public class TextChangedEventArgsTests
- {
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("TextChangedEventArgsTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("TextChangedEventArgsTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a TextChangedEventArgs instance.")]
- [Property("SPEC", "Xamarin.Forms.TextChangedEventArgs.TextChangedEventArgs C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void TextChangedEventArgs_INIT()
- {
- /* TEST CODE */
- var oldText = "OldText";
- var newText = "NewText";
- TextChangedEventArgs textChangedEventArgs = new TextChangedEventArgs(oldText,newText);
-
- Assert.IsNotNull(textChangedEventArgs, "Object should be not null after initialize");
- Assert.IsInstanceOf<TextChangedEventArgs>(textChangedEventArgs, "Object should be instance of TextChangedEventArgs");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the NewTextValue property is readable.")]
- [Property("SPEC", "Xamarin.Forms.TextChangedEventArgs.NewTextValue A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void NewTextValue_READ()
- {
- /* TEST CODE */
- var oldText = "OldText";
- var newText = "NewText";
- TextChangedEventArgs textChangedEventArgs = new TextChangedEventArgs(oldText, newText);
-
- var getNewTextValue = textChangedEventArgs.NewTextValue;
- Assert.IsInstanceOf<string>(getNewTextValue, "Get NewTextValue should return object string.");
- Assert.IsTrue(newText.Equals(textChangedEventArgs.NewTextValue), "Should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the OldTextValue property is readable.")]
- [Property("SPEC", "Xamarin.Forms.TextChangedEventArgs.OldTextValue A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void OldTextValue_READ()
- {
- /* TEST CODE */
- var oldText = "OldText";
- var newText = "NewText";
- TextChangedEventArgs textChangedEventArgs = new TextChangedEventArgs(oldText, newText);
-
- var getOldTextValue = textChangedEventArgs.OldTextValue;
- Assert.IsInstanceOf<string>(getOldTextValue, "Get OldTextValue should return object string.");
- Assert.IsTrue(oldText.Equals(textChangedEventArgs.OldTextValue), "Should be equal.");
- }
- }
-}
+++ /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;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.Thickness Tests")]
- public class ThicknessTests
- {
- private Thickness _thickness;
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("ThicknessTests --------------- Setup()");
- _thickness = new Thickness();
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("ThicknessTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a Thickness instance.")]
- [Property("SPEC", "Xamarin.Forms.Thickness.Thickness C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Property("COVPARAM", "Double")]
- public void Thickness_INIT()
- {
- /* TEST CODE */
- var thickness = new Thickness(3.00);
-
- Assert.IsNotNull(thickness, "Object should be not null after initialize");
- Assert.IsInstanceOf<Thickness>(thickness, "Object should be instance of Thickness");
-
- Assert.AreEqual(3.00, thickness.Left, "Left should be 3");
- Assert.AreEqual(3.00, thickness.Top, "Top should be 3");
- Assert.AreEqual(3.00, thickness.Right, "Right should be 3");
- Assert.AreEqual(3.00, thickness.Bottom, "Bottom should be 3");
- Assert.AreEqual(6.00, thickness.HorizontalThickness, "HorizontalThickness should be 6");
- Assert.AreEqual(6.00, thickness.VerticalThickness, "VerticalThickness should be 6");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a Thickness instance.")]
- [Property("SPEC", "Xamarin.Forms.Thickness.Thickness C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Property("COVPARAM", "Double, Double")]
- public void Thickness_INIT_WITH_HORIZONTAL_VERTICAL()
- {
- /* TEST CODE */
- var thickness = new Thickness(4.00, 5.00);
-
- Assert.IsNotNull(thickness, "Object should be not null after initialize");
- Assert.IsInstanceOf<Thickness>(thickness, "Object should be instance of Thickness");
-
- Assert.AreEqual(4.00, thickness.Left, "Left should be 4.00");
- Assert.AreEqual(5.00, thickness.Top, "Top should be 5.00");
- Assert.AreEqual(4.00, thickness.Right, "Right should be 4.00");
- Assert.AreEqual(5.00, thickness.Bottom, "Bottom should be 5.00");
- Assert.AreEqual(8.00, thickness.HorizontalThickness, "HorizontalThickness should be 8.00");
- Assert.AreEqual(10.00, thickness.VerticalThickness, "VerticalThickness should be 10.00");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a Thickness instance.")]
- [Property("SPEC", "Xamarin.Forms.Thickness.Thickness C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Property("COVPARAM", "Double, Double, Double, Double")]
- public void Thickness_INIT_WITH_LEFT_TOP_RIGHT_BOTTOM()
- {
- /* TEST CODE */
- var thickness = new Thickness(1.2, 3.3, 4.2, 10.66);
-
- Assert.IsNotNull(thickness, "Object should be not null after initialize");
- Assert.IsInstanceOf<Thickness>(thickness, "Object should be instance of Thickness");
-
- Assert.AreEqual(1.2, thickness.Left, "Left should be 1.2");
- Assert.AreEqual(3.3, thickness.Top, "Top should be 3.3");
- Assert.AreEqual(4.2, thickness.Right, "Right should be 4.2");
- Assert.AreEqual(10.66, thickness.Bottom, "Bottom should be 10.66");
- Assert.AreEqual(5.4, thickness.HorizontalThickness, "HorizontalThickness should be 5.4");
- Assert.AreEqual(13.96, thickness.VerticalThickness, "VerticalThickness should be 13.96");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the Bottom property is readable and writable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.Thickness.Bottom A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Bottom_READ_WRITE()
- {
- /* TEST CODE */
- _thickness.Bottom = 15.00;
- Assert.AreEqual(15.00, _thickness.Bottom, "Bottom property doesn't set and get successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the Left property is readable and writable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.Thickness.Left A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Left_READ_WRITE()
- {
- /* TEST CODE */
- _thickness.Left = 7.00;
- Assert.AreEqual(7.00, _thickness.Left, "Left property doesn't set and get successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the Right property is readable and writable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.Thickness.Right A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Right_READ_WRITE()
- {
- /* TEST CODE */
- _thickness.Right = 5.00;
- Assert.AreEqual(5.00, _thickness.Right, "Right property doesn't set and get successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the Top property is readable and writable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.Thickness.Top A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Top_READ_WRITE()
- {
- /* TEST CODE */
- _thickness.Top = 3.00;
- Assert.AreEqual(3.00, _thickness.Top, "Top property doesn't set and get successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the HorizontalThickness property is readable.")]
- [Property("SPEC", "Xamarin.Forms.Thickness.HorizontalThickness A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void HorizontalThickness_READ()
- {
- /* TEST CODE */
- Assert.IsInstanceOf<double>(_thickness.HorizontalThickness, "Get HorizontalThickness should return object double.");
- var thickness = new Thickness(1.5, 3.5, 4.5, 10.5);
- Assert.AreEqual(6.0, thickness.HorizontalThickness, "HorizontalThickness should be 6.0");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the VerticalThickness property is readable.")]
- [Property("SPEC", "Xamarin.Forms.Thickness.VerticalThickness A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void VerticalThickness_READ()
- {
- /* TEST CODE */
- Assert.IsInstanceOf<double>(_thickness.VerticalThickness, "Get VerticalThickness should return object double.");
- var thickness = new Thickness(1.5, 3.5, 4.5, 10.5);
- Assert.AreEqual(14.0, thickness.VerticalThickness, "VerticalThickness should be 14.0");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Equals.")]
- [Property("SPEC", "Xamarin.Forms.Thickness.Equals M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Equals_CHECK_RETURN()
- {
- /* TEST CODE */
- Assert.False(new Thickness().Equals(null), "Should not be equal.");
- Assert.False(new Thickness().Equals("Thickness"), "Should not be equal.");
- Assert.False(new Thickness().Equals(new Thickness(1, 2, 3, 4)), "Should not be equal.");
- Assert.True(new Thickness().Equals(new Thickness()), "Should be equal.");
- Assert.True(new Thickness(7.00, 9.00).Equals(new Thickness(7.00, 9.00)), "Should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of GetHashCode.")]
- [Property("SPEC", "Xamarin.Forms.Thickness.GetHashCode M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void GetHashCode_CHECK_RETURN()
- {
- /* TEST CODE */
- var result = new Thickness(2.00, 3.00).GetHashCode();
- Assert.IsNotNull(result, "Should not be null.");
- Assert.IsInstanceOf<Int32>(result, "Should be instance of int32.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Equality.")]
- [Property("SPEC", "Xamarin.Forms.Thickness.== M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Equality_CHECK_RETURN()
- {
- /* TEST CODE */
- Assert.True(new Thickness(2.00, 3.00) == new Thickness(2.00, 3.00), "Two Thickness's should be equal.");
- Assert.True(new Thickness(2.00, 3.00, 4.00, 5.5) == new Thickness(2.00, 3.00, 4.00, 5.5), "Two Thickness's should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Inequality.")]
- [Property("SPEC", "Xamarin.Forms.Thickness.!= M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Inequality_CHECK_RETURN()
- {
- /* TEST CODE */
- Assert.True(new Thickness(2.00, 3.00) != new Thickness(3.00, 2.00), "Two Thickness's should not be equal.");
- Assert.True(new Thickness(2.00, 3.00, 4.9, 5.5) != new Thickness(2.00, 3.00, 4.00, 5.5), "Two Thickness's should not be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Size.")]
- [Property("SPEC", "Xamarin.Forms.Thickness.Implicit M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Property("COVPARAM", "Size")]
- public void Implicit_CONVERSION_SIZE_TO_THICKNESS()
- {
- /* TEST CODE */
- Thickness thickness = new Thickness();
- Assert.DoesNotThrow(() => thickness = new Size(42.00, 84.00));
- Assert.AreEqual(new Thickness(42.00, 84.00), thickness, "Doesn't Converted from size to thickness");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Double.")]
- [Property("SPEC", "Xamarin.Forms.Thickness.Implicit M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Property("COVPARAM", "Double")]
- public void Implicit_CONVERSION_DOUBLE_TO_THICKNESS()
- {
- /* TEST CODE */
- Thickness thickness = new Thickness();
- Assert.DoesNotThrow(() => thickness = 42.00);
- Assert.AreEqual(new Thickness(42.00), thickness, "Doesn't Converted from double to thickness");
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class ThicknessTypeConverterTests
- {
- [SetUp]
- public void Init()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Setup-------------------------");
- }
-
- [TearDown]
- public void Destroy()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Teardown-------------------------");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a ThicknessTypeConverter instance without parameter.")]
- [Property("SPEC", "Xamarin.Forms.ThicknessTypeConverter.ThicknessTypeConverter C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void ThicknessTypeConverter_INIT()
- {
- /* TEST CODE */
- var thicknessTypeComverter = new ThicknessTypeConverter();
- Assert.IsNotNull(thicknessTypeComverter, "Object is null after initializing");
- Assert.IsInstanceOf<ThicknessTypeConverter>(thicknessTypeComverter);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check type and value return of method ConvertFromInvariantString.")]
- [Property("SPEC", "Xamarin.Forms.ThicknessTypeConverter.ConvertFromInvariantString M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void ConvertFromInvariantString_CHECK()
- {
- /* PRECONDITION
- * 1. Create a ThicknessTypeConverter.
- */
- var thicknessTypeComverter = new ThicknessTypeConverter();
- Assert.IsNotNull(thicknessTypeComverter, "Object is null after initializing");
- Assert.IsInstanceOf<ThicknessTypeConverter>(thicknessTypeComverter);
-
- /* TEST CODE */
- string _value = "10, 10, 10, 20";
- object thickness = thicknessTypeComverter.ConvertFromInvariantString(_value);
- Assert.IsInstanceOf<Thickness>(thickness);
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class TimePickerTests
- {
- private TimePicker _timePicker;
- [SetUp]
- public void Init()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Setup---------------------------------");
- _timePicker = new TimePicker();
- }
-
- [TearDown]
- public void Destroy()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Teardown---------------------------------");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a TimePicker instance without parameter.")]
- [Property("SPEC", "Xamarin.Forms.TimePicker.TimePicker C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void TimePicker_INIT()
- {
- /* TEST CODE */
- var timePicker = new TimePicker();
- Assert.IsNotNull(timePicker, "Object is null after initializing");
- Assert.IsInstanceOf<TimePicker>(timePicker);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Format is readable and settable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.TimePicker.Format A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void Format_SET_GET()
- {
- /* PRECONDITION
- * 1. Check object TimePicker not null.
- * 2. Create a datetimeFormat to set format of TimePicker.
- */
- Assert.IsNotNull(_timePicker, "Object is null after initializing");
- var datetimeFormat = "YYYY:mm:DD-HH:mm:ss-p";
-
- /* TEST CODE */
- _timePicker.Format = datetimeFormat;
- Assert.AreEqual(datetimeFormat, _timePicker.Format, "Format property of TimePicker classs doens't set and get successful");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Time is readable and settable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.TimePicker.Time A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void Time_SET_GET()
- {
- /* PRECONDITION
- * 1. Check object TimePicker not null.
- * 2. Create a timeSpan to set TimeSpan of TimePicker.
- */
- Assert.IsNotNull(_timePicker, "Object TimePicker is null after initializing");
- var timeSpan = new TimeSpan(14, 40, 55);
- Assert.IsNotNull(timeSpan, "Object TimeSpan is null after initializing");
-
- /* TEST CODE */
- _timePicker.Time = timeSpan;
- Assert.AreEqual(timeSpan.Hours, _timePicker.Time.Hours, "Time.Hours doens't set and get successfully");
- Assert.AreEqual(timeSpan.Minutes, _timePicker.Time.Minutes, "Time.Minutes doens't set and get successfully");
- Assert.AreEqual(timeSpan.Seconds, _timePicker.Time.Seconds, "Time.Seconds doens't set and get successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check value of Format of two other TimePickers after set binding.")]
- [Property("SPEC", "Xamarin.Forms.TimePicker.FormatProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void FormatProperty_PROPERTY_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Initiate two TimePickers.
- * 2. Set Format for two TimePickers is different.
- */
- var datetimeFormat1 = "YYYY:mm:DD-HH:mm:ss-p";
- _timePicker.Format = datetimeFormat1;
- TimePicker timePicker = new TimePicker();
- var datetimeFormat2 = "K:mm a, vvvv";
- timePicker.Format = datetimeFormat2;
- Assert.AreNotEqual(timePicker.Format,_timePicker.Format, "Format of two TimePickers should be different before binding.");
- /* TEST CODE */
- _timePicker.BindingContext = timePicker;
- _timePicker.SetBinding(TimePicker.FormatProperty, "Format");
- Assert.AreEqual(timePicker.Format, _timePicker.Format, "Format of two TimePickers should be same after binding.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check value of Time of two other TimePickers after set binding.")]
- [Property("SPEC", "Xamarin.Forms.TimePicker.TimeProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void TimeProperty_PROPERTY_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Initiate two TimePickers.
- * 2. Set Time for two TimePickers is different.
- */
- var timeSpan1 = new TimeSpan(14, 40, 55);
- _timePicker.Time = timeSpan1;
- TimePicker timePicker = new TimePicker();
- var timeSpan2 = new TimeSpan(18, 30, 45);
- timePicker.Time = timeSpan2;
- Assert.AreNotEqual(timePicker.Time, _timePicker.Time, "Time of two TimePickers should be different before binding.");
-
- /* TEST CODE */
- _timePicker.BindingContext = timePicker;
- _timePicker.SetBinding(TimePicker.TimeProperty, "Time");
- Assert.AreEqual(timePicker.Time, _timePicker.Time, "Time of two TimePickers should be same after binding.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check type and value return of method On<IConfigPlatform>().")]
- [Property("SPEC", "Xamarin.Forms.TimePicker.On<T> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void On_CONFIGURATION_METHOD()
- {
- /* PRECONDITION
- * 1. Initiate two TimePickers.
- * 2. Set value Format and TextColor for TimePicker.
- */
- var datetimeFormat = "YYYY:mm:DD-HH:mm:ss-p";
- Color myColor = Color.Blue;
- _timePicker.Format = datetimeFormat;
- _timePicker.TextColor = myColor;
-
- /*TEST CODE*/
- var myConfig = _timePicker.On<IConfigPlatform>();
- Assert.IsInstanceOf<IPlatformElementConfiguration<IConfigPlatform, TimePicker>>(myConfig, "myConfig should be a instance of IPlatformElementConfiguration");
- Assert.IsInstanceOf<TimePicker>(myConfig.Element, "myConfig.Element should be a instance of TimePicker");
- Assert.AreEqual(datetimeFormat, myConfig.Element.Format, "Source of myConfig.Element value & Format of TimePicker should be equal");
- Assert.AreEqual(myColor, myConfig.Element.TextColor, "Source of myConfig.Element value & TextColor of TimePicker should be equal");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property TextColorProperty is readable.")]
- [Property("SPEC", "Xamarin.Forms.TimePicker.TextColorProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void TextColorProperty_PROPERTY_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Initiate two TimePickers.
- * 2. Set Time for two TimePickers is different.
- */
- var color1 = Color.Green;
- _timePicker.TextColor = color1;
- TimePicker timePicker = new TimePicker();
- var color2 = Color.Red;
- timePicker.TextColor = color2;
-
- /* TEST CODE */
- _timePicker.BindingContext = timePicker;
- _timePicker.SetBinding(TimePicker.TextColorProperty, "TextColor");
- Assert.AreEqual(timePicker.TextColor, _timePicker.TextColor, "TextColor of two TimePickers should be same.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property TextColor is readable and settable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.TimePicker.TextColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void TextColor_PROPERTY()
- {
- /*
- * PRECONDITION
- * 1. Check object TimePicker not null.
- * 2. Create a textColor to set TextColor of TimePicker.
- */
- Assert.IsNotNull(_timePicker, "Object TimePicker is null after initializing");
- Color textColor = Color.Blue;
- Assert.IsNotNull(textColor, "Object TimeSpan is null after initializing");
-
- /* TEST CODE */
- _timePicker.TextColor = textColor;
- Assert.AreEqual(textColor, _timePicker.TextColor, "TextColor doens't set and get successfully");
- }
- }
-}
+++ /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 Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class ToggledEventArgsTests
- {
- private ToggledEventArgs _toggledEventArgs;
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("ToggledEventArgs --------------- SetUp()");
- _toggledEventArgs = new ToggledEventArgs(true);
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("ToggledEventArgs --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a ToggledEventArgs instance. Check whether object is successfully created or not")]
- [Property("SPEC", "Xamarin.Forms.ToggledEventArgs.ToggledEventArgs C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void ToggledEventArgs_INIT()
- {
- /* TEST CODE */
- var toggledEventArgs = new ToggledEventArgs(false);
- Assert.IsNotNull(toggledEventArgs, "Creating a ToggledEventArgs object failed. It is set to null");
- Assert.IsFalse(toggledEventArgs.Value, "Value of ToggledEventArgs should be False");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Value is readable correct or not")]
- [Property("SPEC", "Xamarin.Forms.ToggledEventArgs.Value A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void Value_PROPERTY_GET()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- Assert.IsNotNull(_toggledEventArgs, "Creating a ToggledEventArgs object failed. It is set to null");
-
- /* TEST CODE */
- var value = true;
- Assert.AreEqual(value, _toggledEventArgs.Value, "Get value of Value is not correct");
- }
- }
-}
+++ /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.Threading.Tasks;
-using NUnit.Framework;
-using NUnit.Framework.TUnit;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class ToolbarItemTests
- {
- [SetUp]
- public void Init()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Setup-------------------------");
- }
-
- [TearDown]
- public void Destroy()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Teardown-------------------------");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a ToolbarItem instance without parameter.")]
- [Property("SPEC", "Xamarin.Forms.ToolbarItem.ToolbarItem C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void ToolbarItem_INIT()
- {
- /* TEST CODE */
- var toolbarItem = new ToolbarItem();
- Assert.IsNotNull(toolbarItem, "Object is null after initializing");
- Assert.IsInstanceOf<ToolbarItem>(toolbarItem);
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a ToolbarItem instance with parameter.")]
- [Property("SPEC", "Xamarin.Forms.ToolbarItem.ToolbarItem C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("COVPARAM", "string, string, Action, ToolbarItemOrder, int")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void ToolbarItem_INIT_WITH_PARAMETER()
- {
- /* PRECONDITION
- * 1. Make all parameter to create ToolbarItem.
- */
- string name = "ToolbarItem";
- string icon = "Icon";
- //Action activated = new Action();
- ToolbarItemOrder order = ToolbarItemOrder.Default;
- int priority = 0;
-
- /* TEST CODE */
- var toolbarItem = new ToolbarItem(name, icon, ()=> { }, order, priority);
- Assert.IsNotNull(toolbarItem, "Object is null after initializing");
- Assert.IsInstanceOf<ToolbarItem>(toolbarItem);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property NAme is readable and settable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.ToolbarItem.Name A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void Name_SET_GET()
- {
- /* PRECONDITION
- * 1. Create a ToolbarItem.
- * 2. Make a string.
- */
- ToolbarItem toolbarItem = new ToolbarItem();
- Assert.IsNotNull(toolbarItem, "Object is null after initializing");
- string name = "Toolbar";
-
- /* TEST CODE */
- toolbarItem.Name = name;
- Assert.AreEqual(name, toolbarItem.Name, "Name property of ToolbarItem classs doens't set and get successful");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Priority is readable and settable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.ToolbarItem.Priority A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void Priority_SET_GET()
- {
- /* PRECONDITION
- * 1. Create a ToolbarItem.
- * 2. Make a priority.
- */
- ToolbarItem toolbarItem = new ToolbarItem();
- Assert.IsNotNull(toolbarItem, "Object is null after initializing");
- int priority = 23;
-
- /* TEST CODE */
- toolbarItem.Priority = priority;
- Assert.AreEqual(priority, toolbarItem.Priority, "Priority property of ToolbarItem classs doens't set and get successful");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Order is readable and settable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.ToolbarItem.Order A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void Order_SET_GET()
- {
- /* PRECONDITION
- * 1. Create a ToolbarItem.
- */
- ToolbarItem toolbarItem = new ToolbarItem();
- Assert.IsNotNull(toolbarItem, "Object is null after initializing");
-
- /* TEST CODE */
- toolbarItem.Order = ToolbarItemOrder.Primary;
- Assert.AreEqual(ToolbarItemOrder.Primary, toolbarItem.Order, "Order property of ToolbarItem classs doens't set and get successful");
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System.Collections.Generic;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.Trigger test")]
- public class TriggerTest
- {
- private static Trigger _trigger;
-
- [SetUp]
- public void Setup()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Trigger: Setup---------------------------------");
- _trigger = new Trigger(typeof(Entry));
- }
-
- [TearDown]
- public void TearDown()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Trigger: Teardown------------------------------");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a Trigger instance. Check whether object is successfully created or not.")]
- [Property("SPEC", "Xamarin.Forms.Trigger.Trigger C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Ngo Van Hai, hai.nv3@samsung.com")]
- public void Trigger_INIT()
- {
- /*TEST CODE*/
- var trigger = new Trigger(typeof(Entry));
- Assert.NotNull(trigger,"Create a Trigger is not successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Property is readable and settable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.Trigger.Property A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ngo Van Hai, hai.nv3@samsung.com")]
- public void Property_PROPERTY()
- {
- /*TEST CODE*/
- BindableProperty testProperty = BindableProperty.Create("PropertyName", typeof(int), typeof(bool), 0);
- _trigger.Property = testProperty;
- Assert.AreEqual(testProperty,_trigger.Property, "Set, Get Property is fail");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Setters is readable.")]
- [Property("SPEC", "Xamarin.Forms.Trigger.Setters A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Ngo Van Hai, hai.nv3@samsung.com")]
- public void Setters_PROPERTY()
- {
- /*TEST CODE*/
- var getSetters = _trigger.Setters;
- Assert.IsInstanceOf<IList<Setter>>(getSetters);
- }
-
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Value is readable and settable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.Trigger.Value A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ngo Van Hai, hai.nv3@samsung.com")]
- public void Value_PROPERTY()
- {
- /*TEST CODE*/
- _trigger.Value = 100;
- Assert.AreEqual(100, _trigger.Value, "Set, Get Value property is fail");
- }
-
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.TriggerAction Tests")]
- public class TriggerActionTests
- {
- public class CustomTriggerAction : TriggerAction<Label>
- {
- public bool Invoked { get; set; }
-
- protected override void Invoke(Label sender)
- {
- base.Invoke(typeof(Label));
- Invoked = true;
- }
-
- public Type GetAssociatedType()
- {
- return AssociatedType;
- }
- }
-
- public class MockTriggerAction : TriggerAction<BindableObject>
- {
- public bool Invoked { get; set; }
-
- protected override void Invoke(BindableObject sender)
- {
- Invoked = true;
- }
- }
-
- public class MockBindableWithEvent : StackLayout
- {
- public void FireEvent()
- {
- if (MockEvent != null)
- MockEvent(this, EventArgs.Empty);
- }
-
- public event EventHandler MockEvent;
- }
-
- [SetUp]
- public void Setup()
- {
- Console.WriteLine("TriggerActionTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("TriggerActionTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a TriggerAction object")]
- [Property("SPEC", "Xamarin.Forms.TriggerAction.TriggerAction C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void TriggerAction_INIT()
- {
- /* TEST CODE */
- MockTriggerAction mockTriggerAction = new MockTriggerAction();
- Assert.IsNotNull(mockTriggerAction, "TriggerAction instance is null");
- Assert.IsInstanceOf<TriggerAction>(mockTriggerAction, "Not an instance of TriggerAction.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the value for AssociatedType.")]
- [Property("SPEC", "Xamarin.Forms.TriggerAction.AssociatedType A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void AssociatedType_READ_ONLY()
- {
- /* TEST CODE */
- CustomTriggerAction customTriggerAction = new CustomTriggerAction();
- Assert.IsInstanceOf <TriggerAction> (customTriggerAction, "Not an instance of TriggerAction.");
- var associatedType = customTriggerAction.GetAssociatedType();
- Assert.AreEqual(associatedType, typeof(Label), "AssociatedType not returning expected value.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if override this method to provide the behavior that is triggered, possible or not.")]
- [Property("SPEC", "Xamarin.Forms.TriggerAction.Invoke M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Invoke_CHECK()
- {
- /* TEST CODE */
- var bindable = new MockBindableWithEvent();
- var triggeraction = new MockTriggerAction();
- var eventtrigger = new EventTrigger() { Event = "MockEvent", Actions = { triggeraction } };
- var collection = bindable.Triggers;
- collection.Add(eventtrigger);
-
- Assert.False(triggeraction.Invoked, "Expected false but was true.");
- bindable.FireEvent();
- Assert.True(triggeraction.Invoked, "Expected true but was false."); ;
- }
- }
-}
+++ /dev/null
-using System;
-using NUnit.Framework;
-using Xamarin.Forms;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class TriggerActionTemplateTests
- {
-
- internal class MockTriggerAction : TriggerAction<BindableObject>
- {
- public MockTriggerAction()
- {
-
- }
- public bool Invoked { get; set; }
- public bool Invoked2 { get; set; }
-
- protected override void Invoke(BindableObject sender)
- {
- Invoked = true;
- }
-
- protected override void Invoke(object sender)
- {
- base.Invoke(sender);
- Invoked2 = true;
- }
- }
-
- internal class MockBindableWithEvent : StackLayout
- {
- public void FireEvent()
- {
- if (MockEvent != null)
- MockEvent(this, EventArgs.Empty);
- }
-
- public void FireEvent2()
- {
- if (MockEvent2 != null)
- MockEvent2(this, EventArgs.Empty);
- }
-
- public event EventHandler MockEvent;
- public event EventHandler MockEvent2;
- }
-
- MockTriggerAction _triggerAction;
-
- [SetUp]
- public void Setup()
- {
- _triggerAction = new MockTriggerAction();
- }
-
-
- [TearDown]
- public void Tear()
- {
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a TriggerAction instance.")]
- [Property("SPEC", "Xamarin.Forms.TriggerAction<T>.TriggerAction M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [MaxTime(5000)]
- public void TriggerAction_INIT()
- {
- /* TEST CODE */
- var triggerAction = (TriggerAction<BindableObject>)new MockTriggerAction();
- Assert.IsNotNull(triggerAction, "Object should be not null after initialize");
- Assert.IsInstanceOf<TriggerAction<BindableObject>>(triggerAction, "Object must be TriggerAction<BindableObject> type.");
-
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the TriggerAction Invocked.")]
- [Property("SPEC", "Xamarin.Forms.TriggerAction<T>.Invoke M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Property("COVPARAM", "T")]
- [MaxTime(5000)]
- public void Invoke_T_CHECK()
- {
- /* TEST CODE */
- var bindable = new MockBindableWithEvent();
- var triggerAction = new MockTriggerAction();
- var eventTrigger = new EventTrigger() { Event = "MockEvent", Actions = { triggerAction } };
- var collection = bindable.Triggers;
- collection.Add(eventTrigger);
-
- Assert.False(triggerAction.Invoked);
- bindable.FireEvent();
- Assert.True(triggerAction.Invoked);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the TriggerAction Invocked.")]
- [Property("SPEC", "Xamarin.Forms.TriggerAction<T>.Invoke M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [Property("COVPARAM", "object")]
- [MaxTime(5000)]
- public void Invoke_OBJECT_CHECK()
- {
- /* TEST CODE */
- var bindable = new MockBindableWithEvent();
- var triggerAction = new MockTriggerAction();
- var eventTrigger = new EventTrigger() { Event = "MockEvent", Actions = { triggerAction } };
- var collection = bindable.Triggers;
- collection.Add(eventTrigger);
-
- Assert.False(triggerAction.Invoked2);
- bindable.FireEvent();
- Assert.True(triggerAction.Invoked2);
- }
-
- }
-}
+++ /dev/null
-using System;
-using System.Collections.Generic;
-using NUnit.Framework;
-using Xamarin.Forms;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class TriggerBaseTest
- {
- class MockElement : StackLayout
- {
- }
-
- internal class MockTriggerAction : TriggerAction<BindableObject>
- {
- public bool Invoked { get; set; }
-
- protected override void Invoke(BindableObject sender)
- {
- Invoked = true;
- }
- }
-
- [SetUp]
- public void Setup()
- {
-
- }
-
-
- [TearDown]
- public void Tear()
- {
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the EnterActions return a list of TirggerAction objects .")]
- [Property("SPEC", "Xamarin.Forms.TriggerBase.EnterActions A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [MaxTime(5000)]
- public void EnterActions_READ_ONLY()
- {
- /* TEST CODE */
- var conditionBindableProperty = BindableProperty.Create("foo", typeof(string), typeof(BindableObject), null);
- var element = new MockElement();
- var enterAction = new MockTriggerAction();
- var exitAction = new MockTriggerAction();
- var trigger = new Trigger(typeof(VisualElement))
- {
- Property = conditionBindableProperty,
- Value = "foobar",
- EnterActions = {
- enterAction
- },
- ExitActions = {
- exitAction
- }
- };
- TriggerBase triggerBase = trigger;
- IList<TriggerAction> enterActions = triggerBase.EnterActions;
- Assert.AreEqual((TriggerAction)enterAction, enterActions[0], "TriggerAction should be equal");
- Assert.False(enterAction.Invoked);
- Assert.False(exitAction.Invoked);
- element.Triggers.Add(trigger);
- Assert.False(enterAction.Invoked);
- Assert.False(exitAction.Invoked);
- element.SetValue(conditionBindableProperty, "foobar");
- Assert.True(enterAction.Invoked);
- Assert.False(exitAction.Invoked);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the ExitActions return a list of TirggerAction objects .")]
- [Property("SPEC", "Xamarin.Forms.TriggerBase.ExitActions A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [MaxTime(5000)]
- public void ExitActions_READ_ONLY()
- {
- /* TEST CODE */
- var conditionBindableProperty = BindableProperty.Create("foo", typeof(string), typeof(BindableObject), null);
- var element = new MockElement();
- var enterAction = new MockTriggerAction();
- var exitAction = new MockTriggerAction();
- var trigger = new Trigger(typeof(VisualElement))
- {
- Property = conditionBindableProperty,
- Value = "foobar",
- EnterActions = {
- enterAction
- },
- ExitActions = {
- exitAction
- }
- };
- TriggerBase triggerBase = trigger;
- IList<TriggerAction> exitActions = triggerBase.ExitActions;
- Assert.AreEqual((TriggerAction)exitAction, exitActions[0], "TriggerAction should be equal");
- Assert.False(enterAction.Invoked);
- Assert.False(exitAction.Invoked);
- element.Triggers.Add(trigger);
- Assert.False(enterAction.Invoked);
- Assert.False(exitAction.Invoked);
- element.SetValue(conditionBindableProperty, "foobar");
- Assert.True(enterAction.Invoked);
- Assert.False(exitAction.Invoked);
-
- enterAction.Invoked = exitAction.Invoked = false;
- Assert.False(enterAction.Invoked);
- Assert.False(exitAction.Invoked);
- element.SetValue(conditionBindableProperty, "");
- Assert.False(enterAction.Invoked);
- Assert.True(exitAction.Invoked);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the IsSealed return a value that indicates whether or not the trigger is sealed.")]
- [Property("SPEC", "Xamarin.Forms.TriggerBase.IsSealed A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [MaxTime(5000)]
- public void IsSealed_READ_ONLY()
- {
- /* TEST CODE */
-
- var conditionBindableProperty = BindableProperty.Create("foo", typeof(string), typeof(BindableObject), null);
- var element = new MockElement();
- var enterAction = new MockTriggerAction();
- var exitAction = new MockTriggerAction();
- var trigger = new Trigger(typeof(VisualElement))
- {
- Property = conditionBindableProperty,
- Value = "foobar",
- EnterActions = {
- enterAction
- },
- ExitActions = {
- exitAction
- }
- };
- TriggerBase triggerBase = trigger;
- IList<TriggerAction> enterActions = triggerBase.EnterActions;
- IList<TriggerAction> exitActions = triggerBase.ExitActions;
- Assert.AreEqual((TriggerAction)enterAction, enterActions[0], "TriggerAction should be equal");
- Assert.AreEqual((TriggerAction)exitAction, exitActions[0], "TriggerAction should be equal");
-
- Assert.False(triggerBase.IsSealed, "Trigger should not be sealed");
- element.Triggers.Add(trigger);
-
-
- element.SetValue(conditionBindableProperty, "foobar");
- Assert.True(triggerBase.IsSealed, "Trigger should be sealed");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the TargetType return the type of object to which this TriggerBase object can be attached")]
- [Property("SPEC", "Xamarin.Forms.TriggerBase.TargetType A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [MaxTime(5000)]
- public void TargetType_READ_ONLY()
- {
- /* TEST CODE */
-
- var conditionBindableProperty = BindableProperty.Create("foo", typeof(string), typeof(BindableObject), null);
-
- var enterAction = new MockTriggerAction();
- var exitAction = new MockTriggerAction();
- Type targetType = typeof(VisualElement);
- var trigger = new Trigger(targetType)
- {
- Property = conditionBindableProperty,
- Value = "foobar",
- EnterActions = {
- enterAction
- },
- ExitActions = {
- exitAction
- }
- };
- TriggerBase triggerBase = trigger;
- IList<TriggerAction> enterActions = triggerBase.EnterActions;
- IList<TriggerAction> exitActions = triggerBase.ExitActions;
- Assert.AreEqual((TriggerAction)enterAction, enterActions[0], "TriggerAction should be equal");
- Assert.AreEqual((TriggerAction)exitAction, exitActions[0], "TriggerAction should be equal");
- Assert.AreEqual(triggerBase.TargetType, targetType, "TragetType should be same");
- }
-
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-using System.Collections;
-using System.Collections.Generic;
-using NUnit.Framework.TUnit;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- public class CustomTypeConverter : TypeConverter
- {
- public CustomTypeConverter() : base()
- {
- ;
- }
- }
-
- [TestFixture]
- [Description("Xamarin.Forms.TypeConverter Tests")]
- public class TypeConverterTests
- {
- public TypeConverter _typeConverter;
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("TypeConverterTests --------------- Setup()");
- _typeConverter = new CustomTypeConverter();
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("TypeConverterTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a new TypeConverter instance.")]
- [Property("SPEC", "Xamarin.Forms.TypeConverter.TypeConverter C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void TypeConverter_INIT()
- {
- /* TEST CODE */
- TypeConverter typeConverter = new CustomTypeConverter();
- Assert.IsNotNull(typeConverter, "Object should be not null after initialize");
- Assert.IsInstanceOf<TypeConverter>(typeConverter);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of CanConvertFrom.")]
- [Property("SPEC", "Xamarin.Forms.TypeConverter.CanConvertFrom M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void CanConvertFrom_CHECK_RETURN()
- {
- /* TEST CODE */
- Assert.IsInstanceOf<bool>(_typeConverter.CanConvertFrom(typeof(string)), "CanCorvertForm's return value should be boolean.");
- Assert.True(_typeConverter.CanConvertFrom(typeof(string)));
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the ConvertFromInvariantString converts the value into Point.")]
- [Property("SPEC", "Xamarin.Forms.TypeConverter.ConvertFromInvariantString M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void ConvertFromInvariantString_CHECK_RETURN()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- var typeConverter = new GridLengthTypeConverter();
- Assert.IsNotNull(typeConverter, "Creating a TypeConverter object failed. It is set to null");
-
- /* TEST CODE */
- var gridLength = new GridLength(0.7, GridUnitType.Star);
- var getStringValue = gridLength.Value.ToString();
- var getConvertFromInvariantString = (GridLength)typeConverter.ConvertFromInvariantString(getStringValue);
- Assert.AreEqual(gridLength.Value, getConvertFromInvariantString.Value, "ConvertFromInvariantString doesn't return correct");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-using System.Collections;
-using System.Collections.Generic;
-using NUnit.Framework.TUnit;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.TypeConverterAttribute Tests")]
- public class TypeConverterAttributeTests
- {
- public TypeConverterAttribute _typeConverterAttribute;
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("TypeConverterAttributeTests --------------- Setup()");
- _typeConverterAttribute = new TypeConverterAttribute();
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("TypeConverterAttributeTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a new TypeConverterAttribute instance.")]
- [Property("SPEC", "Xamarin.Forms.TypeConverterAttribute.TypeConverterAttribute C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void TypeConverterAttribute_INIT_DEFAULT()
- {
- /* TEST CODE */
- TypeConverterAttribute typeConverterAttribute = new TypeConverterAttribute();
- Assert.IsNotNull(typeConverterAttribute, "Object should be not null after initialize");
- Assert.IsInstanceOf<TypeConverterAttribute>(typeConverterAttribute);
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a new TypeConverterAttribute instance with string parameter.")]
- [Property("SPEC", "Xamarin.Forms.TypeConverterAttribute.TypeConverterAttribute C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("COVPARAM", "string")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void TypeConverterAttribute_INIT_STRING()
- {
- /* TEST CODE */
- TypeConverterAttribute typeConverterAttribute = new TypeConverterAttribute("StringTypeName");
- Assert.IsNotNull(typeConverterAttribute, "Object should be not null after initialize");
- Assert.IsInstanceOf<TypeConverterAttribute>(typeConverterAttribute);
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a new TypeConverterAttribute instance with type.")]
- [Property("SPEC", "Xamarin.Forms.TypeConverterAttribute.TypeConverterAttribute C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("COVPARAM", "System.Type")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void TypeConverterAttribute_INIT_TYPE()
- {
- /* TEST CODE */
- TypeConverterAttribute typeConverterAttribute = new TypeConverterAttribute(typeof(string));
- Assert.IsNotNull(typeConverterAttribute, "Object should be not null after initialize");
- Assert.IsInstanceOf<TypeConverterAttribute>(typeConverterAttribute);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the GetHashCode returns valid values.")]
- [Property("SPEC", "Xamarin.Forms.TypeConverterAttribute.GetHashCode M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void GetHashCode_CHECK_RETURN()
- {
- /* TEST CODE */
- TypeConverterAttribute typeConverterAttribute1 = new TypeConverterAttribute();
- TypeConverterAttribute typeConverterAttribute2 = new TypeConverterAttribute(typeof(string));
- TypeConverterAttribute typeConverterAttribute3 = new TypeConverterAttribute();
-
- Assert.AreNotEqual(typeConverterAttribute1.GetHashCode(), typeConverterAttribute2.GetHashCode());
- Assert.AreEqual(typeConverterAttribute1.GetHashCode(), typeConverterAttribute3.GetHashCode());
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the Equals returns valid values.")]
- [Property("SPEC", "Xamarin.Forms.TypeConverterAttribute.Equals M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Equals_CHECK_RETURN()
- {
- /* TEST CODE */
- TypeConverterAttribute typeConverterAttribute1 = new TypeConverterAttribute();
- TypeConverterAttribute typeConverterAttribute2 = new TypeConverterAttribute("STRING_TYPE_NAME");
- TypeConverterAttribute typeConverterAttribute3 = new TypeConverterAttribute("STRING_TYPE_NAME");
- KeyboardTypeConverter keyboardTypeConverter = new KeyboardTypeConverter();
-
- Assert.IsFalse(typeConverterAttribute1.Equals(typeConverterAttribute2), "objects should not be equal.");
- Assert.IsTrue(typeConverterAttribute2.Equals(typeConverterAttribute3), "objects should be equal.");
- Assert.IsFalse(typeConverterAttribute1.Equals(keyboardTypeConverter), "objects should not be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property ConverterTypeName is readable.")]
- [Property("SPEC", "Xamarin.Forms.TypeConverterAttribute.ConverterTypeName A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void ConverterTypeName_READ()
- {
- /* TEST CODE */
- TypeConverterAttribute typeConverterAttribute1 = new TypeConverterAttribute();
- TypeConverterAttribute typeConverterAttribute2 = new TypeConverterAttribute("STRING_TYPE_NAME");
-
- Assert.AreEqual("", typeConverterAttribute1.ConverterTypeName, "ConverterTypeName is not getting setted value");
- Assert.AreEqual("STRING_TYPE_NAME", typeConverterAttribute2.ConverterTypeName, "ConverterTypeName is not getting setted value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check value return Default.")]
- [Property("SPEC", "Xamarin.Forms.TypeConverterAttribute.Default A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void Default_READONLY()
- {
- /* TEST CODE */
- var typeConverterAttribute = TypeConverterAttribute.Default;
- Assert.IsNotNull(typeConverterAttribute, "Instance TypeConverterAttribute is null");
- Assert.IsInstanceOf<TypeConverterAttribute>(typeConverterAttribute);
- }
-
- }
-}
+++ /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 Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class TypeTypeConverterTests
- {
- private TypeTypeConverter _typeTypeConverter;
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("TypeTypeConverter --------------- SetUp()");
- _typeTypeConverter = new TypeTypeConverter();
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("TypeTypeConverter --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a TypeTypeConverter instance. Check whether object is successfully created or not")]
- [Property("SPEC", "Xamarin.Forms.TypeTypeConverter.TypeTypeConverter C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void TypeTypeConverter_INIT()
- {
- /* TEST CODE */
- var typeTypeConverter = new TypeTypeConverter();
- Assert.IsNotNull(typeTypeConverter, "Creating a TypeTypeConverter object failed. It is set to null");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check whether ConvertFromInvariantString is corrected or not")]
- [Property("SPEC", "Xamarin.Forms.TypeTypeConverter.ConvertFromInvariantString M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")]
- public void ConvertFromInvariantString_CHECK()
- {
- /*PRECONDITION
- * Check whether object is successfully created or not
- */
- //Assert.IsNotNull(_typeTypeConverter, "Creating a TypeTypeConverter object failed. It is set to null");
-
- ///* TEST CODE */
- //var button = new Button()
- //{
- // Text = "This is Button"
- //};
- //var typeName = button.GetType().FullName;
- //var getType = (Type)_typeTypeConverter.ConvertFromInvariantString(typeName);
- //Assert.AreEqual(typeName, getType.FullName, "ConvertFromInvariantString doesn't return correct");
- Assert.True(false, "[NA] Need to check API behavior");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.UnsolvableConstraintsException Tests")]
- public class UnsolvableConstraintsExceptionTests
- {
- [SetUp]
- public void Setup()
- {
- Console.WriteLine("UnsolvableConstraintsExceptionTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("UnsolvableConstraintsExceptionTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a UnsolvableConstraintsException object")]
- [Property("SPEC", "Xamarin.Forms.UnsolvableConstraintsException.UnsolvableConstraintsException C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void UnsolvableConstraintsException_INIT()
- {
- /* TEST CODE */
- UnsolvableConstraintsException unsolvableConstraintsException = new UnsolvableConstraintsException("Tizen");
- Assert.IsNotNull(unsolvableConstraintsException, "UnsolvableConstraintsException instance is null");
- Assert.IsInstanceOf<UnsolvableConstraintsException>(unsolvableConstraintsException, "Not an instance of UnsolvableConstraintsException.");
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class UriImageSourceTests
- {
- [SetUp]
- public void Init()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Setup-------------------------");
- }
-
- [TearDown]
- public void Destroy()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Teardown-------------------------");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a UriImageSource object")]
- [Property("SPEC", "Xamarin.Forms.UriImageSource.UriImageSource C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void UriImageSource_INIT()
- {
- /* TEST CODE */
- var uriImageSource = new UriImageSource();
- Assert.IsNotNull(uriImageSource, "Instance UriImageSource is null");
- Assert.IsInstanceOf<UriImageSource>(uriImageSource);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property CacheValidity is readable and settable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.UriImageSource.CacheValidity A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void CacheValidity_SET_GET()
- {
- /* PRECONDITION
- * 1. Initiate a UriImageSource
- */
- UriImageSource uriImageSource = new UriImageSource();
- Assert.IsNotNull(uriImageSource, "Instance UriImageSource is null");
- TimeSpan timeSpan = new TimeSpan(8, 24, 45);
-
- /* TEST CODE */
- uriImageSource.CacheValidity = timeSpan;
- Assert.AreEqual(timeSpan, uriImageSource.CacheValidity, "CacheValidity value of get is different set.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property CacheValidity is readable and settable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.UriImageSource.CachingEnabled A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void CachingEnabled_SET_GET()
- {
- /* PRECONDITION
- * 1. Initiate a UriImageSource
- */
- UriImageSource uriImageSource = new UriImageSource();
- Assert.IsNotNull(uriImageSource, "Instance UriImageSource is null");
- bool enabled = true;
-
- /* TEST CODE */
- uriImageSource.CachingEnabled = enabled;
- Assert.AreEqual(enabled, uriImageSource.CachingEnabled, "CachingEnabled value of get is different set.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Uri is readable and settable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.UriImageSource.Uri A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void Uri_SET_GET()
- {
- /* PRECONDITION
- * 1. Initiate a UriImageSource
- */
- UriImageSource uriImageSource = new UriImageSource();
- Assert.IsNotNull(uriImageSource, "Instance UriImageSource is null");
- Uri uri = new Uri("http://static.campaign.naver.com/0/hangeul/2011/img/img_family.gif");
-
- ///* TEST CODE */
- uriImageSource.Uri = uri;
- Assert.AreEqual(uri, uriImageSource.Uri, "Uri value of get is different set.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check value of UriProperty of two other UriImageSources after set binding.")]
- [Property("SPEC", "Xamarin.Forms.UriImageSource.UriProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void UriProperty_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Initiate two UriImageSources.
- * 2. Set Command for two UriImageSources is different.
- */
- UriImageSource uriImageSource1 = new UriImageSource();
- Assert.IsNotNull(uriImageSource1, "Instance UriImageSource is null");
- Uri uri1 = new Uri("http://static.campaign.naver.com/0/hangeul/2011/img/img_family.gif");
- uriImageSource1.Uri = uri1;
- UriImageSource uriImageSource2 = new UriImageSource();
- Assert.IsNotNull(uriImageSource2, "Instance UriImageSource is null");
- Uri uri2 = new Uri("http://hangeul.naver.com/img/2014/museum_thmb.jpg");
- uriImageSource2.Uri = uri2;
- Assert.AreNotEqual(uriImageSource2.Uri, uriImageSource1.Uri, "Uri of two UriImageSource should be different.");
-
- /* TEST CODE */
- uriImageSource1.BindingContext = uriImageSource2;
- uriImageSource1.SetBinding(UriImageSource.UriProperty, "Uri");
- Assert.AreEqual(uriImageSource2.Uri, uriImageSource1.Uri, "Uri of two UriImageSource should be same.");
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class UriTypeConverterTests
- {
- [SetUp]
- public void Init()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Setup-------------------------");
- }
-
- [TearDown]
- public void Destroy()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Teardown-------------------------");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a UriTypeConverter object")]
- [Property("SPEC", "Xamarin.Forms.UriTypeConverter.UriTypeConverter C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void UriTypeConverter_INIT()
- {
- /* TEST CODE */
- var uriTypeConverter = new UriTypeConverter();
- Assert.IsNotNull(uriTypeConverter, "Instance UriTypeConverter is null");
- Assert.IsInstanceOf<UriTypeConverter>(uriTypeConverter);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check type and value return of method ConvertFromInvariantString.")]
- [Property("SPEC", "Xamarin.Forms.UriTypeConverter.ConvertFromInvariantString M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void ConvertFromInvariantString_CHECK()
- {
- /* PRECONDITION
- * 1. Create a UriTypeConverter.
- * 2. Create a Uri.
- */
- UriTypeConverter uriTypeConverter = new UriTypeConverter();
- Assert.IsNotNull(uriTypeConverter, "Instance UriTypeConverter is null");
- string _value = "http://hangeul.naver.com/img/2014/museum_thmb.jpg";
- Uri uriSet = new Uri(_value);
-
- /* TEST CODE */
- object uriReturn = uriTypeConverter.ConvertFromInvariantString(_value);
- Assert.IsInstanceOf<Uri>(uriReturn);
- Assert.AreEqual(uriSet, uriReturn, "Value of uriReturn should be same with value of uri be created by string convert.");
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class UrlWebViewSourceTests
- {
- [SetUp]
- public void Init()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Setup-------------------------");
- }
-
- [TearDown]
- public void Destroy()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Teardown-------------------------");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a UrlWebViewSource object")]
- [Property("SPEC", "Xamarin.Forms.UrlWebViewSource.UrlWebViewSource C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void UrlWebViewSource_INIT()
- {
- /* TEST CODE */
- var urlWebViewSource = new UrlWebViewSource();
- Assert.IsNotNull(urlWebViewSource, "Instance UrlWebViewSource is null");
- Assert.IsInstanceOf<UrlWebViewSource>(urlWebViewSource);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Url is readable and settable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.UrlWebViewSource.Url A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void Url_SET_GET()
- {
- /* PRECONDITION
- * 1. Initiate a UrlWebViewSource.
- * 2. Create a Url.
- */
- UrlWebViewSource urlWebViewSource = new UrlWebViewSource();
- Assert.IsNotNull(urlWebViewSource, "Instance UrlWebViewSource is null");
- String url = "google.com";
-
- /* TEST CODE */
- urlWebViewSource.Url = url;
- Assert.AreEqual(url, urlWebViewSource.Url, "Url value of get is different set.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check value of Url of two other UrlWebViewSource after set binding.")]
- [Property("SPEC", "Xamarin.Forms.UrlWebViewSource.UrlProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void UrlProperty_READ_ONLY()
- {
- /* PRECONDITION
- * 1. Initiate two TextCells.
- * 2. Set Url for two TextCells is different.
- */
- UrlWebViewSource urlWebViewSource1 = new UrlWebViewSource();
- Assert.IsNotNull(urlWebViewSource1, "Instance UrlWebViewSource is null");
- String url1 = "google.com";
- urlWebViewSource1.Url = url1;
- UrlWebViewSource urlWebViewSource2 = new UrlWebViewSource();
- Assert.IsNotNull(urlWebViewSource2, "Instance UrlWebViewSource is null");
- String url2 = "samsung.com";
- urlWebViewSource2.Url = url2;
- Assert.AreNotEqual(urlWebViewSource2.Url, urlWebViewSource1.Url, "Url of two TextCells should be different befor set binding before set binding.");
-
- /* TEST CODE */
- urlWebViewSource1.BindingContext = urlWebViewSource2;
- urlWebViewSource1.SetBinding(UrlWebViewSource.UrlProperty, "Url");
- Assert.AreEqual(urlWebViewSource2.Url, urlWebViewSource1.Url, "Url of two TextCells should be same after set binding after set binding.");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-using NUnit.Framework.TUnit;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.ValueChangedEventArgs Tests")]
- public class ValueChangedEventArgsTests
- {
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("ValueChangedEventArgsTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("ValueChangedEventArgsTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a ValueChangedEventArgs instance.")]
- [Property("SPEC", "Xamarin.Forms.ValueChangedEventArgs.ValueChangedEventArgs C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void ValueChangedEventArgs_INIT()
- {
- /* TEST CODE */
- var oldValue = 10.00;
- var newValue = 20.00;
- ValueChangedEventArgs valueChangedEventArgs = new ValueChangedEventArgs(oldValue, newValue);
-
- Assert.IsNotNull(valueChangedEventArgs, "Object should be not null after initialize");
- Assert.IsInstanceOf<ValueChangedEventArgs>(valueChangedEventArgs, "Object should be instance of ValueChangedEventArgs");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the NewValue property is readable.")]
- [Property("SPEC", "Xamarin.Forms.ValueChangedEventArgs.NewValue A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void NewValue_READ()
- {
- /* TEST CODE */
- var oldValue = 11.00;
- var newValue = 12.00;
- ValueChangedEventArgs valueChangedEventArgs = new ValueChangedEventArgs(oldValue, newValue);
-
- var getNewValue = valueChangedEventArgs.NewValue;
- Assert.IsInstanceOf<double>(getNewValue, "Get NewValue should return object double.");
- Assert.IsTrue(newValue.Equals(valueChangedEventArgs.NewValue), "Should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the OldValue property is readable.")]
- [Property("SPEC", "Xamarin.Forms.ValueChangedEventArgs.OldValue A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void OldValue_READ()
- {
- /* TEST CODE */
- var oldValue = 11.00;
- var newValue = 12.00;
- ValueChangedEventArgs valueChangedEventArgs = new ValueChangedEventArgs(oldValue, newValue);
-
- var getOldValue = valueChangedEventArgs.OldValue;
- Assert.IsInstanceOf<double>(getOldValue, "Get OldValue should return object double.");
- Assert.IsTrue(oldValue.Equals(valueChangedEventArgs.OldValue), "Should be equal.");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.Vec2 Tests")]
- public class Vec2Tests
- {
- private Vec2 vec2;
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("Vec2Tests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("Vec2Tests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a Vec2 instance.")]
- [Property("SPEC", "Xamarin.Forms.Vec2.Vec2 C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Vec2_INIT()
- {
- /* TEST CODE */
- vec2 = new Vec2(2.0, 3.0);
- Assert.IsNotNull(vec2, "Vec2 instance is null");
- Assert.IsInstanceOf<Vec2>(vec2, "Not an instance of Vec2.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the X property is readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.Vec2.X A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void X_READ_WRITE()
- {
- /* TEST CODE */
- vec2 = new Vec2(2.0, 3.0);
- Assert.AreEqual(vec2.X, 2.0, "Not returning expected X value.");
-
- vec2.X = 5.0;
- Assert.AreEqual(vec2.X, 5.0, "Not returning expected X value.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the Y property is readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.Vec2.Y A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Y_READ_WRITE()
- {
- /* TEST CODE */
- vec2 = new Vec2(2.0, 3.0);
- Assert.AreEqual(vec2.Y, 3.0, "Not returning expected Y value.");
-
- vec2.Y = 5.0;
- Assert.AreEqual(vec2.Y, 5.0, "Not returning expected Y value.");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
-
- [TestFixture]
- [Description("Xamarin.Forms.View Tests")]
- public class ViewTests
- {
- internal class TestView : View
- {
- public bool TestViewBindingContextChanged { get; set; }
-
- protected override void OnBindingContextChanged()
- {
- base.OnBindingContextChanged();
- TestViewBindingContextChanged = true;
- }
- }
-
- private TestView _view;
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("TSViewTests --------------- Setup()");
- _view = new TestView()
- {
- IsEnabled = true
- };
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("TSViewTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of HorizontalOptionsProperty's bound or not")]
- [Property("SPEC", "Xamarin.Forms.View.HorizontalOptionsProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void HorizontalOptionsProperty_CHECK_BINDABLE()
- {
- /*TEST CODE*/
- _view.HorizontalOptions = LayoutOptions.FillAndExpand;
- Entry entry = new Entry()
- {
- HorizontalOptions = LayoutOptions.Fill
- };
-
- Assert.AreNotEqual(entry.HorizontalOptions, _view.HorizontalOptions, "HorizontalOptions value of _view must be different form entry HorizontalOptions value");
- _view.BindingContext = entry;
- _view.SetBinding(View.HorizontalOptionsProperty, "HorizontalOptions");
- Assert.AreEqual(entry.HorizontalOptions, _view.HorizontalOptions, "HorizontalOptions value of _view must be same as entry HorizontalOptions value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of MarginProperty's bound or not")]
- [Property("SPEC", "Xamarin.Forms.View.MarginProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void MarginProperty_CHECK_BINDABLE()
- {
- /*TEST CODE*/
- _view.Margin = new Thickness(12.4);
- Entry entry = new Entry()
- {
- Margin = new Thickness(12.1,10.5)
- };
-
- Assert.AreNotEqual(entry.Margin, _view.Margin, "Margin value of _view must be different form entry Margin value");
- _view.BindingContext = entry;
- _view.SetBinding(View.MarginProperty, "Margin");
- Assert.AreEqual(entry.Margin, _view.Margin, "Margin value of _view must be same as entry Margin value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of VerticalOptionsProperty's bound or not")]
- [Property("SPEC", "Xamarin.Forms.View.VerticalOptionsProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void VerticalOptionsProperty_CHECK_BINDABLE()
- {
- /*TEST CODE*/
- _view.VerticalOptions = LayoutOptions.FillAndExpand;
- Entry entry = new Entry()
- {
- VerticalOptions = LayoutOptions.Fill
- };
-
- Assert.AreNotEqual(entry.VerticalOptions, _view.VerticalOptions, "VerticalOptions value of _view must be different form entry VerticalOptions value");
- _view.BindingContext = entry;
- _view.SetBinding(View.VerticalOptionsProperty, "HorizontalOptions");
- Assert.AreEqual(entry.VerticalOptions, _view.VerticalOptions, "VerticalOptions value of _view must be same as entry VerticalOptions value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check GestureRecognizers whether readable.")]
- [Property("SPEC", "Xamarin.Forms.View.GestureRecognizers A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void GestureRecognizers_READ()
- {
- /*TEST CODE*/
- var gestureRecognizer = new TapGestureRecognizer();
-
- _view.GestureRecognizers.Add(gestureRecognizer);
-
- var gestureRecognizerList = _view.GestureRecognizers;
- bool isGestureRecognizerExist = gestureRecognizerList.Contains(gestureRecognizer);
- Assert.IsNotNull(gestureRecognizerList, ".GestureRecognizers should not return NULL.");
- Assert.IsTrue(isGestureRecognizerExist, "GestureRecognizers should return a list of GestureRecognizer");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check HorizontalOptions whether readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.View.HorizontalOptions A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void HorizontalOptions_READ_WRITE()
- {
- /*TEST CODE*/
- var horizontalOptions = LayoutOptions.FillAndExpand;
-
- _view.HorizontalOptions = horizontalOptions;
-
- Assert.AreEqual(horizontalOptions, _view.HorizontalOptions, "HorizontalOptions should be readable and writable.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check Margin whether readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.View.Margin A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void Margin_READ_WRITE()
- {
- /*TEST CODE*/
- var margin = new Thickness(15.03);
-
- _view.Margin = margin;
-
- Assert.AreEqual(margin, _view.Margin, "Margin should be readable and writable.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check VerticalOptions whether readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.View.VerticalOptions A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void VerticalOptions_READ_WRITE()
- {
- /*TEST CODE*/
- var verticalOptions = LayoutOptions.FillAndExpand;
-
- _view.VerticalOptions = verticalOptions;
-
- Assert.AreEqual(verticalOptions, _view.VerticalOptions, "VerticalOptions should be readable and writable.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check OnBindingContextChanged is Invoked whenever the binding context of the View changes.")]
- [Property("SPEC", "Xamarin.Forms.View.OnBindingContextChanged A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void OnBindingContextChanged_CHECK_INVOCK()
- {
- /*TEST CODE*/
- _view.VerticalOptions = LayoutOptions.FillAndExpand;
-
- Entry entry = new Entry()
- {
- VerticalOptions = LayoutOptions.Fill
- };
-
- _view.BindingContext = entry;
-
- Assert.IsTrue(_view.TestViewBindingContextChanged, "OnBindingContextChanged should be invocked whenever the binding context of the View changes.");
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class ViewCellTests
- {
- [SetUp]
- public void Init()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "ViewCell CLASS: Setup-------------------------");
- }
-
- [TearDown]
- public void Destroy()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "ViewCell CLASS: Teardown-------------------------");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a ViewCell object")]
- [Property("SPEC", "Xamarin.Forms.ViewCell.ViewCell C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void ViewCell_INIT()
- {
- /* TEST CODE */
- var mViewCell = new ViewCell();
- Assert.IsNotNull(mViewCell, "Instance ViewCell is null");
- Assert.IsInstanceOf<ViewCell>(mViewCell);
- }
-
- [Test]
- [Category("P1")]
- [Description("Test: set & get a View for ViewCell")]
- [Property("SPEC", "Xamarin.Forms.ViewCell.View A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void View_SET_GET()
- {
- /* PRECONDITION
- * 1. Initiate a ViewCell
- */
- ViewCell mViewCell = new ViewCell();
- Assert.IsNotNull(mViewCell, "Instance ViewCell is null");
- Label mLabel = new Label()
- {
- Text = "Test ViewCell"
- };
-
- /* TEST CODE */
- mViewCell.View = mLabel;
- Assert.AreEqual(mLabel, mViewCell.View, "Can't set & get a view object for ViewCell");
- Assert.AreEqual(mLabel.Text, ((Label)mViewCell.View).Text, "Text value is not same");
- }
- }
-}
+++ /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 System.Threading.Tasks;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class ViewExtensionsTests
- {
- [SetUp]
- public void Setup()
- {
- Console.WriteLine("ViewExtensionsTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("ViewExtensionsTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check return value of CancelAnimations.")]
- [Property("SPEC", "Xamarin.Forms.ViewExtensions.CancelAnimations M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void CancelAnimations_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- View view = new StackLayout();
-
- var task = view.TranslateTo(100.0, 50.0, 3000);
-
- Assert.IsInstanceOf<Task<bool>>(task, "TranslateTo is not returning an instance of Task<bool>.");
- Assert.IsNotNull(task, "Task instance is null.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if returns a task that performs the fading.")]
- [Property("SPEC", "Xamarin.Forms.ViewExtensions.FadeTo M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void FadeTo_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- View view = new StackLayout();
-
- var task = ViewExtensions.FadeTo(view, 10.0, 3000, null);
-
- Assert.IsInstanceOf<Task<bool>>(task, "FadeTo is not returning an instance of Task<bool>.");
- Assert.IsNotNull(task, "Task instance is null.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if returns a task that eases the bounds.")]
- [Property("SPEC", "Xamarin.Forms.ViewExtensions.LayoutTo M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void LayoutTo_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- View view = new StackLayout();
- Rectangle rectangle = new Rectangle(1.0, 1.0, 2.0, 2.0);
-
- var task = ViewExtensions.LayoutTo(view, rectangle, 3000, null);
-
- Assert.IsInstanceOf<Task<bool>>(task, "LayoutTo is not returning an instance of Task<bool>.");
- Assert.IsNotNull(task, "Task instance is null.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if rotates the VisualElement that is specified by view.")]
- [Property("SPEC", "Xamarin.Forms.ViewExtensions.RelRotateTo M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void RelRotateTo_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- View view = new StackLayout();
-
- var task = ViewExtensions.RelRotateTo(view, 2.0, 3000, null);
-
- Assert.IsInstanceOf<Task<bool>>(task, "RelRotateTo is not returning an instance of Task<bool>.");
- Assert.IsNotNull(task, "Task instance is null.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if returns a task that scales the VisualElement that is specified by view.")]
- [Property("SPEC", "Xamarin.Forms.ViewExtensions.RelScaleTo M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void RelScaleTo_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- View view = new StackLayout();
-
- var task = ViewExtensions.RelScaleTo(view, 2.0, 3000, null);
-
- Assert.IsInstanceOf<Task<bool>>(task, "RelScaleTo is not returning an instance of Task<bool>.");
- Assert.IsNotNull(task, "Task instance is null.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if returns a task that performs the rotation.")]
- [Property("SPEC", "Xamarin.Forms.ViewExtensions.RotateTo M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void RotateTo_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- View view = new StackLayout();
-
- var task = ViewExtensions.RotateTo(view, 2.0, 3000, null);
-
- Assert.IsInstanceOf<Task<bool>>(task, "RotateTo is not returning an instance of Task<bool>.");
- Assert.IsNotNull(task, "Task instance is null.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if returns a task that skews the Y axis.")]
- [Property("SPEC", "Xamarin.Forms.ViewExtensions.RotateXTo M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void RotateXTo_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- View view = new StackLayout();
-
- var task = ViewExtensions.RotateXTo(view, 2.0, 3000, null);
-
- Assert.IsInstanceOf<Task<bool>>(task, "RotateXTo is not returning an instance of Task<bool>.");
- Assert.IsNotNull(task, "Task instance is null.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if returns a task that skews the X axis.")]
- [Property("SPEC", "Xamarin.Forms.ViewExtensions.RotateYTo M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void RotateYTo_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- View view = new StackLayout();
-
- var task = ViewExtensions.RotateYTo(view, 2.0, 3000, null);
-
- Assert.IsInstanceOf<Task<bool>>(task, "RotateYTo is not returning an instance of Task<bool>.");
- Assert.IsNotNull(task, "Task instance is null.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if returns a task that scales the VisualElement.")]
- [Property("SPEC", "Xamarin.Forms.ViewExtensions.ScaleTo M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void ScaleTo_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- View view = new StackLayout();
-
- var task = ViewExtensions.ScaleTo(view, 2.0, 3000, null);
-
- Assert.IsInstanceOf<Task<bool>>(task, "ScaleTo is not returning an instance of Task<bool>.");
- Assert.IsNotNull(task, "Task instance is null.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if animates an elements TranslationX and TranslationY properties .")]
- [Property("SPEC", "Xamarin.Forms.ViewExtensions.TranslateTo M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void TranslateTo_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- View view = new StackLayout();
-
- var task = ViewExtensions.TranslateTo(view, 2.0, 2.0, 3000, null);
-
- Assert.IsInstanceOf<Task<bool>>(task, "TranslateTo is not returning an instance of Task<bool>.");
- Assert.IsNotNull(task, "Task instance is null.");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-using System.Collections;
-using System.Collections.Generic;
-using XamarinForTizen.Tizen;
-using AutoTemplate;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.VisualElement Tests")]
- public class VisualElementTests
- {
- private VisualElement _visualElement;
- private static bool
- _flagFocused,
- _flagUnfocused,
- _flagChildrenReordered,
- _flagInvalidateMeasure,
- _flagOnMeasure,
- _flagOnSizeAllocated,
- _flagSizeAllocated,
- _flagOnParentSet,
- _flagSizeChanged;
-
- public class SubButton : Button
- {
- public SubButton()
- : base()
- {
-
- }
-
- protected override SizeRequest OnMeasure(double w, double h)
- {
- Console.WriteLine("OnMeasure invoked");
- _flagOnMeasure = true;
- return base.OnMeasure(w, h);
- }
-
-
- protected override void OnParentSet()
- {
- Console.WriteLine("OnParentSet invoked");
- _flagOnParentSet = true;
- base.OnParentSet();
- }
-
- protected override void OnSizeAllocated(double width, double height)
- {
- _flagOnSizeAllocated = true;
- base.OnSizeAllocated(width, height);
- }
-
- public void TestInvalidateMeasure()
- {
- Console.WriteLine("TestInvalidateMeasure invoked");
- this.InvalidateMeasure();
- return;
- }
-
- protected override void InvalidateMeasure()
- {
- Console.WriteLine("InvalidateMeasure invoked");
- _flagInvalidateMeasure = true;
- return;
- }
- }
-
- private static bool
- _flagLayoutChildren,
- _flagOnChildAdded,
- _flagOnChildRemoved,
- _flagOnChildrenReordered,
- _flagOnSizeRequest;
- internal class SubAbsoluteLayout : AbsoluteLayout
- {
- protected override void LayoutChildren(double x, double y, double width, double height)
- {
- _flagLayoutChildren = true;
- base.LayoutChildren(x, y, width, height);
- }
-
- protected override void OnChildAdded(Element child)
- {
- _flagOnChildAdded = true;
- base.OnChildAdded(child);
- }
-
- protected override void OnChildRemoved(Element child)
- {
- _flagOnChildRemoved = true;
- base.OnChildRemoved(child);
- }
- protected override SizeRequest OnSizeRequest(double widthConstraint, double heightConstraint)
- {
- _flagOnSizeRequest = true;
- return base.OnSizeRequest(widthConstraint, heightConstraint);
- }
- }
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("VisualElementTests --------------- Setup()");
- _visualElement = new ContentPage();
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("VisualElementTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property AnchorX is readable and writable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.AnchorX A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void AnchorX_READ_WRITE()
- {
- /* TEST CODE */
- var anchorX = 5.00;
- _visualElement.AnchorX = anchorX;
- Assert.True(Double.Equals(_visualElement.AnchorX, anchorX), "AnchorX property doesn't set and get successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property AnchorY is readable and writable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.AnchorY A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void AnchorY_READ_WRITE()
- {
- /* TEST CODE */
- var anchorY = 5.00;
- _visualElement.AnchorY = anchorY;
- Assert.True(Double.Equals(_visualElement.AnchorY, anchorY), "AnchorY property doesn't set and get successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property BackgroundColor is readable and writable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.BackgroundColor A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void BackgroundColor_READ_WRITE()
- {
- /* TEST CODE */
- _visualElement.BackgroundColor = Color.Gray;
- Assert.IsInstanceOf<Color>(_visualElement.BackgroundColor, "Should be instance of Color.");
- Assert.AreEqual(Color.Gray, _visualElement.BackgroundColor, "BackgroundColor doesn't set and get successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Bounds is readable.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.Bounds A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Bounds_READ()
- {
- /*PRECONDITION*/
- /*
- * Create a Rectangle instance.
- * Updates the Rectangle of the element during the layout cycle
- */
- _visualElement.HeightRequest = 10.00;
- _visualElement.WidthRequest = 12.00;
- Rectangle rect = new Rectangle(1.00, 1.00, _visualElement.WidthRequest, _visualElement.HeightRequest);
- _visualElement.Layout(rect);
-
- /* TEST CODE */
- var getRect = _visualElement.Bounds;
- Assert.IsInstanceOf<Rectangle>(getRect, "Get Rect should return object Rectangle");
- Assert.AreEqual(getRect, rect, "Bounds property doesn't set and get successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Height is readable.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.Height A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Height_READ()
- {
- /* TEST CODE */
- var getHeight = _visualElement.Height;
- Assert.IsInstanceOf<double>(getHeight, "Get Height should return object double");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property HeightRequest is readable and writable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.HeightRequest A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void HeightRequest_READ_WRITE()
- {
- /* TEST CODE */
- var heightReq = 25.00;
- _visualElement.HeightRequest = heightReq;
- Assert.True(Double.Equals(_visualElement.HeightRequest, heightReq), "HeightRequest property doesn't set and get successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property IsVisible is readable and writable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.IsVisible A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void IsVisible_READ_WRITE()
- {
- /* TEST CODE */
- _visualElement.IsVisible = false;
- Assert.False(_visualElement.IsVisible, "IsVisible property is not set true");
- _visualElement.IsVisible = true;
- Assert.True(_visualElement.IsVisible, "IsVisible property is not set false");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property MinimumHeightRequest is readable and writable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.MinimumHeightRequest A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void MinimumHeightRequest_READ_WRITE()
- {
- /* TEST CODE */
- Assert.AreEqual(-1, _visualElement.MinimumHeightRequest, "MinimumHeightRequest property Default value is not -1");
- var getMinHeightReq = 20.00;
- _visualElement.MinimumHeightRequest = getMinHeightReq;
- Assert.True(Double.Equals(_visualElement.MinimumHeightRequest, getMinHeightReq), "MinimumHeightRequest property doesn't set and get successfully.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property MinimumWidthRequest is readable and writable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.MinimumWidthRequest A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void MinimumWidthRequest_READ_WRITE()
- {
- /* TEST CODE */
- Assert.AreEqual(-1, _visualElement.MinimumWidthRequest, "MinimumWidthRequest property Default value is not -1");
- var getMinWidthReq = 20.00;
- _visualElement.MinimumWidthRequest = getMinWidthReq;
- Assert.True(Double.Equals(_visualElement.MinimumWidthRequest, getMinWidthReq), "MinimumWidthRequest property doesn't set and get successfully.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Opacity is readable and writable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.Opacity A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Opacity_READ_WRITE()
- {
- /*PRECONDITION*/
- /*
- * Set IsVisible property true.
- */
- _visualElement.IsVisible = true;
-
- /* TEST CODE */
- var opacity = 0.01;
- _visualElement.Opacity = opacity;
- Assert.True(Double.Equals(_visualElement.Opacity, opacity), "HeightRequest property doesn't set and get successfully.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Rotation is readable and writable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.Rotation A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Rotation_READ_WRITE()
- {
- /* TEST CODE */
- var rotation = 5.00;
- _visualElement.Rotation = rotation;
- Assert.True(Double.Equals(_visualElement.Rotation, rotation), "Rotation property doesn't set and get successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property RotationX is readable and writable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.RotationX A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void RotationX_READ_WRITE()
- {
- /* TEST CODE */
- var rotationX = 5.00;
- _visualElement.RotationX = rotationX;
- Assert.True(Double.Equals(_visualElement.RotationX, rotationX), "RotationX property doesn't set and get successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property RotationY is readable and writable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.RotationY A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void RotationY_READ_WRITE()
- {
- /* TEST CODE */
- var rotationY = 5.00;
- _visualElement.RotationY = rotationY;
- Assert.True(Double.Equals(_visualElement.RotationY, rotationY), "RotationY property doesn't set and get successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Scale is readable and writable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.Scale A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Scale_READ_WRITE()
- {
- /* TEST CODE */
- Assert.AreEqual(1.0, _visualElement.Scale, "Scale property Default value is not 1.0");
- var scale = 5.00;
- _visualElement.Scale = scale;
- Assert.True(Double.Equals(_visualElement.Scale, scale), "Scale property doesn't set and get successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Style is readable and writable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.Style A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Style_READ_WRITE()
- {
- /* TEST CODE */
- var contentPageRedStyle = new Style(typeof(ContentPage))
- {
- Setters = {
- new Setter { Property = ContentPage.BackgroundColorProperty, Value = Color.Red }
- }
- };
- _visualElement.Style = contentPageRedStyle;
- var getStyle = _visualElement.Style;
- Assert.IsInstanceOf<Style>(getStyle, "Get Style should return object Style");
- Assert.AreEqual(getStyle, contentPageRedStyle, "Style property doesn't set and get successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property StyleClass is readable and writable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.StyleClass A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void StyleClass_READ_WRITE()
- {
- /* TEST CODE */
- System.Collections.Generic.List<string> strStyleClass = new System.Collections.Generic.List<string>();
- strStyleClass.Add("StyleClass");
- _visualElement.StyleClass = strStyleClass;
- var getStyleClass = _visualElement.StyleClass;
- Assert.AreEqual(strStyleClass, getStyleClass, "StyleClass property doesn't set and get successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property TranslationX is readable and writable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.TranslationX A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void TranslationX_READ_WRITE()
- {
- /* TEST CODE */
- var translationX = 15.00;
- _visualElement.TranslationX = translationX;
- Assert.True(Double.Equals(_visualElement.TranslationX, translationX), "TranslationX property doesn't set and get successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property TranslationY is readable and writable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.TranslationY A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void TranslationY_READ_WRITE()
- {
- /* TEST CODE */
- var translationY = 7.00;
- _visualElement.TranslationY = translationY;
- Assert.True(Double.Equals(_visualElement.TranslationY, translationY), "TranslationY property doesn't set and get successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Width is readable.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.Width A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Width_READ()
- {
- /* TEST CODE */
- var getWidth = _visualElement.Width;
- Assert.IsInstanceOf<double>(getWidth, "Get Width should return object double");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property WidthRequest is readable and writable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.WidthRequest A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void WidthRequest_READ_WRITE()
- {
- /* TEST CODE */
- var widthReq = 25.00;
- _visualElement.WidthRequest = widthReq;
- Assert.True(Double.Equals(_visualElement.WidthRequest, widthReq), "WidthRequest property doesn't set and get successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property X is readable.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.X A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void X_READ()
- {
- /* TEST CODE */
- var getX = _visualElement.X;
- Assert.IsInstanceOf<double>(getX, "Get X should return object double");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Y is readable.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.Y A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Y_READ()
- {
- /* TEST CODE */
- var getY = _visualElement.Y;
- Assert.IsInstanceOf<double>(getY, "Get Y should return object double");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of HeightRequestProperty's bound or not")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.HeightRequestProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void HeightRequestProperty_READ_ONLY()
- {
- /*TEST CODE*/
- var mFirstHeightRequestProperty = 22.00;
- var mSecondHeightRequestProperty = 6.00;
-
- _visualElement.HeightRequest = mFirstHeightRequestProperty;
- Page mPage = new Page();
- mPage.HeightRequest = mSecondHeightRequestProperty;
- Assert.AreNotEqual(mPage.HeightRequest, _visualElement.HeightRequest, "HeightRequestProperty of _visualElement value must be different form HeightRequestProperty of mPage value");
- _visualElement.BindingContext = mPage;
- _visualElement.SetBinding(VisualElement.HeightRequestProperty, "HeightRequest");
- Assert.AreEqual(mPage.HeightRequest, _visualElement.HeightRequest, "HeightRequestProperty of mPage value & HeightRequestProperty of _visualElement value should be same ");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of AnchorXProperty's bound or not")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.AnchorXProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void AnchorXProperty_READ_ONLY()
- {
- /*TEST CODE*/
- var mFirstAnchorX = 8.00;
- var mSecondAnchorX = 6.00;
-
- _visualElement.AnchorX = mFirstAnchorX;
- Page mPage = new Page();
- mPage.AnchorX = mSecondAnchorX;
- Assert.AreNotEqual(mPage.AnchorX, _visualElement.AnchorX, "AnchorXProperty of _visualElement value must be different form AnchorXProperty of mPage value");
- _visualElement.BindingContext = mPage;
- _visualElement.SetBinding(VisualElement.AnchorXProperty, "AnchorX");
- Assert.AreEqual(mPage.AnchorX, _visualElement.AnchorX, "AnchorXProperty of mPage value & AnchorXProperty of _visualElement value should be same ");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of AnchorYProperty's bound or not")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.AnchorYProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void AnchorYProperty_READ_ONLY()
- {
- /*TEST CODE*/
- var mFirstAnchorY = 8.00;
- var mSecondAnchorY = 6.00;
-
- _visualElement.AnchorY = mFirstAnchorY;
- Page mPage = new Page();
- mPage.AnchorY = mSecondAnchorY;
- Assert.AreNotEqual(mPage.AnchorY, _visualElement.AnchorY, "AnchorYProperty of _visualElement value must be different form AnchorYProperty of mPage value");
- _visualElement.BindingContext = mPage;
- _visualElement.SetBinding(VisualElement.AnchorYProperty, "AnchorY");
- Assert.AreEqual(mPage.AnchorY, _visualElement.AnchorY, "AnchorYProperty of mPage value & AnchorYProperty of _visualElement value should be same ");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of BackgroundColorProperty's bound or not")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.BackgroundColorProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void BackgroundColorProperty_READ_ONLY()
- {
- /*TEST CODE*/
- var mFirstBGColor = new Color(255, 0, 0);
- var mSecondBGColor = new Color(0, 0, 255);
-
- _visualElement.BackgroundColor = mFirstBGColor;
- Page mPage = new Page();
- mPage.BackgroundColor = mSecondBGColor;
- Assert.AreNotEqual(mPage.BackgroundColor, _visualElement.BackgroundColor, "BackgroundColorProperty of _visualElement value must be different form BackgroundColorProperty of mPage value");
- _visualElement.BindingContext = mPage;
- _visualElement.SetBinding(VisualElement.BackgroundColorProperty, "BackgroundColor");
- Assert.AreEqual(mPage.BackgroundColor, _visualElement.BackgroundColor, "BackgroundColorProperty of mPage value & BackgroundColorProperty of _visualElement value should be same ");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of HeightProperty's bound or not")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.HeightProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void HeightProperty_READ_ONLY()
- {
- /*TEST CODE*/
- Page mPage = new Page();
- _visualElement.BindingContext = mPage;
- _visualElement.SetBinding(VisualElement.HeightProperty, "Height");
- Assert.IsNotNull(VisualElement.HeightProperty);
- Assert.IsInstanceOf<double>(_visualElement.Height);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of MinimumHeightRequestProperty's bound or not")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.MinimumHeightRequestProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void MinimumHeightRequestProperty_READ_ONLY()
- {
- /*TEST CODE*/
- var mFirstMinHeight = 22.00;
- var mSecondMinHeight = 6.00;
-
- _visualElement.MinimumHeightRequest = mFirstMinHeight;
- Page mPage = new Page();
- mPage.MinimumHeightRequest = mSecondMinHeight;
- Assert.AreNotEqual(mPage.MinimumHeightRequest, _visualElement.MinimumHeightRequest, "MinimumHeightRequestProperty of _visualElement value must be different form MinimumHeightRequestProperty of mPage value");
- _visualElement.BindingContext = mPage;
- _visualElement.SetBinding(VisualElement.MinimumHeightRequestProperty, "MinimumHeightRequest");
- Assert.AreEqual(mPage.MinimumHeightRequest, _visualElement.MinimumHeightRequest, "MinimumHeightRequestProperty of mPage value & MinimumHeightRequestProperty of _visualElement value should be same ");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of MinimumWidthRequestProperty's bound or not")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.MinimumWidthRequestProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void MinimumWidthRequestProperty_READ_ONLY()
- {
- /*TEST CODE*/
- var mFirstMinWidth = 22.00;
- var mSecondMinWidth = 6.00;
-
- _visualElement.MinimumWidthRequest = mFirstMinWidth;
- Page mPage = new Page();
- mPage.MinimumWidthRequest = mSecondMinWidth;
- Assert.AreNotEqual(mPage.MinimumWidthRequest, _visualElement.MinimumWidthRequest, "MinimumWidthRequestProperty of _visualElement value must be different form MinimumWidthRequestProperty of mPage value");
- _visualElement.BindingContext = mPage;
- _visualElement.SetBinding(VisualElement.MinimumWidthRequestProperty, "MinimumWidthRequest");
- Assert.AreEqual(mPage.MinimumWidthRequest, _visualElement.MinimumWidthRequest, "MinimumWidthRequestProperty of mPage value & MinimumWidthRequestProperty of _visualElement value should be same ");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of OpacityProperty's bound or not")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.OpacityProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void OpacityProperty_READ_ONLY()
- {
- /*TEST CODE*/
- var mFirstOpacity = 0.50;
- var mSecondOpacity = 0.60;
-
- _visualElement.IsVisible = true;
- _visualElement.Opacity = mFirstOpacity;
- Page mPage = new Page();
- mPage.IsVisible = true;
- mPage.Opacity = mSecondOpacity;
- Assert.AreNotEqual(mPage.Opacity, _visualElement.Opacity, "OpacityProperty of _visualElement value must be different form OpacityProperty of mPage value");
- _visualElement.BindingContext = mPage;
- _visualElement.SetBinding(VisualElement.OpacityProperty, "Opacity");
- Assert.AreEqual(mPage.Opacity, _visualElement.Opacity, "OpacityProperty of mPage value & OpacityProperty of _visualElement value should be same ");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of RotationProperty's bound or not")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.RotationProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void RotationProperty_READ_ONLY()
- {
- /*TEST CODE*/
- var mFirstRotation = 5.50;
- var mSecondRotation = 7.60;
-
- _visualElement.Rotation = mFirstRotation;
- Page mPage = new Page();
- mPage.Rotation = mSecondRotation;
- Assert.AreNotEqual(mPage.Rotation, _visualElement.Rotation, "RotationProperty of _visualElement value must be different form RotationProperty of mPage value");
- _visualElement.BindingContext = mPage;
- _visualElement.SetBinding(VisualElement.RotationProperty, "Rotation");
- Assert.AreEqual(mPage.Rotation, _visualElement.Rotation, "RotationProperty of mPage value & RotationProperty of _visualElement value should be same ");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of RotationXProperty's bound or not")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.RotationXProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void RotationXProperty_READ_ONLY()
- {
- /*TEST CODE*/
- var mFirstRotationX = 5.50;
- var mSecondRotationX = 7.60;
-
- _visualElement.RotationX = mFirstRotationX;
- Page mPage = new Page();
- mPage.RotationX = mSecondRotationX;
- Assert.AreNotEqual(mPage.RotationX, _visualElement.RotationX, "RotationXProperty of _visualElement value must be different form RotationXProperty of mPage value");
- _visualElement.BindingContext = mPage;
- _visualElement.SetBinding(VisualElement.RotationXProperty, "RotationX");
- Assert.AreEqual(mPage.RotationX, _visualElement.RotationX, "RotationXProperty of mPage value & RotationXProperty of _visualElement value should be same ");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of RotationYProperty's bound or not")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.RotationYProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void RotationYProperty_READ_ONLY()
- {
- /*TEST CODE*/
- var mFirstRotationY = 5.50;
- var mSecondRotationY = 7.60;
-
- _visualElement.RotationY = mFirstRotationY;
- Page mPage = new Page();
- mPage.RotationY = mSecondRotationY;
- Assert.AreNotEqual(mPage.RotationY, _visualElement.RotationY, "RotationYProperty of _visualElement value must be different form RotationYProperty of mPage value");
- _visualElement.BindingContext = mPage;
- _visualElement.SetBinding(VisualElement.RotationYProperty, "RotationY");
- Assert.AreEqual(mPage.RotationY, _visualElement.RotationY, "RotationYProperty of mPage value & RotationYProperty of _visualElement value should be same ");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of ScaleProperty's bound or not")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.ScaleProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void ScaleProperty_READ_ONLY()
- {
- /*TEST CODE*/
- var mFirstScale = 5.50;
- var mSecondScale = 7.60;
-
- _visualElement.Scale = mFirstScale;
- Page mPage = new Page();
- mPage.Scale = mSecondScale;
- Assert.AreNotEqual(mPage.Scale, _visualElement.Scale, "ScaleProperty of _visualElement value must be different form ScaleProperty of mPage value");
- _visualElement.BindingContext = mPage;
- _visualElement.SetBinding(VisualElement.ScaleProperty, "Scale");
- Assert.AreEqual(mPage.Scale, _visualElement.Scale, "ScaleProperty of mPage value & ScaleProperty of _visualElement value should be same ");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of StyleProperty's bound or not")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.StyleProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void StyleProperty_READ_ONLY()
- {
- /*TEST CODE*/
- var contentPageRedStyle = new Style(typeof(ContentPage))
- {
- Setters = {
- new Setter { Property = ContentPage.BackgroundColorProperty, Value = Color.Red }
- }
- };
- var contentPageBlueStyle = new Style(typeof(ContentPage))
- {
- Setters = {
- new Setter { Property = ContentPage.BackgroundColorProperty, Value = Color.Blue }
- }
- };
-
- _visualElement.Style = contentPageRedStyle;
- Page mPage = new Page();
- mPage.Style = contentPageBlueStyle;
- Assert.AreNotEqual(mPage.Style, _visualElement.Style, "StyleProperty of _visualElement value must be different form StyleProperty of mPage value");
- _visualElement.BindingContext = mPage;
- _visualElement.SetBinding(VisualElement.StyleProperty, "Style");
- Assert.AreEqual(mPage.Style, _visualElement.Style, "StyleProperty of mPage value & StyleProperty of _visualElement value should be same ");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of TranslationXProperty's bound or not")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.TranslationXProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void TranslationXProperty_READ_ONLY()
- {
- /*TEST CODE*/
- var mFirstTranslationX = 5.50;
- var mSecondTranslationX = 7.60;
-
- _visualElement.TranslationX = mFirstTranslationX;
- Page mPage = new Page();
- mPage.TranslationX = mSecondTranslationX;
- Assert.AreNotEqual(mPage.TranslationX, _visualElement.TranslationX, "TranslationXProperty of _visualElement value must be different form TranslationXProperty of mPage value");
- _visualElement.BindingContext = mPage;
- _visualElement.SetBinding(VisualElement.TranslationXProperty, "TranslationX");
- Assert.AreEqual(mPage.TranslationX, _visualElement.TranslationX, "TranslationXProperty of mPage value & TranslationXProperty of _visualElement value should be same ");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of TranslationYProperty's bound or not")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.TranslationYProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void TranslationYProperty_READ_ONLY()
- {
- /*TEST CODE*/
- var mFirstTranslationY = 5.50;
- var mSecondTranslationY = 7.60;
-
- _visualElement.TranslationY = mFirstTranslationY;
- Page mPage = new Page();
- mPage.TranslationY = mSecondTranslationY;
- Assert.AreNotEqual(mPage.TranslationY, _visualElement.TranslationY, "TranslationYProperty of _visualElement value must be different form TranslationYProperty of mPage value");
- _visualElement.BindingContext = mPage;
- _visualElement.SetBinding(VisualElement.TranslationYProperty, "TranslationY");
- Assert.AreEqual(mPage.TranslationY, _visualElement.TranslationY, "TranslationYProperty of mPage value & TranslationYProperty of _visualElement value should be same ");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of WidthProperty's bound or not")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.WidthProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void WidthProperty_READ_ONLY()
- {
- /*TEST CODE*/
- Page mPage = new Page();
- _visualElement.BindingContext = mPage;
- _visualElement.SetBinding(VisualElement.WidthProperty, "Width");
- Assert.IsNotNull(VisualElement.WidthProperty);
- Assert.IsInstanceOf<double>(_visualElement.Width);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of WidthRequestProperty's bound or not")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.WidthRequestProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void WidthRequestProperty_READ_ONLY()
- {
- /*TEST CODE*/
- var mFirstWidthReq = 8.00;
- var mSecondWidthReq = 6.00;
-
- _visualElement.WidthRequest = mFirstWidthReq;
- Page mPage = new Page();
- mPage.WidthRequest = mSecondWidthReq;
- Assert.AreNotEqual(mPage.WidthRequest, _visualElement.WidthRequest, "WidthRequestProperty of _visualElement value must be different form WidthRequestProperty of mPage value");
- _visualElement.BindingContext = mPage;
- _visualElement.SetBinding(VisualElement.WidthRequestProperty, "WidthRequest");
- Assert.AreEqual(mPage.WidthRequest, _visualElement.WidthRequest, "WidthRequestProperty of mPage value & WidthRequestProperty of _visualElement value should be same ");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of XProperty's bound or not")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.XProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void XProperty_READ_ONLY()
- {
- /*TEST CODE*/
- Page mPage = new Page();
- _visualElement.BindingContext = mPage;
- _visualElement.SetBinding(VisualElement.XProperty, "X");
- Assert.IsNotNull(VisualElement.XProperty);
- Assert.IsInstanceOf<double>(_visualElement.X);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of YProperty's bound or not")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.YProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void YProperty_READ_ONLY()
- {
- /*TEST CODE*/
- Page mPage = new Page();
- _visualElement.BindingContext = mPage;
- _visualElement.SetBinding(VisualElement.YProperty, "Y");
- Assert.IsNotNull(VisualElement.YProperty);
- Assert.IsInstanceOf<double>(_visualElement.Y);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Behaviors is readable.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.Behaviors A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Behaviors_READ()
- {
- /* TEST CODE */
- var getBehaviors = _visualElement.Behaviors;
- Assert.IsInstanceOf<System.Collections.Generic.IList<Behavior>>(getBehaviors, "Get Behaviors should return object Behavior");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of BehaviorsProperty's bound or not")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.BehaviorsProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void BehaviorsProperty_READ_ONLY()
- {
- /*TEST CODE*/
- Page mPage = new Page();
- _visualElement.BindingContext = mPage;
- _visualElement.SetBinding(VisualElement.BehaviorsProperty, "Behaviors");
- Assert.IsNotNull(VisualElement.BehaviorsProperty);
- Assert.IsInstanceOf<System.Collections.Generic.IList<Behavior>>(_visualElement.Behaviors);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the Opacity property set with out of bound max values.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.Opacity A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PMAX")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Opacity_READ_WRITE_CHECK_OUT_OF_BOUND_MAX()
- {
- /*PRECONDITION*/
- /*
- * 1. Set IsVisible property true.
- */
- _visualElement.IsVisible = true;
-
- /* TEST CODE */
- var opacityMax = 2.0;
- _visualElement.Opacity = opacityMax;
- Assert.True(Double.Equals((double)1, _visualElement.Opacity), "Should be set to th Max value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the Opacity property set with out of bound min values.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.Opacity A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PMIN")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Opacity_CHECK_OUT_OF_BOUND_MIN()
- {
- /*PRECONDITION*/
- /*
- * 1. Set IsVisible property true.
- */
- _visualElement.IsVisible = true;
-
- /* TEST CODE */
- var opacityMin = -2.00;
- _visualElement.Opacity = opacityMin;
- Assert.True(Double.Equals((double)0, _visualElement.Opacity), "Should be set to th Min value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the IsEnabled property is readable and writable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.IsEnabled A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void IsEnabled_READ_WRITE()
- {
- /* TEST CODE */
- Assert.True(_visualElement.IsEnabled, "IsEnabled property does not set default value true");
- _visualElement.IsEnabled = false;
- Assert.False(_visualElement.IsEnabled, "IsEnabled property does not set false");
- _visualElement.IsEnabled = true;
- Assert.True(_visualElement.IsEnabled, "IsEnabled property does not set true");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether IsEnabledProperty property bound or not")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.IsEnabledProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void IsEnabledProperty_READ_ONLY()
- {
- /* TEST CODE */
- _visualElement.IsEnabled = false;
- Page mPage = new Page();
- mPage.IsEnabled = true;
- Assert.AreNotEqual(mPage.IsEnabled, _visualElement.IsEnabled, "IsEnabledProperty value must be different.");
- _visualElement.BindingContext = mPage;
- _visualElement.SetBinding(VisualElement.IsEnabledProperty, "IsEnabled");
- Assert.AreEqual(mPage.IsEnabled, _visualElement.IsEnabled, "After binding, should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the InputTransparent property is readable and writable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.InputTransparent A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void InputTransparent_READ_WRITE()
- {
- /* TEST CODE */
- _visualElement.InputTransparent = true;
- Assert.True(_visualElement.InputTransparent, "InputTransparent property does not set true");
- _visualElement.InputTransparent = false;
- Assert.False(_visualElement.InputTransparent, "InputTransparent property does not set false");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether InputTransparentProperty property bound or not")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.InputTransparentProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void InputTransparentProperty_READ_ONLY()
- {
- /* TEST CODE */
- _visualElement.InputTransparent = true;
- Page mPage = new Page();
- mPage.InputTransparent = false;
- Assert.AreNotEqual(mPage.InputTransparent, _visualElement.InputTransparent, "InputTransparentProperty value must be different.");
- _visualElement.BindingContext = mPage;
- _visualElement.SetBinding(VisualElement.InputTransparentProperty, "InputTransparent");
- Assert.AreEqual(mPage.InputTransparent, _visualElement.InputTransparent, "After binding, should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether IsVisibleProperty property bound or not")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.IsVisibleProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void IsVisibleProperty_READ_ONLY()
- {
- /* TEST CODE */
- _visualElement.IsVisible = false;
- Page mPage = new Page();
- mPage.IsVisible = true;
- Assert.AreNotEqual(mPage.IsVisible, _visualElement.IsVisible, "IsVisibleProperty value must be different.");
- _visualElement.BindingContext = mPage;
- _visualElement.SetBinding(VisualElement.IsVisibleProperty, "IsVisible");
- Assert.AreEqual(mPage.IsVisible, _visualElement.IsVisible, "After binding, should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the IsFocused property is readable.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.IsFocused A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void IsFocused_READ()
- {
- /* TEST CODE */
- var getIsFocused = _visualElement.IsFocused;
- Assert.IsInstanceOf<bool>(getIsFocused, "Get IsFocused should return object bool");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether IsFocusedProperty property bound or not")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.IsFocusedProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void IsFocusedProperty_READ_ONLY()
- {
- /* TEST CODE */
- Page mPage = new Page();
- _visualElement.BindingContext = mPage;
- _visualElement.SetBinding(VisualElement.IsFocusedProperty, "IsFocused");
- Assert.IsNotNull(VisualElement.IsFocusedProperty, "IsFocusedProperty property should not be null");
- Assert.IsInstanceOf<bool>(_visualElement.IsFocused, "IsFocusedProperty property should return object Boolean");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the Resources property is readable and writable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.Resources A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Resources_READ_WRITE()
- {
- /* TEST CODE */
- var resources = new ResourceDictionary();
- _visualElement.Resources = resources;
- Assert.AreEqual(resources, _visualElement.Resources, "Resources property doesn't set and get successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ChildrenReordered Event is raised when a property is changed.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.ChildrenReordered E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void ChildrenReordered_EVENT()
- {
- /* TEST CODE */
- VisualElement stack = new StackLayout();
- var child1 = new Button();
- var child2 = new Button();
- var child3 = new Button();
-
- ((StackLayout)stack).Children.Add(child1);
- ((StackLayout)stack).Children.Add(child2);
- ((StackLayout)stack).Children.Add(child3);
-
- _flagChildrenReordered = false;
- stack.ChildrenReordered += (sender, args) => _flagChildrenReordered = true;
- ((StackLayout)stack).LowerChild(child2);
- Assert.IsTrue(_flagChildrenReordered, "Event value changed should be handled.");
- }
- private void SizeChangedCB(object sender, System.EventArgs e)
- {
- _flagSizeChanged = true;
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether SizeChanged Event is raised when a property is changed.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.SizeChanged E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void SizeChanged_EVENT()
- {
- /*PRECONDITION*/
- /*
- * 1. Set IsVisible property true.
- */
- VisualElement visualElement = new Button { Text = "btntext" };
- visualElement.IsVisible = true;
-
- /* TEST CODE */
- StackLayout stack = new StackLayout();
- stack.Children.Add((Xamarin.Forms.View)visualElement);
- _flagSizeChanged = false;
- visualElement.SizeChanged += SizeChangedCB;
-
- visualElement.Layout(new Rectangle(0, 0, 100, 100));
-
- Assert.IsTrue(_flagSizeChanged, "Event value changed should be handled.");
- visualElement.SizeChanged -= SizeChangedCB;
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether MeasureInvalidated Event is raised when a property is changed.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.MeasureInvalidated E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void MeasureInvalidated_EVENT()
- {
- /* TEST CODE */
- var stack = new StackLayout();
- VisualElement visual = new Button();
- visual.IsVisible = false;
-
- bool flagMeasure = false;
- visual.MeasureInvalidated += (sender, args) => flagMeasure = true;
- visual.IsVisible = true;
- Assert.IsTrue(flagMeasure, "Event value changed should be handled.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check BatchBegin returns without any exceptions")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.BatchBegin M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void BatchBegin_CHECK()
- {
- /* TEST CODE */
- try
- {
- VisualElement visual = new Button();
- visual.BatchBegin();
- Assert.True(true);
- }
- catch (Exception ex)
- {
- Assert.False(false, "Should not throw exception. " + ex.ToString());
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check BatchCommit returns without any exceptions")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.BatchCommit M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void BatchCommit_CHECK()
- {
- /* TEST CODE */
- try
- {
- VisualElement visual = new Button();
- visual.BatchBegin();
- visual.BatchCommit();
- Assert.True(true);
- }
- catch (Exception ex)
- {
- Assert.False(false, "Should not throw exception. " + ex.ToString());
- }
- }
-
- //[Test] //manual
- [Category("P1")]
- [Description("Check the return value of Focus.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.Focus M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Focus_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- App app = XamarinForTizen.Tizen.Program.getApp();
-
- var stackLayout = new StackLayout()
- {
- Orientation = StackOrientation.Horizontal,
- IsVisible = true,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- };
-
- Button btn = new Button()
- {
- HorizontalOptions = LayoutOptions.Center,
- Text = "Focus",
- FontSize = 30,
- WidthRequest = 300,
- HeightRequest = 80,
- };
-
- stackLayout.Children.Add(btn);
-
- ContentPage page = new ContentPage()
- {
- Content = stackLayout
- };
-
- bool flagFocused = false;
-
- NavigationPage navi = new NavigationPage(page);
- app.MainPage = navi;
-
- btn.Focused += (sender, arg) => flagFocused = true;
- btn.Focus();
-
- Assert.IsTrue(btn.IsFocused, "Return value of Focus should be true.");
-
- }
-
- //[Test]
- [Category("P1")]
- [Description("After Focus invoking, check whether focused or not.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.Focus M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Focus_CHECK_STATUS()
- {
- /* TEST CODE */
- VisualElement visual = new Button();
- bool flagFocused = false;
- visual.Focused += (sender, args) => flagFocused = true;
- visual.Focus();
- Assert.IsTrue(visual.IsFocused, "IsFocused should be True.");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check whether Focused Event is raised when a property is changed.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.Focused E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Focused_EVENT()
- {
- /* TEST CODE */
- VisualElement visualElement = new Button();
-
- bool flagFocused = false;
- visualElement.Focused += (sender, args) => flagFocused = true;
-
- visualElement.SetValue(VisualElement.IsFocusedProperty, true);
-
- Assert.IsTrue(flagFocused, "Event value changed should be handled.");
- }
-
- [Test]
- [Category("P1")]
- [Description("After Unfocus, check the element is unfocused.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.Unfocus M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Unfocus_CHECK()
- {
- /* TEST CODE */
- VisualElement visualElement = new Button();
- visualElement.Unfocus();
- Assert.False(visualElement.IsFocused, "Element is not unfocused.");
- }
-
- [Test]
- [Category("P1")]
- [Description("After Unfocus invoking, check whether unfocused or not.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.Unfocus M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Unfocus_CHECK_STATUS()
- {
- /* TEST CODE */
- VisualElement visual = new Button();
- bool flagUnfocused = false;
- visual.Unfocused += (sender, args) => flagUnfocused = true;
- visual.Unfocus();
- Assert.IsFalse(visual.IsFocused, "Event value changed should be handled.");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check whether Unfocused Event is raised when a property is changed.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.Unfocused E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Unfocused_EVENT()
- {
- /* TEST CODE */
- VisualElement visualElement = new Button();
-
- bool flagUnfocused = false;
- visualElement.SetValue(VisualElement.IsFocusedProperty, true);
- visualElement.Unfocused += (sender, args) => flagUnfocused = true;
-
- visualElement.SetValue(VisualElement.IsFocusedProperty, false);
-
- Assert.IsTrue(flagUnfocused, "Event value changed should be handled.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Layout.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.Layout M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Layout_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- VisualElement visual = new Button();
- visual.Layout(new Rectangle(50, 25, 100, 200));
-
- Assert.AreEqual(visual.X, 50, "The position of the Rectangle on the X axis should be 50.");
- Assert.AreEqual(visual.Y, 25, "The position of the Rectangle on the Y axis should be 25.");
- Assert.AreEqual(visual.Width, 100, "Extent along the X axis should be 100.");
- Assert.AreEqual(visual.Height, 200, "Extent along the Y axis should be 200.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of GetSizeRequest.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.GetSizeRequest M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void GetSizeRequest_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- VisualElement visual = new Button();
- visual.WidthRequest = 50.00;
- visual.HeightRequest = 80.00;
-
- var res = visual.GetSizeRequest(double.PositiveInfinity, double.PositiveInfinity).Request;
- Assert.AreEqual(new Size(50.00, 80.00), res, "Width and Height values are not same.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Measure.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.Measure M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Measure_CHECK_RETURN_VALUE_MEASUREFLAGS_NONE()
- {
- /* TEST CODE */
- VisualElement visual = new Button();
- visual.WidthRequest = 50.00;
- visual.HeightRequest = 80.00;
-
- var res = visual.Measure(double.PositiveInfinity, double.PositiveInfinity, MeasureFlags.None);
- Assert.IsInstanceOf<SizeRequest>(res, "Should be SizeRequest Type.");
- Assert.AreEqual(new Size(50.00, 80.00), res.Request, "Width and Height values are not same.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Measure.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.Measure M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Measure_CHECK_RETURN_VALUE_MEASUREFLAGS_INCLUDEMARGINS()
- {
- /* TEST CODE */
- VisualElement visual = new Button();
- visual.WidthRequest = 50.00;
- visual.HeightRequest = 80.00;
-
- var res = visual.Measure(double.PositiveInfinity, double.PositiveInfinity, MeasureFlags.IncludeMargins);
- Assert.IsInstanceOf<SizeRequest>(res, "Should be SizeRequest Type.");
- Assert.AreEqual(new Size(50.00, 80.00), res.Request, "Width and Height values are not same.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether InvalidateMeasure is invoked or not.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.InvalidateMeasure M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Nguyen Thao, nguyen.tthao@samsung.com")]
- public void InvalidateMeasure_CHECK()
- {
- /* TEST CODE */
- _flagInvalidateMeasure = false;
- var subButton = new SubButton();
- subButton.TestInvalidateMeasure();
- Assert.True(_flagInvalidateMeasure, "InvalidateMeasure should be invoked");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OnChildAdded is invoked or not.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.OnChildAdded M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Nguyen Thao, nguyen.tthao@samsung.com")]
- public void OnChildAdded_CHECK()
- {
- /*PRE CONDITION
- * _flagOnChildAdded flag is initialize false value
- * Create a instance SubAbsoluteLayout
- */
- _flagOnChildAdded = false;
- Assert.False(_flagOnChildAdded, "_flagOnChildAdded should false initial");
- /**TEST CODE**/
- var mAbsoluteLayout = new SubAbsoluteLayout()
- {
- Children =
- {
- new Label() {
- Text = "My Tex",
- FontSize = 12
- },
- new Button()
- {
- Text = "My Button",
- BorderColor = new Color(0,0,0,0)
- }
- }
- };
- Assert.True(_flagOnChildAdded, "OnChildAdded overrided method not invoked.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OnChildRemoved is invoked or not.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.OnChildRemoved M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Nguyen Thao, nguyen.tthao@samsung.com")]
- public void OnChildRemoved_CHECK()
- {
- /*PRE CONDITION
- * _flagOnChildRemoved flag is initialize false value
- * Create a instance SubAbsoluteLayout
- */
- _flagOnChildRemoved = false;
- Assert.False(_flagOnChildRemoved, "_flagOnChildRemoved should false initial");
- /**TEST CODE**/
- var mAbsoluteLayout = new SubAbsoluteLayout()
- {
- Children =
- {
- new Label() {
- Text = "My Tex",
- FontSize = 12
- },
- new Button()
- {
- Text = "My Button",
- BorderColor = new Color(0,0,0,0)
- }
- }
- };
- mAbsoluteLayout.Children.RemoveAt(0);
- Assert.True(_flagOnChildRemoved, "OnChildRemoved overrided method not invoked.");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check whether OnChildrenReordered is invoked or not.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.OnChildrenReordered M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Nguyen Thao, nguyen.tthao@samsung.com")]
- public void OnChildrenReordered_CHECK()
- {
- /* TEST CODE */
-
- //invoke event
- _flagOnChildrenReordered = false;
- Assert.False(_flagOnChildrenReordered, "_flagOnChildrenReordered should false initial");
-
- VisualElement stack = new SubAbsoluteLayout();
- var child1 = new Button();
- var child2 = new Button();
- var child3 = new Button();
-
- ((SubAbsoluteLayout)stack).Children.Add(child1);
- ((SubAbsoluteLayout)stack).Children.Add(child2);
- ((SubAbsoluteLayout)stack).Children.Add(child3);
-
- _flagChildrenReordered = false;
- stack.ChildrenReordered += (sender, args) => _flagChildrenReordered = true;
- ((SubAbsoluteLayout)stack).LowerChild(child2);
- Assert.IsTrue(_flagChildrenReordered, "Event value changed should be handled.");
-
- //check on method
- Assert.True(_flagOnChildrenReordered, "OnChildrenReordered overrided method not invoked.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OnMeasure is invoked or not.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.OnMeasure M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void OnMeasure_CHECK()
- {
- /* TEST CODE */
- _flagOnMeasure = false;
- Assert.False(_flagOnMeasure, "_flagOnMeasure should false initial");
- var mButton = new SubButton()
- {
- Text = "My Button",
- BorderColor = new Color(0, 0, 0, 0)
- };
- var layout = new StackLayout();
- layout.Children.Add(mButton);
- mButton.Measure(100, 200, MeasureFlags.None);
- Assert.True(_flagOnMeasure, "OnMeasure overrided method not invoked.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OnParentSet is invoked or not.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.OnParentSet M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void OnParentSet_CHECK()
- {
- /* TEST CODE */
- _flagOnParentSet = false;
- var lbl = new Label();
- var subButton = new SubButton();
- subButton.Parent = lbl;
- Assert.True(_flagOnParentSet, "OnParentSet should be invoked");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OnSizeAllocated is invoked or not.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.OnSizeAllocated M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void OnSizeAllocated_CHECK()
- {
- /* TEST CODE */
- _flagOnSizeAllocated = false;
- var mButton = new SubButton()
- {
- Text = "My Button",
- BorderColor = new Color(0, 0, 0, 0),
- HeightRequest = 10,
- WidthRequest = 20
- };
- mButton.Layout(new Rectangle(0, 0, 100, 100));
- Assert.IsTrue(_flagOnSizeAllocated, "_flagOnSizeAllocated should be changed.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether OnSizeRequest is invoked or not.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.OnSizeRequest M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Nguyen Thao, nguyen.tthao@samsung.com")]
- public void OnSizeRequest_CHECK()
- {
- /*PRE CONDITION
- * _flagOnSizeRequest flag is initialize false value
- * Create a instance SubAbsoluteLayout
- */
- _flagOnSizeRequest = false;
- Assert.False(_flagOnSizeRequest, "_flagOnSizeRequest should false initial");
- /**TEST CODE**/
- var mButton = new Button()
- {
- Text = "My Button",
- BorderColor = new Color(0, 0, 0, 0)
- };
- var mAbsoluteLayout = new SubAbsoluteLayout()
- {
- Children =
- {
- new Label() {
- Text = "My Tex",
- FontSize = 12
- },
- mButton
- }
- };
- mAbsoluteLayout.Measure(100, 200, MeasureFlags.None);
- Assert.True(_flagOnSizeRequest, "OnSizeRequest overrided method not invoked.");
- }
-
- //[Test]
- [Category("P1")]
- [Description("Check whether SizeAllocated is invoked or not.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.SizeAllocated M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void SizeAllocated_CHECK()
- {
- /* TEST CODE */
- Assert.True(false, "[NA] Can't inherit this api for test");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Triggers is readable.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.Triggers A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Triggers_READ()
- {
- /* TEST CODE */
- var triggerOne = new Trigger(typeof(VisualElement))
- {
- Property = Entry.IsPasswordProperty,
- Value = true,
- Setters = { new Setter { Property = VisualElement.ScaleProperty, Value = 2d }, }
- };
-
- var triggerTwo = new Trigger(typeof(VisualElement))
- {
- Property = Entry.IsPasswordProperty,
- Value = false,
- Setters = { new Setter { Property = VisualElement.ScaleProperty, Value = 3d }, }
- };
-
- var btn = new Button()
- {
- Triggers =
- {
- triggerOne, triggerTwo
- }
- };
- btn.Text = "Hello Button";
-
- var triggers = btn.Triggers;
- Assert.IsNotNull(triggers, "btn.Triggers should not be null");
- foreach (var trigger in triggers)
- {
- Assert.IsNotNull(trigger, "Each Trigger in list should not null");
- }
- Assert.IsInstanceOf<IList<TriggerBase>>(triggers, "btn.Triggers should be List of TriggerBase");
- Assert.AreEqual(triggers[0], triggerOne, "Not returning expected trigeer.");
- Assert.AreEqual(triggers[1], triggerTwo, "Not returning expected trigeer.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of TriggersProperty's bound or not")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.TriggersProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Nguyen Thao, nguyen.tthao@samsung.com")]
- public void TriggersProperty_READ_ONLY()
- {
- /* TEST CODE */
- var getTriggersProperty = Page.TriggersProperty;
- Assert.IsInstanceOf<BindableProperty>(getTriggersProperty, "TriggersProperty should be return a BindableProperty object");
- Assert.IsTrue(getTriggersProperty.IsReadOnly, "IsReadOnly should be true");
- Assert.AreEqual("Triggers", getTriggersProperty.PropertyName, "PropertyName should be return 'Triggers'");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Navigation is readable.")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.Navigation A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Thao, nguyen.tthao@samsung.com")]
- public void Navigation_GET()
- {
- /* TEST CODE */
- var _page = new Page();
- _page.Title = "MyPage1";
- Assert.IsNotNull(_page.Navigation, "Navigation can't NUll");
- Assert.IsNotNull(_page.Navigation.NavigationStack, "NavigationStack can't NUll");
- Assert.AreEqual(0, _page.Navigation.NavigationStack.Count, "Stack should empty when init");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of NavigationProperty's bound or not")]
- [Property("SPEC", "Xamarin.Forms.VisualElement.NavigationProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Nguyen Thao, nguyen.tthao@samsung.com")]
- public void NavigationProperty_READ_ONLY()
- {
- /* TEST CODE */
- var getNavigationProperty = Page.NavigationProperty;
- Assert.IsInstanceOf<BindableProperty>(getNavigationProperty, "NavigationProperty should be return a BindableProperty object");
- Assert.IsTrue(getNavigationProperty.IsReadOnly, "IsReadOnly should be true");
- Assert.AreEqual("Navigation", getNavigationProperty.PropertyName, "PropertyName should be return 'Navigation'");
-
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.WebNavigatedEventArgs Tests")]
- public class WebNavigatedEventArgsTests
- {
- [SetUp]
- public void Setup()
- {
- Console.WriteLine("WebNavigatedEventArgsTests --------------- Setup()");
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("WebNavigatedEventArgsTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a WebNavigatedEventArgs object.")]
- [Property("SPEC", "Xamarin.Forms.WebNavigatedEventArgs.WebNavigatedEventArgs C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void WebNavigatedEventArgs_INIT()
- {
- /* TEST CODE */
- WebViewSource webViewSource = new HtmlWebViewSource();
- WebNavigatedEventArgs webNavigatedEventArgs = new WebNavigatedEventArgs(WebNavigationEvent.Forward, webViewSource, "Tizen", WebNavigationResult.Success);
- Assert.IsNotNull(webNavigatedEventArgs, "WebNavigatedEventArgs instance is null");
- Assert.IsInstanceOf<WebNavigatedEventArgs>(webNavigatedEventArgs, "Not an instance of WebNavigatedEventArgs.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the value for Result.")]
- [Property("SPEC", "Xamarin.Forms.WebNavigatedEventArgs.Result A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void Result_READ_ONLY()
- {
- /* TEST CODE */
- WebViewSource webViewSource = new HtmlWebViewSource();
- WebNavigatedEventArgs webNavigatedEventArgs = new WebNavigatedEventArgs(WebNavigationEvent.Forward, webViewSource, "Tizen", WebNavigationResult.Success);
- Assert.IsNotNull(webNavigatedEventArgs, "WebNavigatedEventArgs instance is null");
- Assert.AreEqual(webNavigatedEventArgs.Result, WebNavigationResult.Success, "Expected WebNavigationResult.Success but was " + webNavigatedEventArgs.Result + ".");
- }
- }
-}
+++ /dev/null
-using NUnit.Framework;
-using Xamarin.Forms;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class WebNavigatingEventArgsTest
- {
- [SetUp]
- public void Setup()
- {
- }
-
- [TearDown]
- public void Tear()
- {
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a WebNavigatingEventArgs instance.")]
- [Property("SPEC", "Xamarin.Forms.WebNavigatingEventArgs.WebNavigatingEventArgs C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [MaxTime(5000)]
- public void WebNavigatingEventArgs_INIT()
- {
- /* TEST CODE */
- var url = "https://developer.xamarin.com/api/type/Xamarin.Forms.WebNavigatingEventArgs/";
- var webNavigatingEventArgs = new WebNavigatingEventArgs(new WebNavigationEvent(), new HtmlWebViewSource(), url);
- Assert.IsNotNull(webNavigatingEventArgs, "Object should be not null after initialize");
- Assert.IsInstanceOf<WebNavigatingEventArgs>(webNavigatingEventArgs);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the Cancel property is readable and writable.")]
- [Property("SPEC", "Xamarin.Forms.WebNavigatingEventArgs.Cancel A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
-
- public void Cancel_READ_WRITE()
- {
- /* TEST CODE */
- var url = "https://developer.xamarin.com/api/type/Xamarin.Forms.WebNavigatingEventArgs/";
- var webNavigatingEventArgs = new WebNavigatingEventArgs(new WebNavigationEvent(), new HtmlWebViewSource(), url);
- webNavigatingEventArgs.Cancel = true;
- Assert.IsNotNull(webNavigatingEventArgs, "Object should be not null after initialize");
- Assert.IsInstanceOf<WebNavigatingEventArgs>(webNavigatingEventArgs);
- Assert.True(webNavigatingEventArgs.Cancel, "Value of cancel property should be true");
- webNavigatingEventArgs.Cancel = false;
- var cancel = webNavigatingEventArgs.Cancel;
- Assert.False(cancel, "Cancel should be false");
- }
- }
-}
+++ /dev/null
-using System;
-using System.Collections.Generic;
-using System.Text;
-using NUnit.Framework;
-using Xamarin.Forms;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- public class WebNavigationEventArgsTest
- {
-
- public class MocWebNavigationEventArgs: WebNavigationEventArgs
- {
- public MocWebNavigationEventArgs(WebNavigationEvent navigationEvent, WebViewSource source, string url):base(navigationEvent, source, url)
- {
-
- }
- }
-
-
- private static WebNavigationEventArgs _webNavigationEventArgs;
- string _url = "https://developer.xamarin.com/api/type/Xamarin.Forms.WebNavigatingEventArgs/";
- string _baseUrl = "https://developer.xamarin.com";
- WebNavigationEvent _webNavigationEvent;
- WebViewSource _webViewSource;
-
-
- [SetUp]
- public void Setup()
- {
- _webNavigationEvent = WebNavigationEvent.Refresh;
- _webViewSource = new HtmlWebViewSource
- {
- BaseUrl = _baseUrl,
- };
- _webNavigationEventArgs = new MocWebNavigationEventArgs(_webNavigationEvent, _webViewSource, _url);
- }
-
- [TearDown]
- public void Tear()
- {
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a WebNavigationEventArgs instance.")]
- [Property("SPEC", "Xamarin.Forms.WebNavigationEventArgs.WebNavigationEventArgs M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [MaxTime(5000)]
- public void WebNavigationEventArgs_INIT()
- {
- /* TEST CODE */
- var webNavigationEventArgs = (WebNavigationEventArgs)new MocWebNavigationEventArgs(new WebNavigationEvent(), new HtmlWebViewSource(), _url);
- Assert.IsNotNull(webNavigationEventArgs, "Object should be not null after initialize");
- Assert.IsInstanceOf<WebNavigationEventArgs>(webNavigationEventArgs, "Object must be WebNavigationEventArgs type.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the NavigationEvent property is readable.")]
- [Property("SPEC", "Xamarin.Forms.WebNavigationEventArgs.NavigationEvent A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [MaxTime(5000)]
- public void NavigationEvent_READ_ONLY()
- {
- /* TEST CODE */
- var navigationEvent = _webNavigationEventArgs.NavigationEvent;
- Assert.IsNotNull(navigationEvent, "Object should be not null after initialize");
- Assert.IsInstanceOf<WebNavigationEvent>(navigationEvent, "Object must be WebNavigationEvent type.");
- Assert.AreEqual(navigationEvent, _webNavigationEvent, "Navigation event should be same");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the Source property is readable.")]
- [Property("SPEC", "Xamarin.Forms.WebNavigationEventArgs.Source A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [MaxTime(5000)]
- public void Source_READ_ONLY()
- {
- /* TEST CODE */
- var webViewSource = _webNavigationEventArgs.Source;
- Assert.IsNotNull(webViewSource, "Object should be not null after initialize");
- Assert.IsInstanceOf<WebViewSource>(webViewSource, "Object must be WebViewSource type.");
- Assert.AreEqual(webViewSource, _webViewSource, "Source should be same");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the Url property is readable.")]
- [Property("SPEC", "Xamarin.Forms.WebNavigationEventArgs.Url A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")]
- [MaxTime(5000)]
- public void Url_READ_ONLY()
- {
- /* TEST CODE */
- var url = _webNavigationEventArgs.Url;
- Assert.IsNotNull(url, "Object should be not null after initialize");
- Assert.IsInstanceOf<string>(url, "Object must be string type.");
- Assert.AreEqual(url, _url, "Url should be same");
- }
- }
-}
+++ /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 Xamarin.Forms;
-using NUnit.Framework;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
-
- [TestFixture]
- [Description("Xamarin.Forms.WebView Tests")]
- public class WebViewTests
- {
- internal class TestWebView : WebView
- {
- public bool TestWebViewBindingContextChanged { get; set; }
- public bool TestWebViewPropertyChangedHapped { get; set; }
-
- protected override void OnBindingContextChanged()
- {
- base.OnBindingContextChanged();
- TestWebViewBindingContextChanged = true;
- }
-
- protected override void OnPropertyChanged(string propertyName = null)
- {
- base.OnPropertyChanged(propertyName);
- TestWebViewPropertyChangedHapped = true;
- }
- }
-
- private TestWebView _testWebView;
- private WebView _webView;
-
- [SetUp]
- public void SetUp()
- {
- Console.WriteLine("TSWebViewTests --------------- Setup()");
- _webView = new WebView()
- {
- Source = new UrlWebViewSource
- {
- Url = "http://blog.xamarin.com/",
- },
- VerticalOptions = LayoutOptions.FillAndExpand
- };
- }
-
- [TearDown]
- public void TearDown()
- {
- Console.WriteLine("TSWebViewTests --------------- TearDown()");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create an WebView instance.")]
- [Property("SPEC", "Xamarin.Forms.WebView.WebView C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void WebView_INIT()
- {
- /* TEST CODE */
- var webView = new WebView();
- Assert.IsNotNull(webView, "Object is null after initialize");
- Assert.IsInstanceOf<WebView>(webView);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property CanGoBack is readable.")]
- [Property("SPEC", "Xamarin.Forms.WebView.CanGoBack A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void CanGoBack_READ_ONLY()
- {
- /* TEST CODE */
- var getCanGoBack = _webView.CanGoBack;
- Assert.IsInstanceOf<Boolean>(getCanGoBack, "Get CanGoBack should return object boolean");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property CanGoForward is readable.")]
- [Property("SPEC", "Xamarin.Forms.WebView.CanGoForward A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void CanGoForward_READ_ONLY()
- {
- /* TEST CODE */
- var getCanGoForward = _webView.CanGoForward;
- Assert.IsInstanceOf<Boolean>(getCanGoForward, "Get CanGoForward should return object boolean");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Source is readable and writable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.WebView.Source A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Source_READ_WRITE()
- {
- /* TEST CODE */
- var urlWebViewSource = new UrlWebViewSource
- {
- Url = "https://developer.xamarin.com/",
- };
-
- _webView.Source = urlWebViewSource;
- var getWebViewSource = _webView.Source;
- Assert.IsInstanceOf<WebViewSource>(getWebViewSource, "Get Source should return object WebViewSource");
- Assert.AreEqual(getWebViewSource, urlWebViewSource, "Source property doesn't set and get successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of CanGoBackProperty's bound or not")]
- [Property("SPEC", "Xamarin.Forms.WebView.CanGoBackProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void CanGoBackProperty_READ_ONLY_BINDABLE()
- {
- /* TEST CODE */
- var getCanGoBackProperty = WebView.CanGoBackProperty;
- Assert.IsInstanceOf<BindableProperty>(getCanGoBackProperty, "CanGoBackProperty should be return a BindableProperty object");
- Assert.IsTrue(getCanGoBackProperty.IsReadOnly, "IsReadOnly should be true");
- Assert.AreEqual("CanGoBack", getCanGoBackProperty.PropertyName, "PropertyName should be return 'CanGoBack'");
-
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of CanGoForwardProperty's bound or not")]
- [Property("SPEC", "Xamarin.Forms.WebView.CanGoForwardProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void CanGoForwardProperty_READ_ONLY_BINDABLE()
- {
- /* TEST CODE */
- var getCanGoForwardProperty = WebView.CanGoForwardProperty;
- Assert.IsInstanceOf<BindableProperty>(getCanGoForwardProperty, "CanGoForwardProperty should be return a BindableProperty object");
- Assert.IsTrue(getCanGoForwardProperty.IsReadOnly, "IsReadOnly should be true");
- Assert.AreEqual("CanGoForward", getCanGoForwardProperty.PropertyName, "PropertyName should be return 'CanGoForward'");
-
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether property of SourceProperty's bound or not")]
- [Property("SPEC", "Xamarin.Forms.WebView.SourceProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void SourceProperty_READ_ONLY_BINDABLE()
- {
- /*TEST CODE*/
- var urlWebViewSource1 = new UrlWebViewSource
- {
- Url = "http://blog.xamarin.com/",
- };
- var urlWebViewSource2 = new UrlWebViewSource
- {
- Url = "https://developer.xamarin.com/",
- };
-
- var webView1 = new WebView();
- var webView2 = new WebView();
-
- webView1.Source = urlWebViewSource1;
- webView2.Source = urlWebViewSource2;
-
- Assert.AreNotEqual(webView1.Source, webView2.Source, "SourceProperty of webView1 value must be different form SourceProperty of webView2 value");
- webView1.BindingContext = webView2;
- webView1.SetBinding(WebView.SourceProperty, "Source");
- Assert.AreEqual(webView1.Source, webView2.Source, "SourceProperty of webView1 value and SourceProperty of webView2 value should be same ");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check Eval returns without any exceptions")]
- [Property("SPEC", "Xamarin.Forms.WebView.Eval M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Eval_CHECK()
- {
- /* TEST CODE */
- try
- {
- _webView.Eval("script");
- Assert.True(true, "NO exception has been thrown.");
- }
- catch (Exception ex)
- {
- Assert.False(false, "Should not throw exception. " + ex.ToString());
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check GoBack returns without any exceptions")]
- [Property("SPEC", "Xamarin.Forms.WebView.GoBack M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void GoBack_CHECK()
- {
- /* TEST CODE */
- try
- {
- _webView.GoBack();
- Assert.True(true, "NO exception has been thrown.");
- }
- catch (Exception ex)
- {
- Assert.False(false, "Should not throw exception. " + ex.ToString());
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check GoForward returns without any exceptions")]
- [Property("SPEC", "Xamarin.Forms.WebView.GoForward M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void GoForward_CHECK()
- {
- /* TEST CODE */
- try
- {
- _webView.GoForward();
- Assert.True(true, "NO exception has been thrown.");
- }
- catch (Exception ex)
- {
- Assert.False(false, "Should not throw exception. " + ex.ToString());
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Check return WebView configuration")]
- [Property("SPEC", "Xamarin.Forms.WebView.On<T> M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void On_CONFIGURATION_METHOD()
- {
- /*TEST CODE*/
- var resouce = new ResourceDictionary();
- _webView.Resources = resouce;
- var myConfig = _webView.On<IConfigPlatform>();
- Assert.IsInstanceOf<IPlatformElementConfiguration<IConfigPlatform, WebView>>(myConfig, "Should be an instance of IPlatformElementConfiguration");
- Assert.IsInstanceOf<WebView>(myConfig.Element, "Should be an instance of WebView");
- Assert.AreEqual(resouce, myConfig.Element.Resources, "Resources of myConfig.Element value & Resources of _webView should be to equal");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check OnBindingContextChanged is Invoked whenever the binding context of the WebView changes.")]
- [Property("SPEC", "Xamarin.Forms.WebView.OnBindingContextChanged A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void OnBindingContextChanged_CHECK_INVOCK()
- {
- /*TEST CODE*/
- _testWebView = new TestWebView();
- _testWebView.VerticalOptions = LayoutOptions.FillAndExpand;
-
- Entry entry = new Entry()
- {
- VerticalOptions = LayoutOptions.Fill
- };
-
- _testWebView.BindingContext = entry;
-
- Assert.IsTrue(_testWebView.TestWebViewBindingContextChanged, "OnBindingContextChanged should be invocked whenever the binding context of the WebView changes.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check OnPropertyChanged is Invoked whenever the WebView.Source is changed.")]
- [Property("SPEC", "Xamarin.Forms.WebView.OnPropertyChanged A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void OnPropertyChanged_CHECK_INVOCK()
- {
- /* TEST CODE */
- _testWebView = new TestWebView();
- var urlWebViewSource = new UrlWebViewSource
- {
- Url = "http://blog.xamarin.com/",
- };
- _testWebView.Source = urlWebViewSource;
- Assert.IsTrue(_testWebView.TestWebViewPropertyChangedHapped, "OnPropertyChanged should be invoked");
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class WebViewSourceTests
- {
- public class CustomWebViewSource : WebViewSource
- {
- public override void Load(IWebViewDelegate renderer)
- {
- throw new NotImplementedException();
- }
- }
-
- [SetUp]
- public void Init()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Setup-------------------------");
- }
-
- [TearDown]
- public void Destroy()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Teardown-------------------------");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check if a WebViewSource instance is created.")]
- [Property("SPEC", "Xamarin.Forms.WebViewSource.WebViewSource C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")]
- public void WebViewSource_INIT()
- {
- CustomWebViewSource customWebViewSource = new CustomWebViewSource();
-
- Assert.IsNotNull(customWebViewSource, "Object should be not null after initialize.");
- Assert.IsInstanceOf<WebViewSource>(customWebViewSource, "Should be an instance of WebViewSource.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check casts a String to a WebViewSource")]
- [Property("SPEC", "Xamarin.Forms.WebViewSource.Implicit(System.String) M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- [Property("COVPARAM", "string")]
- public void Implicit_WITH_STRING()
- {
- /* TEST CODE */
- WebViewSource webViewSource = "google.com";
- Assert.IsNotNull(webViewSource, "Instance WebView is null");
- Assert.IsInstanceOf<WebViewSource>(webViewSource);
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "ToString: " + webViewSource.ToString());
- }
-
- [Test]
- [Category("P1")]
- [Description("Check casts a Uri to a WebViewSource")]
- [Property("SPEC", "Xamarin.Forms.WebViewSource.Implicit(System.Uri) M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- [Property("COVPARAM", "System.Uri")]
- public void Implicit_WITH_URI()
- {
- /* TEST CODE */
- Uri uri = new Uri("http://www.google.com/");
- WebViewSource webViewSource = uri;
- Assert.IsNotNull(webViewSource, "Instance WebView is null");
- Assert.IsInstanceOf<WebViewSource>(webViewSource);
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-namespace Xamarin.Forms.Core.UnitTests
-{
- [TestFixture]
- class WebViewSourceTypeConverterTests
- {
- [SetUp]
- public void Init()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Setup-------------------------");
- }
-
- [TearDown]
- public void Destroy()
- {
- LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Teardown-------------------------");
- }
-
-
- [Test]
- [Category("P1")]
- [Description("Create a WebViewSourceTypeConverter object")]
- [Property("SPEC", "Xamarin.Forms.WebViewSourceTypeConverter.WebViewSourceTypeConverter C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void WebViewSourceTypeConverter_INIT()
- {
- /* TEST CODE */
- var webViewSourceTypeConverter = new WebViewSourceTypeConverter();
- Assert.IsNotNull(webViewSourceTypeConverter, "Object is null after initializing");
- Assert.IsInstanceOf<WebViewSourceTypeConverter>(webViewSourceTypeConverter);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check type and value return of method ConvertFromInvariantString.")]
- [Property("SPEC", "Xamarin.Forms.WebViewSourceTypeConverter.ConvertFromInvariantString M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")]
- public void ConvertFromInvariantString_CHECK()
- {
- /* PRECONDITION
- * 1. Create a WebViewSourceTypeConverter.
- */
- var webViewSourceTypeConverter = new WebViewSourceTypeConverter();
- Assert.IsNotNull(webViewSourceTypeConverter, "Object is null after initializing");
- Assert.IsInstanceOf<WebViewSourceTypeConverter>(webViewSourceTypeConverter);
-
- /* TEST CODE */
- String url = "google.com";
- object urlWebViewSource = webViewSourceTypeConverter.ConvertFromInvariantString(url);
- Assert.IsInstanceOf<UrlWebViewSource>(urlWebViewSource);
- }
- }
-}
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns="http://tizen.org/ns/packages" api-version="6" package="Tizen.XamarinForms5.Tests" version="1.0.0">
- <profile name="common" />
- <ui-application appid="Tizen.XamarinForms5.Tests"
- exec="Tizen.XamarinForms5.Tests.dll"
- type="dotnet"
- multiple="false"
- taskmanage="true"
- launch_mode="single">
- <icon>Tizen.XamarinForms5.Tests.png</icon>
- <label>Tizen.XamarinForms5.Tests</label>
- </ui-application>
- <privileges>
- <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
- <privilege>http://tizen.org/privilege/internet</privilege>
- </privileges>
-</manifest>
+++ /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;
-using Tizen.XamarinFormsMaps.Tests;
-
-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.Platform.Tizen.Forms.Init(app);
- Console.WriteLine("HERE manual : " + PreconditionUtils.GetHereMapsProviderKey());
- global::Xamarin.FormsMaps.Init("HERE", PreconditionUtils.GetHereMapsProviderKey());
- app.Run(args);
- }
- }
-}
+++ /dev/null
-<Project Sdk="Microsoft.NET.Sdk">
-
- <!-- Property Group for .NET Core Project -->
- <PropertyGroup>
- <OutputType>Exe</OutputType>
- <TargetFramework>tizen60</TargetFramework>
- </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>
- <PackageReference Include="Tizen.NET.Sdk" Version="$(TizenNETSdkVersion)" />
- </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.XamarinFormsMaps.Manual.Tests", "Tizen.XamarinFormsMaps.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 NUnit.Framework;
-using NUnit.Framework.TUnit;
-using System.Threading.Tasks;
-using XamarinApplication.Tizen;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Threading;
-
-namespace Xamarin.Forms.Maps.Tests
-{
- [TestFixture]
- [Description("Xamarin.Forms.Maps.Distance Tests")]
- class DistanceTests
- {
- private static TestPage _testPage = TestPage.GetInstance();
-
- [SetUp]
- public void SetUp()
- {
- }
-
- [TearDown]
- public void TearDown()
- {
- }
-
- [Test]
- [Category("P1")]
- [Description("Gets the distance in kilometers that is spanned by thisDistance.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Distance.Kilometers A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click \"Click Here\" button.")]
- [Step(3, "If Distance shows number 5, it Passes")]
- [Step(4, "Press back button, then click pass or fail.")]
- [Postcondition(1, "NA")]
- public async Task Kilometers_Distance_UIBH()
- {
- Distance dis = new Distance(5000);
-
- var testMapSpan = (MapSpan.FromCenterAndRadius(new Position(37.466047, 127.024097), dis));
- Map _map = new Map(testMapSpan);
-
- var pin1 = new Pin()
- {
- Position = new Position(37.466047, 127.024097),
- Label = "Seoul!"
- };
-
- _map.Pins.Add(pin1);
-
- Label _labelkilo = new Label
- {
- Text = "Distance from Center: ",
- Margin = new Thickness(0,50,0,0),
- HorizontalTextAlignment = TextAlignment.Center
- };
-
- var checkButton1 = new Button
- {
- Text = "Click Here ",
- BackgroundColor = Color.Green,
- TextColor = Color.White
- };
- checkButton1.Clicked += (s, e) =>
- {
- _labelkilo.Text = "Distance from Center : " + testMapSpan.Radius.Kilometers + " Kilometers";
-
- };
-
- ContentPage page = new ContentPage
- {
- Title = "Distance Test",
- Content = new StackLayout
- {
- Children =
- {
- _map,
- _labelkilo,
- checkButton1
- }
- }
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Gets the distance in meters that is spanned by thisDistance.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Distance.Meters A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click \"Click Here\" button.")]
- [Step(3, "If Distance shows number 5000, it Passes")]
- [Step(4, "Press back button, then click pass or fail.")]
- [Postcondition(1, "NA")]
- public async Task Meters_Distance_UIBH()
- {
- Distance dis = new Distance(5000);
-
- var testMapSpan2 = (MapSpan.FromCenterAndRadius(new Position(37.466047, 127.024097), dis));
- Map _map1 = new Map(testMapSpan2);
-
- var pin1 = new Pin()
- {
- Position = new Position(37.466047, 127.024097),
- Label = "Seoul!"
- };
-
- _map1.Pins.Add(pin1);
-
- Label _labelMeters = new Label
- {
- Text = "Distance from Center: ",
- Margin = new Thickness(0, 50, 0, 0),
- HorizontalTextAlignment = TextAlignment.Center
- };
-
- var checkButton2 = new Button
- {
- Text = "Click Here ",
- BackgroundColor = Color.Green,
- TextColor = Color.White
- };
- checkButton2.Clicked += (s, e) =>
- {
- _labelMeters.Text = "Distance from Center: " + testMapSpan2.Radius.Meters + " Meters";
- };
-
- ContentPage page = new ContentPage
- {
- Title = "Distance Test",
- Content = new StackLayout
- {
- Children =
- {
- _map1,
- _labelMeters,
- checkButton2
- }
- }
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Gets the distance in miles that is spanned by thisDistance.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Distance.Miles A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click \"Click Here\" button.")]
- [Step(3, "If Distance shows number 3.10685596118667, it Passes")]
- [Step(4, "Press back button, then click pass or fail.")]
- [Postcondition(1, "NA")]
- public async Task Miles_Distance_UIBH()
- {
- Distance dis = new Distance(5000);
-
- var testMapSpan3 = (MapSpan.FromCenterAndRadius(new Position(37.466047, 127.024097), dis));
- Map _map2 = new Map(testMapSpan3);
-
- var pin1 = new Pin()
- {
- Position = new Position(37.466047, 127.024097),
- Label = "Seoul!"
- };
-
- _map2.Pins.Add(pin1);
-
- Label _labelMiles = new Label
- {
- Text = "Distance from Center: ",
- Margin = new Thickness(0, 50, 0, 0),
- HorizontalTextAlignment = TextAlignment.Center
- };
-
- var checkButton3 = new Button
- {
- Text = "Click Here ",
- BackgroundColor = Color.Green,
- TextColor = Color.White
- };
- checkButton3.Clicked += (s, e) =>
- {
- _labelMiles.Text = "Distance from Center: " + testMapSpan3.Radius.Miles + " Miles";
- };
-
- ContentPage page = new ContentPage
- {
- Title = "Distance Test",
- Content = new StackLayout
- {
- Children =
- {
- _map2,
- _labelMiles,
- checkButton3
- }
- }
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Factory method to create a Distance from a value provided in kilometers.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Distance.FromKilometers M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click \"Click Here\" button.")]
- [Step(3, "If Distance shows number 5000, it Passes")]
- [Step(4, "Press back button, then click pass or fail.")]
- [Postcondition(1, "NA")]
- public async Task FromKilometers_Distance_UIBH()
- {
- Distance disFromKilo = Distance.FromKilometers(5);
-
- var testMapSpan4 = (MapSpan.FromCenterAndRadius(new Position(37.466047, 127.024097), disFromKilo));
- Map _map4 = new Map(testMapSpan4);
-
- var pin1 = new Pin()
- {
- Position = new Position(37.466047, 127.024097),
- Label = "Seoul!"
- };
-
- _map4.Pins.Add(pin1);
-
- Label _labelFromkilo = new Label
- {
- Text = "Distance : ",
- Margin = new Thickness(0, 50, 0, 0),
- HorizontalTextAlignment = TextAlignment.Center
- };
-
- var checkButton4 = new Button
- {
- Text = "Click Here ",
- BackgroundColor = Color.Green,
- TextColor = Color.White
- };
- checkButton4.Clicked += (s, e) =>
- {
- _labelFromkilo.Text = "Distance : " + testMapSpan4.Radius.Meters + " Meters";
- };
-
- ContentPage page = new ContentPage
- {
- Title = "Distance Test",
- Content = new StackLayout
- {
- Children =
- {
- _map4,
- _labelFromkilo,
- checkButton4
- }
- }
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Factory method to create a Distance from a value provided in meters.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Distance.FromMeters M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click \"Click Here\" button.")]
- [Step(3, "If Distance shows number 5, it Passes")]
- [Step(4, "Press back button, then click pass or fail.")]
- [Postcondition(1, "NA")]
- public async Task FromMeters_Distance_UIBH()
- {
- Distance disFromMeters = Distance.FromMeters(5000);
-
- var testMapSpan5 = (MapSpan.FromCenterAndRadius(new Position(37.466047, 127.024097), disFromMeters));
- Map _map5 = new Map(testMapSpan5);
-
- var pin1 = new Pin()
- {
- Position = new Position(37.466047, 127.024097),
- Label = "Seoul!"
- };
-
- _map5.Pins.Add(pin1);
-
- Label _labelFromMeters = new Label
- {
- Text = "Distance : ",
- Margin = new Thickness(0, 50, 0, 0),
- HorizontalTextAlignment = TextAlignment.Center
- };
-
- var checkButton5 = new Button
- {
- Text = "Click Here ",
- BackgroundColor = Color.Green,
- TextColor = Color.White
- };
- checkButton5.Clicked += (s, e) =>
- {
- _labelFromMeters.Text = "Distance : " + testMapSpan5.Radius.Kilometers + " Kilometers";
- };
-
- ContentPage page = new ContentPage
- {
- Title = "Distance Test",
- Content = new StackLayout
- {
- Children =
- {
- _map5,
- _labelFromMeters,
- checkButton5
- }
- }
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Factory method to create a Distance from a value provided in miles.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Distance.FromMiles M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click \"Click Here\" button.")]
- [Step(3, "If Distance shows number 8.04672, it Passes")]
- [Step(4, "Press back button, then click pass or fail.")]
- [Postcondition(1, "NA")]
- public async Task FromMiles_Distance_UIBH()
- {
- Distance disFromMiles = Distance.FromMiles(5);
-
- var testMapSpan6 = (MapSpan.FromCenterAndRadius(new Position(37.466047, 127.024097), disFromMiles));
- Map _map6 = new Map(testMapSpan6);
-
- var pin1 = new Pin()
- {
- Position = new Position(37.466047, 127.024097),
- Label = "Seoul!"
- };
-
- _map6.Pins.Add(pin1);
-
- Label _labelFromMiles = new Label
- {
- Text = "Distance : ",
- Margin = new Thickness(0, 50, 0, 0),
- HorizontalTextAlignment = TextAlignment.Center
- };
-
- var checkButton6 = new Button
- {
- Text = "Click Here ",
- BackgroundColor = Color.Green,
- TextColor = Color.White
- };
- checkButton6.Clicked += (s, e) =>
- {
- _labelFromMiles.Text = "Distance : " + testMapSpan6.Radius.Kilometers + " Kilometers";
- };
-
- ContentPage page = new ContentPage
- {
- Title = "Distance Test",
- Content = new StackLayout
- {
- Children =
- {
- _map6,
- _labelFromMiles,
- checkButton6
- }
- }
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System.Threading.Tasks;
-using XamarinApplication.Tizen;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Threading;
-
-namespace Xamarin.Forms.Maps.Tests
-{
- [TestFixture]
- [Description("Xamarin.Forms.Maps.Geocoder Tests")]
- class GeocoderTests
- {
- private static TestPage _testPage = TestPage.GetInstance();
-
- [SetUp]
- public void SetUp()
- {
- }
-
- [TearDown]
- public void TearDown()
- {
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether this Map is allowed to scroll.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Geocoder.GetAddressesForPositionAsync M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click \"University Of Dhaka\" button.")]
- [Step(3, "If Label Address is Fuller Road,Dhaka,Bangladesh and Map pin is near University of Dhaka, it Passes")]
- [Step(4, "Press back button, then click pass or fail.")]
- [Postcondition(1, "NA")]
- public async Task GetAddressesForPositionAsync_Geocoder_UIBH()
- {
- Geocoder geocoder = new Geocoder();
- Map map = new Map();
- var pos = new Position(23.7315, 90.3925);
-
- var pin = new Pin()
- {
- Position = new Position(23.7315, 90.3925),
- Label = "University Of Dhaka"
- };
- map.Pins.Add(pin);
-
- Label address2 = new Label()
- {
- Text = "Address : "
- };
-
- Label position2 = new Label()
- {
- Text = "Position : 23.7315, 90.3925"
- };
-
- var tcButton = new Button
- {
- Text = "Move to University of Dhaka.",
- };
-
- Label geocodedOutputLabel = new Label()
- {
- IsVisible = false,
- Margin = new Thickness(10, 0, 0, 50)
- };
-
- var approximateLocations = await geocoder.GetAddressesForPositionAsync(pos);
- tcButton.Clicked += (s, e) =>
- {
- map.MoveToRegion(new MapSpan(new Position(23.7315, 90.3925), 10, 10).WithZoom(1500.0));
- geocodedOutputLabel.IsVisible = true;
- foreach (var position in approximateLocations)
- geocodedOutputLabel.Text = position;
- address2.Text = "Address : "+geocodedOutputLabel.Text;
- };
-
- ContentPage page = new ContentPage
- {
- Title = "GetAddressesForPositionAsync Test",
- Content = new StackLayout
- {
- Children =
- {
- address2,
- position2,
- map,
- tcButton
- }
- }
- };
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
-
- [Test]
- [Category("P1")]
- [Description("Check whether this Map is allowed to scroll.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Geocoder.GetPositionsForAddressAsync M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click \"Click for Position\" button.")]
- [Step(3, "If Label Position shows 37.79752, -122.40183 then it Passes")]
- [Step(4, "Press back button, then click pass or fail.")]
- [Postcondition(1, "NA")]
- public async Task GetPositionsForAddressAsync_Geocoder_UIBH()
- {
- Geocoder geocoder1 = new Geocoder();
- Map map1 = new Map();
- var pin = new Pin()
- {
- Position = new Position(37.79752, -122.40183),
- Label = "394 Pacific Ave, San Francisco CA"
- };
- map1.Pins.Add(pin);
-
- Label address1 = new Label()
- {
- Text = "Address : 394 Pacific Ave, San Francisco CA"
- };
-
- Label position1 = new Label()
- {
- Text = "Position : "
- };
-
- var tcButton = new Button
- {
- Text = "Click for Position.",
- };
-
- Label geocodedOutputLabel = new Label()
- {
- IsVisible = false,
- Margin = new Thickness(10, 0, 0, 50)
- };
-
- string address = "394 Pacific Ave, San Francisco CA";
- var approximateLocations = await geocoder1.GetPositionsForAddressAsync(address);
-
- foreach (var position in approximateLocations)
- geocodedOutputLabel.Text += position.Latitude + ", " + position.Longitude + "\n";
-
- tcButton.Clicked += (s, e) =>
- {
- map1.MoveToRegion(new MapSpan(new Position(37.79752, -122.40183), 10, 10));
- geocodedOutputLabel.IsVisible = true;
- position1.Text = "Position : " + geocodedOutputLabel.Text;
- };
-
- ContentPage page = new ContentPage
- {
- Title = "GetPositionsForAddressAsync Test",
- Content = new StackLayout
- {
- Children =
- {
- address1,
- position1,
- map1,
- tcButton
- }
- }
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System.Threading.Tasks;
-using XamarinApplication.Tizen;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Threading;
-
-namespace Xamarin.Forms.Maps.Tests
-{
- [TestFixture]
- [Description("Xamarin.Forms.Maps.Map Tests")]
- class MapTests
- {
- private static TestPage _testPage = TestPage.GetInstance();
- private static Map _map1, _map2, _map3, _map4, _map5;
-
- [SetUp]
- public void SetUp()
- {
- }
-
- [TearDown]
- public void TearDown()
- {
- _map1 = null;
- _map2 = null;
- _map3 = null;
- _map4 = null;
- _map5 = null;
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether this Map is allowed to scroll.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Map.HasScrollEnabled A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click \"Click Here\" button.")]
- [Step(3, "If Label below title shows true, it Passes")]
- [Step(4, "Press back button, then click pass or fail.")]
- [Postcondition(1, "NA")]
- public async Task HasScrollEnabled_MAP_UIBH()
- {
- _map1 = new Map()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- HasScrollEnabled = true
- };
-
- Label result = new Label
- {
- HeightRequest = 80,
- WidthRequest = 200,
- Text = "Result",
- HorizontalTextAlignment = TextAlignment.Center,
- Margin = 5,
- Scale = 1.5
- };
-
- var checkButton = new Button
- {
- Text = "Click Here ",
- BackgroundColor = Color.Green,
- TextColor = Color.Red
- };
- checkButton.Clicked += (s, e) =>
- {
- result.Text = _map1.HasScrollEnabled.ToString();
- };
-
- ContentPage page = new ContentPage
- {
- Title = "HasScrollEnabled Test",
- Content = new StackLayout
- {
- Children =
- {
- result,
- _map1,
- checkButton,
- }
- }
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether this Map is allowed to zoom.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Map.HasZoomEnabled A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click \"Click Here\" button.")]
- [Step(3, "If Label below title shows true, it Passes")]
- [Step(4, "Press back button, then click pass or fail.")]
- [Postcondition(1, "NA")]
- public async Task HasZoomEnabled_MAP_UIBH()
- {
- _map2 = new Map()
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- HasZoomEnabled = true
- };
-
- Label result1 = new Label
- {
- HeightRequest = 80,
- WidthRequest = 200,
- Text = "Result",
- HorizontalTextAlignment = TextAlignment.Center,
- Margin = 5,
- Scale = 1.5
- };
-
- var checkButton = new Button
- {
- Text = "Click Here ",
- BackgroundColor = Color.Green,
- TextColor = Color.Red
- };
- checkButton.Clicked += (s, e) =>
- {
- result1.Text = _map2.HasZoomEnabled.ToString();
- };
-
- ContentPage page = new ContentPage
- {
- Title = "HasZoomEnabled Test",
- Content = new StackLayout
- {
- Children =
- {
- result1,
- _map2,
- checkButton,
- }
- }
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether this Map is showing the user's current location.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Map.IsShowingUser A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "Goto the Settings -> Privacy and Security-> Location service -> Use Location services (toggle to ON)")]
- [Precondition(2, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")]
- [Step(1, "Click run TC")]
- [Step(2, "Click \"Click Here\" button.")]
- [Step(3, "If Label below title shows true, it Passes")]
- [Step(4, "Press back button, then click pass or fail.")]
- [Postcondition(1, "NA")]
- public async Task IsShowingUser_MAP_UIBH()
- {
- if (Device.Idiom != TargetIdiom.Phone)
- {
- _testPage.UnlockUIButton();
- Assert.Pass("Not Supported");
- }
- _map3 = new Map()
- {
- IsShowingUser = true,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- VerticalOptions = LayoutOptions.FillAndExpand,
- MapType = MapType.Hybrid
- };
-
- Label result2 = new Label
- {
- HeightRequest = 80,
- WidthRequest = 200,
- Text = "Result",
- HorizontalTextAlignment = TextAlignment.Center,
- Margin = 5,
- Scale = 1.5
- };
-
- var checkButton = new Button
- {
- Text = "Click Here ",
- BackgroundColor = Color.Green,
- TextColor = Color.Red
- };
- checkButton.Clicked += (s, e) =>
- {
- result2.Text = _map3.IsShowingUser.ToString();
- };
-
- ContentPage page = new ContentPage
- {
- Title = "IsShowingUser Test",
- Content = new StackLayout
- {
- Children =
- {
- result2,
- _map3,
- checkButton,
- }
- }
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("The MapType display style of this Map.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Map.MapType A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click \"Map Type Street\" button.")]
- [Step(3, "Check Map Type street is visible.")]
- [Step(4, "Click \"Map Type Satellite\" button.")]
- [Step(5, "Check Map Type Satellite is visible.")]
- [Step(6, "If MapType changes accrding to button press then it Passes")]
- [Step(7, "Press back button, then click pass or fail.")]
- [Postcondition(1, "NA")]
- public async Task MapType_MAP_UIBH()
- {
- _map4 = new Map()
- {
- HeightRequest = 700,
- WidthRequest = 700,
- HorizontalOptions = LayoutOptions.Center,
- VerticalOptions = LayoutOptions.Center,
- MapType = MapType.Hybrid
- };
-
- var checkButtonStreet = new Button
- {
- Text = "Map Type Street",
- BackgroundColor = Color.Green,
- TextColor = Color.White
- };
-
- var checkButtonSatellite = new Button
- {
- Text = "Map Type Satellite",
- BackgroundColor = Color.Green,
- TextColor = Color.White
- };
-
- checkButtonStreet.Clicked += (s, e) =>
- {
- _map4.MapType = MapType.Street;
- };
-
- checkButtonSatellite.Clicked += (s, e) =>
- {
- _map4.MapType = MapType.Satellite;
- };
-
- ContentPage page = new ContentPage
- {
- Title = "MapType Test",
- Content = new StackLayout
- {
- Children =
- {
- checkButtonStreet,
- checkButtonSatellite,
- _map4,
- }
- }
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the IList of the Pins on givrn Map.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Map.Pins A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click \"Move to Seoul.\" button.")]
- [Step(3, "If map moves to Seoul, it Passes")]
- [Step(4, "Press back button, then click pass or fail.")]
- [Postcondition(1, "NA")]
- public async Task Pins_MAP_UIBH()
- {
- _map5 = new Map();
-
- var tcButton1 = new Button
- {
- Text = "Pin to Seoul",
- };
-
- var pin = new Pin()
- {
- Position = new Position(37.466047, 127.024097),
- Label = "Seoul!"
- };
-
- tcButton1.Clicked += (s, e) =>
- {
- _map5.Pins.Add(pin);
- _map5.MoveToRegion(new MapSpan(new Position(37.466047, 127.024097), 10, 10));
- };
-
- ContentPage page = new ContentPage
- {
- Title = "Pins Test",
- Content = new StackLayout
- {
- Children =
- {
- _map5,
- tcButton1
- }
- }
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Map moves to specific point")]
- [Property("SPEC", "Xamarin.Forms.Maps.Map.MoveToRegion M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click \"Move to Seoul.\" button.")]
- [Step(3, "If map moves to Seoul, it Passes")]
- [Step(4, "Press back button, then click pass or fail.")]
- [Postcondition(1, "NA")]
- public async Task MoveToRegion_CHECK_RETURN()
- {
- Map map = new Map();
-
- var tcButton = new Button
- {
- Text = "Move to Seoul.",
- };
-
- var pin = new Pin()
- {
- Position = new Position(37.466047, 127.024097),
- Label = "Seoul!"
- };
- map.Pins.Add(pin);
-
- tcButton.Clicked += (s, e) =>
- {
- map.MoveToRegion(new MapSpan(new Position(37.466047, 127.024097), 10, 10));
- };
-
- ContentPage page = new ContentPage
- {
- Title = "MoveToRegion",
- Content = new StackLayout
- {
- Children =
- {
- map,
- tcButton
- }
- }
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether VisibleRegion property is readable.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Map.VisibleRegion A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click \"Click Here\" button.")]
- [Step(3, "Wait 2seconds.")]
- [Step(4, "If Center of VisibleRegion return expected value, result is set as pass automatically.")]
- [Postcondition(1, "NA")]
- public async Task VisibleRegion_READ_ONLY()
- {
- var testMapSpan = (MapSpan.FromCenterAndRadius(new Position(37.466047, 127.024097), Distance.FromMiles(1)));
-
- Map map = new Map();
-
- var tcButton = new Button
- {
- Text = "Click Here",
- };
-
- tcButton.Clicked += async (s, e) =>
- {
- map.MoveToRegion(testMapSpan);
-
- await Task.Delay(3000);
-
- Assert.AreEqual(map.VisibleRegion.Center.Latitude, testMapSpan.Center.Latitude, "Center of VisibleRegion should be equal.");
- Assert.AreEqual(map.VisibleRegion.Center.Longitude, testMapSpan.Center.Longitude, "Center of VisibleRegion should be equal.");
-
- ManualTest.Confirm();
- };
-
- ContentPage page = new ContentPage
- {
- Title = "VisibleRegion",
- Content = new StackLayout
- {
- Children =
- {
- map,
- tcButton
- }
- }
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System.Threading.Tasks;
-using XamarinApplication.Tizen;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Threading;
-
-namespace Xamarin.Forms.Maps.Tests
-{
- [TestFixture]
- [Description("Xamarin.Forms.Maps.MapSpan Tests")]
- class MapSpanTests
- {
- private static TestPage _testPage = TestPage.GetInstance();
-
- [SetUp]
- public void SetUp()
- {
- }
-
- [TearDown]
- public void TearDown()
- {
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether FromCenterAndRadius method works properly or not")]
- [Property("SPEC", "Xamarin.Forms.Maps.MapSpan.FromCenterAndRadius M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click 'Change MapSpan CenterAndRadius' button.")]
- [Step(3, "If map moves to Bangladesh, it Passes")]
- [Step(4, "Click 'Change MapSpan Radius' button.")]
- [Step(5, "If pin center is same and zoom out(as redius of visibity is decreased), it Passes")]
- [Step(6, "Press back button, then click pass or fail.")]
- [Postcondition(1, "NA")]
- public async Task FromCenterAndRadius_MapSpan_UIBH()
- {
- var mapSpan = (MapSpan.FromCenterAndRadius(new Position(23.7315492, 90.3924947), Distance.FromMiles(50)));
- Map map = new Map();
-
- var tcButton = new Button
- {
- Text = "Change MapSpan CenterAndRadius",
- BorderRadius=0
- };
- var tcButton2 = new Button
- {
- Text = "Change MapSpan Radius",
- BorderRadius = 0
- };
-
- var pin = new Pin()
- {
- Label = ""
- };
- //map.Pins.Add(pin);
-
- tcButton.Clicked += (s, e) =>
- {
- map.MoveToRegion(mapSpan);
- pin.Position = mapSpan.Center;
- if(map.Pins.Count==0)
- map.Pins.Add(pin);
- };
- tcButton2.Clicked += (s, e) =>
- {
- map.MoveToRegion((MapSpan.FromCenterAndRadius(new Position(23.7315492, 90.3924947), Distance.FromMiles(100))));
- pin.Position = mapSpan.Center;
- if (map.Pins.Count == 0)
- map.Pins.Add(pin);
- };
-
- ContentPage page = new ContentPage
- {
- Title = "MapSpan-FromCenterAndRadius",
- Content = new StackLayout
- {
- Children =
- {
- map,
- tcButton,tcButton2
- }
- }
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Map is Zoomed or not.")]
- [Property("SPEC", "Xamarin.Forms.Maps.MapSpan.WithZoom M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click on 'Zoom' button.")]
- [Step(3, "If map zoomed and pin point near Dhaka University, it Passes")]
- [Step(4, "Press back button, then click pass or fail.")]
- [Postcondition(1, "NA")]
- public async Task WithZoom_MapSpan_UIBH()
- {
- var mapSpan = (MapSpan.FromCenterAndRadius(new Position(23.7315492, 90.3924947), Distance.FromMiles(50)));
- Map map = new Map(mapSpan);
-
- var tcButton = new Button
- {
- Text = "Zoom",
- };
-
- var pin = new Pin()
- {
- Position = new Position(23.7315492, 90.3924947),
- Label = "Dhaka"
- };
- map.Pins.Add(pin);
-
- tcButton.Clicked += (s, e) =>
- {
- map.MoveToRegion(mapSpan.WithZoom(200.00));
- };
-
- ContentPage page = new ContentPage
- {
- Title = "MapSpan-WithZoom",
- Content = new StackLayout
- {
- Children =
- {
- map,
- tcButton
- }
- }
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether ClampLatitude method works properly or not")]
- [Property("SPEC", "Xamarin.Forms.Maps.MapSpan.ClampLatitude M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click 'Apply ClampLatitude' button.")]
- [Step(3, "If pin adds in map with new mapspan, it Passes")]
- [Step(4, "If mapspan's Longitude is same and Latitude has been changed, it Passes")]
- [Step(5, "Press back button, then click pass or fail.")]
- [Postcondition(1, "NA")]
- public async Task ClampLatitude_MapSpan_UIBH()
- {
- var mapSpan = new MapSpan(new Position(23.7315492, 90.3924947), 1, 1);
- Map map = new Map(mapSpan);
-
- var tcButton = new Button
- {
- Text = "Apply ClampLatitude",
- };
-
- var pin = new Pin()
- {
- Position = new Position(23.7315492, 90.3924947),
- Label = "Dhaka"
- };
- map.Pins.Add(pin);
-
- Label lb1 = new Label
- {
- Text = "Before Latitude: " + mapSpan.Center.Latitude,
- };
- Label lb2 = new Label
- {
- Text = "Before Longitude: " + mapSpan.Center.Longitude,
- };
- Label lb3 = new Label
- {
- Text = "After Lat: ",
- };
- Label lb4 = new Label
- {
- Text = "After Lon: ",
- };
-
- tcButton.Clicked += (s, e) =>
- {
- mapSpan = mapSpan.ClampLatitude(22.00, -9.00);
- pin.Position = mapSpan.Center;
- map.Pins.Add(pin);
- lb3.Text = "After Latitude: " + mapSpan.Center.Latitude;
- lb4.Text = "After Longitude: " + mapSpan.Center.Longitude;
- tcButton.IsEnabled = false;
- };
-
- ContentPage page = new ContentPage
- {
- Title = "MapSpan-ClampLatitude",
- Content = new StackLayout {
- Children =
- {
- lb1,lb2,lb3,lb4,
- map,
- tcButton
- }
- }
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System.Threading.Tasks;
-using XamarinApplication.Tizen;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Threading;
-
-namespace Xamarin.Forms.Maps.Tests
-{
- [TestFixture]
- [Description("Xamarin.Forms.Maps.MapType Tests")]
- class MapTypeTests
- {
- private static TestPage _testPage = TestPage.GetInstance();
- private static Map _mapHybrid, _mapSatellite, _mapStreet;
-
- [SetUp]
- public void SetUp()
- {
- }
-
- [TearDown]
- public void TearDown()
- {
- _mapHybrid = null;
- _mapSatellite = null;
- _mapStreet = null;
- }
-
- [Test]
- [Category("P1")]
- [Description("A map that combines satellite imagery and street data.")]
- [Property("SPEC", "Xamarin.Forms.Maps.MapType.Hybrid A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Check Map Type Hybrid is visible.")]
- [Step(3, "If Map Type is Hybrid press back button, then click pass otherwise fail.")]
- [Postcondition(1, "NA")]
- public async Task Hybrid_MapType_UIBH()
- {
- _mapHybrid = new Map()
- {
- MapType = MapType.Hybrid
- };
-
- ContentPage page = new ContentPage
- {
- Title = "Hybrid MapType Test",
- Content = new StackLayout
- {
- Children =
- {
- _mapHybrid
- }
- }
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("A map that contains satellite imagery.")]
- [Property("SPEC", "Xamarin.Forms.Maps.MapType.Satellite A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Check Satellite Type Map is visible.")]
- [Step(3, "If Map Type is Satellite Press back button, then click pass otherwise fail.")]
- [Postcondition(1, "NA")]
- public async Task Satellite_MapType_UIBH()
- {
- _mapSatellite = new Map(MapSpan.FromCenterAndRadius(new Position(37, -122), Distance.FromMiles(0.3)))
- {
- MapType = MapType.Satellite
- };
-
- ContentPage page = new ContentPage
- {
- Title = "Satellite MapType Test",
- Content = new StackLayout
- {
- Children =
- {
- _mapSatellite
- }
- }
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("A street map.")]
- [Property("SPEC", "Xamarin.Forms.Maps.MapType.Street A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Check Street Type Map is visible.")]
- [Step(3, "If Map Type is Street, then click pass otherwise fail.")]
- [Postcondition(1, "NA")]
- public async Task Street_MapType_UIBH()
- {
- _mapStreet = new Map(MapSpan.FromCenterAndRadius(new Position(37, -122), Distance.FromMiles(0.3)))
- {
- MapType = MapType.Street
- };
-
- ContentPage page = new ContentPage
- {
- Title = "Street MapType Test",
- Content = new StackLayout
- {
- Children =
- {
- _mapStreet
- }
- }
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System.Threading.Tasks;
-using XamarinApplication.Tizen;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Threading;
-using Xamarin.Forms;
-
-namespace Xamarin.Forms.Maps.UnitTests
-{
- [TestFixture]
- [Description("Xamarin.Forms.Maps.Pin Tests")]
- class PinTests
- {
- private static TestPage _testPage = TestPage.GetInstance();
-
- [SetUp]
- public void SetUp()
- {
- }
-
- [TearDown]
- public void TearDown()
- {
- }
-
- [Test]
- [Category("P1")]
- [Description("check whether Clicked event is called or not.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Pin.Clicked E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "Click the Pin on the Map")]
- [Step(3, "If click event is occurred, result is set pass automatically. Otherwise please press fail.")]
- [Postcondition(1, "NA")]
- public async Task Clicked_EVENT()
- {
- var pin = new Pin
- {
- Position = new Position(37.466047, 127.024097),
- Label = "Seoul RnD",
- Type = PinType.Place
- };
-
- Map map = new Map(new MapSpan(new Position(37.466047, 127.024097), 0, 0).WithZoom(80))
- {
- HeightRequest = 500,
- };
-
- pin.Clicked += (s, e) =>
- {
- Assert.True(true);
- ManualTest.Confirm();
- };
-
- map.Pins.Add(pin);
-
- ContentPage page = new ContentPage
- {
- Title = "Pin Clicked",
- Content = map
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("check the Position of the pin in a Map.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Pin.Position A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "If a pin is displayed and it's position is showed, it Passes")]
- [Step(3, "Click 'New Pin Position' button")]
- [Step(4, "If a new pin is displayed and it's position is showed, it Passes")]
- [Step(5, "Press back button, then click pass or fail.")]
- [Postcondition(1, "NA")]
- public async Task Position_Pin_UIBH()
- {
- var pin = new Pin
- {
- Position = new Position(23.7315492, 90.3924947),
- Label = "University of Dhaka",
- };
-
- Label lb = new Label
- {
- Text = "Position: " + pin.Position.Latitude + " " + pin.Position.Longitude,
- };
-
- var mapSpan = MapSpan.FromCenterAndRadius(new Position(23.7315492, 90.3924947), Distance.FromMiles(10)).WithZoom(80);
- Map map = new Map(mapSpan);
- map.Pins.Add(pin);
-
- Button btn = new Button
- {
- Text = "New Pin Position"
- };
- btn.Clicked += (s, e) =>
- {
- //pin.Position = new Position(23.7312192, 90.3962159);
- var pin2 = new Pin
- {
- Position = new Position(23.7312192, 90.3962159),
- Label = "University of Dhaka",
- };
- map.Pins.Add(pin2);
-
- lb.Text = "Position2: " + pin2.Position.Latitude + " " + pin2.Position.Longitude;
- btn.IsEnabled = false;
- };
-
- ContentPage page = new ContentPage
- {
- Title = "Pin-Position",
- Content = new StackLayout
- {
- Children =
- {
- lb,
- map,
- btn
- }
- }
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("check the Label of the pin in a Map.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Pin.Label A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "If a pin is displayed and it's label(Samsung Digital City) is showed, it Passes")]
- [Step(3, "Press back button, then click pass or fail.")]
- [Postcondition(1, "NA")]
- public async Task Label_Pin_UIBH()
- {
- var pin = new Pin
- {
- Position = new Position(37.2574184, 127.0557593),
- Label = "Samsung Digital City",
- };
-
- Label lb = new Label
- {
- Text = "Label: " + pin.Label,
- };
-
- var mapSpan = MapSpan.FromCenterAndRadius(new Position(37.2574184, 127.0557593), Distance.FromMiles(10));
- Map map = new Map(mapSpan);
- map.Pins.Add(pin);
-
- ContentPage page = new ContentPage
- {
- Title = "Pin-Label",
- Content = new StackLayout
- {
- Children =
- {
- lb,
- map,
- }
- }
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- [Test]
- [Category("P1")]
- [Description("check the Address of the pin in a Map.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Pin.Address A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Precondition(1, "NA")]
- [Step(1, "Click run TC")]
- [Step(2, "If a pin is displayed and it's Address(457-4 Maetan 3(sam)-dong, Yeongtong-gu, Suwon, Gyeonggi-do, South Korea) is showed, it Passes")]
- [Step(3, "Press back button, then click pass or fail.")]
- [Postcondition(1, "NA")]
- public async Task Address_Pin_UIBH()
- {
- var pin = new Pin
- {
- Position = new Position(37.2574184, 127.0557593),
- Label = "Samsung Digital City",
- Address = "457-4 Maetan 3(sam)-dong, Yeongtong-gu, Suwon, Gyeonggi-do, South Korea"
- };
-
- Label lb = new Label
- {
- Text = "Address: " + pin.Address,
- };
-
- var mapSpan = MapSpan.FromCenterAndRadius(new Position(37.2574184, 127.0557593), Distance.FromMiles(10));
- Map map = new Map(mapSpan);
- map.Pins.Add(pin);
-
- ContentPage page = new ContentPage
- {
- Title = "Pin-Address",
- Content = new StackLayout
- {
- Children =
- {
- lb,
- map,
- }
- }
- };
-
- _testPage.ExecuteTC(page);
- await ManualTest.WaitForConfirm();
- }
-
- //[Test]
- //[Category("P1")]
- //[Description("Check whether Pin Type works properly or not.")]
- //[Property("SPEC", "Xamarin.Forms.Maps.Pin.Type A")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "PRW")]
- //[Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- //[Precondition(1, "NA")]
- //[Step(1, "Click run TC")]
- //[Step(2, "Click 'Generic', 'Place', 'SavedPin', 'SearchResult' button.")]
- //[Step(3, "If pin type is changed accordingly, it Passes")]
- //[Step(4, "Press back button, then click pass or fail.")]
- //[Postcondition(1, "NA")]
- //public async Task Type_Pin_UIBH()
- //{
- // var mapSpan = new MapSpan(new Position(23.7315492, 90.3924947), 1, 1).WithZoom(200);
- // Map map = new Map(mapSpan);
-
- // var btn1 = new Button
- // {
- // Text = "Generic",
- // };
- // var btn2 = new Button
- // {
- // Text = "Place",
- // };
- // var btn3 = new Button
- // {
- // Text = "SavedPin",
- // };
- // var btn4 = new Button
- // {
- // Text = "SearchResult",
- // };
- // var pin = new Pin()
- // {
- // Position = new Position(23.7315492, 90.3924947),
- // Label = "Dhaka"
- // };
- // map.Pins.Add(pin);
-
- // Label lb1 = new Label
- // {
- // Text = "Before Lat: "
- // };
-
- // btn1.Clicked += (s, e) => {
- // pin.Type = PinType.Generic;
- // };
- // btn2.Clicked += (s, e) => {
- // pin.Type = PinType.Place;
- // };
- // btn3.Clicked += (s, e) => {
- // pin.Type = PinType.SavedPin;
- // };
- // btn4.Clicked += (s, e) => {
- // pin.Type = PinType.SearchResult;
- // };
-
- // ContentPage page = new ContentPage
- // {
- // Title = "Pin-Type",
- // Content = new StackLayout
- // {
- // Children =
- // {
- // map,
- // btn1,btn2,btn3,btn4
- // }
- // }
- // };
-
- // _testPage.ExecuteTC(page);
- // await ManualTest.WaitForConfirm();
- //}
- }
-}
+++ /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 NUnit.Framework.TUnit;
-using System.Threading.Tasks;
-using XamarinApplication.Tizen;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Threading;
-
-namespace Xamarin.Forms.Maps.Tests
-{
- [TestFixture]
- [Description("Xamarin.Forms.Maps.PinType Tests")]
- class PinTypeTests
- {
- private static TestPage _testPage = TestPage.GetInstance();
-
- [SetUp]
- public void SetUp()
- {
- }
-
- [TearDown]
- public void TearDown()
- {
- }
-
- //[Test]
- //[Category("P1")]
- //[Description("Check whether PinType works accordingly or not.")]
- //[Property("SPEC", "Xamarin.Forms.Maps.PinType.PinType A")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "PRW")]
- //[Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- //[Precondition(1, "NA")]
- //[Step(1, "Click run TC")]
- //[Step(2, "Click 'Generic', 'Place', 'SavedPin', 'SearchResult' button.")]
- //[Step(3, "If pin type is changed accordingly, it Passes")]
- //[Step(4, "Press back button, then click pass or fail.")]
- //[Postcondition(1, "NA")]
- //public async Task PinType_PinType_UIBH()
- //{
- // var mapSpan = new MapSpan(new Position(23.7315492, 90.3924947), 1, 1).WithZoom(200);
- // Map map = new Map(mapSpan);
-
- // var btn1 = new Button {
- // Text = "Generic",
- // };
- // var btn2 = new Button
- // {
- // Text = "Place",
- // };
- // var btn3 = new Button
- // {
- // Text = "SavedPin",
- // };
- // var btn4 = new Button
- // {
- // Text = "SearchResult",
- // };
- // var pin = new Pin()
- // {
- // Position = new Position(23.7315492, 90.3924947),
- // Label = "Dhaka"
- // };
- // map.Pins.Add(pin);
-
- // Label lb1 = new Label
- // {
- // Text = "Before Lat: "
- // };
-
- // btn1.Clicked += (s, e) => {
- // pin.Type = PinType.Generic;
- // };
- // btn2.Clicked += (s, e) => {
- // pin.Type = PinType.Place;
- // };
- // btn3.Clicked += (s, e) => {
- // pin.Type = PinType.SavedPin;
- // };
- // btn4.Clicked += (s, e) => {
- // pin.Type = PinType.SearchResult;
- // };
-
- // ContentPage page = new ContentPage
- // {
- // Title = "PinType",
- // Content = new StackLayout {
- // Children =
- // {
- // map,
- // btn1,btn2,btn3,btn4
- // }
- // }
- // };
-
- // _testPage.ExecuteTC(page);
- // await ManualTest.WaitForConfirm();
- //}
- }
-}
+++ /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.XamarinFormsMaps.Tests
-{
- public class PreconditionUtils
- {
- private static string HERE_MAPS_PROVIDER_KEY = null;
-
- public static string GetHereMapsProviderKey()
- {
- if (HERE_MAPS_PROVIDER_KEY == null)
- SetPrecondition();
-
- return HERE_MAPS_PROVIDER_KEY;
- }
-
- public static void SetPrecondition()
- {
- string result = ReadFile("/opt/usr/home/owner/share/tct/preconfigure.json");
- if (result == null)
- return;
-
- int index = 0;
- string[] resultArray = StringParser(result);
- foreach (string item in resultArray)
- {
- switch (item)
- {
- case "HERE_MAPS_PROVIDER_KEY_FOR_XAMARIN":
- // 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();
- reader.Close();
- }
- catch (Exception e)
- {
- LogUtils.Write(LogUtils.ERROR, LogUtils.TAG, "File read error : " + e.Message);
- }
-
- return result;
- }
-
- private static string[] StringParser(string TCID)
- {
- string[] delimiter = { "[{\"", "\":\"", "\",\"", "\":", ",\"", "\"}]", "}" };
- string[] stringPieces = { };
-
- try
- {
- stringPieces = TCID.Split(delimiter, StringSplitOptions.None);
- }
- catch (Exception e)
- {
- LogUtils.Write(LogUtils.ERROR, LogUtils.TAG, "ResultParser : " + e.Message);
- }
-
- return stringPieces;
- }
- }
-}
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<manifest package="Tizen.XamarinFormsMaps.Manual.Tests" version="1.0.0" api-version="6" xmlns="http://tizen.org/ns/packages">
- <profile name="common" />
- <ui-application appid="Tizen.XamarinFormsMaps.Manual.Tests" exec="Tizen.XamarinFormsMaps.Manual.Tests.dll" multiple="false" taskmanage="true" splash-screen-display="true" type="dotnet" launch_mode="single">
- <icon>Tizen.XamarinFormsMaps.Manual.Tests.png</icon>
- <label>Tizen.XamarinFormsMaps.Manual.Tests</label>
- </ui-application>
- <shortcut-list />
- <privileges>
- <privilege>http://tizen.org/privilege/internet</privilege>
- <privilege>http://tizen.org/privilege/mapservice</privilege>
- <privilege>http://tizen.org/privilege/network.get</privilege>
- <privilege>http://tizen.org/privilege/location</privilege>
- <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
- </privileges>
-</manifest>
+++ /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;
-using Tizen.XamarinFormsMaps.Tests;
-
-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.Platform.Tizen.Forms.Init(app);
- Console.WriteLine("HERE auto : " + PreconditionUtils.GetHereMapsProviderKey());
- global::Xamarin.FormsMaps.Init("HERE", PreconditionUtils.GetHereMapsProviderKey());
- app.Run(args);
- }
- }
-}
+++ /dev/null
-<Project Sdk="Microsoft.NET.Sdk">
-
- <!-- Property Group for .NET Core Project -->
- <PropertyGroup>
- <OutputType>Exe</OutputType>
- <TargetFramework>tizen60</TargetFramework>
- </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>
- <PackageReference Include="Tizen.NET.Sdk" Version="$(TizenNETSdkVersion)" />
- </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.XamarinFormsMaps.Tests", "Tizen.XamarinFormsMaps.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
-using NUnit.Framework;
-using System;
-using Xamarin.Forms.Maps;
-
-namespace Xamarin.Forms.Maps.Tests
-{
- [TestFixture]
- [Description("Xamarin.Forms.Maps.Distance Tests")]
- public class DistanceTests
- {
- private Distance _distance;
-
- [SetUp]
- public void Setup()
- {
- _distance = new Distance(12.0);
- }
-
- [TearDown]
- public void Tear()
- {
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a Distance instance.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Distance.Distance C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Distance_INIT()
- {
- /* TEST CODE */
- double meters = 10.00;
- var distance = new Distance(meters);
- Assert.IsNotNull(distance, "Object should be not null after initialize");
- Assert.IsInstanceOf<Distance>(distance);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the Meters property is readable.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Distance.Meters A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Meters_READ_ONLY()
- {
- /* TEST CODE */
- var distance = new Distance(10.00);
- Assert.AreEqual(distance.Meters, (double)10.0, "Meters should be 10.0");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the Kilometers property is readable.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Distance.Kilometers A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Kilometers_READ_ONLY()
- {
- /* TEST CODE */
- var distance = new Distance(10.00);
- Assert.AreEqual(distance.Kilometers, (double)0.01, "Kilometers should be 0.01");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the Miles property is readable.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Distance.Miles A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Miles_READ_ONLY()
- {
- double meter = 10.00;
- double MetersPerMile = 1609.344;
- double expectedMile = meter/ MetersPerMile;
- /* TEST CODE */
- var distance = new Distance(meter);
- Assert.AreEqual(distance.Miles, expectedMile, "Miles should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Equals.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Distance.Equals M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Property("COVPARAM", "Xamarin.Forms.Maps.Distance")]
-
- public void Equals_CHECK_RETURN()
- {
- double metersA = 10.0;
- double metersB = 15.0;
- /* TEST CODE */
- Assert.False(new Distance().Equals(null), "Should not be equal.");
- Assert.False(new Distance().Equals("Distance"), "Should not be equal.");
- Assert.True(new Distance(metersA).Equals(new Distance(metersA)), "Should be equal.");
- Assert.False(new Distance(metersA).Equals(new Distance(metersB)), "Should not be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Equals.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Distance.Equals M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Property("COVPARAM", "object")]
- public void Equals_CHECK_RETURN_OBJ()
- {
- double metersA = 10.0;
- double metersB = 15.0;
- double metersC = 10.0;
-
- Distance distanceA = new Distance(metersA);
- Distance distanceB = new Distance(metersB);
- Distance distanceC = new Distance(metersC);
- /* TEST CODE */
- Assert.False(new Distance().Equals(null), "Should not be equal.");
- Assert.False(new Distance().Equals("Distance"), "Should not be equal.");
- Assert.True(distanceA.Equals(distanceC), "Should be equal.");
- Assert.False(distanceA.Equals(distanceB), "Should not be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of FromKilometers.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Distance.FromKilometers M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void FromKilometers_CHECK_RETURN()
- {
- /* TEST CODE */
- var result = Distance.FromKilometers(15.00);
- Assert.IsNotNull(result, "Should not be null.");
- // Assert.IsInstanceOf<Distance>(result, "Should be instance of Distance.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of FromMeters.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Distance.FromMeters M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void FromMeters_CHECK_RETURN()
- {
- /* TEST CODE */
- var result = Distance.FromMeters(15.00);
- Assert.IsNotNull(result, "Should not be null.");
- Assert.IsInstanceOf<Distance>(result, "Should be instance of Distance.");
- Assert.True(new Distance(15.0).Equals(result), "Should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of FromMiles.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Distance.FromMiles M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void FromMiles_CHECK_RETURN()
- {
- /* TEST CODE */
- var result = Distance.FromMiles(15.00);
- Assert.IsNotNull(result, "Should not be null.");
- Assert.IsInstanceOf<Distance>(result, "Should be instance of Distance.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of GetHashCode.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Distance.GetHashCode M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void GetHashCode_CHECK_RETURN()
- {
- /* TEST CODE */
- var result = new Distance(12.00).GetHashCode();
- Assert.IsNotNull(result, "Should not be null.");
- Assert.IsInstanceOf<Int32>(result, "Should be instance of int32.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Equality.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Distance.== M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Equality_CHECK_RETURN()
- {
- double metersA = 10.0;
-
- Distance distanceA = new Distance(metersA);
- Distance distanceB = new Distance(metersA);
- /* TEST CODE */
- Assert.True(distanceA == distanceB, "Two Distance's should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Inequality.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Distance.!= M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Inequality_CHECK_RETURN()
- {
- double metersA = 10.0;
- double metersB = 12.0;
-
- Distance distanceA = new Distance(metersA);
- Distance distanceB = new Distance(metersB);
-
- /* TEST CODE */
- Assert.True(distanceA != distanceB, "Two Distance's should not be equal.");
- }
- }
-}
+++ /dev/null
-using NUnit.Framework;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-using Xamarin.Forms.Maps;
-
-namespace Xamarin.Forms.Maps.Tests
-{
- [TestFixture]
- [Description("Xamarin.Forms.Maps.Position Tests")]
- public class GeocoderTests
- {
- private Geocoder _geocoder;
-
- [SetUp]
- public void Setup()
- {
- _geocoder = new Geocoder();
- }
-
- [TearDown]
- public void Tear()
- {
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a Geocoder instance.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Geocoder.Geocoder C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Md. Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public void Geocoder_INIT()
- {
- /* TEST CODE */
- var mGeocoder = new Geocoder();
- Assert.IsNotNull(mGeocoder, "Object should be not null after initialize");
- Assert.IsInstanceOf<Geocoder>(mGeocoder);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the GetAddressesForPositionAsync method return addresses near position.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Geocoder.GetAddressesForPositionAsync M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Md. Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public async Task GetAddressesForPositionAsync_CHECK_RETURN()
- {
- double latitude = 23.7479246;
- double longitude = 90.3917394;
- /* TEST CODE */
- Geocoder geocoder = new Geocoder();
- Position position = new Position(latitude, longitude);
- IEnumerable<string> address = await geocoder.GetAddressesForPositionAsync(position);
- string[] addressAry = address.ToArray();
- Assert.IsNotNull(address, "Address should be not null");
- Assert.IsTrue(addressAry.Length > 0, "Should greater than 0.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the GetPositionsForAddressAsync method return a list of positions for address.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Geocoder.GetPositionsForAddressAsync M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Md. Elme Focruzzaman Razi, ef.razi@samsung.com")]
- public async Task GetPositionsForAddressAsync_CHECK_RETURN()
- {
- /* TEST CODE */
- string address = "111 Sonargaon Road, Dhaka 1205";
- Geocoder geocoder = new Geocoder();
-
- IEnumerable<Position> positions = await geocoder.GetPositionsForAddressAsync(address);
-
- Assert.IsNotNull(positions, "Potions should be not null");
- Position[] positionAry = positions.ToArray();
- Assert.IsTrue(positionAry.Length > 0, "Should greater than 0.");
-
- double longitude = 90.3917394;
- Assert.AreNotEqual(positionAry[0].Longitude, longitude, "Longitude should be 90.3917394");
- }
- }
-}
+++ /dev/null
-using NUnit.Framework;
-using Xamarin.Forms;
-using Xamarin.Forms.Maps;
-using System.Collections.Generic;
-
-namespace Xamarin.Forms.Maps.Tests
-{
- [TestFixture]
- [Description("Xamarin.Forms.Maps.Map Tests")]
- public class MapTests
- {
- private Map _map;
-
- [SetUp]
- public void Setup()
- {
- _map = new Map();
- }
-
-
- [TearDown]
- public void Tear()
- {
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a Map instance.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Map.Map C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Map_INIT()
- {
- /* TEST CODE */
- var mMap = new Map();
- Assert.IsNotNull(mMap, "Object should be not null after initialize");
- Assert.IsInstanceOf<Map>(mMap);
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a Map instance with region.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Map.Map C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- [Property("COVPARAM", "Xamarin.Forms.Maps.MapSpan")]
- public void Map_INIT_WITH_MAPSPAN()
- {
- /* TEST CODE */
- double latitude = 23.7479246;
- double longitude = 90.3917394;
- var mMapSpan = new MapSpan(new Position(), latitude, longitude);
- var mMap = new Map(mMapSpan);
- Assert.IsNotNull(mMap, "Object should be not null after initialize");
- Assert.IsInstanceOf<Map>(mMap);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether HasScrollEnabledProperty property bound or not")]
- [Property("SPEC", "Xamarin.Forms.Maps.Map.HasScrollEnabledProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void HasScrollEnabledProperty_BINDABLE()
- {
- /* TEST CODE */
- var mapA = new Map();
- var mapB = new Map();
-
- mapA.HasScrollEnabled = false;
- mapB.HasScrollEnabled = true;
- Assert.AreNotEqual(mapA.HasScrollEnabled, mapB.HasScrollEnabled, "HasScrollEnabledProperty value must be different.");
- mapA.BindingContext = mapB;
- mapA.SetBinding(Map.HasScrollEnabledProperty, "HasScrollEnabled");
- Assert.AreEqual(mapA.HasScrollEnabled, mapB.HasScrollEnabled, "After binding, value should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether HasZoomEnabledProperty property bound or not")]
- [Property("SPEC", "Xamarin.Forms.Maps.Map.HasZoomEnabledProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void HasZoomEnabledProperty_BINDABLE()
- {
- /* TEST CODE */
- double latitudeA = 23.7479246;
- double longitudeA = 90.3917394;
- var mapSpanA = new MapSpan(new Position(), latitudeA, longitudeA);
- var mapA = new Map(mapSpanA);
-
- double latitudeB = 24.8413651;
- double longitudeB = 89.3001658;
- var mapSpanB = new MapSpan(new Position(), latitudeB, longitudeB);
- var mapB = new Map(mapSpanB);
-
- mapA.HasZoomEnabled = false;
- mapB.HasZoomEnabled = true;
- Assert.AreNotEqual(mapA.HasZoomEnabled, mapB.HasZoomEnabled, "HasZoomEnabledProperty value must be different.");
- mapA.BindingContext = mapB;
- mapA.SetBinding(Map.HasZoomEnabledProperty, "HasZoomEnabled");
- Assert.AreEqual(mapA.HasZoomEnabled, mapB.HasZoomEnabled, "After binding, value should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether IsShowingUserProperty property bound or not")]
- [Property("SPEC", "Xamarin.Forms.Maps.Map.IsShowingUserProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void IsShowingUserProperty_BINDABLE()
- {
- /* TEST CODE */
- double latitudeA = 23.7479246;
- double longitudeA = 90.3917394;
- var mapSpanA = new MapSpan(new Position(), latitudeA, longitudeA);
- var mapA = new Map(mapSpanA);
-
- double latitudeB = 24.8413651;
- double longitudeB = 89.3001658;
- var mapSpanB = new MapSpan(new Position(), latitudeB, longitudeB);
- var mapB = new Map(mapSpanB);
-
- mapA.IsShowingUser = false;
- mapB.IsShowingUser = true;
- Assert.AreNotEqual(mapA.IsShowingUser, mapB.IsShowingUser, "IsShowingUserProperty value must be different.");
- mapA.BindingContext = mapB;
- mapA.SetBinding(Map.IsShowingUserProperty, "IsShowingUser");
- Assert.AreEqual(mapA.IsShowingUser, mapB.IsShowingUser, "After binding, value should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether MapTypeProperty property bound or not")]
- [Property("SPEC", "Xamarin.Forms.Maps.Map.MapTypeProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void MapTypeProperty_BINDABLE()
- {
- /* TEST CODE */
- double latitudeA = 23.7479246;
- double longitudeA = 90.3917394;
- var mapSpanA = new MapSpan(new Position(), latitudeA, longitudeA);
- var mapA = new Map(mapSpanA);
-
- double latitudeB = 24.8413651;
- double longitudeB = 89.3001658;
- var mapSpanB = new MapSpan(new Position(), latitudeB, longitudeB);
- var mapB = new Map(mapSpanB);
-
- mapA.MapType = MapType.Hybrid;
- mapB.MapType = MapType.Satellite;
- Assert.AreNotEqual(mapA.MapType, mapB.MapType, "MapTypeProperty value must be different.");
- mapA.BindingContext = mapB;
- mapA.SetBinding(Map.MapTypeProperty, "MapType");
- Assert.AreEqual(mapA.MapType, mapB.MapType, "After binding, value should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property HasScrollEnabled is readable and writable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Map.HasScrollEnabled A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void HasScrollEnabled_READ_WRITE()
- {
- /* TEST CODE */
- _map.HasScrollEnabled = false;
- Assert.False(_map.HasScrollEnabled, "HasScrollEnabled property doesn't set and get successfully");
- _map.HasScrollEnabled = true;
- Assert.True(_map.HasScrollEnabled, "HasScrollEnabled property doesn't set and get successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property HasZoomEnabled is readable and writable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Map.HasZoomEnabled A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void HasZoomEnabled_READ_WRITE()
- {
- /* TEST CODE */
- _map.HasZoomEnabled = false;
- Assert.False(_map.HasZoomEnabled, "HasZoomEnabled property doesn't set and get successfully");
- _map.HasZoomEnabled = true;
- Assert.True(_map.HasZoomEnabled, "HasZoomEnabled property doesn't set and get successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property IsShowingUser is readable and writable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Map.IsShowingUser A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void IsShowingUser_READ_WRITE()
- {
- /* TEST CODE */
- _map.IsShowingUser = false;
- Assert.False(_map.IsShowingUser, "IsShowingUser property doesn't set and get successfully");
- _map.IsShowingUser = true;
- Assert.True(_map.IsShowingUser, "IsShowingUser property doesn't set and get successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property MapType is readable and writable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Map.MapType A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void MapType_READ_WRITE()
- {
- /* TEST CODE */
- _map.MapType = MapType.Hybrid;
- Assert.AreEqual(MapType.Hybrid, _map.MapType, "MapType property doesn't set and get successfully for MapType.Hybrid");
- _map.MapType = MapType.Satellite;
- Assert.AreEqual(MapType.Satellite, _map.MapType, "MapType property doesn't set and get successfully for MapType.Satellite");
- _map.MapType = MapType.Street;
- Assert.AreEqual(MapType.Street, _map.MapType, "MapType property doesn't set and get successfully for MapType.Street");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether Pins property is readable.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Map.Pins A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Pins_READ_ONLY()
- {
- /* TEST CODE */
- double latitude = 23.7479246;
- double longitude = 90.3917394;
- var mMapSpan = new MapSpan(new Position(), latitude, longitude);
- var mMap = new Map(mMapSpan);
-
- IList<Pin> lPin = mMap.Pins;
- Assert.IsInstanceOf<IList<Pin>>(mMap.Pins);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of GetEnumerator.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Map.GetEnumerator M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void GetEnumerator_CHECK_RETURN()
- {
- /* TEST CODE */
- double latitude = 23.7479246;
- double longitude = 90.3917394;
- //var mapSpanA = new MapSpan(new Position(), latitude, longitude);
- //var mMap = new Map(mapSpanA);
- var pin = new Pin();
- pin.Position = new Position(latitude, longitude);
- pin.Label = "Pin Test";
- Map map = new Map();
- map.Pins.Add(pin);
- IEnumerator<Pin> enumerator = map.GetEnumerator();
- enumerator.MoveNext();
- Pin mPin = enumerator.Current;
- Assert.AreEqual(pin, mPin, "Pin should be same.");
- Assert.IsInstanceOf<IEnumerator<Pin>>(map.GetEnumerator());
- }
- }
-}
+++ /dev/null
-
-using System;
-using NUnit.Framework;
-using Xamarin.Forms.Maps;
-
-namespace Xamarin.Forms.Maps.Tests
-{
- [TestFixture]
- [Description("Xamarin.Forms.Maps.MapSpan Tests")]
- public class MapSpanTests
- {
- private MapSpan _mapSpan;
- private Position _position;
- private double _latitude = 23.7479246;
- private double _longitude = 90.3917394;
-
- [SetUp]
- public void Setup()
- {
- _position = new Position();
- _mapSpan = new MapSpan(_position, _latitude, _longitude);
- }
-
-
- [TearDown]
- public void Tear()
- {
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a MapSpan instance.")]
- [Property("SPEC", "Xamarin.Forms.Maps.MapSpan.MapSpan C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void MapSpan_INIT()
- {
- /* TEST CODE */
- double _latitude = 23.7479246;
- double _longitude = 90.3917394;
- var mapSpan = new MapSpan(new Position(), _latitude, _longitude);
- Assert.IsNotNull(mapSpan, "Object should be not null after initialize");
- Assert.IsInstanceOf<MapSpan>(mapSpan);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the Center property is readable.")]
- [Property("SPEC", "Xamarin.Forms.Maps.MapSpan.Center A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Center_READ_ONLY()
- {
- /* TEST CODE */
- Assert.IsInstanceOf<Position>(_mapSpan.Center);
- Assert.AreEqual(new Position(), _mapSpan.Center, "Both Position should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the LatitudeDegrees property is readable.")]
- [Property("SPEC", "Xamarin.Forms.Maps.MapSpan.LatitudeDegrees A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void LatitudeDegrees_READ_ONLY()
- {
- /* TEST CODE */
- double m_latitude = 23.7479246;
- Assert.AreEqual(m_latitude, _mapSpan.LatitudeDegrees, "Both LatitudeDegrees values should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the LongitudeDegrees property is readable.")]
- [Property("SPEC", "Xamarin.Forms.Maps.MapSpan.LongitudeDegrees A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void LongitudeDegrees_READ_ONLY()
- {
- /* TEST CODE */
- double mLongitudeDegrees = 90.3917394;
- Assert.AreEqual(mLongitudeDegrees, _mapSpan.LongitudeDegrees, "Both LongitudeDegrees values should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the Radius property is readable.")]
- [Property("SPEC", "Xamarin.Forms.Maps.MapSpan.Radius A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Radius_READ_ONLY()
- {
- /* TEST CODE */
- var distance = _mapSpan.Radius;
- Assert.IsInstanceOf<Distance>(_mapSpan.Radius);
- //Assert.AreEqual(distance., _mapSpan.Radius, "Both LongitudeDegrees values should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Equals.")]
- [Property("SPEC", "Xamarin.Forms.Maps.MapSpan.Equals M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Equals_CHECK_RETURN()
- {
- /* TEST CODE */
- double _latitude = 23.7479246;
- double _longitude = 90.3917394;
- double _latitudeC = 24.8413651;
- double _longitudeC = 89.3001658;
- var mapSpanA = new MapSpan(new Position(), _latitude, _longitude);
- var mapSpanB = new MapSpan(new Position(), _latitude, _longitude);
- var mapSpanC = new MapSpan(new Position(), _latitudeC, _longitudeC);
-
- Assert.False(mapSpanA.Equals(null), "Should not be equal.");
- Assert.False(mapSpanA.Equals("MapSpan"), "Should not be equal.");
- Assert.True(mapSpanA.Equals(mapSpanB), "Should be equal.");
- Assert.False(mapSpanA.Equals(mapSpanC), "Should not be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of GetHashCode.")]
- [Property("SPEC", "Xamarin.Forms.Maps.MapSpan.GetHashCode M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void GetHashCode_CHECK_RETURN()
- {
- /* TEST CODE */
- double _latitude = 23.7479246;
- double _longitude = 90.3917394;
- var mapSpan = new MapSpan(new Position(), _latitude, _longitude);
-
- var result = mapSpan.GetHashCode();
- Assert.IsNotNull(result, "Should not be null.");
- Assert.IsInstanceOf<Int32>(result, "Should be instance of int32.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of ClampLatitude.")]
- [Property("SPEC", "Xamarin.Forms.Maps.MapSpan.ClampLatitude M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void ClampLatitude_CHECK_RETURN()
- {
- /* TEST CODE */
- double _latitude = 23.7479246;
- double _longitude = 90.3917394;
- var mapSpan = new MapSpan(new Position(), _latitude, _longitude);
-
- var result = mapSpan.ClampLatitude(10.00,20.00);
- Assert.IsNotNull(result, "Should not be null.");
- Assert.IsInstanceOf<MapSpan>(result, "Should be instance of MapSpan.");
- Assert.AreEqual(mapSpan.LongitudeDegrees, result.LongitudeDegrees, "Values should be equal");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of FromCenterAndRadius.")]
- [Property("SPEC", "Xamarin.Forms.Maps.MapSpan.FromCenterAndRadius M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void FromCenterAndRadius_CHECK_RETURN()
- {
- /* TEST CODE */
- double latitude = 23.7479246;
- double longitude = 90.3917394;
- double radius = 10.00;
- var position = new Position(latitude, longitude);
- var distance = new Distance(radius);
-
- var result = MapSpan.FromCenterAndRadius(position, distance);
- Assert.IsNotNull(result, "Should not be null.");
- Assert.IsInstanceOf<MapSpan>(result, "Should be instance of MapSpan.");
- Assert.AreEqual(distance, result.Radius,"Values should be equal");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of WithZoom.")]
- [Property("SPEC", "Xamarin.Forms.Maps.MapSpan.WithZoom M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void WithZoom_CHECK_RETURN()
- {
- /* TEST CODE */
- double latitude = 23.7479246;
- double longitude = 90.3917394;
- double meter = 10.00;
- double zoomFactor = 5.0;
-
- Position position = new Position(latitude, longitude);
- Distance distance = new Distance(meter);
- MapSpan result = MapSpan.FromCenterAndRadius(position, distance);
-
- MapSpan newMapSpan =result.WithZoom(zoomFactor);
-
- double expectecdMeter = result.Radius.Meters / zoomFactor;
- Distance expectedDistance = new Distance(expectecdMeter);
-
-
- Assert.IsNotNull(result, "Should not be null.");
- Assert.AreEqual(newMapSpan.Center, result.Center , "Center should be equal.");
- Assert.AreEqual(newMapSpan.Radius.Meters, expectedDistance.Meters, "Expected Values should be equal");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Equality.")]
- [Property("SPEC", "Xamarin.Forms.Maps.MapSpan.== M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Equality_CHECK_RETURN()
- {
- /* TEST CODE */
- double _latitude = 23.7479246;
- double _longitude = 90.3917394;
- var mapSpanA = new MapSpan(new Position(), _latitude, _longitude);
- var mapSpanB = new MapSpan(new Position(), _latitude, _longitude);
-
- Assert.True(mapSpanA == mapSpanB, "Two MapSpan's should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Inequality.")]
- [Property("SPEC", "Xamarin.Forms.Maps.MapSpan.!= M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Inequality_CHECK_RETURN()
- {
- /* TEST CODE */
- double _latitudeA = 23.7479246;
- double _longitudeA = 90.3917394;
- double _latitudeB = 24.8413651;
- double _longitudeB = 89.3001658;
- var mapSpanA = new MapSpan(new Position(), _latitudeA, _longitudeA);
- var mapSpanB = new MapSpan(new Position(), _latitudeB, _longitudeB);
-
- Assert.True(mapSpanA != mapSpanB, "Two MapSpan's should not be equal.");
- }
- }
-}
+++ /dev/null
-
-using System;
-using NUnit.Framework;
-using Xamarin.Forms;
-using Xamarin.Forms.Maps;
-
-namespace Xamarin.Forms.Maps.Tests
-{
- [TestFixture]
- [Description("Xamarin.Forms.Maps.Pin Tests")]
- public class PinTests
- {
- private Pin _pin;
- private double _latitude = 23.7479246;
- private double _longitude = 90.3917394;
-
- [SetUp]
- public void Setup()
- {
- _pin = new Pin();
- }
-
- [TearDown]
- public void Tear()
- {
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a Pin instance.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Pin.Pin C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Pin_INIT()
- {
- /* TEST CODE */
- var mPin = new Pin();
- Assert.IsNotNull(mPin, "Object should be not null after initialize");
- Assert.IsInstanceOf<Pin>(mPin);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether AddressProperty property bound or not")]
- [Property("SPEC", "Xamarin.Forms.Maps.Pin.AddressProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void AddressProperty_BINDABLE()
- {
- /* TEST CODE */
- var pinA = new Pin()
- {
- Label = "Pin1"
- };
-
- var pinB = new Pin()
- {
- Label = "Pin2"
- };
-
- pinA.Address = "Monem Business District";
- pinB.Address = "BRB Hospital";
- Assert.AreNotEqual(pinA.Address, pinB.Address, "AddressProperty value must be different.");
- pinA.BindingContext = pinB;
- pinA.SetBinding(Pin.AddressProperty, "Address");
- Assert.AreEqual(pinA.Address, pinB.Address, "After binding, value should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether PositionProperty property bound or not")]
- [Property("SPEC", "Xamarin.Forms.Maps.Pin.PositionProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void PositionProperty_BINDABLE()
- {
- /* TEST CODE */
- var pinA = new Pin()
- {
- Label = "Pin1"
- };
-
- var pinB = new Pin()
- {
- Label = "Pin2"
- };
-
- double lat = 23.7521701;
- double lon = 90.3917394;
-
- pinA.Position = new Position(_latitude, _longitude);
- pinB.Position = new Position(lat, lon);
- Assert.AreNotEqual(pinA.Position, pinB.Position, "PositionProperty value must be different.");
- pinA.BindingContext = pinB;
- pinA.SetBinding(Pin.PositionProperty, "Position");
- Assert.AreEqual(pinA.Position, pinB.Position, "After binding, value should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether TypeProperty property bound or not")]
- [Property("SPEC", "Xamarin.Forms.Maps.Pin.TypeProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void TypeProperty_BINDABLE()
- {
- double lat = 23.7521701;
- double lon = 90.3917394;
- /* TEST CODE */
- var pinA = new Pin()
- {
- Position = new Position(_latitude, _longitude),
- Label = "Pin1"
- };
-
- var pinB = new Pin()
- {
- Position = new Position(lat, lon),
- Label = "Pin2"
- };
-
- pinA.Type = PinType.Generic;
- pinB.Type = PinType.Place;
- Assert.AreNotEqual(pinA.Type, pinB.Type, "TypeProperty value must be different.");
- pinA.BindingContext = pinB;
- pinA.SetBinding(Pin.TypeProperty, "Type");
- Assert.AreEqual(pinA.Type, pinB.Type, "After binding, value should be equal.");
- }
-
-
- [Test]
- [Category("P1")]
- [Description("Check whether LabelProperty property bound or not")]
- [Property("SPEC", "Xamarin.Forms.Maps.Pin.LabelProperty A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void LabelProperty_READ_WRITE()
- {
- double lat = 23.7521701;
- double lon = 90.3917394;
- /* TEST CODE */
- var pinA = new Pin()
- {
- Position = new Position(_latitude, _longitude),
- Label = "PinA"
- };
-
- var pinB = new Pin()
- {
- Position = new Position(lat, lon),
- Label = "PinB"
- };
-
- Assert.AreNotEqual(pinA.Label, pinB.Label, "LabelProperty value must be different.");
- pinA.BindingContext = pinB;
- pinA.SetBinding(Pin.LabelProperty, "Label");
- Assert.AreEqual(pinA.Label, pinB.Label, "After binding, value should be equal.");
-
- }
-
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Address is readable and writable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Pin.Address A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Address_READ_WRITE()
- {
- /* TEST CODE */
- var addressPin = "Monem Business District";
- _pin.Address = addressPin;
- Assert.True(String.Equals(_pin.Address, addressPin), "Address property doesn't set and get successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Label is readable and writable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Pin.Label A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Label_READ_WRITE()
- {
- /* TEST CODE */
- var labelPin = "PinLabel";
- _pin.Label = labelPin;
- Assert.True(String.Equals(_pin.Label, labelPin), "Label property doesn't set and get successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Position is readable and writable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Pin.Position A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Position_READ_WRITE()
- {
- /* TEST CODE */
- var positionPin = new Position(_latitude, _longitude);
- _pin.Position = positionPin;
- Assert.True(positionPin == _pin.Position, "Position property doesn't set and get successfully");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the property Type is readable and writable with valid values.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Pin.Type A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Type_READ_WRITE()
- {
- /* TEST CODE */
- _pin.Type = PinType.Generic;
- Assert.AreEqual(PinType.Generic, _pin.Type, "Type property doesn't set and get successfully for PinType.Generic");
- _pin.Type = PinType.Place;
- Assert.AreEqual(PinType.Place, _pin.Type, "Type property doesn't set and get successfully for PinType.Place");
- _pin.Type = PinType.SavedPin;
- Assert.AreEqual(PinType.SavedPin, _pin.Type, "Type property doesn't set and get successfully for PinType.SavedPin");
- _pin.Type = PinType.SearchResult;
- Assert.AreEqual(PinType.SearchResult, _pin.Type, "Type property doesn't set and get successfully for PinType.SearchResult");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Equals.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Pin.Equals M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Equals_CHECK_RETURN()
- {
- /* TEST CODE */
- var pinA = new Pin()
- {
- Position = new Position(_latitude, 90.3917394),
- Label = "Pin1"
- };
-
- var pinB = new Pin()
- {
- Position = new Position(_latitude, 100.3917394),
- Label = "Pin2"
- };
-
- Assert.False(new Pin().Equals(null), "Should not be equal.");
- Assert.False(new Pin().Equals("Pin"), "Should not be equal.");
- Assert.True(pinA.Equals(new Pin(){Position = new Position(_latitude, 90.3917394),Label = "Pin1"}), "Should be equal.");
- Assert.False(pinA.Equals(pinB), "Should not be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of GetHashCode.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Pin.GetHashCode M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void GetHashCode_CHECK_RETURN()
- {
- /* TEST CODE */
- var result = new Pin().GetHashCode();
- Assert.IsNotNull(result, "Should not be null.");
- Assert.IsInstanceOf<Int32>(result, "Should be instance of int32.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Equality.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Pin.Position.== M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Equality_CHECK_RETURN()
- {
-
- /* TEST CODE */
- var pinA = new Pin()
- {
- Position = new Position(_latitude, _longitude),
- Label = "Pin"
- };
-
- var pinB = new Pin()
- {
- Position = new Position(_latitude, _longitude),
- Label = "Pin"
- };
-
- Assert.True(pinA == pinB, "Two Pin's should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Inequality.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Pin.!= M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Inequality_CHECK_RETURN()
- {
- double lat = 13.7521701;
- double lon = 100.3917394;
-
- /* TEST CODE */
- var pinA = new Pin()
- {
- Position = new Position(_latitude, _longitude),
- Label = "Pin1"
- };
-
- var pinB = new Pin()
- {
- Position = new Position(lat, lon),
- Label = "Pin2"
- };
-
- Assert.True(pinA != pinB, "Two Pin's should not be equal.");
- }
-
- // [Test] // should be created by manual.
- [Category("P1")]
- [Description("Check whether Clicked Event is raised when a Pin is clicked.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Pin.Clicked E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Clicked_EVENT()
- {
- /* TEST CODE */
- Assert.IsTrue(false, "[NA] Need to Manual.");
- }
- }
-}
+++ /dev/null
-using NUnit.Framework;
-using System;
-using Xamarin.Forms.Maps;
-
-namespace Xamarin.Forms.Maps.Tests
-{
- [TestFixture]
- [Description("Xamarin.Forms.Maps.Position Tests")]
- public class PositionTests
- {
- private Position _position;
- private double _latitude = 23.7479246;
- private double _longitude = 90.3917394;
-
- [SetUp]
- public void Setup()
- {
- _position = new Position(_latitude, _longitude);
- }
-
- [TearDown]
- public void Tear()
- {
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a Position instance.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Position.Position C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Position_INIT()
- {
- /* TEST CODE */
- var position = new Position(_latitude, _longitude);
- Assert.IsNotNull(position, "Object should be not null after initialize");
- Assert.IsInstanceOf<Position>(position);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the Latitude property is readable.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Position.Latitude A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Latitude_READ_ONLY()
- {
- /* TEST CODE */
- var position = new Position(_latitude, _longitude);
- Assert.AreEqual(position.Latitude, _latitude, "Latitude should be 23.7479246");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether the Longitude property is readable.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Position.Longitude A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Longitude_READ_ONLY()
- {
- /* TEST CODE */
- var position = new Position(_latitude, _longitude);
- Assert.AreEqual(position.Longitude, _longitude, "Longitude should be 90.3917394");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Equals.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Position.Equals M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Equals_CHECK_RETURN()
- {
- /* TEST CODE */
- Assert.False(new Position().Equals(null), "Should not be equal.");
- Assert.False(new Position().Equals("Position"), "Should not be equal.");
- Assert.True(new Position(_latitude, _longitude).Equals(new Position(_latitude, _longitude)), "Should be equal.");
- Assert.False(new Position(15.0, 20.0).Equals(new Position(_latitude, _longitude)), "Should not be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of GetHashCode.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Position.GetHashCode M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void GetHashCode_CHECK_RETURN()
- {
- /* TEST CODE */
- var result = new Position(_latitude, _longitude).GetHashCode();
- Assert.IsNotNull(result, "Should not be null.");
- Assert.IsInstanceOf<Int32>(result, "Should be instance of int32.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Equality.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Position.== M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Equality_CHECK_RETURN()
- {
- Position posA = new Position(_latitude, _longitude);
- Position posB = new Position(_latitude, _longitude);
-
- /* TEST CODE */
- Assert.True(posA == posB, "Two Position's should be equal.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Check the return value of Inequality.")]
- [Property("SPEC", "Xamarin.Forms.Maps.Position.!= M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")]
- public void Inequality_CHECK_RETURN()
- {
- double lat = 11.203254;
- double lon = 190.203254;
- Position posA = new Position(_latitude, _longitude);
- Position posB = new Position(lat, lon);
-
- /* TEST CODE */
- Assert.True(posA != posB, "Two Position's should not be equal.");
- }
- }
-}
+++ /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.XamarinFormsMaps.Tests
-{
- public class PreconditionUtils
- {
- private static string HERE_MAPS_PROVIDER_KEY = null;
-
- public static string GetHereMapsProviderKey()
- {
- if (HERE_MAPS_PROVIDER_KEY == null)
- SetPrecondition();
-
- return HERE_MAPS_PROVIDER_KEY;
- }
-
- public static void SetPrecondition()
- {
- string result = ReadFile("/opt/usr/home/owner/share/tct/preconfigure.json");
- if (result == null)
- return;
-
- int index = 0;
- string[] resultArray = StringParser(result);
- foreach (string item in resultArray)
- {
- switch (item)
- {
- case "HERE_MAPS_PROVIDER_KEY_FOR_XAMARIN":
- // 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();
- reader.Close();
- }
- catch (Exception e)
- {
- LogUtils.Write(LogUtils.ERROR, LogUtils.TAG, "File read error : " + e.Message);
- }
-
- return result;
- }
-
- private static string[] StringParser(string TCID)
- {
- string[] delimiter = { "[{\"", "\":\"", "\",\"", "\":", ",\"", "\"}]", "}" };
- string[] stringPieces = { };
-
- try
- {
- stringPieces = TCID.Split(delimiter, StringSplitOptions.None);
- }
- catch (Exception e)
- {
- LogUtils.Write(LogUtils.ERROR, LogUtils.TAG, "ResultParser : " + e.Message);
- }
-
- return stringPieces;
- }
- }
-}
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<manifest package="Tizen.XamarinFormsMaps.Tests" version="1.0.0" api-version="6" xmlns="http://tizen.org/ns/packages">
- <profile name="common" />
- <ui-application appid="Tizen.XamarinFormsMaps.Tests" exec="Tizen.XamarinFormsMaps.Tests.dll" multiple="false" taskmanage="true" splash-screen-display="true" type="dotnet" launch_mode="single">
- <icon>Tizen.XamarinFormsMaps.Tests.png</icon>
- <label>Tizen.XamarinFormsMaps.Tests</label>
- </ui-application>
- <shortcut-list />
- <privileges>
- <privilege>http://tizen.org/privilege/internet</privilege>
- <privilege>http://tizen.org/privilege/mapservice</privilege>
- <privilege>http://tizen.org/privilege/network.get</privilege>
- <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
- </privileges>
-</manifest>