Exemple #1
0
        protected override VendorImageInfo GetImageInfo(string imageName)
        {
            VendorImageInfo info = new VendorImageInfo();


            string[] filearray = imageName.Split('_');
            var      reg       = "^\\w+_\\d+_[f|b|F|B|L|l|H|h]$";

            if (!Regex.IsMatch(imageName, reg))
            {
                log.InfoFormat("{0} is not correct", imageName);
                log.InfoFormat("ERROR!! File name is not in the right format... .");

                return(null);
            }

            info.Name        = imageName;
            info.Description = filearray[0];
            var imageDiscriminator = filearray[2].ToLower();

            try
            {
                info.Sequence = ATMediaHelper.GetImageSequence(filearray[2].ToLower());
            }
            catch (Exception e)
            {
                log.Warn("Invalid image " + imageName);
                info.Sequence = 7;
            }

            info.IsThumbnail = false;
            return(info);
        }
Exemple #2
0
 public void Sequence_Should_Be_4_If_FileName_Ends_In_H()
 {
     Assert.AreEqual(4, ATMediaHelper.GetImageSequence("h"));
 }
Exemple #3
0
 public void Sequence_Should_Be_3_If_FileName_Ends_In_L()
 {
     Assert.AreEqual(3, ATMediaHelper.GetImageSequence("l"));
 }
Exemple #4
0
 public void Sequence_Should_Be_1_If_FileName_Ends_In_B()
 {
     Assert.AreEqual(1, ATMediaHelper.GetImageSequence("b"));
 }
Exemple #5
0
 public void Sequence_Should_Be_0_If_FileName_Ends_In_F()
 {
     Assert.AreEqual(0, ATMediaHelper.GetImageSequence("f"));
 }
Exemple #6
0
 public void Sequence_Should_Throw_An_Exception_If_Extension_Is_Invalid()
 {
     var sequence = ATMediaHelper.GetImageSequence("asqwe");
 }