Ejemplo n.º 1
0
        public void MoveImageSubjectToTitle_Exists_TitleIsFilled()
        {
            string testImage = "_MoveSubjectToTitle.jpg";

            File.Copy(TestingImagesNames.LeahOnShip1957, testImage);

            var imageProperties1 = new ImageProperties(testImage);

            Assert.IsNull(imageProperties1.ExTitle);
            string expectedTitle = imageProperties1.Subject;
            var    sut           = new ImageFilePropertiesChanger(testImage, false);

            sut.ChangeImageProperties();

            var imageProps = new ImageProperties(testImage);

            Assert.AreEqual(expectedTitle, imageProps.ExTitle);
        }
Ejemplo n.º 2
0
        internal void CheckAndChange(string imageFileName)
        {
            var imagePropsChanger = new ImageFilePropertiesChanger(imageFileName, m_simulationOnly);

            ImageFilePropertiesChanger.PropertiesChangeResult changeResult = imagePropsChanger.ChangeImageProperties();

            switch (changeResult)
            {
            case ImageFilePropertiesChanger.PropertiesChangeResult.Success:
                s_logger.Debug($"successfully changed {imageFileName}");
                break;

            case ImageFilePropertiesChanger.PropertiesChangeResult.Failure:
                s_logger.Warn($"failed changing {imageFileName}");
                break;

            default:
                break;
            }
        }
Ejemplo n.º 3
0
        public void ChangeTitle_NoTitleSubjectExists_Updated()
        {
            string imageFileName      = TestingImagesNames.ZelmaKoon;
            var    existingProperties = new ImageProperties(imageFileName);
            string existingTitle      = existingProperties.ExTitle;
            string existingSubject    = existingProperties.Subject;

            Assert.AreNotEqual(existingSubject, existingTitle);

            string testImageFileName = "_NoTitleSubjectExists_.jpg";

            File.Copy(imageFileName, testImageFileName);

            var sut = new ImageFilePropertiesChanger(testImageFileName, false);

            sut.ChangeImageProperties();

            string newTitle = new ImageProperties(testImageFileName).ExTitle;

            Assert.AreEqual(existingSubject, newTitle);
        }
Ejemplo n.º 4
0
        private ImageFilePropertiesChanger.PropertiesChangeResult ChangeImageFileProperties(string imageFileName)
        {
            var changeImageAttributes = new ImageFilePropertiesChanger(imageFileName, m_simulationOnly);

            return(changeImageAttributes.ChangeImageProperties());
        }
Ejemplo n.º 5
0
        public void ChangeProperties_DateExists_DSCAndDigits_NoChangeToProperties()
        {
            ImageFilePropertiesChanger sut = new ImageFilePropertiesChanger(TestingImagesNames.NameIsDSCHasValidDate, true);

            Assert.AreEqual(ImageFilePropertiesChanger.PropertiesChangeResult.NoNeed, sut.ChangeImageProperties());
        }