예제 #1
0
 public void AttachmentPageSettings_NotExistingAttachmentFileInNetworkPathIsPdf()
 {
     _profile.AttachmentPage.Enabled = true;
     _profile.AttachmentPage.File    = @"\\notexistingnetworkpath_3920ß392932013912\does_not_exist_3912839021830.pdf";
     _result = ProfileChecker.ProfileCheck(_profile);
     Assert.IsTrue(_result, "Unexpected errorcodes:" + Environment.NewLine + _result);
 }
예제 #2
0
 public void ScriptSettings_NotExistingSkriptFileInNetworkPath()
 {
     _profile.Scripting.Enabled    = true;
     _profile.Scripting.ScriptFile = @"\\notexistingnetworkpath_3920ß392932013912\does_not_exist_3912839021830.exe";
     _result = ProfileChecker.ProfileCheck(_profile);
     Assert.IsTrue(_result, "Unexpected errorcodes:" + Environment.NewLine + _result);
 }
예제 #3
0
        public void SmtpSettings_AutoSave_MultipleErrors()
        {
            _profile.EmailSmtp.Enabled      = true;
            _profile.EmailSmtp.Ssl          = false;
            _profile.EmailSmtp.Subject      = "";
            _profile.EmailSmtp.Content      = "";
            _profile.EmailSmtp.AddSignature = false;

            _profile.EmailSmtp.Address    = "";
            _profile.EmailSmtp.UserName   = "";
            _profile.EmailSmtp.Server     = "";
            _profile.EmailSmtp.Port       = -1;
            _profile.EmailSmtp.Recipients = "";
            SetValidAutoSaveSettings();
            _profile.EmailSmtp.Password = "";
            _result = ProfileChecker.ProfileCheck(_profile);
            Assert.Contains(15100, _result, "ProfileCheck did not detect missing SMTP adress.");
            _result.Remove(15100);
            Assert.Contains(15104, _result, "ProfileCheck did not detect missing SMTP username.");
            _result.Remove(15104);
            Assert.Contains(15102, _result, "ProfileCheck did not detect missing SMTP host.");
            _result.Remove(15102);
            Assert.Contains(15103, _result, "ProfileCheck did not detect invalid SMTP port.");
            _result.Remove(15103);
            Assert.Contains(15101, _result, "ProfileCheck did not detect missing SMTP recipients.");
            _result.Remove(15101);
            Assert.Contains(15110, _result, "ProfileCheck did not detect missing SMTP password for autosaving.");
            _result.Remove(15110);
            Assert.IsTrue(_result, "Unexpected errorcodes:" + Environment.NewLine + _result);
        }
예제 #4
0
 public void StampingSettings_valid()
 {
     _profile.Stamping.Enabled   = true;
     _profile.Stamping.StampText = "Stamp Text";
     _profile.Stamping.FontName  = "Arial";
     _result = ProfileChecker.ProfileCheck(_profile);
     Assert.IsTrue(_result, "Unexpected errorcodes:" + Environment.NewLine + _result);
 }
예제 #5
0
 public void EmptyFolderForSaveDialog_EnabledAutosave_IsValid()
 {
     _profile.SaveDialog.SetDirectory = true;
     _profile.SaveDialog.Folder       = "";
     _profile.AutoSave.Enabled        = true;
     _result = ProfileChecker.ProfileCheck(_profile);
     Assert.IsFalse(_result.Contains(28100), "ProfileCheck should ignore empty folder for save dialog if Autosave is enabled.");
 }
예제 #6
0
        public void BackgroundPageSettings_valid_forCamelCasePdfExtension()
        {
            _profile.BackgroundPage.Enabled = true;
            var testFile = TempFileHelper.CreateTempFile("ProfileCheckerTest", "testfile.Pdf");

            _profile.BackgroundPage.File = testFile;
            _result = ProfileChecker.ProfileCheck(_profile);
            Assert.IsTrue(_result, "Unexpected errorcodes:" + Environment.NewLine + _result);
        }
예제 #7
0
 public void BackgroundPageSettings_NotExistingBackgroundFile()
 {
     _profile.BackgroundPage.Enabled = true;
     _profile.BackgroundPage.File    = "does_not_exist_3912839021830.pdf";
     _result = ProfileChecker.ProfileCheck(_profile);
     Assert.Contains(17101, _result, "Profile check did not detect, that the Background file does not exist.");
     _result.Remove(17101);
     Assert.IsTrue(_result, "Unexpected errorcodes:" + Environment.NewLine + _result);
 }
예제 #8
0
 public void AttachmentPageSettings_NotExistingAttachmentFileInNetworkPathIsNoPdf()
 {
     _profile.AttachmentPage.Enabled = true;
     _profile.AttachmentPage.File    = @"\\notexistingnetworkpath_3920ß392932013912\does_not_exist_3912839021830.nopdf";
     _result = ProfileChecker.ProfileCheck(_profile);
     Assert.Contains(23102, _result, "Profile check did not detect, that the attachment file is no PDF.");
     _result.Remove(23102);
     Assert.IsTrue(_result, "Unexpected errorcodes:" + Environment.NewLine + _result);
 }
예제 #9
0
 public void AttachmentPageSettings_NoAttachmentFile()
 {
     _profile.AttachmentPage.Enabled = true;
     _profile.AttachmentPage.File    = "";
     _result = ProfileChecker.ProfileCheck(_profile);
     Assert.Contains(23100, _result, "Profile check did not detect missing attachment file.");
     _result.Remove(23100);
     Assert.IsTrue(_result, "Unexpected errorcodes:" + Environment.NewLine + _result);
 }
예제 #10
0
        public void AttachmentPageSettings_valid_forCamelCasePdfExtension()
        {
            _profile.AttachmentPage.Enabled = true;
            var testFile = TempFileHelper.CreateTempFile("ProfileCheckerTest", "testfile.Pdf");

            _profile.AttachmentPage.File = testFile;
            _result = ProfileChecker.ProfileCheck(_profile);
            Assert.IsTrue(_result, "Valid profile for AttachmentPage contains errors:" + Environment.NewLine + _result);
        }
예제 #11
0
        public void CoverPageSettings_valid()
        {
            _profile.CoverPage.Enabled = true;
            var testFile = TempFileHelper.CreateTempFile("ProfileCheckerTest", "testfile.pdf");

            _profile.CoverPage.File = testFile;
            _result = ProfileChecker.ProfileCheck(_profile);
            Assert.IsTrue(_result, "Valid profile for CoverPage contains errors:" + Environment.NewLine + _result);
        }
예제 #12
0
 public void EmptyFolderForSaveDialog()
 {
     _profile.SaveDialog.SetDirectory = true;
     _profile.SaveDialog.Folder       = "";
     _result = ProfileChecker.ProfileCheck(_profile);
     Assert.Contains(28100, _result, "ProfileCheck did not detect empty folder for save dialog.");
     _result.Remove(28100);
     Assert.IsTrue(_result, "Unexpected errorcodes:" + Environment.NewLine + _result);
 }
예제 #13
0
 public void ScriptSettings_NotExistingScriptFile()
 {
     _profile.Scripting.Enabled    = true;
     _profile.Scripting.ScriptFile = "Doesnotexist.exe";
     _result = ProfileChecker.ProfileCheck(_profile);
     Assert.Contains(14101, _result, "ProfileCheck did not detect, that the script file does not exist.");
     _result.Remove(14101);
     Assert.IsTrue(_result, "Unexpected errorcodes:" + Environment.NewLine + _result);
 }
예제 #14
0
 public void BackgroundPageSettings_NoBackgroundFile()
 {
     _profile.BackgroundPage.Enabled = true;
     _profile.BackgroundPage.File    = "";
     _result = ProfileChecker.ProfileCheck(_profile);
     Assert.Contains(17100, _result, "Profile check did not detect missing Background file.");
     _result.Remove(17100);
     Assert.IsTrue(_result, "Unexpected errorcodes:" + Environment.NewLine + _result);
 }
예제 #15
0
        public void ScriptSettings_valid()
        {
            _profile.Scripting.Enabled = true;
            var testFile = TempFileHelper.CreateTempFile("ProfileCheckerTest", "ScriptfielDummy.exe");

            _profile.Scripting.ScriptFile = testFile;
            _result = ProfileChecker.ProfileCheck(_profile);
            Assert.IsTrue(_result, "Unexpected errorcodes:" + Environment.NewLine + _result);
        }
예제 #16
0
 public void ScriptSettings_NoScriptFile()
 {
     _profile.Scripting.Enabled    = true;
     _profile.Scripting.ScriptFile = "";
     _result = ProfileChecker.ProfileCheck(_profile);
     Assert.Contains(14100, _result, "ProfileCheck did not detect missing script file.");
     _result.Remove(14100);
     Assert.IsTrue(_result, "Unexpected errorcodes:" + Environment.NewLine + _result);
 }
예제 #17
0
 public void DefaultProfile_Autosave_NoDirectory()
 {
     _profile.AutoSave.Enabled         = true;
     _profile.AutoSave.TargetDirectory = "";
     _result = ProfileChecker.ProfileCheck(_profile);
     Assert.Contains(21100, _result, "ProfileCheck did not detect missing directory for autosave.");
     _result.Remove(21100);
     Assert.IsTrue(_result, "Unexpected errorcodes:" + Environment.NewLine + _result);
 }
예제 #18
0
        public void ScriptSettings_ScriptFile_Result_must_be_valid()
        {
            _profile.Scripting.Enabled = true;
            var testFile = TempFileHelper.CreateTempFile("ProfileCheckerTest", "ScriptfielDummy.exe");

            _profile.Scripting.ScriptFile = testFile;
            _result = ProfileChecker.ProfileCheck(_profile);
            Assert.IsTrue(_result, "Valid profile for Scripting (without Autosave) contains errors:" + Environment.NewLine + _result);
        }
예제 #19
0
 public void StampingSettings_NoFontname()
 {
     _profile.Stamping.Enabled   = true;
     _profile.Stamping.StampText = "Stamp Text";
     _profile.Stamping.FontName  = "";
     _result = ProfileChecker.ProfileCheck(_profile);
     Assert.Contains(24101, _result, "Profile check did not detect missing font name.");
     _result.Remove(24101);
     Assert.IsTrue(_result, "Unexpected errorcodes:" + Environment.NewLine + _result);
 }
예제 #20
0
 public void DefaultProfile_Autosave_NoFilename()
 {
     _profile.AutoSave.Enabled = true;
     SetValidAutoSaveSettings();
     _profile.FileNameTemplate = "";
     _result = ProfileChecker.ProfileCheck(_profile);
     Assert.Contains(21101, _result, "ProfileCheck did not detect missing filename template for autosave.");
     _result.Remove(21101);
     Assert.IsTrue(_result, "Unexpected errorcodes:" + Environment.NewLine + _result);
 }
예제 #21
0
 public void SecuritySettings_Autosave_UserPwEnabled_valid()
 {
     _profile.PdfSettings.Security.Enabled = true;
     SetValidAutoSaveSettings();
     _profile.PdfSettings.Security.OwnerPassword       = "******";
     _profile.PdfSettings.Security.RequireUserPassword = true;
     _profile.PdfSettings.Security.UserPassword        = "******";
     _result = ProfileChecker.ProfileCheck(_profile);
     Assert.IsTrue(_result, "Unexpected errorcodes:" + Environment.NewLine + _result);
 }
예제 #22
0
 public void FTPSettings_Autosave_valid()
 {
     _profile.Ftp.Enabled   = true;
     _profile.Ftp.Directory = "random ftp directory";
     _profile.Ftp.Server    = "random ftp server";
     _profile.Ftp.UserName  = "******";
     SetValidAutoSaveSettings();
     _profile.Ftp.Password = "******";
     _result = ProfileChecker.ProfileCheck(_profile);
     Assert.IsTrue(_result, "Unexpected errorcodes:" + Environment.NewLine + _result);
 }
예제 #23
0
        public void BackgroundPageSettings_ExistingBackgroundFileButNoPDF()
        {
            _profile.BackgroundPage.Enabled = true;
            var testFile = TempFileHelper.CreateTempFile("ProfileCheckerTest", "testfile.noPdf");

            _profile.BackgroundPage.File = testFile;
            _result = ProfileChecker.ProfileCheck(_profile);
            Assert.Contains(17102, _result, "Profile check did not detect, that the Background file is no PDF.");
            _result.Remove(17102);
            Assert.IsTrue(_result, "Unexpected errorcodes:" + Environment.NewLine + _result);
        }
예제 #24
0
 public void SecuritySettings_Autosave_UserPwEnabled_NoUserPw()
 {
     _profile.PdfSettings.Security.Enabled = true;
     SetValidAutoSaveSettings();
     _profile.PdfSettings.Security.OwnerPassword       = "******";
     _profile.PdfSettings.Security.RequireUserPassword = true;
     _profile.PdfSettings.Security.UserPassword        = "";
     _result = ProfileChecker.ProfileCheck(_profile);
     Assert.Contains(25101, _result, "ProfileCheck did not detect, missing user password for autosave.");
     _result.Remove(25101);
     Assert.IsTrue(_result, "Unexpected errorcodes:" + Environment.NewLine + _result);
 }
예제 #25
0
 public void SigningSettings_NoAutoSave_NotExistingCertificateFileInNetworkPath()
 {
     _profile.PdfSettings.Signature.Enabled         = true;
     _profile.PdfSettings.Signature.CertificateFile = @"\\notexistingnetworkpath_3920ß392932013912\does_not_exist_3912839021830.psx";
     _profile.AutoSave.Enabled = false;
     _profile.PdfSettings.Signature.SignaturePassword   = "";
     _profile.PdfSettings.Signature.TimeServerIsSecured = false;
     _profile.PdfSettings.Signature.TimeServerLoginName = "";
     _profile.PdfSettings.Signature.TimeServerPassword  = "";
     _result = ProfileChecker.ProfileCheck(_profile);
     Assert.IsTrue(_result, "Unexpected errorcodes:" + Environment.NewLine + _result);
 }
예제 #26
0
 public void FTPSettings_Autosave_NoPassword()
 {
     _profile.Ftp.Enabled   = true;
     _profile.Ftp.Directory = "random ftp directory";
     _profile.Ftp.Server    = "random ftp server";
     _profile.Ftp.UserName  = "******";
     SetValidAutoSaveSettings();
     _profile.Ftp.Password = "";
     _result = ProfileChecker.ProfileCheck(_profile);
     Assert.Contains(18109, _result, "ProfileCheck did not detect missing FTP password for autosave.");
     _result.Remove(18109);
     Assert.IsTrue(_result, "Unexpected errorcodes:" + Environment.NewLine + _result);
 }
예제 #27
0
        public void SetUp()
        {
            this.mockEntityReader = new Mock <IReadAll <Profile> >();
            this.systemUnderTests = new ProfileChecker(mockEntityReader.Object);

            existingProfiles =
                new EnumerableQuery <Profile>(new List <Profile>()
            {
                new Profile()
                {
                    Id = 1, Name = "aaaaaa", Password = "******"
                }
            });
        }
예제 #28
0
 public void SigningSettings_NoAutoSave_NoCertFile()
 {
     _profile.PdfSettings.Signature.Enabled         = true;
     _profile.PdfSettings.Signature.CertificateFile = "";
     _profile.AutoSave.Enabled = false;
     _profile.PdfSettings.Signature.SignaturePassword   = "";
     _profile.PdfSettings.Signature.TimeServerIsSecured = false;
     _profile.PdfSettings.Signature.TimeServerLoginName = "";
     _profile.PdfSettings.Signature.TimeServerPassword  = "";
     _result = ProfileChecker.ProfileCheck(_profile);
     Assert.Contains(12100, _result, "ProfileCheck did not detect missing certification file.");
     _result.Remove(12100);
     Assert.IsTrue(_result, "Unexpected errorcodes:" + Environment.NewLine + _result);
 }
예제 #29
0
 public void SigningSettings_NoAutoSave_NotExistingCertFile()
 {
     _profile.PdfSettings.Signature.Enabled         = true;
     _profile.PdfSettings.Signature.CertificateFile = "does_not_exist_3912839021830.psx";
     _profile.AutoSave.Enabled = false;
     _profile.PdfSettings.Signature.SignaturePassword   = "";
     _profile.PdfSettings.Signature.TimeServerIsSecured = false;
     _profile.PdfSettings.Signature.TimeServerLoginName = "";
     _profile.PdfSettings.Signature.TimeServerPassword  = "";
     _result = ProfileChecker.ProfileCheck(_profile);
     Assert.Contains(12101, _result, "ProfileCheck did not detect, that the certification file does not exist.");
     _result.Remove(12101);
     Assert.IsTrue(_result, "Unexpected errorcodes:" + Environment.NewLine + _result);
 }
예제 #30
0
        public void SigningSettings_NoAutosave_SecuredTimeServer_valid()
        {
            _profile.PdfSettings.Signature.Enabled = true;
            var testFile = TempFileHelper.CreateTempFile("ProfileCheckerTest", "certification_file_dummy.whatever");

            _profile.PdfSettings.Signature.CertificateFile = testFile;
            _profile.AutoSave.Enabled = false;
            _profile.PdfSettings.Signature.SignaturePassword   = "";
            _profile.PdfSettings.Signature.TimeServerIsSecured = true;
            _profile.PdfSettings.Signature.TimeServerLoginName = "SecuredTimeServerLoginName";
            _profile.PdfSettings.Signature.TimeServerPassword  = "******";
            _result = ProfileChecker.ProfileCheck(_profile);
            Assert.IsTrue(_result, "Unexpected errorcodes:" + Environment.NewLine + _result);
        }