/// <summary>
 /// Servers the operation manager password change requested.
 /// </summary>
 /// <param name="serverOperationManager">
 /// The server operation manager.
 /// </param>
 /// <param name="isRequested">
 /// if set to <c>true</c> [is requested].
 /// </param>
 /// <returns>
 /// The <see cref="bool"/>.
 /// </returns>
 public bool ServerOperationManagerPasswordChangeRequested(
     ServerOperationManager serverOperationManager,
     bool isRequested)
 {
     return(this.Delegate != null &&
            this.Delegate.ServerOperationManagerPasswordChangeRequested(serverOperationManager, isRequested));
 }
 /// <summary>
 /// Servers the operation manager did fail server login.
 /// </summary>
 /// <param name="serverOperationManager">
 /// The server operation manager.
 /// </param>
 /// <param name="error">
 /// The error.
 /// </param>
 /// <param name="passwordChanged">
 /// The password changed.
 /// </param>
 public void ServerOperationManagerDidFailServerLogin(
     ServerOperationManager serverOperationManager,
     Exception error,
     PasswordChangeResult passwordChanged)
 {
     this.IsLoggedIn = false;
     this.Delegate?.ServerOperationManagerDidFailServerLogin(serverOperationManager, error, passwordChanged);
 }
예제 #3
0
        public void Init_ServerOperation_Fail_NullParameter()
        {
            // Arrange
            InformationParser informationParser = new InformationParser();
            Logger            logger            = null;

            // Act , Assert
            ServerOperationManager operationResult = informationParser.Init_ServerOperation(logger);
        }
예제 #4
0
        /// <summary>
        /// Click evet, Save the curret loaded config file for the other events in the program.
        /// </summary>
        private void subSave_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(this.SettingsRichTextBox.Text) || string.IsNullOrWhiteSpace(this.SettingsRichTextBox.Text))
            {
                Alert.AlertCreation("Load Something!", AlertType.error);
                return;
            }
            else
            {
                string executableLocation = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
                string configLocation     = Path.Combine(executableLocation, "UI_TFS_ServerOperation.exe.config");

                TextWriter writer = new StreamWriter(configLocation);

                writer.Write(SettingsRichTextBox.Text);
                writer.Close();

                try
                {
                    ConfigurationManager.RefreshSection("PBICollectionSection");
                    ConfigurationManager.RefreshSection("Connection");
                    ConfigurationManager.RefreshSection("MailInformation");
                    ConfigurationManager.RefreshSection("system.diagnostics");

                    // Controller ReInit
                    informationParser = new InformationParser();
                    log            = informationParser.Init_Log();
                    serverOperator = informationParser.Init_ServerOperation(log);
                    mailSender     = informationParser.Init_MailSender(log);

                    // Server information setting to the Upload page
                    ServerCollectionInfoLabel.Text  = informationParser.CurrentTfsCollectionName;
                    ServerTeamProjectInfoLabel.Text = informationParser.CurrentTeamProjectName;
                    UploadActiveButton.Text         = "Active";
                    UploadActiveButton.ForeColor    = Color.SeaGreen;
                    ServerCollectionInfoLabel.Refresh();
                    ServerTeamProjectInfoLabel.Refresh();
                    UploadActiveButton.Refresh();
                    FileRichTextBox.Clear();
                    LogRichTextBox.Clear();
                }
                catch (Exception)
                {
                    log.Error("Server connection fail!");
                    log.Flush();
                    ServerCollectionInfoLabel.Text  = "Fail";
                    ServerTeamProjectInfoLabel.Text = "Fail";
                    UploadActiveButton.Text         = "Inactive";
                    UploadActiveButton.ForeColor    = Color.Red;
                    Alert.AlertCreation("Server connection fail!", AlertType.error);
                }
                Alert.AlertCreation("Save Success!", AlertType.success);
            }
        }
 /// <summary>
 /// Servers the operation manager did fail with internet connection error.
 /// </summary>
 /// <param name="serverOperationManager">
 /// The server operation manager.
 /// </param>
 /// <param name="error">
 /// The error.
 /// </param>
 /// <param name="passwordChangeResult">
 /// The password change result.
 /// </param>
 public void ServerOperationManagerDidFailWithInternetConnectionError(
     ServerOperationManager serverOperationManager,
     Exception error,
     PasswordChangeResult passwordChangeResult)
 {
     this.IsLoggedIn = false;
     this.Delegate?.ServerOperationManagerDidFailWithInternetConnectionError(
         serverOperationManager,
         error,
         passwordChangeResult);
 }
예제 #6
0
        public void Init_ServerOperation_Success_CurrentTfsCollectionNameValid()
        {
            // Arrange
            InformationParser informationParser = new InformationParser();
            Logger            logger            = new Logger("TFS_Init_ServerOperation_Success_CurrentTfsCollectionNameValid_ServerOperation.log");

            // Act
            ServerOperationManager operationResult = informationParser.Init_ServerOperation(logger);

            // Assert
            Assert.AreEqual("http://localhost:8080/tfs/SzakdolgozatCollection", informationParser.CurrentTfsCollectionName);
        }
예제 #7
0
        public void Init_ServerOperation_Success_CurrentTeamProjectNameValid()
        {
            // Arrange
            InformationParser informationParser = new InformationParser();
            Logger            logger            = new Logger("TFS_Init_ServerOperation_Success_CurrentTeamProjectNameValid_ServerOperation.log");

            // Act
            ServerOperationManager operationResult = informationParser.Init_ServerOperation(logger);

            // Assert
            Assert.AreEqual("Test_Project", informationParser.CurrentTeamProjectName);
        }
예제 #8
0
        public void Init_ServerOperation_Success()
        {
            // Arrange
            InformationParser informationParser = new InformationParser();
            Logger            logger            = new Logger("TFS_Init_ServerOperation_Success_ServerOperation.log");

            // Act
            ServerOperationManager operationResult = informationParser.Init_ServerOperation(logger);

            // Assert
            Assert.IsTrue(typeof(Object).IsInstanceOfType(operationResult));
        }
예제 #9
0
        public void DeleteFromFile_Fail_FileDoesNotExist()
        {
            // Arrange
            Logger                 log             = new Logger("Test_OperationManager1.log");
            ConnectionAdapter      conn            = new ConnectionAdapter("http://localhost:8080/tfs/SzakdolgozatCollection", "Test_Project", log);
            ServerOperationManager serverOperation = new ServerOperationManager(conn, "Test_Project", "Test_Project", log);

            // Act
            bool result = serverOperation.DeleteFromFile("Something.csv");

            // Assert
            Assert.AreEqual(false, result);
        }
예제 #10
0
        public void Upload_IntegrationTest_Success_NullParameterLog()
        {
            // Arrange
            InformationParser      informationParser = new InformationParser();
            Logger                 logger            = new Logger("Upload_IntegrationTest_SuccessUploadToTestProject1.log");
            ServerOperationManager operationManager  = informationParser.Init_ServerOperation(logger);

            // Act
            bool result = informationParser.Upload_Process(true, operationManager, null);

            // Assert
            Assert.IsTrue(result);
        }
예제 #11
0
        public void DeleteByIds_NoIds()
        {
            // Arrange
            Logger                 log             = new Logger("Test_OperationManager3.log");
            ConnectionAdapter      conn            = new ConnectionAdapter("http://localhost:8080/tfs/SzakdolgozatCollection", "Test_Project", log);
            ServerOperationManager serverOperation = new ServerOperationManager(conn, "Test_Project", "Test_Project", log);
            List <string>          datas           = new List <string>();

            // Act
            bool result = serverOperation.DeleteByIds(datas);

            // Assert
            Assert.AreEqual(true, result);
        }
예제 #12
0
        public void DeleteByIds_Process_NoIds()
        {
            // Arrange
            InformationParser      informationParser = new InformationParser();
            Logger                 logger            = new Logger("DeleteByIds_Process_IntegrationTest3.log");
            ServerOperationManager operationManager  = informationParser.Init_ServerOperation(logger);

            // Act
            List <string> datas  = new List <string>();
            bool          result = informationParser.DeleteByIds_Process(datas, operationManager, informationParser.Init_MailSender(logger));

            // Assert
            Assert.IsTrue(result);
        }
 /// <summary>
 /// Servers the operation manager requires language for session.
 /// </summary>
 /// <param name="serverOperationManager">
 /// The server operation manager.
 /// </param>
 /// <param name="availableLanguages">
 /// The available languages.
 /// </param>
 /// <param name="sessionAttributes">
 /// The session attributes.
 /// </param>
 /// <param name="serverInfo">
 /// The server information.
 /// </param>
 /// <param name="passwordChanged">
 /// The password changed.
 /// </param>
 public void ServerOperationManagerRequiresLanguageForSession(
     ServerOperationManager serverOperationManager,
     List <ServerLanguage> availableLanguages,
     Dictionary <string, object> sessionAttributes,
     List <object> serverInfo,
     PasswordChangeResult passwordChanged)
 {
     this.Delegate?.ServerOperationManagerRequiresLanguageForSession(
         serverOperationManager,
         availableLanguages,
         sessionAttributes,
         serverInfo,
         passwordChanged);
 }
        /// <summary>
        /// Servers the operation manager did perform server login.
        /// </summary>
        /// <param name="serverOperationManager">
        /// The server operation manager.
        /// </param>
        /// <param name="availableLanguages">
        /// The available languages.
        /// </param>
        /// <param name="sessionAttributes">
        /// The session attributes.
        /// </param>
        /// <param name="serverInfo">
        /// The server information.
        /// </param>
        /// <param name="passwordChanged">
        /// The password changed.
        /// </param>
        public void ServerOperationManagerDidPerformServerLogin(
            ServerOperationManager serverOperationManager,
            List <ServerLanguage> availableLanguages,
            Dictionary <string, object> sessionAttributes,
            List <object> serverInfo,
            PasswordChangeResult passwordChanged)
        {
            this.IsLoggedIn = true;

            this.Delegate?.ServerOperationManagerDidPerformServerLogin(
                serverOperationManager,
                availableLanguages,
                sessionAttributes,
                serverInfo,
                passwordChanged);
        }
예제 #15
0
        public void DeleteFromFile_Process_IntegrationTest_NoFileFail()
        {
            // Arrange
            InformationParser      informationParser = new InformationParser();
            Logger                 logger            = new Logger("DeleteFromFile_Process_IntegrationTest2.log");
            ServerOperationManager operationManager  = informationParser.Init_ServerOperation(logger);

            // Act
            string workingDirectory = Environment.CurrentDirectory;
            string projectDirectory = Directory.GetParent(workingDirectory).Parent.FullName;
            string fileName         = "";
            string path             = Path.Combine(projectDirectory, @"TestFiles\", fileName);
            bool   result           = informationParser.DeleteFromFile_Process(path, operationManager, informationParser.Init_MailSender(logger));

            // Assert
            Assert.IsFalse(result);
        }
예제 #16
0
        public void DeleteFromFile_Fail_NoFileOnTheServer()
        {
            // Arrange
            Logger                 log             = new Logger("Test_OperationManager2.log");
            ConnectionAdapter      conn            = new ConnectionAdapter("http://*****:*****@"TestFiles\", fileName);
            bool   result           = serverOperation.DeleteFromFile(path);

            // Assert
            Assert.AreEqual(true, result);
        }
예제 #17
0
        public subMenu()
        {
            InitializeComponent();
            if (Program.isInDesignMode())
            {
                return;
            }

            try
            {
                // Controller Init
                informationParser = new InformationParser();
                log            = informationParser.Init_Log();
                serverOperator = informationParser.Init_ServerOperation(log);
                mailSender     = informationParser.Init_MailSender(log);

                // Server information setting to the Upload page
                ServerCollectionInfoLabel.Text  = informationParser.CurrentTfsCollectionName;
                ServerTeamProjectInfoLabel.Text = informationParser.CurrentTeamProjectName;
            }
            catch (Exception)
            {
                ServerCollectionInfoLabel.Text  = "Fail";
                ServerTeamProjectInfoLabel.Text = "Fail";
                UploadActiveButton.Text         = "Inactive";
                UploadActiveButton.ForeColor    = Color.Red;
                Alert.AlertCreation("Configure your Settings!", AlertType.info);
            }

            //BarLabel init part
            UploadBar.LabelVisible                  = true;
            OneElemDeleteBar.LabelVisible           = true;
            MoreElemDeleteBar.LabelVisible          = true;
            FileDeleteProgressBar.LabelVisible      = true;
            AllServerDeleteProgressBar.LabelVisible = true;

            VSReactive <int> .Subscribe("menu", e => tabControl1.SelectedIndex = e);

            VSReactive <int> .Subscribe("ContentControllerPages", e => ContentControllerPages.SelectedIndex = e);
        }