Hi guys
I am looking at doing some automated unit testing and I was wondering if you know of any way that one can "Parse"/"Compile" a stored proc(s) from code (i.e. from within .net).
The case I am trying to catch is if someone makes a change to a table (i.e. removes a column) and that breaks a stored proc somewhere that they don't kn...
I'm currently looking for ways to improve the productivity of our team. I've read in a number of places that unit testing can be used to improve productivity. I can imagine writing unit tests now can be helpful in the future, but does it help in the short term too? Because I don't understand how writing more code (=more potential bugs) c...
Similar to htmlunit, but for use with C#. I've seen that you can use htmlunit with .NET via IKVM, but I'd like a native solution if at all possible.
The aim is to add UI tests to our existing (xUnit.net) tests being run on the CI server. I'd like to be able to run UI tests in memory (since I don't want to be opening browser instances on...
I was wondering if really great programmers (Knuth, Kernighan, Torvalds, etc) are advocates of extensive unit testing. I can imagine large projects they've worked on adding them to deal with collaboration scaling issues, but did, say, Knuth use unit tests in TeX? And this doesn't weigh on my decision to use them, it's just a matter of cu...
Toy example code:
public abstract class testBase
{
public testBase()
{
//Some common test setup code, which will initialize ManagerClass
}
}
public class someTests: testBase
{
public someTests()
{
//someTests-specific constructor code.
}
[Theory]
[PropertyData("MyTestData")]
public void test1(Foo foo)
{
...
Hi,
I've searched but can't quite find what I'm looking for and the manual isn't much help in this respect. I'm fairly new to unit testing, so not sure if I'm on the right track at all. Anyway, onto the question. I have a class:
<?php
class testClass {
public function doSomething($array_of_stuff) {
return Anothe...
I have a project group with the main project and a test project.
When writing unit tests for a class in the main project, do you include the source file in the test project, or do you put the path to it in the search path?
Why do you do one over the other?
Are there any best practices on this?
UPDATE:
It looks like including is the p...
I have used the RhinoMocks product for quite some time and have been quite happy with the product - never had a reason to look elsewhere really. I was recently asked by the good folks at TypeMock to give their product a whirl and was wondering what other developers opinions are about Typemock Isolator. Are there any other isolation/moc...
How can I test that my controller action is putting the correct errors in the ModelState when validating an entity, when I'm using DataAnnotation validation in MVC 2 Preview 1?
Some code to illustrate. First, the action:
[HttpPost]
public ActionResult Index(BlogPost b)
{
if(ModelState.IsValid)
{
...
Hi all,
I'm writing a unit test for file uploading feature of my web application. I mocked a test file, and save it in the "Test files" subdirectory of the directory that my test project resident in.
As I don't want to hard coded the file path. How can I know the directory of my project by code? I used @"..\Test files\test1.xml", but i...
I'm working on a web project in Django, and I'm using the python unittest framework. For every app I have some fixtures. This means, that every app has some identical tables in fixtures. I would like to share fixtures between apps and testcases, because otherwise if I change a model, I will have to change all json fixtures where this con...
I am writing unit tests for a PHP class that maintains users in a database. I now want to test if creating a user works, but also if deleting a user works. I see multiple possibilities to do that:
I only write one method that creates a user and deletes it afterwards
I write two methods. The first one creates the user, saves it's ID. Th...
Hello,
I am writing a winforms application and eventually I would like to write unit test for this application from the DAL, and Biz Objects layers etc.
Does someone know of a FREE tool that can recieve the path to an assembly and then output unit test stubs with matching signatures for the assembly.
Any configurable options like "pub...
In my experience anything that can be achieved using mock objects, could be achieved using stubs. Are there any scenarios, where stubs cannot be used and mock objects serves well.
...
Our team has just started unittesting and mocking, and we have run into some discussion considering extension methods. The question is what is a good approach to testing classes, that make use of extension methods. I.e. we have an Enum like this..
public enum State
{
[LangID(2817)]
Draft = 0,
[LangID(2832)]
Booked = 1,
...
A new project we began introduced a lot of new technologies we weren't so familiar with, and an architecture that we don't have a lot of practice in. In other words, the interfaces and interactions between service classes etc of what we're building are fairly volatile, even more so due to internal and customer feedback. Though I've alway...
Is it possible to use selenium to test whether a jQuery data() is set on an element?
In my app, the user enters information about several orders. Each order gets appended to an overview table so they can see their progress as they're going. In addition to the visible order information, we store some additional information that we need...
I want to test the JavaScript code in our web app. We are using the jQuery library and .Net MVC. I've looked at these answers, and jqUnit looked nice, so I tried it, just to realize that I'll have to pretty much recreate all markup for every page I want to test.
Am I missing something? Are there any alternative approaches for testing J...
I have a unit test project inside my solution. I keep adding new unit tests and modifying old ones. Some days ago, a message box keeps appearing when running my unit test project. The message box say:
DisconnectedContext was detected
Message: Context 0x2aae50' is disconnected. Releasing the interfaces from the current context
(cont...
How can I use an external data file in my Visual Studio unit tests? If I try to just include it in the test project and set Copy To Output Directory to true, it still can't be found.
What I have is:
[TestMethod]
public void DoMyTest() {
using (StreamReader rdr = new StreamReader("MyTestData.txt")) {
blahblah
}
}
Howev...