BindaTests.Tests.CollectionBindingTests.When_binding_an_object_to_a_form_with_a_property_and_a_collection_with_a_pluralized_name_of_the_property_using_prefixes C# (CSharp) Method

When_binding_an_object_to_a_form_with_a_property_and_a_collection_with_a_pluralized_name_of_the_property_using_prefixes() private method

        public void When_binding_an_object_to_a_form_with_a_property_and_a_collection_with_a_pluralized_name_of_the_property_using_prefixes()
        {
            var binder = new Binder();
            binder.AddControlPrefix(new HungarianNotationControlPrefix());
            var form = new PostWithOptionsPrefixForm();
            var post = NeededObjectsFactory.CreatePost();
            post.PublishStates.Add(new PublishState { State = "Published" });
            post.PublishStates.Add(new PublishState { State = "Reviewed" });
            post.PublishStates.Add(new PublishState { State = "Pending Review" });
            post.PublishStates.Add(new PublishState { State = "Draft" });
            post.PublishState = post.PublishStates[2];

            binder.Bind(post, form);

            Assert.That(form.cbPublishState.DataSource, Is.SameAs(post.PublishStates));
            Assert.That(form.cbPublishState.SelectedItem, Is.SameAs(post.PublishState));
        }