BindaTests.Tests.BindingObjectToFormTests.When_binding_an_oject_to_aform_using_prefixesaliases_and_custom_registrations C# (CSharp) Method

When_binding_an_oject_to_aform_using_prefixesaliases_and_custom_registrations() private method

        public void When_binding_an_oject_to_aform_using_prefixesaliases_and_custom_registrations()
        {
            var binder = new Binder();
            binder.AddControlPrefix(new HungarianNotationControlPrefix());
            binder.AddRegistration(typeof (FluxCapacitor), "PopularityRanking");
            var aliases = new List<BindaAlias> {new BindaAlias("Location", "PostLocation")};
            var form = new MySamplePrefixForm();
            var post = NeededObjectsFactory.CreatePost();
            post.PopularityRanking = TestVariables.PopularityRanking;

            binder.Bind(post, form, aliases);

            Assert.That(form.txtTitle.Text, Is.EqualTo(TestVariables.Title));
            Assert.That(form.txtAuthor.Text, Is.EqualTo(TestVariables.Author));
            Assert.That(form.dpDate.Value, Is.EqualTo(TestVariables.Posted));
            Assert.That(form.txtBody.Text, Is.EqualTo(TestVariables.Body));
            Assert.That(form.txtPostLocation.Text, Is.EqualTo(TestVariables.Location));
            Assert.That(form.fcPopularityRanking.PopularityRanking, Is.EqualTo(TestVariables.PopularityRanking));
        }