public void TestCleanup()
        {
            _sendNotifications = null;

            _updatePackageMock = null;
            _notificationReceiverMock = null;
        }
        public void TestCleanup()
        {
            _cleanupOldUnpackedFilesTest = null;

            _commandResult = null;
            _updatePackageMock = null;
            _directoryMock = null;
            _loggerMock = null;
        }
예제 #3
0
        public void TestInitialize()
        {
            TestCleanup();

            _updatePackageAccessMock = new UpdatePackageAccessMock() { GetFilenameOnly = _fileName };

            _updatePackageMock = new UpdatePackageMock();
            _updatePackageMock.Access = _updatePackageAccessMock;

            _unzipFile = new UnzipFile(_workFolder, _updatePackageMock);
        }
예제 #4
0
        public void TestCleanup()
        {
            if (Directory.Exists(_workFolder) && Directory.EnumerateFiles(_workFolder).Any(name => !name.EndsWith(".zip")))
            {
                Directory.Delete(_workFolder, true);
            }

            _unzipFile = null;
            _updatePackageMock = null;
            _updatePackageAccessMock = null;
        }
        public void TestInitialize()
        {
            TestCleanup();

            _updatePackageAccessMock = new UpdatePackageAccessMock();

            _updatePackageMock = new UpdatePackageMock();
            _updatePackageMock.Access = _updatePackageAccessMock;

            _loggerMock = new LoggerMock();
            _singleFileMock = new SingleFileMock();
        }
        public void TestInitialize()
        {
            TestCleanup();

            _updatePackageMock = new UpdatePackageMock();
            _updatePackageMock.PackageName = "CheckUrlHttpStatusIs200Test";

            _htmlGetterMock = new Mock<IHtmlGetter>();

            _loggerMock = new LoggerMock();

            _checkUrlHttpStatusIs200 = new CheckUrlHttpStatusIs200(_url, _updatePackageMock, _htmlGetterMock.Object, _loggerMock);
        }
        public void TestInitialize()
        {
            TestCleanup();

            _updatePackageMock = new UpdatePackageMock();
            _updatePackageMock.PackageName = "CheckUrlHttpStatusIs200Test";

            _notificationReceiverMock = new NotificationReceiverMock();

            _nowGetterMock = new NowGetterMock();
            _nowGetterMock.Now = new System.DateTime(2015, 5, 15, 11, 0, 0);

            _blackboardMock = new Mock<IBlackboard>();
        }
        public void TestInitialize()
        {
            TestCleanup();

            _commandResult = new CommandResult();

            _updatePackageAccessMock = new UpdatePackageAccessMock();
            _updatePackageAccessMock.GetFilenameOnly = _getFileNameOnly; // wird sowieso nie echt drauf zugegriffen
            _updatePackageMock = new UpdatePackageMock() { Access = _updatePackageAccessMock };

            _directoryMock = new DirectoryMock();

            _loggerMock = new LoggerMock();

            _cleanupOldUnpackedFilesTest = new CleanupOldUnpackedFiles(_workFolder, _updatePackageMock, _directoryMock, _loggerMock);
        }
        public void TestInitialize()
        {
            TestCleanup();

            _commandResult = new CommandResult();

            _updatePackageAccessMock = new UpdatePackageAccessMock();
            _updatePackageAccessMock.GetFilenameOnly = "RunInstallerCommandTest.zip";

            _updatePackageMock = new UpdatePackageMock();
            _updatePackageMock.PackageName = "RunInstallerCommandTest";
            _updatePackageMock.Access = _updatePackageAccessMock;

            _loggerMock = new LoggerMock();

            _runExternalCommandMock = new RunExternalCommandMock();

            TryDeleteFile();

            Directory.CreateDirectory(_updatePackageMock.PackageName);
            File.Copy(_installerCommand, Path.Combine(_updatePackageMock.PackageName, _installerCommand));

            _runInstallerCommand = new RunInstallerCommand(_installerCommand, _installerCommandArguments, _workFolder, _updatePackageMock, _runExternalCommandMock, _loggerMock);
        }
        public void AutoUpdaterCommandCreatorTest_OneCheck_CheckNecessary_CommandPackageAlreadyExists()
        {
            var mockPackage = new UpdatePackageMock()
            {
                PackageName = "UpdatePackageMock"
            };

            _commandBuilderMock.GetCommands.Add(new CommandMock()
            {
                PackageNameResult = mockPackage.PackageName
            });

            _checkTimerMock.IsCheckForUpdatesNecessary = true;
            _autoUpdaterCommandCreator.CheckIfUpdateIsNecessaryAndEnqueueCommands(_settings, new[] { mockPackage }, new INotificationReceiver[0]);
            Assert.AreEqual(1, _checkTimerMock.IsCheckForUpdatesNecessaryCalled);
            Assert.AreEqual(1, _commandBuilderMock.GetCommandsCalled);
            Assert.AreEqual(1, CommandsProducerConsumer.Queue.Count);

            //  Beim zweiten Mal darf das Command nicht nochmal eingereiht werden
            _autoUpdaterCommandCreator.CheckIfUpdateIsNecessaryAndEnqueueCommands(_settings, new[] { mockPackage }, new INotificationReceiver[0]);
            Assert.AreEqual(2, _checkTimerMock.IsCheckForUpdatesNecessaryCalled);
            Assert.AreEqual(2, _commandBuilderMock.GetCommandsCalled);
            Assert.AreEqual(1, CommandsProducerConsumer.Queue.Count);
        }
예제 #11
0
        public void TestInitialize()
        {
            TestCleanup();

            _updatePackageAccessMock = new UpdatePackageAccessMock();
            _updatePackageAccessMock.GetFilenameOnly = _fileName; // wird sowieso nie echt drauf zugegriffen
            _updatePackageMock = new UpdatePackageMock() { Access = _updatePackageAccessMock };
            _updatePackageMock.Settings = new ServerSettings()
            {
                DatabaseUpdaterCommandArguments = "ddl",
                DatabaseUpdaterCommand = "connectionString",
                CheckUrlsAfterInstallation = new[] { "fakeCheckUrl1", "fakeCheckUrl2" },
            };

            _singleFileMock = new SingleFileMock();
            _loggerMock = new LoggerMock();
            _directoryMock = new DirectoryMock();
            _runExternalCommandMock = new RunExternalCommandMock();
            _htmlGetterMock = new Mock<IHtmlGetter>();
            _nowGetterMock = new NowGetterMock();
            _blackboardMock = new Mock<IBlackboard>();

            _commandBuilder = new CommandBuilder(_singleFileMock, _directoryMock, _loggerMock, _runExternalCommandMock, _htmlGetterMock.Object, _nowGetterMock, _blackboardMock.Object);
        }
예제 #12
0
        public void TestCleanup()
        {
            _commandBuilder = null;

            _updatePackageMock = null;
            _singleFileMock = null;
            _loggerMock = null;
            _directoryMock = null;
        }
        public void TestCleanup()
        {
            _checkUrlHttpStatusIs200 = null;

            _updatePackageMock = null;
        }
예제 #14
0
 public void TestCleanup()
 {
     _updatePackageAccessMock = null;
     _singleFileMock = null;
     _updatePackageMock = null;
 }