diff options
Diffstat (limited to 'tct-mediacontent-tizen-tests/src/Testcase/TSAlbum.cs')
-rw-r--r-- | tct-mediacontent-tizen-tests/src/Testcase/TSAlbum.cs | 143 |
1 files changed, 143 insertions, 0 deletions
diff --git a/tct-mediacontent-tizen-tests/src/Testcase/TSAlbum.cs b/tct-mediacontent-tizen-tests/src/Testcase/TSAlbum.cs new file mode 100644 index 0000000..98e089f --- /dev/null +++ b/tct-mediacontent-tizen-tests/src/Testcase/TSAlbum.cs @@ -0,0 +1,143 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using TestFramework; +using Tizen.Content.MediaContent; +namespace TizenTest.MediaInformationT +{ + [TestFixture] + [Description("Tizen.Content.MediaContent.Album Tests")] + class TSAlbum + { + private static string TAG = "TCT"; + private static string _logTag = "TizenTest.MediaInformationT.TSAlbum"; + [SetUp] + public static void Init() + { + //LogUtils.write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST"); + } + + [TearDown] + public static void Destroy() + { + //LogUtils.write(LogUtils.DEBUG, LogUtils.TAG, "Postconditions for each TEST"); + } + + [Test] + [Category("P1")] + [Description("Test for Group count ...")] + [Property("SPEC", " Tizen.Content.MediaContent.Album M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Praveen Kumar Gattu, gattu.p@samsung.com")] + public static void albumCount_CHECK_RESULT() + { + Tizen.Log.Info(TAG, "Executing TC:albumCount_CHECK_RESULT Album"); + int Count = ContentManager.Database.GetCount<Album>( null); + Tizen.Log.Info(TAG, "Executing TC:albumCount_CHECK_RESULT Album count :"+ Count); + Assert.IsTrue(Count > 0, "Failed to get the group Count"); + Tizen.Log.Info(TAG, "Executing TC:albumCount_CHECK_RESULT Album end"); + } + + [Test] + [Category("P1")] + [Description("Test for Group list ...")] + [Property("SPEC", " Tizen.Content.MediaContent.Album.Nanme A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "P")] + [Property("AUTHOR", "Praveen Kumar Gattu, gattu.p@samsung.com")] + public static async Task albumList_CHECK_RESULT() + { + Tizen.Log.Info(TAG, "Executing TC:albumList_CHECK_RESULT Album"); + Task<IEnumerable<Album>> albumsTask = ContentManager.Database.SelectAsync<Album>(null); + await albumsTask; + IEnumerable<Album> albums = albumsTask.Result; + foreach (Album album in albums) + { + Tizen.Log.Info(TAG, "Executing TC:albumList_CHECK_RESULT Name :"+ album.Name); + Assert.IsTrue(album.Name.Length > 0, "Failed to get the group information"); + } + Tizen.Log.Info(TAG, "Executing TC:albumList_CHECK_RESULT Album"); + } + + [Test] + [Category("P1")] + [Description("Test for MediaInformation count in Album ...")] + [Property("SPEC", " Tizen.Content.MediaContent.Album M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Praveen Kumar Gattu, gattu.p@samsung.com")] + public static async Task albumMediaCount_CHECK_RESULT() + { + Tizen.Log.Info(TAG, "Executing TC:albumMediaCount_CHECK_RESULT Album"); + Task<IEnumerable<Album>> albumsTask = ContentManager.Database.SelectAsync<Album>(null); + await albumsTask; + IEnumerable<Album> albums = albumsTask.Result; + foreach (Album album in albums) + { + int count = album.GetMediaInformationCount(null); + Tizen.Log.Info(TAG, "Executing TC:albumMediaCount_CHECK_RESULT Album mediacount : " + count); + Assert.IsTrue(count > 0, "Failed to get the media information count from album"); + } + Tizen.Log.Info(TAG, "Executing TC:albumMediaCount_CHECK_RESULT Album end"); + } + + [Test] + [Category("P1")] + [Description("Test for MediaInformation in Album ...")] + [Property("SPEC", " Tizen.Content.MediaContent.Album M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Praveen Kumar Gattu, gattu.p@samsung.com")] + public static async Task albummediaInfo_CHECK_RESULT() + { + Tizen.Log.Info(TAG, "Executing TC:albummediaInfo_CHECK_RESULT Album"); + IEnumerable<Album> albums = await ContentManager.Database.SelectAsync<Album>(null); + foreach (Album album in albums) + { + try + { + IEnumerable<MediaInformation> mediaList = await album.GetMediaInformationsAsync(null); + Tizen.Log.Info(TAG, "Executing TC:albummediaInfo_CHECK_RESULT Album"); + } + catch (Exception) + { + Assert.Fail(); + } + } + Tizen.Log.Info(TAG, "Executing TC:albummediaInfo_CHECK_RESULT Album end"); + } + + [Test] + [Category("P1")] + [Description("Test for Album properties...")] + [Property("SPEC", " Tizen.Content.MediaContent.Album.Artist A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "P")] + [Property("AUTHOR", "Praveen Kumar Gattu, gattu.p@samsung.com")] + public static async Task readAlbumProperties_CHECK_RESULT() + { + Tizen.Log.Info(TAG, "Executing TC:readAlbumProperties_CHECK_RESULT Album"); + try + { + Task<IEnumerable<Album>> albumsTask = ContentManager.Database.SelectAsync<Album>(null); + await albumsTask; + IEnumerable<Album> albums = albumsTask.Result; + foreach (Album album in albums) + { + Tizen.Log.Info(TAG, "Executing TC:readAlbumProperties_CHECK_RESULT Album art : "+ album.Art); + LogUtils.write(LogUtils.INFO, _logTag, "Album art is : "+ album.Art); + Tizen.Log.Info(TAG, "Executing TC:readAlbumProperties_CHECK_RESULT Album artist :" +album.Artist); + LogUtils.write(LogUtils.INFO, _logTag, "Album artist is : " + album.Artist); + LogUtils.write(LogUtils.INFO, _logTag, "Album artist is : " + album.Name); + Tizen.Log.Info(TAG, "Executing TC:readAlbumProperties_CHECK_RESULT Album Name :" +album.Name); + } + }catch(Exception e) + { + Assert.Fail(); + } + Tizen.Log.Info(TAG, "Executing TC:readAlbumProperties_CHECK_RESULT Album end"); + } + + } +} |