Example #1
0
        /// <summary>
        /// 変換ボタンのイベント
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnConversion_Click(object sender, EventArgs e)
        {
            MessageListConversion logic = new MessageListConversion();

            string result = string.Empty;

            if (rdbUpperSnake.Checked)
            {
                result = logic.Conversion(txtDataSource.Text, ConversionMode.SNAKE);
            }

            if (rdbToTitleCase.Checked)
            {
                result = logic.Conversion(txtDataSource.Text, ConversionMode.TITLE_CAMEL);
            }

            if (rdbPascal.Checked)
            {
                result = logic.Conversion(txtDataSource.Text, ConversionMode.PASCAL_CASE);
            }

            if (rdbNotChange.Checked)
            {
                result = logic.Conversion(txtDataSource.Text, ConversionMode.NO_CHANGE);
            }

            // 変換結果をクリップボードにコピーする。
            Clipboard.SetText(result, TextDataFormat.Text);

            MessageBox.Show("クリップボードにコピーしました");
        }
Example #2
0
        public void TestMethod8()
        {
            var logic = new MessageListConversion();

            string str = "Error Message	エラー\rINFORMATION TEST	情報";

            string result = logic.Conversion(str, ConversionMode.TITLE_CAMEL);

            Assert.AreEqual("public static readonly string Errormessage = \"エラー\";\rpublic static readonly string Informationtest = \"情報\";\r", result);
        }
Example #3
0
        public void TestMethod6()
        {
            var logic = new MessageListConversion();

            string str = "Error Message	エラー\rINFORMATION	情報";

            string result = logic.Conversion(str, ConversionMode.PASCAL_CASE);

            Assert.AreEqual("public static readonly string ErrorMessage = \"エラー\";\rpublic static readonly string Information = \"情報\";\r", result);
        }
Example #4
0
        public void TestMethod5()
        {
            var logic = new MessageListConversion();

            string str = "Error Message	エラー\r\nINFORMATION	情報";

            string result = logic.Conversion(str, ConversionMode.SNAKE);

            Assert.AreEqual("public static readonly string ERROR_MESSAGE = \"エラー\";\rpublic static readonly string INFORMATION = \"情報\";\r", result);
        }
Example #5
0
        public void TestMethod2()
        {
            var logic = new MessageListConversion();

            string str = "Error	エラー\rINFORMATION	情報";

            string result = logic.Conversion(str, ConversionMode.SNAKE);

            Assert.AreNotEqual("", result);
        }
Example #6
0
        public void TestMethod1()
        {
            var logic = new MessageListConversion();

            string str = "";

            ConversionMode mode = ConversionMode.SNAKE;

            string result = logic.Conversion(str, mode);

            Assert.AreEqual("", result);
        }