[Test]
[Category("P1")]
+ [Description("Check whether MetadataFilePath returns correct value.")]
+ [Property("SPEC", "Tizen.Multimedia.Vision.InferenceModelConfiguration.MetadataFilePath A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void MetadataFilePath_READ_WRITE()
+ {
+ var path = TestHelper.TFLitePath + "face_detector/fd_tflite_meta_model.json";
+ _config.MetadataFilePath = path;
+
+ Assert.IsInstanceOf<string>(_config.MetadataFilePath);
+ Assert.AreEqual(path, _config.MetadataFilePath, "Should be got same value.");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Check whether MetadataFilePath throws exception if parameter is null")]
+ [Property("SPEC", "Tizen.Multimedia.Vision.InferenceModelConfiguration.MetadataFilePath A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void MetadataFilePath_THROWS_IF_PARAM_IS_NULL()
+ {
+ Assert.Throws<ArgumentNullException>(() => _config.MetadataFilePath = null);
+ }
+
+ [Test]
+ [Category("P1")]
[Description("Check whether MeanValue returns correct value.")]
[Property("SPEC", "Tizen.Multimedia.Vision.InferenceModelConfiguration.MeanValue A")]
[Property("SPEC_URL", "-")]
[Description("Tizen.Multimedia.Vision.QrConfiguration test class")]
public class QrConfigurationTests
{
+ private const string _mediaPath = "/opt/usr/test-barcode-generate-new";
+
[Test]
[Category("P1")]
[Description("Tests instantiating a QrConfiguration instance")]
var obj = new QrConfiguration(QrMode.Numeric, ErrorCorrectionLevel.Medium, 30);
Assert.AreEqual(obj.Version, 30, "Version is incorrect");
}
+
+ [Test]
+ [Category("P1")]
+ [Description("Check whether EmbedImagePath returns expected value or not.")]
+ [Property("SPEC", "Tizen.Multimedia.Vision.QrConfiguration.EmbedImagePath A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void EmbedImagePath_READ_WRITE()
+ {
+ var obj = new QrConfiguration(QrMode.Numeric, ErrorCorrectionLevel.Medium, 30);
+
+ obj.EmbedImagePath = _mediaPath;
+ Assert.AreEqual(obj.EmbedImagePath, _mediaPath, "EmbedImagePath should be the same");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Check whether EmbedImagePath throws ArgumentNullException if parameter is null.")]
+ [Property("SPEC", "Tizen.Multimedia.Vision.QrConfiguration.EmbedImagePath A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void EmbedImagePath_THROWS_IF_NULL_PARAM()
+ {
+ var obj = new QrConfiguration(QrMode.Numeric, ErrorCorrectionLevel.Medium, 30);
+
+ Assert.Throws<ArgumentNullException>(() => obj.EmbedImagePath = null, "Should throw ArgumentNullException");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Check whether EmbedImagePath throws ArgumentException if parameter is invalid string.")]
+ [Property("SPEC", "Tizen.Multimedia.Vision.QrConfiguration.EmbedImagePath A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void EmbedImagePath_THROWS_IF_INVALID_STRING()
+ {
+ var obj = new QrConfiguration(QrMode.Numeric, ErrorCorrectionLevel.Medium, 30);
+
+ Assert.Throws<ArgumentException>(() => obj.EmbedImagePath = "", "Should throw ArgumentException");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Check whether DataShape returns expected value or not.")]
+ [Property("SPEC", "Tizen.Multimedia.Vision.QrConfiguration.DataShape A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void DataShape_READ_WRITE()
+ {
+ var obj = new QrConfiguration(QrMode.Numeric, ErrorCorrectionLevel.Medium, 30);
+
+ foreach (QrShape dataShape in Enum.GetValues(typeof(QrShape)))
+ {
+ obj.DataShape = dataShape;
+
+ Assert.AreEqual(obj.DataShape, dataShape, "DataShape should be the same");
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Check whether DataShape throws ArgumentException if parameter is invalid enum type.")]
+ [Property("SPEC", "Tizen.Multimedia.Vision.QrConfiguration.DataShape A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void DataShape_THROWS_IF_NULL_PARAM()
+ {
+ var obj = new QrConfiguration(QrMode.Numeric, ErrorCorrectionLevel.Medium, 30);
+
+ Assert.Throws<ArgumentException>(() => obj.DataShape = QrShape.Rectangular - 1,
+ "Should throw ArgumentException");
+
+ Assert.Throws<ArgumentException>(() => obj.DataShape = QrShape.Circle + 1,
+ "Should throw ArgumentException");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Check whether FinderShape returns expected value or not.")]
+ [Property("SPEC", "Tizen.Multimedia.Vision.QrConfiguration.FinderShape A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void FinderShape_READ_WRITE()
+ {
+ var obj = new QrConfiguration(QrMode.Numeric, ErrorCorrectionLevel.Medium, 30);
+
+ foreach (QrShape finderShape in Enum.GetValues(typeof(QrShape)))
+ {
+ obj.FinderShape = finderShape;
+
+ Assert.AreEqual(obj.FinderShape, finderShape, "FinderShape should be the same");
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Check whether FinderShape throws ArgumentException if parameter is invalid enum type.")]
+ [Property("SPEC", "Tizen.Multimedia.Vision.QrConfiguration.FinderShape A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void FinderShape_THROWS_IF_NULL_PARAM()
+ {
+ var obj = new QrConfiguration(QrMode.Numeric, ErrorCorrectionLevel.Medium, 30);
+
+ Assert.Throws<ArgumentException>(() => obj.FinderShape = QrShape.Rectangular - 1,
+ "Should throw ArgumentException");
+
+ Assert.Throws<ArgumentException>(() => obj.FinderShape = QrShape.Circle + 1,
+ "Should throw ArgumentException");
+ }
}
}