imageView.Unparent();
}
+ [Test]
+ [Category("P1")]
+ [Description("Test AdjustViewSize. Check whether AdjustViewSize is readable and writable with true value.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.ImageView.AdjustViewSize A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "jae_hyun.cho@samsung.com")]
+ public async Task AdjustViewSize_SET_GET_TRUE_VALUE()
+ {
+ /* TEST CODE */
+ var parentView = new View()
+ {
+ Layout = new AbsoluteLayout(),
+ WidthSpecification = 512,
+ HeightSpecification = 256,
+ };
+
+ Assert.IsNotNull(parentView, "Should not be a Null : View");
+ Assert.IsInstanceOf<View>(parentView, "Should be an instance of : View");
+
+ var imageView = new ImageView(image_path)
+ {
+ FittingMode = FittingModeType.ShrinkToFit,
+ WidthSpecification = LayoutParamPolicies.WrapContent,
+ HeightSpecification = LayoutParamPolicies.MatchParent,
+ };
+
+ Assert.IsNotNull(imageView, "Should not be a Null : ImageView");
+ Assert.IsInstanceOf<ImageView>(imageView, "Should be an instance of : ImageView");
+
+ imageView.ResourceUrl = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture2.jpg";
+
+ imageView.AdjustViewSize = true;
+
+ Assert.IsNotNull(Window.Instance, "Should not be a Null : Window.Instance");
+ Assert.IsInstanceOf<Window>(Window.Instance, "Should be an instance of : Window.Instance");
+
+ Window.Instance.Add(parentView);
+ parentView.Add(imageView);
+
+ await Task.Delay(1000);
+
+ Assert.AreEqual(true, imageView.AdjustViewSize, "Retrieved AdjustViewSize should be equal to set value");
+ Assert.AreEqual(imageView.Size2D.Width, imageView.Size2D.Height, "Retrieved Width should be equal to Height because image's aspect ratio 1 is respected by AdjustViewSize true");
+
+ imageView.Unparent();
+ parentView.Unparent();
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test AdjustViewSize. Check whether AdjustViewSize is readable and writable with false value.")]
+ [Property("SPEC", "Tizen.NUI.BaseComponents.ImageView.AdjustViewSize A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "jae_hyun.cho@samsung.com")]
+ public async Task AdjustViewSize_SET_GET_FALSE_VALUE()
+ {
+ /* TEST CODE */
+ var parentView = new View()
+ {
+ Layout = new AbsoluteLayout(),
+ WidthSpecification = 512,
+ HeightSpecification = 256,
+ };
+
+ Assert.IsNotNull(parentView, "Should not be a Null : View");
+ Assert.IsInstanceOf<View>(parentView, "Should be an instance of : View");
+
+ var imageView = new ImageView(image_path)
+ {
+ FittingMode = FittingModeType.ShrinkToFit,
+ WidthSpecification = LayoutParamPolicies.WrapContent,
+ HeightSpecification = LayoutParamPolicies.MatchParent,
+ };
+
+ Assert.IsNotNull(imageView, "Should not be a Null : ImageView");
+ Assert.IsInstanceOf<ImageView>(imageView, "Should be an instance of : ImageView");
+
+ imageView.ResourceUrl = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture2.jpg";
+
+ imageView.AdjustViewSize = false;
+
+ Assert.IsNotNull(Window.Instance, "Should not be a Null : Window.Instance");
+ Assert.IsInstanceOf<Window>(Window.Instance, "Should be an instance of : Window.Instance");
+
+ Window.Instance.Add(parentView);
+ parentView.Add(imageView);
+
+ await Task.Delay(1000);
+
+ Assert.AreEqual(false, imageView.AdjustViewSize, "Retrieved AdjustViewSize should be equal to set value");
+ Assert.AreNotEqual(imageView.Size2D.Width, imageView.Size2D.Height, "Retrieved Width should not be equal to Height because image's aspect ratio 1 is not respected by AdjustViewSize false");
+
+ imageView.Unparent();
+ parentView.Unparent();
+ }
}
-}
\ No newline at end of file
+}