From 688c45bcc8a1b0a5c5b90de2fc2e5e0566abf611 Mon Sep 17 00:00:00 2001 From: Yeongjong Lee Date: Mon, 7 Dec 2020 15:57:05 +0900 Subject: [PATCH] [NUI][TCSACR-392] Add RelativeLayout TCT - Add TCT for new RelativeLayout public APIs Change-Id: I31cb92bb8febe34644460239e7028d351aa488d0 --- .../Tizen.NUI.Tests/testcase/TSRelativeLayout.cs | 1141 ++++++++++++++++++++ 1 file changed, 1141 insertions(+) create mode 100644 tct-suite-vs/Tizen.NUI.Tests/testcase/TSRelativeLayout.cs diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSRelativeLayout.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSRelativeLayout.cs new file mode 100644 index 0000000..66f9969 --- /dev/null +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSRelativeLayout.cs @@ -0,0 +1,1141 @@ +using NUnit.Framework; +using NUnit.Framework.TUnit; +using System; +using Tizen.NUI; +using Tizen.NUI.BaseComponents; +using Tizen.NUI.Test; +using System.Threading.Tasks; + +namespace Tizen.NUI.Tests +{ + [TestFixture] + [Description("Tizen.NUI.RelativeLayout Tests")] + public class RelativeLayoutTests + { + private string TAG = "NUI"; + private static bool _flagOnMeasureOverride; + private static bool _flagOnLayoutOverride; + internal class DerivedLayout : RelativeLayout + { + public DerivedLayout() : base() + { } + + // This method needs to call protected method, OnMeasure for the test cases. + public void OnMeasureTest( MeasureSpecification widthMeasureSpec, MeasureSpecification heightMeasureSpec ) + { + OnMeasure( widthMeasureSpec, heightMeasureSpec ); + } + protected override void OnMeasure(MeasureSpecification widthMeasureSpec, MeasureSpecification heightMeasureSpec) + { + _flagOnMeasureOverride = true; + } + + public void OnLayoutTest(bool changed, LayoutLength left, LayoutLength top, LayoutLength right, LayoutLength bottom) + { + OnLayout( changed, left, top, right, bottom ); + } + protected override void OnLayout(bool changed, LayoutLength left, LayoutLength top, LayoutLength right, LayoutLength bottom) + { + _flagOnLayoutOverride = true; + } + } + + [SetUp] + public void Init() + { + Tizen.Log.Info(TAG, "Init() is called!"); + App.MainTitleChangeText("RelativeLayoutTests"); + App.MainTitleChangeBackgroundColor(null); + } + + [TearDown] + public void Destroy() + { + Tizen.Log.Info(TAG, "Destroy() is called!"); + } + + [Test] + [Category("P1")] + [Description("RelativeLayout constructor test")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.RelativeLayout C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void RelativeLayout_INIT() + { + var layout = new RelativeLayout(); + Assert.IsNotNull(layout, "null handle"); + Assert.IsInstanceOf(layout, "Should return RelativeLayout instance."); + } + + [Test] + [Category("P1")] + [Description("Check override method OnMeasure is invoked when called on a derived class .")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.OnMeasure M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MCST")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void OnMeasure_OVERRIDE_METHOD() + { + /*PRE CONDITION + * _flagOnMeasureOverride flag is initialize false value + * Create a derived instance of RelativeLayout + */ + _flagOnMeasureOverride = false; + Assert.False(_flagOnMeasureOverride, "_flagOnMeasureOverride should be false initial"); + /**TEST CODE**/ + var derivedLayout = new DerivedLayout(); + Assert.IsNotNull(derivedLayout, "Should not be null."); + Assert.IsInstanceOf(derivedLayout, "Should be an instance of RelativeLayout type."); + + MeasureSpecification measureWidth = new MeasureSpecification(new LayoutLength(50.0f), MeasureSpecification.ModeType.Exactly); + MeasureSpecification measureHeight = new MeasureSpecification(new LayoutLength(50.0f), MeasureSpecification.ModeType.Exactly); + + derivedLayout.OnMeasureTest(measureWidth, measureHeight); + Assert.True(_flagOnMeasureOverride, "RelativeLayout overridden method not invoked."); + } + + [Test] + [Category("P1")] + [Description("Check override method OnLayout is invoked when called on a derived class .")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.OnLayout M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MCST")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void OnLayout_OVERRIDE_METHOD() + { + /*PRE CONDITION + * _flagOnLayoutOverride flag is initialize false value + * Create a derived instance of RelativeLayout + */ + _flagOnLayoutOverride = false; + Assert.False(_flagOnLayoutOverride, "_flagOnLayoutOverride should be false initial"); + /**TEST CODE**/ + var derivedLayout = new DerivedLayout(); + Assert.IsNotNull(derivedLayout, "Should not be null."); + Assert.IsInstanceOf(derivedLayout, "Should be an instance of RelativeLayout type."); + derivedLayout.OnLayoutTest(true, new LayoutLength(5), new LayoutLength(5), new LayoutLength(10), new LayoutLength(10)); + Assert.True(_flagOnLayoutOverride, "RelativeLayout overridden method not invoked."); + + // Test with false parameter + _flagOnLayoutOverride = false; + Assert.False(_flagOnLayoutOverride, "_flagOnLayoutOverride should be false initial"); + derivedLayout.OnLayoutTest(false, new LayoutLength(10), new LayoutLength(10), new LayoutLength(20), new LayoutLength(20)); + Assert.True(_flagOnLayoutOverride, "RelativeLayout overridden method not invoked."); + } + + [Test] + [Category("P1")] + [Description("Test SetLeftTarget. Check whether SetLeftTarget is working.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.SetLeftTarget M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void SetLeftTarget_CHECK_VALUE() + { + View child = new View(); + Assert.IsNotNull(child, "Should be not null "); + View target = new View(); + Assert.IsNotNull(target, "Should be not null "); + + RelativeLayout.SetLeftTarget(child, target); + Assert.AreEqual(RelativeLayout.GetLeftTarget(child), target, $"Should be {target}."); + + RelativeLayout.SetLeftTarget(child, null); + Assert.AreEqual(RelativeLayout.GetLeftTarget(child), null, "Should be null."); + } + + [Test] + [Category("P2")] + [Description("Verify SetLeftTarget with null argument.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.SetLeftTarget M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void SetLeftTarget_NULL_ARGUMENT() + { + try + { + View target = new View(); + Assert.IsNotNull(target, "Should be not null "); + + RelativeLayout.SetLeftTarget(null, target); + Assert.Fail("Should return null argument exception"); + } + catch (ArgumentNullException) + { + Assert.Pass("ArgumentNullException: passed!"); + } + } + + [Test] + [Category("P2")] + [Description("Verify SetLeftTarget with null argument and null reference.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.SetLeftTarget M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void SetLeftTarget_NULL_ARGUMENT_WITH_NULL_REFERENCE() + { + try + { + RelativeLayout.SetLeftTarget(null, null); + Assert.Fail("Should return null argument exception"); + } + catch (ArgumentNullException) + { + Assert.Pass("ArgumentNullException: passed!"); + } + } + + [Test] + [Category("P1")] + [Description("Test GetLeftTarget. Check whether GetLeftTarget is working.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.GetLeftTarget M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void GetLeftTarget_CHECK_RETURN_VALUE() + { + View child = new View(); + Assert.IsNotNull(child, "Should be not null "); + View target = new View(); + Assert.IsNotNull(target, "Should be not null "); + + RelativeLayout.SetLeftTarget(child, target); + Assert.AreEqual(RelativeLayout.GetLeftTarget(child), target, $"Should be {target}."); + } + + [Test] + [Category("P2")] + [Description("Verify GetLeftTarget with null argument.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.GetLeftTarget M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void GetLeftTarget_NULL_ARGUMENT() + { + try + { + RelativeLayout.GetLeftTarget(null); + Assert.Fail("Should return null argument exception"); + } + catch (ArgumentNullException) + { + Assert.Pass("ArgumentNullException: passed!"); + } + } + + [Test] + [Category("P1")] + [Description("Test SetRightTarget. Check whether SetRightTarget is working.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.SetRightTarget M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void SetRightTarget_CHECK_VALUE() + { + View child = new View(); + Assert.IsNotNull(child, "Should be not null "); + View target = new View(); + Assert.IsNotNull(target, "Should be not null "); + + RelativeLayout.SetRightTarget(child, target); + Assert.AreEqual(RelativeLayout.GetRightTarget(child), target, $"Should be {target}."); + + RelativeLayout.SetRightTarget(child, null); + Assert.AreEqual(RelativeLayout.GetRightTarget(child), null, "Should be null."); + } + + [Test] + [Category("P2")] + [Description("Verify SetRightTarget with null argument.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.SetRightTarget M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void SetRightTarget_NULL_ARGUMENT() + { + try + { + View target = new View(); + Assert.IsNotNull(target, "Should be not null "); + + RelativeLayout.SetRightTarget(null, target); + Assert.Fail("Should return null argument exception"); + } + catch (ArgumentNullException) + { + Assert.Pass("ArgumentNullException: passed!"); + } + } + + [Test] + [Category("P2")] + [Description("Verify SetRightTarget with null argument and null reference.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.SetRightTarget M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void SetRightTarget_NULL_ARGUMENT_WITH_NULL_REFERENCE() + { + try + { + RelativeLayout.SetRightTarget(null, null); + Assert.Fail("Should return null argument exception"); + } + catch (ArgumentNullException) + { + Assert.Pass("ArgumentNullException: passed!"); + } + } + + [Test] + [Category("P1")] + [Description("Test GetRightTarget. Check whether GetRightTarget is working.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.GetRightTarget M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void GetRightTarget_CHECK_RETURN_VALUE() + { + View child = new View(); + Assert.IsNotNull(child, "Should be not null "); + View target = new View(); + Assert.IsNotNull(target, "Should be not null "); + + RelativeLayout.SetRightTarget(child, target); + Assert.AreEqual(RelativeLayout.GetRightTarget(child), target, $"Should be {target}."); + } + + [Test] + [Category("P2")] + [Description("Verify GetRightTarget with null argument.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.GetRightTarget M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void GetRightTarget_NULL_ARGUMENT() + { + try + { + RelativeLayout.GetRightTarget(null); + Assert.Fail("Should return null argument exception"); + } + catch (ArgumentNullException) + { + Assert.Pass("ArgumentNullException: passed!"); + } + } + + [Test] + [Category("P1")] + [Description("Test SetTopTarget. Check whether SetTopTarget is working.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.SetTopTarget M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void SetTopTarget_CHECK_VALUE() + { + View child = new View(); + Assert.IsNotNull(child, "Should be not null "); + View target = new View(); + Assert.IsNotNull(target, "Should be not null "); + + RelativeLayout.SetTopTarget(child, target); + Assert.AreEqual(RelativeLayout.GetTopTarget(child), target, $"Should be {target}."); + + RelativeLayout.SetTopTarget(child, null); + Assert.AreEqual(RelativeLayout.GetTopTarget(child), null, "Should be null."); + } + + [Test] + [Category("P2")] + [Description("Verify SetTopTarget with null argument.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.SetTopTarget M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void SetTopTarget_NULL_ARGUMENT() + { + try + { + View target = new View(); + Assert.IsNotNull(target, "Should be not null "); + + RelativeLayout.SetTopTarget(null, target); + Assert.Fail("Should return null argument exception"); + } + catch (ArgumentNullException) + { + Assert.Pass("ArgumentNullException: passed!"); + } + } + + [Test] + [Category("P2")] + [Description("Verify SetTopTarget with null argument and null reference.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.SetTopTarget M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void SetTopTarget_NULL_ARGUMENT_WITH_NULL_REFERENCE() + { + try + { + RelativeLayout.SetTopTarget(null, null); + Assert.Fail("Should return null argument exception"); + } + catch (ArgumentNullException) + { + Assert.Pass("ArgumentNullException: passed!"); + } + } + + [Test] + [Category("P1")] + [Description("Test GetTopTarget. Check whether GetTopTarget is working.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.GetTopTarget M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void GetTopTarget_CHECK_RETURN_VALUE() + { + View child = new View(); + Assert.IsNotNull(child, "Should be not null "); + View target = new View(); + Assert.IsNotNull(target, "Should be not null "); + + RelativeLayout.SetTopTarget(child, target); + Assert.AreEqual(RelativeLayout.GetTopTarget(child), target, $"Should be {target}."); + } + + [Test] + [Category("P2")] + [Description("Verify GetTopTarget with null argument.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.GetTopTarget M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void GetTopTarget_NULL_ARGUMENT() + { + try + { + RelativeLayout.GetTopTarget(null); + Assert.Fail("Should return null argument exception"); + } + catch (ArgumentNullException) + { + Assert.Pass("ArgumentNullException: passed!"); + } + } + + [Test] + [Category("P1")] + [Description("Test SetBottomTarget. Check whether SetBottomTarget is working.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.SetBottomTarget M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void SetBottomTarget_CHECK_VALUE() + { + View child = new View(); + Assert.IsNotNull(child, "Should be not null "); + View target = new View(); + Assert.IsNotNull(target, "Should be not null "); + + RelativeLayout.SetBottomTarget(child, target); + Assert.AreEqual(RelativeLayout.GetBottomTarget(child), target, $"Should be {target}."); + + RelativeLayout.SetBottomTarget(child, null); + Assert.AreEqual(RelativeLayout.GetBottomTarget(child), null, "Should be null."); + } + + [Test] + [Category("P2")] + [Description("Verify SetBottomTarget with null argument.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.SetBottomTarget M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void SetBottomTarget_NULL_ARGUMENT() + { + try + { + View target = new View(); + Assert.IsNotNull(target, "Should be not null "); + + RelativeLayout.SetBottomTarget(null, target); + Assert.Fail("Should return null argument exception"); + } + catch (ArgumentNullException) + { + Assert.Pass("ArgumentNullException: passed!"); + } + } + + [Test] + [Category("P2")] + [Description("Verify SetBottomTarget with null argument and null reference.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.SetBottomTarget M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void SetBottomTarget_NULL_ARGUMENT_WITH_NULL_REFERENCE() + { + try + { + RelativeLayout.SetBottomTarget(null, null); + Assert.Fail("Should return null argument exception"); + } + catch (ArgumentNullException) + { + Assert.Pass("ArgumentNullException: passed!"); + } + } + + [Test] + [Category("P1")] + [Description("Test GetBottomTarget. Check whether GetBottomTarget is working.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.GetBottomTarget M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void GetBottomTarget_CHECK_RETURN_VALUE() + { + View child = new View(); + Assert.IsNotNull(child, "Should be not null "); + View target = new View(); + Assert.IsNotNull(target, "Should be not null "); + + RelativeLayout.SetBottomTarget(child, target); + Assert.AreEqual(RelativeLayout.GetBottomTarget(child), target, $"Should be {target}."); + } + + [Test] + [Category("P2")] + [Description("Verify GetBottomTarget with null argument.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.GetBottomTarget M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void GetBottomTarget_NULL_ARGUMENT() + { + try + { + RelativeLayout.GetBottomTarget(null); + Assert.Fail("Should return null argument exception"); + } + catch (ArgumentNullException) + { + Assert.Pass("ArgumentNullException: passed!"); + } + } + + [Test] + [Category("P1")] + [Description("Test SetLeftRelativeOffset. Check whether SetLeftRelativeOffset is working.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.SetLeftRelativeOffset M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void SetLeftRelativeOffset_CHECK_VALUE() + { + View child = new View(); + Assert.IsNotNull(child, "Should be not null "); + + RelativeLayout.SetLeftRelativeOffset(child, 0.0f); + Assert.AreEqual(RelativeLayout.GetLeftRelativeOffset(child), 0.0f, "Should be 0.0."); + + RelativeLayout.SetLeftRelativeOffset(child, -1.0f); + Assert.AreEqual(RelativeLayout.GetLeftRelativeOffset(child), -1.0f, "Should be -1.0f."); + } + + [Test] + [Category("P2")] + [Description("Verify SetLeftRelativeOffset with null argument.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.SetLeftRelativeOffset M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void SetLeftRelativeOffset_NULL_ARGUMENT() + { + try + { + RelativeLayout.SetLeftRelativeOffset(null, 0.0f); + Assert.Fail("Should return null argument exception"); + } + catch (ArgumentNullException) + { + Assert.Pass("ArgumentNullException: passed!"); + } + } + + [Test] + [Category("P1")] + [Description("Test GetLeftRelativeOffset. Check whether GetLeftRelativeOffset is working.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.GetLeftRelativeOffset M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void GetLeftRelativeOffset_CHECK_RETURN_VALUE() + { + View child = new View(); + Assert.IsNotNull(child, "Should be not null "); + + RelativeLayout.SetLeftRelativeOffset(child, 0.0f); + Assert.AreEqual(RelativeLayout.GetLeftRelativeOffset(child), 0.0f, "Should be 0.0."); + } + + [Test] + [Category("P2")] + [Description("Verify GetLeftRelativeOffset with null argument.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.GetLeftRelativeOffset M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void GetLeftRelativeOffset_NULL_ARGUMENT() + { + try + { + RelativeLayout.GetLeftRelativeOffset(null); + Assert.Fail("Should return null argument exception"); + } + catch (ArgumentNullException) + { + Assert.Pass("ArgumentNullException: passed!"); + } + } + + [Test] + [Category("P1")] + [Description("Test SetRightRelativeOffset. Check whether SetRightRelativeOffset is working.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.SetRightRelativeOffset M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void SetRightRelativeOffset_CHECK_VALUE() + { + View child = new View(); + Assert.IsNotNull(child, "Should be not null "); + + RelativeLayout.SetRightRelativeOffset(child, 0.0f); + Assert.AreEqual(RelativeLayout.GetRightRelativeOffset(child), 0.0f, "Should be 0.0."); + + RelativeLayout.SetRightRelativeOffset(child, -1.0f); + Assert.AreEqual(RelativeLayout.GetRightRelativeOffset(child), -1.0f, "Should be -1.0f."); + } + + [Test] + [Category("P2")] + [Description("Verify SetRightRelativeOffset with null argument.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.SetRightRelativeOffset M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void SetRightRelativeOffset_NULL_ARGUMENT() + { + try + { + RelativeLayout.SetRightRelativeOffset(null, 0.0f); + Assert.Fail("Should return null argument exception"); + } + catch (ArgumentNullException) + { + Assert.Pass("ArgumentNullException: passed!"); + } + } + + [Test] + [Category("P1")] + [Description("Test GetRightRelativeOffset. Check whether GetRightRelativeOffset is working.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.GetRightRelativeOffset M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void GetRightRelativeOffset_CHECK_RETURN_VALUE() + { + View child = new View(); + Assert.IsNotNull(child, "Should be not null "); + + RelativeLayout.SetRightRelativeOffset(child, 0.0f); + Assert.AreEqual(RelativeLayout.GetRightRelativeOffset(child), 0.0f, "Should be 0.0."); + } + + [Test] + [Category("P2")] + [Description("Verify GetRightRelativeOffset with null argument.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.GetRightRelativeOffset M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void GetRightRelativeOffset_NULL_ARGUMENT() + { + try + { + RelativeLayout.GetRightRelativeOffset(null); + Assert.Fail("Should return null argument exception"); + } + catch (ArgumentNullException) + { + Assert.Pass("ArgumentNullException: passed!"); + } + } + + [Test] + [Category("P1")] + [Description("Test SetTopRelativeOffset. Check whether SetTopRelativeOffset is working.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.SetTopRelativeOffset M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void SetTopRelativeOffset_CHECK_VALUE() + { + View child = new View(); + Assert.IsNotNull(child, "Should be not null "); + + RelativeLayout.SetTopRelativeOffset(child, 0.0f); + Assert.AreEqual(RelativeLayout.GetTopRelativeOffset(child), 0.0f, "Should be 0.0."); + + RelativeLayout.SetTopRelativeOffset(child, -1.0f); + Assert.AreEqual(RelativeLayout.GetTopRelativeOffset(child), -1.0f, "Should be -1.0f."); + } + + [Test] + [Category("P2")] + [Description("Verify SetTopRelativeOffset with null argument.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.SetTopRelativeOffset M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void SetTopRelativeOffset_NULL_ARGUMENT() + { + try + { + RelativeLayout.SetTopRelativeOffset(null, 0.0f); + Assert.Fail("Should return null argument exception"); + } + catch (ArgumentNullException) + { + Assert.Pass("ArgumentNullException: passed!"); + } + } + + [Test] + [Category("P1")] + [Description("Test GetTopRelativeOffset. Check whether GetTopRelativeOffset is working.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.GetTopRelativeOffset M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void GetTopRelativeOffset_CHECK_RETURN_VALUE() + { + View child = new View(); + Assert.IsNotNull(child, "Should be not null "); + + RelativeLayout.SetTopRelativeOffset(child, 0.0f); + Assert.AreEqual(RelativeLayout.GetTopRelativeOffset(child), 0.0f, "Should be 0.0."); + } + + [Test] + [Category("P2")] + [Description("Verify GetTopRelativeOffset with null argument.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.GetTopRelativeOffset M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void GetTopRelativeOffset_NULL_ARGUMENT() + { + try + { + RelativeLayout.GetTopRelativeOffset(null); + Assert.Fail("Should return null argument exception"); + } + catch (ArgumentNullException) + { + Assert.Pass("ArgumentNullException: passed!"); + } + } + + [Test] + [Category("P1")] + [Description("Test SetBottomRelativeOffset. Check whether SetBottomRelativeOffset is working.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.SetBottomRelativeOffset M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void SetBottomRelativeOffset_CHECK_VALUE() + { + View child = new View(); + Assert.IsNotNull(child, "Should be not null "); + + RelativeLayout.SetBottomRelativeOffset(child, 0.0f); + Assert.AreEqual(RelativeLayout.GetBottomRelativeOffset(child), 0.0f, "Should be 0.0."); + + RelativeLayout.SetBottomRelativeOffset(child, -1.0f); + Assert.AreEqual(RelativeLayout.GetBottomRelativeOffset(child), -1.0f, "Should be -1.0f."); + } + + [Test] + [Category("P2")] + [Description("Verify SetBottomRelativeOffset with null argument.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.SetBottomRelativeOffset M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void SetBottomRelativeOffset_NULL_ARGUMENT() + { + try + { + RelativeLayout.SetBottomRelativeOffset(null, 0.0f); + Assert.Fail("Should return null argument exception"); + } + catch (ArgumentNullException) + { + Assert.Pass("ArgumentNullException: passed!"); + } + } + + [Test] + [Category("P1")] + [Description("Test GetBottomRelativeOffset. Check whether GetBottomRelativeOffset is working.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.GetBottomRelativeOffset M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void GetBottomRelativeOffset_CHECK_RETURN_VALUE() + { + View child = new View(); + Assert.IsNotNull(child, "Should be not null "); + + RelativeLayout.SetBottomRelativeOffset(child, 0.0f); + Assert.AreEqual(RelativeLayout.GetBottomRelativeOffset(child), 0.0f, "Should be 0.0."); + } + + [Test] + [Category("P2")] + [Description("Verify GetBottomRelativeOffset with null argument.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.GetBottomRelativeOffset M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void GetBottomRelativeOffset_NULL_ARGUMENT() + { + try + { + RelativeLayout.GetBottomRelativeOffset(null); + Assert.Fail("Should return null argument exception"); + } + catch (ArgumentNullException) + { + Assert.Pass("ArgumentNullException: passed!"); + } + } + + [Test] + [Category("P1")] + [Description("Test SetHorizontalAlignment. Check whether SetHorizontalAlignment is working.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.SetHorizontalAlignment M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void SetHorizontalAlignment_CHECK_VALUE() + { + View child = new View(); + Assert.IsNotNull(child, "Should be not null "); + + RelativeLayout.SetHorizontalAlignment(child, RelativeLayout.Alignment.Start); + Assert.AreEqual(RelativeLayout.GetHorizontalAlignment(child), RelativeLayout.Alignment.Start, "Should be RelativeLayout.Alignment.Start."); + + RelativeLayout.SetHorizontalAlignment(child, RelativeLayout.Alignment.Center); + Assert.AreEqual(RelativeLayout.GetHorizontalAlignment(child), RelativeLayout.Alignment.Center, "Should be RelativeLayout.Alignment.Center."); + + RelativeLayout.SetHorizontalAlignment(child, RelativeLayout.Alignment.End); + Assert.AreEqual(RelativeLayout.GetHorizontalAlignment(child), RelativeLayout.Alignment.End, "Should be RelativeLayout.Alignment.End."); + } + + [Test] + [Category("P2")] + [Description("Verify SetHorizontalAlignment with null argument.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.SetHorizontalAlignment M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void SetHorizontalAlignment_NULL_ARGUMENTS() + { + try + { + RelativeLayout.SetHorizontalAlignment(null, RelativeLayout.Alignment.End); + Assert.Fail("Should return null argument exception"); + } + catch (ArgumentNullException) + { + Assert.Pass("ArgumentNullException: passed!"); + } + } + + [Test] + [Category("P1")] + [Description("Test GetHorizontalAlignment. Check whether GetHorizontalAlignment is working.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.GetHorizontalAlignment M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void GetHorizontalAlignment_CHECK_RETURN_VALUE() + { + View child = new View(); + Assert.IsNotNull(child, "Should be not null "); + RelativeLayout.SetHorizontalAlignment(child, RelativeLayout.Alignment.Start); + + Assert.AreEqual(RelativeLayout.GetHorizontalAlignment(child), RelativeLayout.Alignment.Start, "Should be RelativeLayout.Alignment.Start."); + } + + [Test] + [Category("P2")] + [Description("Verify GetHorizontalAlignment with null argument.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.GetHorizontalAlignment M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void GetHorizontalAlignment_NULL_ARGUMENT() + { + try + { + RelativeLayout.GetHorizontalAlignment(null); + Assert.Fail("Should return null argument exception"); + } + catch (ArgumentNullException) + { + Assert.Pass("ArgumentNullException: passed!"); + } + } + + [Test] + [Category("P1")] + [Description("Test SetVerticalAlignment. Check whether SetVerticalAlignment is working.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.SetVerticalAlignment M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void SetVerticalAlignment_CHECK_VALUE() + { + View child = new View(); + Assert.IsNotNull(child, "Should be not null "); + + RelativeLayout.SetVerticalAlignment(child, RelativeLayout.Alignment.Start); + Assert.AreEqual(RelativeLayout.GetVerticalAlignment(child), RelativeLayout.Alignment.Start, "Should be RelativeLayout.Alignment.Start."); + + RelativeLayout.SetVerticalAlignment(child, RelativeLayout.Alignment.Center); + Assert.AreEqual(RelativeLayout.GetVerticalAlignment(child), RelativeLayout.Alignment.Center, "Should be RelativeLayout.Alignment.Center."); + + RelativeLayout.SetVerticalAlignment(child, RelativeLayout.Alignment.End); + Assert.AreEqual(RelativeLayout.GetVerticalAlignment(child), RelativeLayout.Alignment.End, "Should be RelativeLayout.Alignment.End."); + } + + [Test] + [Category("P2")] + [Description("Verify SetVerticalAlignment with null argument.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.SetVerticalAlignment M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void SetVerticalAlignment_NULL_ARGUMENTS() + { + try + { + RelativeLayout.SetVerticalAlignment(null, RelativeLayout.Alignment.End); + Assert.Fail("Should return null argument exception"); + } + catch (ArgumentNullException) + { + Assert.Pass("ArgumentNullException: passed!"); + } + } + + [Test] + [Category("P1")] + [Description("Test GetVerticalAlignment. Check whether GetVerticalAlignment is working.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.GetVerticalAlignment M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void GetVerticalAlignment_CHECK_RETURN_VALUE() + { + View child = new View(); + Assert.IsNotNull(child, "Should be not null "); + RelativeLayout.SetVerticalAlignment(child, RelativeLayout.Alignment.Start); + + Assert.AreEqual(RelativeLayout.GetVerticalAlignment(child), RelativeLayout.Alignment.Start, "Should be RelativeLayout.Alignment.Start."); + } + + [Test] + [Category("P2")] + [Description("Verify GetVerticalAlignment with null argument.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.GetVerticalAlignment M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void GetVerticalAlignment_NULL_ARGUMENT() + { + try + { + RelativeLayout.GetVerticalAlignment(null); + Assert.Fail("Should return null argument exception"); + } + catch (ArgumentNullException) + { + Assert.Pass("ArgumentNullException: passed!"); + } + } + + [Test] + [Category("P1")] + [Description("Test SetFillHorizontal. Check whether SetFillHorizontal is working.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.SetFillHorizontal M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void SetFillHorizontal_CHECK_VALUE() + { + View child = new View(); + Assert.IsNotNull(child, "Should be not null "); + + RelativeLayout.SetFillHorizontal(child, true); + Assert.AreEqual(RelativeLayout.GetFillHorizontal(child), true, "Should be true"); + + RelativeLayout.SetFillHorizontal(child, false); + Assert.AreEqual(RelativeLayout.GetFillHorizontal(child), false, "Should be false"); + } + + [Test] + [Category("P2")] + [Description("Verify SetFillHorizontal with null argument.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.SetFillHorizontal M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void SetFillHorizontal_NULL_ARGUMENTS() + { + try + { + RelativeLayout.SetFillHorizontal(null, true); + Assert.Fail("Should return null argument exception"); + } + catch (ArgumentNullException) + { + Assert.Pass("ArgumentNullException: passed!"); + } + } + + [Test] + [Category("P1")] + [Description("Test GetFillHorizontal. Check whether GetFillHorizontal is working.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.GetFillHorizontal M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void GetFillHorizontal_CHECK_RETURN_VALUE() + { + View child = new View(); + Assert.IsNotNull(child, "Should be not null "); + RelativeLayout.SetFillHorizontal(child, true); + + Assert.AreEqual(RelativeLayout.GetFillHorizontal(child), true, "Should be true."); + } + + [Test] + [Category("P2")] + [Description("Verify GetFillHorizontal with null argument.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.GetFillHorizontal M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void GetFillHorizontal_NULL_ARGUMENT() + { + try + { + RelativeLayout.GetFillHorizontal(null); + Assert.Fail("Should return null argument exception"); + } + catch (ArgumentNullException) + { + Assert.Pass("ArgumentNullException: passed!"); + } + } + + [Test] + [Category("P1")] + [Description("Test SetFillVertical. Check whether SetFillVertical is working.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.SetFillVertical M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void SetFillVertical_CHECK_VALUE() + { + View child = new View(); + Assert.IsNotNull(child, "Should be not null "); + + RelativeLayout.SetFillVertical(child, true); + Assert.AreEqual(RelativeLayout.GetFillVertical(child), true, "Should be true"); + + RelativeLayout.SetFillVertical(child, false); + Assert.AreEqual(RelativeLayout.GetFillVertical(child), false, "Should be false"); + } + + [Test] + [Category("P2")] + [Description("Verify SetFillVertical with null argument.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.SetFillVertical M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void SetFillVertical_NULL_ARGUMENTS() + { + try + { + RelativeLayout.SetFillVertical(null, true); + Assert.Fail("Should return null argument exception"); + } + catch (ArgumentNullException) + { + Assert.Pass("ArgumentNullException: passed!"); + } + } + + [Test] + [Category("P1")] + [Description("Test GetFillVertical. Check whether GetFillVertical is working.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.GetFillVertical M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void GetFillVertical_CHECK_RETURN_VALUE() + { + View child = new View(); + Assert.IsNotNull(child, "Should be not null "); + RelativeLayout.SetFillVertical(child, true); + + Assert.AreEqual(RelativeLayout.GetFillVertical(child), true, "Should be true."); + } + + [Test] + [Category("P2")] + [Description("Verify GetFillVertical with null argument.")] + [Property("SPEC", "Tizen.NUI.RelativeLayout.GetFillVertical M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Yeongjong Lee, yj34.lee@samsung.com")] + public void GetFillVertical_NULL_ARGUMENT() + { + try + { + RelativeLayout.GetFillVertical(null); + Assert.Fail("Should return null argument exception"); + } + catch (ArgumentNullException) + { + Assert.Pass("ArgumentNullException: passed!"); + } + } + } +} -- 2.7.4