Beispiel #1
0
        private static void ProcessSuccess(ReplacerSuccess replacerSuccess, ILicenseHeaderExtension extension, bool isOpen)
        {
            ThreadHelper.ThrowIfNotOnUIThread();
            if (!File.Exists(replacerSuccess.FilePath) || TrySetContent(replacerSuccess.FilePath, extension.Dte2.Solution, replacerSuccess.NewContent, isOpen, extension))
            {
                return;
            }

            s_log.Error($"Updating license header for file {replacerSuccess.FilePath} failed.");
            MessageBoxHelper.ShowError($"Updating license header for file {replacerSuccess.FilePath} failed.");
        }
        public void ReplacerSuccess_ValidInput_ReturnsValidProperties()
        {
            const string filePath        = @"C:\";
            const string newContent      = "new content text";
            var          replacerSuccess = new ReplacerSuccess(filePath, newContent);

            var actualFilePath   = replacerSuccess.FilePath;
            var actualNewContent = replacerSuccess.NewContent;

            Assert.That(actualFilePath, Is.EqualTo(filePath));
            Assert.That(actualNewContent, Is.EqualTo(newContent));
        }