using System;
using System.IO;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using PhotoRenamer.Base;
using PhotoRenamer.Base.Types;

namespace PhotoRenamer.Test
{
    [TestClass]
    public class FilesTest
    {
        private readonly string[] _files;

        public FilesTest()
        {
            var path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Assets");
            _files = FilesHelper.FindSupportedFilesRecursively(path).ToArray();
        }

        [TestMethod, Priority(0)]
        public void FindSupportedFiles()
        {
            Assert.AreEqual(2, _files.Length);
            Assert.AreEqual("IMG_20120528_125912.jpg", Path.GetFileName(_files[0]));
            Assert.AreEqual("IMG_20120526_170007.jpg", Path.GetFileName(_files[1]));
        }

        [TestMethod, Priority(1)]
        public void GetMetaData()
        {
            var expected = new[] {new MediaFile("r", DateTime.Now), new MediaFile("r", DateTime.Now)};
            var actual = FilesHelper.GetMediaFiles(_files);
        }
    }
}