main
 1using System;
 2using System.Windows.Forms;
 3using developwithpassion.bdd.contexts;
 4using Gorilla.Commons.Testing;
 5
 6namespace MoMoney.Presentation.Winforms.Helpers
 7{
 8    public class BindableTextBoxExtensionsSpecs
 9    {
10        [Concern(typeof (BindableTextBoxExtensions))]
11        public class when_binding_a_text_control_to_a_command : concerns
12        {
13            it should_run_each_command_when_the_text_changes_in_the_text_control = () => command.was_told_to(x => x.run(result));
14
15            context c = () =>
16            {
17                textbox = new TextBox();
18                command = an<ITextBoxCommand<string>>();
19            };
20
21            because b = () =>
22            {
23                result = new TextControl<string>(textbox).apply(command);
24                textbox.control_is(x => x.OnLeave(new EventArgs()));
25            };
26
27            static TextBox textbox;
28            static ITextBoxCommand<string> command;
29            static IBindableTextBox<string> result;
30        }
31    }
32}