예제 #1
0
        public void Simple_text_gen_converts_to_PascalCase()
        {
            var    gen    = new TextGeneratorService();
            string result = gen.Process("Some other class\r\n Ba da bing");

            Assert.That(result, Is.EqualTo(@"public class SomeOtherClass
{
public virtual string BaDaBing { get; set; }
}
"));
        }
예제 #2
0
        public void if_a_property_ends_with_Id_its_an_int()
        {
            var    gen    = new TextGeneratorService();
            string result = gen.Process("Some other class\r\n My Id");

            Assert.That(result, Is.EqualTo(@"public class SomeOtherClass
{
public virtual int MyId { get; set; }
}
"));
        }
예제 #3
0
        public void Simple_text_gen()
        {
            var    gen    = new TextGeneratorService();
            string result = gen.Process("ClassName\r\n Foo\r\n Bar");

            Assert.That(result, Is.EqualTo(@"public class ClassName
{
public virtual string Foo { get; set; }
public virtual string Bar { get; set; }
}
"));
        }
예제 #4
0
        public override void Execute()
        {
            var editor = ActiveFormAsEditor;

            if (editor != null)
            {
                var text = editor.SelectedText;
                if (string.IsNullOrEmpty(text))
                {
                    text = editor.AllText;
                }

                var textGeneratorService = new TextGeneratorService();
                var generatedText        = textGeneratorService.Process(text);

                // update editor, just put in the code for now...
                editor.InsertText(generatedText);
            }
        }
        public override void Execute()
        {
            var editor = ActiveFormAsEditor;

            if (editor != null)
            {
                var text = editor.SelectedText;
                if (string.IsNullOrEmpty(text))
                {
                    text = editor.AllText;
                }

                var textGeneratorService = new TextGeneratorService();
                var generatedText = textGeneratorService.Process(text);

                // update editor, just put in the code for now...
                editor.InsertText(generatedText);
            }
        }