main
 1using System.Windows.Forms;
 2using developwithpassion.bdd.contexts;
 3using Gorilla.Commons.Testing;
 4
 5namespace MoMoney.Presentation.Winforms.Databinding
 6{
 7    public class CreateSpecs
 8    {
 9    }
10
11    public abstract class when_a_text_control_is_bound_to_an_item : concerns
12    {
13        context c = () =>
14                        {
15                            textbox = new TextBox();
16                            item = new TestItem {name = "k"};
17                            textbox.bind_to(item, x => x.name);
18                        };
19
20        static protected TextBox textbox;
21        static protected TestItem item;
22    }
23
24    public class when_the_value_of_a_text_control_changes : when_a_text_control_is_bound_to_an_item
25    {
26        it should_update_the_value_of_the_property_on_the_item = () => item.name.should_be_equal_to("mo");
27        because b = () => { textbox.Text = "mo"; };
28    }
29
30    public class TestItem
31    {
32        public string name { get; set; }
33    }
34}