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; } } ")); }
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; } } ")); }
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; } } ")); }
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); } }