Mini ASP.net code executer/testing app thing/widget?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • darrel

    Mini ASP.net code executer/testing app thing/widget?

    I often want to test a simple snippet of ASP.net code. Something usually
    less than a full function such as a quick if/then loop or math function.

    To do that, I usually create a new page, put my code on there, do some
    response.writes , then compile and run. But this is tedius and I'm sure
    there's a better way.

    Is there a way in VS.net, or perhaps some 3rd party tool to, say, type in
    this:

    x=3
    if x=3 then
    y=5
    end if

    and, for example, see what the value of y is at the end?

    -Darrel

    --


  • bruce barker

    #2
    Re: Mini ASP.net code executer/testing app thing/widget?

    you could switch to a langauge that supports this: ironruby, ironpython,
    javascript.net, or f#, or switch to TDD (test driven design).

    to do tdd, you create a unit test to test your code (small snippets).
    for visual studio use nunit or if you have team suite, then its built
    in. after installing one these tools, a test project is added to your
    solution. then you write click to create a test. its just a simple
    harness to run your test snippets (ideally the actual code).


    -- bruce (sqlwork.com)


    darrel wrote:
    I often want to test a simple snippet of ASP.net code. Something usually
    less than a full function such as a quick if/then loop or math function.
    >
    To do that, I usually create a new page, put my code on there, do some
    response.writes , then compile and run. But this is tedius and I'm sure
    there's a better way.
    >
    Is there a way in VS.net, or perhaps some 3rd party tool to, say, type in
    this:
    >
    x=3
    if x=3 then
    y=5
    end if
    >
    and, for example, see what the value of y is at the end?
    >
    -Darrel
    >
    --
    >
    >

    Comment

    • darrel

      #3
      Re: Mini ASP.net code executer/testing app thing/widget?

      you could switch to a langauge that supports this: ironruby, ironpython,
      javascript.net, or f#, or switch to TDD (test driven design).
      Well, given we're a vb.net shop, I kind of have to stick with vb. net ;o)

      IronRuby...that 'd definitely interesting, but I struggle to see the appeal
      in those. Why not just switch to RoR? I suppose it's useful to existing Ruby
      developers, I guess.

      f#? Hadn't heard of that one. Learned something new!
      to do tdd, you create a unit test to test your code (small snippets). for
      visual studio use nunit or if you have team suite, then its built in.
      after installing one these tools, a test project is added to your
      solution. then you write click to create a test. its just a simple harness
      to run your test snippets (ideally the actual code).
      Yes...that sounds exactly like what we'd like. Nunit looks ineresting.

      It'd be nice to have a built-in 'run this chunk of code' in VS.net, but
      nunit might be the next best thing. Thanks for the info!

      -Darrel


      Comment

      • sloan

        #4
        Re: Mini ASP.net code executer/testing app thing/widget?


        You need to verse yourself with UnitTesting.... NUnit is the one I go
        with....

        If you're using VS2008, then you can ECONOMICALLY use the built in one with
        Microsoft as well.
        (VS2005 has it as well, but requires versions more pricier than VS2005 Pro).

        ...

        I would recommend this book:


        Here is the resource itself:
        NUnit is the most popular unit test framework for .NET.


        I know you're a vb.net shop, I'd still recommend that book.
        The concepts are more important than the vb.net vs csharp syntax.

        ..........

        You'll also need to push you business logic down into a business logic
        layer.
        One place to look:
        http://sholliday.space s.live.com/Blog/cns!A68482B9628 A842A!139.entry

        NUnit can help you, but you have to learn it, and then actually take the
        time to write them.




        "darrel" <notreal@nowher e.comwrote in message
        news:%23fW06R7r IHA.3968@TK2MSF TNGP03.phx.gbl. ..
        >I often want to test a simple snippet of ASP.net code. Something usually
        >less than a full function such as a quick if/then loop or math function.
        >
        To do that, I usually create a new page, put my code on there, do some
        response.writes , then compile and run. But this is tedius and I'm sure
        there's a better way.
        >
        Is there a way in VS.net, or perhaps some 3rd party tool to, say, type in
        this:
        >
        x=3
        if x=3 then
        y=5
        end if
        >
        and, for example, see what the value of y is at the end?
        >
        -Darrel
        >
        --
        >

        Comment

        Working...