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

  • Thread starter Thread starter darrel
  • Start date Start date
D

darrel

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

--
 
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)
 
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
 
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:
http://www.amazon.com/Pragmatic-Unit-Testing-Nunit-Programmers/dp/0974514020

Here is the resource itself:
http://www.nunit.org/index.php

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.spaces.live.com/Blog/cns!A68482B9628A842A!139.entry

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