BindaTests.Tests.BindingFormToObjectTests.When_binding_a_prefix_form_to_an_object_with_aliases_and_custom_registrations C# (CSharp) Method

When_binding_a_prefix_form_to_an_object_with_aliases_and_custom_registrations() private method

        public void When_binding_a_prefix_form_to_an_object_with_aliases_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 = NeededObjectsFactory.CreatePrefixForm();
            form.fcPopularityRanking.PopularityRanking = TestVariables.PopularityRanking;
            form.txtPostLocation.Text = TestVariables.Location;
            var post = new Post();

            binder.Bind(form, post, aliases);

            Assert.That(post.Title, Is.EqualTo(TestVariables.Title));
            Assert.That(post.Author, Is.EqualTo(TestVariables.Author));
            Assert.That(post.Date, Is.EqualTo(TestVariables.Posted));
            Assert.That(post.Body, Is.EqualTo(TestVariables.Body));
            Assert.That(post.Location, Is.EqualTo(TestVariables.Location));
            Assert.That(post.PopularityRanking, Is.EqualTo(TestVariables.PopularityRanking));
        }