Exemplo n.º 1
0
        public void InstallationPath_WithNoPdfArchitectInstalled_ReturnsNull()
        {
            var factory      = new PdfArchitectMockRegistryFactory();
            var registryMock = factory.BuildRegistry();
            var fileMock     = factory.BuildFile();

            var architectCheck = new PdfArchitectCheck(registryMock, fileMock);
            var path           = architectCheck.GetInstallationPath();

            Assert.IsNull(path);
        }
Exemplo n.º 2
0
        public void InstallationPath_WithIOException_DoesNotthrowException()
        {
            var factory = new PdfArchitectMockRegistryFactory();

            factory.AddArchitectVersion("000", "PDF Architect 3", @"C:\Program Files\PDF Architect 3", "architect.exe", isWow64: false, throwsException: true);
            var registryMock = factory.BuildRegistry(throwException: true);
            var fileMock     = factory.BuildFile();

            var architectCheck = new PdfArchitectCheck(registryMock, fileMock);

            Assert.DoesNotThrow(() => architectCheck.GetInstallationPath());
        }
Exemplo n.º 3
0
        public void Installed_WithNotPdfArchitect_ReturnsFalse()
        {
            var factory = new PdfArchitectMockRegistryFactory();

            var registryMock = factory.BuildRegistry();
            var fileMock     = factory.BuildFile();

            var architectCheck = new PdfArchitectCheck(registryMock, fileMock);
            var isInstalled    = architectCheck.IsInstalled();

            Assert.IsFalse(isInstalled);
        }
Exemplo n.º 4
0
        public void InstallationPath_WithPdfArchitect2Installed_ReturnsCorrectPath()
        {
            var factory = new PdfArchitectMockRegistryFactory();

            factory.AddArchitectVersion("000", "PDF Architect 2", @"C:\Program Files\PDF Architect 2", "PDF Architect 2.exe", false);
            var registryMock = factory.BuildRegistry();
            var fileMock     = factory.BuildFile();

            var architectCheck = new PdfArchitectCheck(registryMock, fileMock);
            var path           = architectCheck.GetInstallationPath();

            Assert.AreEqual(@"C:\Program Files\PDF Architect 2\PDF Architect 2.exe", path);
        }
Exemplo n.º 5
0
        public void InstallationPath_WithJustManagementConsoleInstalled_ReturnsNull()
        {
            var factory = new PdfArchitectMockRegistryFactory();

            factory.AddArchitectVersion("000", "PDF Architect Enterprise Server", @"C:\Program Files\PDF Architect Enterprise", "PDF Architect.exe", false);
            var registryMock = factory.BuildRegistry();
            var fileMock     = factory.BuildFile();

            var architectCheck = new PdfArchitectCheck(registryMock, fileMock);
            var path           = architectCheck.GetInstallationPath();

            Assert.IsNull(path);
        }
Exemplo n.º 6
0
        public void Installed_WithPdfArchitect3WithInvalidExeName_ReturnsFalse()
        {
            var factory = new PdfArchitectMockRegistryFactory();

            factory.AddArchitectVersion("000", "PDF Architect 3", @"C:\Program Files\PDF Architect 3", "architectXAZ.exe", false);
            var registryMock = factory.BuildRegistry();
            var fileMock     = factory.BuildFile();

            var architectCheck = new PdfArchitectCheck(registryMock, fileMock);
            var isInstalled    = architectCheck.IsInstalled();

            Assert.IsFalse(isInstalled);
        }
Exemplo n.º 7
0
        public void Installed_WithPdfArchitect3InstalledWow64_ReturnsTrue()
        {
            var factory = new PdfArchitectMockRegistryFactory();

            factory.AddArchitectVersion("000", "PDF Architect 3", @"C:\Program Files (x86)\PDF Architect 3", "PDF Architect 3.exe", true);
            var registryMock = factory.BuildRegistry();
            var fileMock     = factory.BuildFile();

            var architectCheck = new PdfArchitectCheck(registryMock, fileMock);
            var isInstalled    = architectCheck.IsInstalled();

            Assert.IsTrue(isInstalled);
        }
Exemplo n.º 8
0
        public void InstallationPath_WithPdfArchitect3WithInvalidExeName_ReturnsNull()
        {
            var factory = new PdfArchitectMockRegistryFactory();

            factory.AddArchitectVersion("000", "PDF Architect 3", @"C:\Program Files\PDF Architect 3", "architectXAZ.exe", false);
            var registryMock = factory.BuildRegistry();
            var fileMock     = factory.BuildFile();

            var architectCheck = new PdfArchitectCheck(registryMock, fileMock);
            var path           = architectCheck.GetInstallationPath();

            Assert.IsNull(path);
        }
        public void InstallationPath_WithPdfArchitect1InstalledWow64_ReturnsCorrectPath()
        {
            var factory = new PdfArchitectMockRegistryFactory();

            factory.AddArchitectVersion("000", "PDF Architect", @"C:\Program Files (x86)\PDF Architect", "PDF Architect.exe", true);
            var registryMock = factory.BuildRegistry();
            var fileMock     = factory.BuildFile();

            var architectCheck = CreateArchitectCheck(registryMock, fileMock);
            var path           = architectCheck.GetInstallationPath();

            Assert.AreEqual(@"C:\Program Files (x86)\PDF Architect\PDF Architect.exe", path);
        }