[Test]
[Category("P1")]
+ [Description("Check whether on method works properly or not.")]
+ [Property("SPEC", "Xamarin.Forms.AbsoluteLayout.On 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", "-")]
[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", "-")]
using XamarinForTizen;
using XamarinForTizen.Tizen;
using System.Threading.Tasks;
-using AutoTemplate;\r
-\r
+using AutoTemplate;
+
namespace Xamarin.Forms.Core.UnitTests
{
[TestFixture]
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License
- */\r
-\r
-using AutoTemplate;\r
+ */
+
+using AutoTemplate;
using NUnit.Framework;
using NUnit.Framework.TUnit;
using System.Threading.Tasks;
using XamarinForTizen;
using System.Threading.Tasks;
using Xamarin.Forms.Platform.Tizen.Native;
-using AutoTemplate;\r
+using AutoTemplate;
namespace Xamarin.Forms.Core.UnitTests
{
using System.Threading.Tasks;
using XamarinForTizen.Tizen;
using XamarinForTizen;
-using AutoTemplate;\r
+using AutoTemplate;
namespace Xamarin.Forms.Core.UnitTests
{
[Test]
[Category("P1")]
+ [Description("Check whether on method works properly or not.")]
+ [Property("SPEC", "Xamarin.Forms.RelativeLayout.On 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>();\r
+ 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", "-")]
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);
+ }
}
}
await Task.Delay(500);
}
+ [Test]
+ [Category("P1")]
+ [Description("Check whether on method works properly or not.")]
+ [Property("SPEC", "Xamarin.Forms.StackLayout.On 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");
+ }
}
}