Assert.That(textFormat.Equals(textFormat2), Is.True);
Assert.That(textFormat.Equals(textFormat3), Is.False);
+ Assert.That(textFormat.Equals(null), Is.False);
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Check whether ToString returns expected value or not.")]
+ [Property("SPEC", "Tizen.Multimedia.TextMediaFormat.ToString M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void ToString_CHECK()
+ {
+ const MediaFormatTextMimeType mimeType = MediaFormatTextMimeType.MP4;
+ const MediaFormatTextType textType = MediaFormatTextType.MP4;
+
+ var textFormat = new TextMediaFormat(mimeType, textType);
+
+ Assert.AreEqual(textFormat.ToString(), $"MimeType={ mimeType.ToString() }, TextType={ textType.ToString() }",
+ "Should be same string");
}
}
}
[Test]
[Category("P2")]
- [Description("Check if it throws out of range exception for region property for arguments less than zero")]
+ [Description("Check if it throws out of range exception for region property for invalid arguments")]
[Property("SPEC", "Tizen.Multimedia.Util.CropTransform.Region A")]
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "PEX")]
[Property("AUTHOR", "Gaurang Khanwalkar, g.khanwalkar@samsung.com")]
public void Region_PROPERTY_CHECK_EXCEPTION()
{
- Assert.Throws<ArgumentOutOfRangeException>(delegate
- {
- _cropTransform.Region = new Rectangle(-1, -1, 50, 50);
- Assert.AreEqual(_cropTransform.Region.X, 5, "Failed to retrieve region location");
- });
+ Assert.That(() => _cropTransform.Region = new Rectangle(-1, 0, 50, 50), Throws.TypeOf<ArgumentOutOfRangeException>(),
+ "Should throw proper exception");
+
+ Assert.That(() => _cropTransform.Region = new Rectangle(0, -1, 50, 50), Throws.TypeOf<ArgumentOutOfRangeException>(),
+ "Should throw proper exception");
+
+ Assert.That(() => _cropTransform.Region = new Rectangle(0, 0, 0, 50), Throws.TypeOf<ArgumentOutOfRangeException>(),
+ "Should throw proper exception");
+
+ Assert.That(() => _cropTransform.Region = new Rectangle(0, 0, 50, -1), Throws.TypeOf<ArgumentOutOfRangeException>(),
+ "Should throw proper exception");
}
[Test]
}
[Test]
+ [Category("P2")]
+ [Description("Throws if the value is invalid")]
+ [Property("SPEC", "Tizen.Multimedia.Util.FlipTransform.Flip A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void Flip_THROWS_ARGUMENT_OUT_OF_RANAGE_EXCEPTION()
+ {
+ var flipTransform = new FlipTransform(Flips.Horizontal);
+
+ Assert.That(() => flipTransform.Flip = Flips.None, Throws.TypeOf<ArgumentOutOfRangeException>(),
+ "Should throw proper exception");
+ }
+
+ [Test]
[Category("P1")]
[Description("Read write")]
[Property("SPEC", "Tizen.Multimedia.Util.FlipTransform.Flip A")]
CreatePacket();
using (var newPacket = await _imageTransformer.TransformAsync(_packet,
+ new RotateTransform(Rotation.Rotate90)))
+ {
+ Assert.Greater(newPacket.VideoPlanes[0].Buffer.Length, 0);
+ }
+
+ using (var newPacket = await _imageTransformer.TransformAsync(_packet,
new RotateTransform(Rotation.Rotate180)))
{
Assert.Greater(newPacket.VideoPlanes[0].Buffer.Length, 0);
}
+
+ using (var newPacket = await _imageTransformer.TransformAsync(_packet,
+ new RotateTransform(Rotation.Rotate270)))
+ {
+ Assert.Greater(newPacket.VideoPlanes[0].Buffer.Length, 0);
+ }
}
[Test]
}
[Test]
+ [Category("P2")]
+ [Description("Check if it throws argument out of range exception for setting rotation with 0 degree")]
+ [Property("SPEC", "Tizen.Multimedia.Util.RotateTransform.Rotation A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void Rotation_PROPERTY_CHECK_ARGUMENT_OUT_OF_RANAGE_EXCEPTION()
+ {
+ Assert.Throws<ArgumentOutOfRangeException>(() => _rotateTransform.Rotation = Rotation.Rotate0);
+ }
+
+ [Test]
[Category("P1")]
[Description("Read write")]
[Property("SPEC", "Tizen.Multimedia.Util.RotateTransform.Rotation A")]