<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns="http://tizen.org/ns/packages" api-version="3.0" package="tpkpkgtest" version="1.0.0">
- <profile name="mobile" />
- <ui-application appid="tpkpkgtest" exec="tpkpkgtest" type="capp" multiple="false" taskmanage="true" nodisplay="false" launch_mode="single">
- <icon>tpkpkgtest.png</icon>
- <label>tpkpkgtest</label>
- </ui-application>
+ <profile name="mobile"/>
+ <ui-application appid="tpkpkgtest"
+ exec="tpkpkgtest"
+ type="capp"
+ multiple="false"
+ taskmanage="true"
+ nodisplay="false"
+ launch_mode="single">
+ <icon>tpkpkgtest.png</icon>
+ <label>tpkpkgtest</label>
+ </ui-application>
+ <dependencies>
+ <dependency type="wants" required-version="1.0.0">dependency_package_1</dependency>
+ <dependency type="wants" required-version="1.2.3">dependency_package_2</dependency>
+ </dependencies>
</manifest>
private Package _wgtPackage = null;
private Package _watchPackage = null;
private const string MainAppId = "tpkpkgtest";
+ private const string DependencyPkg1 = "dependency_package_1";
+ private const string DependencyPkg1Type = "wants";
+ private const string DependencyPkg1RequiredVersion = "1.0.0";
+ private const string DependencyPkg2 = "dependency_package_2";
+ private const string DependencyPkg2Type = "wants";
+ private const string DependencyPkg2RequiredVersion = "1.2.3";
[TestFixtureSetUp]
public void Init()
Assert.IsInstanceOf<ApplicationInfo>(mainapplication, "MainApplication should return ApplicationInfo");
Assert.AreEqual(mainapplication.ApplicationId, MainAppId, "Main Application ID should be same " + MainAppId);
}
+
+ [Test]
+ [Category("P1")]
+ [Description("Checks if DependencyTo property return correct value")]
+ [Property("SPEC", "Tizen.Applications.Package.DependencyTo A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Kim Ilho, ilho159.kim@samsung.com")]
+ public void DependencyTo_READ_ONLY()
+ {
+ // PRECONDITION
+ Assert.IsNotNull(_tpkPackage, "Precondition failed: testPackage should not be null");
+
+ // TEST CODE
+ var dependencies = _tpkPackage.DependencyTo;
+ string[] dependencyPkgList = new string[] { DependencyPkg1, DependencyPkg2 };
+ Assert.IsTrue(dependencies is IEnumerable<PackageDependencyInformation>, "Package dependencies should be of type IEnumerable<PackageDependencyInformation>");
+ Assert.IsNotNull(dependencies, "dependencies list should not be null");
+ Assert.IsNotEmpty(dependencies, "dependencies should be not empty.");
+ Assert.AreEqual(dependencies.Count(), 2, "Number elements of returned list of PackageDependencyInformation should correct");
+ foreach (PackageDependencyInformation dependency in dependencies)
+ {
+ Assert.IsTrue(dependencyPkgList.Contains(dependency.To), "return pkg should be in pkgList");
+ if (dependency.To == DependencyPkg1)
+ {
+ Assert.AreEqual(dependency.From, _tpkPackage.Id, "dependency From should be " + _tpkPackage.Id);
+ Assert.AreEqual(dependency.To, DependencyPkg1, "dependency To should be " + _tpkPackage.Id);
+ Assert.AreEqual(dependency.Type, DependencyPkg1Type, "dependency Type should be" + DependencyPkg1Type);
+ Assert.AreEqual(dependency.RequiredVersion, DependencyPkg1RequiredVersion, "dependency RequiredVersion should be" + DependencyPkg1RequiredVersion);
+ } else if (dependency.To == DependencyPkg2)
+ {
+ Assert.AreEqual(dependency.From, _tpkPackage.Id, "dependency From should be " + _tpkPackage.Id);
+ Assert.AreEqual(dependency.To, DependencyPkg2, "dependency To should be " + DependencyPkg2);
+ Assert.AreEqual(dependency.Type, DependencyPkg2Type, "dependency Type should be" + DependencyPkg2Type);
+ Assert.AreEqual(dependency.RequiredVersion, DependencyPkg2RequiredVersion, "dependency RequiredVersion should be" + DependencyPkg2RequiredVersion);
+ }
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Checks if DependencyFrom property return correct value")]
+ [Property("SPEC", "Tizen.Applications.Package.DependencyFrom A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Kim Ilho, ilho159.kim@samsung.com")]
+ public void DependencyFrom_READ_ONLY()
+ {
+ // PRECONDITION
+ Assert.IsNotNull(_tpkPackage, "Precondition failed: testPackage should not be null");
+
+ // TEST CODE
+ var dependencies = _tpkPackage.DependencyFrom;
+ Assert.IsTrue(dependencies is IEnumerable<PackageDependencyInformation>, "Package dependencies should be of type IEnumerable<PackageDependencyInformation>");
+ Assert.IsNotNull(dependencies, "dependencies list should not be null");
+ Assert.IsNotEmpty(dependencies, "dependencies should be not empty.");
+ Assert.AreEqual(dependencies.Count(), 1, "Number elements of returned list of PackageDependencyInformation should correct");
+ List<PackageDependencyInformation> dependencyList = dependencies.ToList();
+ PackageDependencyInformation dependency = dependencyList[0];
+
+ Assert.AreEqual(dependency.From, "dependency_test", "dependency From should be dependency_test");
+ Assert.AreEqual(dependency.To, _tpkPackage.Id, "dependency To should be " + _tpkPackage.Id);
+ Assert.AreEqual(dependency.Type, "wants", "dependency Type should be wants");
+ Assert.AreEqual(dependency.RequiredVersion, "1.0.0", "dependency RequiredVersion should be 1.0.0");
+ }
}
}
using NUnit.Framework;
using NUnit.Framework.TUnit;
+using System.Collections.Generic;
+using System.Linq;
namespace Tizen.Applications.Tests
{
private string _label = "pkgarchivetest";
private string _author = "test author";
private int _iconSize = 57662;
+ private const string DependencyPkg1 = "dependency_package_1";
+ private const string DependencyPkg2 = "dependency_package_2";
[SetUp]
public void Init()
{
Assert.AreEqual(_iconSize, _pkgArchive.Icon.Length, "Icon size of " + _archiveTestPkg + " is not correct");
}
+
+ [Test]
+ [Category("P1")]
+ [Description("Checks if DependencyTo property return correct value")]
+ [Property("SPEC", "Tizen.Applications.PackageArchive.DependencyTo A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Kim Ilho, ilho159.kim@samsung.com")]
+ public void DependencyTo_GET()
+ {
+ var dependencies = _pkgArchive.DependencyTo;
+ string[] dependencyPkgList = new string[] { DependencyPkg1, DependencyPkg2 };
+ Assert.IsTrue(dependencies is List<PackageDependencyInformation>, "Package dependencies should be of type List<PackageDependencyInformation>");
+ Assert.IsNotNull(dependencies, "dependencies list should not be null");
+ Assert.IsNotEmpty(dependencies, "dependencies should be not empty.");
+ Assert.AreEqual(dependencies.Count, 2, "Number elements of returned list of PackageDependencyInformation should correct");
+ foreach (PackageDependencyInformation dependency in dependencies)
+ {
+ Assert.IsTrue(dependencyPkgList.Contains(dependency.To), "return pkg should be in pkgList");
+ }
+ }
}
}
--- /dev/null
+// Copyright 2019 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using NUnit.Framework;
+
+namespace Tizen.Applications.Tests
+{
+ [TestFixture]
+ [Description("Tizen.Applications.PackageDependencyInformation test class")]
+ public class PackageDependencyInformationTests
+ {
+ PackageDependencyInformation dependency = null;
+
+ [TestFixtureSetUp]
+ public void Init()
+ {
+ var dependencies = TestHelper.TpkPackage.DependencyFrom;
+ Assert.IsTrue(dependencies is IEnumerable<PackageDependencyInformation>, "Package dependencies should be of type IEnumerable<PackageDependencyInformation>");
+ Assert.IsNotNull(dependencies, "dependencies list should not be null");
+ Assert.IsNotEmpty(dependencies, "dependencies should be not empty.");
+ Assert.AreEqual(dependencies.Count(), 1, "Number elements of returned list of PackageDependencyInformation should correct");
+ List<PackageDependencyInformation> dependencyList = dependencies.ToList();
+ dependency = dependencyList[0];
+ }
+
+ [TestFixtureTearDown]
+ public void Destroy()
+ {
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Checks if From property return correct value")]
+ [Property("SPEC", "Tizen.Applications.PackageDependencyInformation.From A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Kim Ilho, ilho159.kim@samsung.com")]
+ public void From_GET()
+ {
+ // TEST CODE
+ Assert.AreEqual(dependency.From, "dependency_test", "dependency From should be dependency_test");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Checks if To property return correct value")]
+ [Property("SPEC", "Tizen.Applications.PackageDependencyInformation.To A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Kim Ilho, ilho159.kim@samsung.com")]
+ public void To_GET()
+ {
+ // TEST CODE
+ Assert.AreEqual(dependency.To, "tpkpkgtest", "dependency To should be tpkpkgtest");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Checks if Type property return correct value")]
+ [Property("SPEC", "Tizen.Applications.PackageDependencyInformation.Type A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Kim Ilho, ilho159.kim@samsung.com")]
+ public void Type_GET()
+ {
+ // TEST CODE
+ Assert.AreEqual(dependency.Type, "wants", "dependency Type should be wants");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Checks if RequiredVersion property return correct value")]
+ [Property("SPEC", "Tizen.Applications.PackageDependencyInformation.RequiredVersion A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Kim Ilho, ilho159.kim@samsung.com")]
+ public void RequiredVersion_GET()
+ {
+ // TEST CODE
+ Assert.AreEqual(dependency.RequiredVersion, "1.0.0", "dependency RequiredVersion should be 1.0.0");
+ }
+
+ }
+
+}