Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Damian Green 452 posts 1433 karma points
    Nov 07, 2012 @ 19:18
    Damian Green
    0

    Unit Testing the user controls

    Spent a good few hours trying to get something testable from the WebUserControlBase<T> user controls but as per usual Mr HttpRequest rears his ugly head and causes me issues - as per the norm with frickin web forms!

    I tried MOQ and got something working as far as creating a request and a page for the current handler but then hit issues with the controls not actually loading as there was no lifecycle etc...

    I know there are way to abstract out the logic into say a presenter but here i am dynamically creating user controls on the fly based on types in the database.  I am then wanting to test i have the correct types and the correct values are set on the controls and the correct interfaces implemented etc.

    I am trying to use/learn good TDD practices as I go so thats probablyhalf the battle.

    Has anyone done this successfully with uSitebuilder or usercontrols in general as ive given up on it for the time being as i was getting bogged down and not going anywhere.

     

     

     

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies