BindaTests.Tests.BindingFormToObjectTests.When_binding_a_form_to_an_object_with_custom_control_registrations C# (CSharp) Метод

When_binding_a_form_to_an_object_with_custom_control_registrations() приватный Метод

private When_binding_a_form_to_an_object_with_custom_control_registrations ( ) : void
Результат void
        public void When_binding_a_form_to_an_object_with_custom_control_registrations()
        {
            var binder = new Binder();
            var form = NeededObjectsFactory.CreateForm();
            var strategy = new TestBindaStrategy();

            binder.AddRegistration(strategy, form.Title);
            strategy.GetValue = "Good Title";

            binder.AddRegistration(typeof (TextBox), "Text");
            form.Title.Text = "Bad Title";

            var post = new Post();
            binder.Bind(form, post);

            Assert.That(post.Title, Is.EqualTo(strategy.GetValue));
        }