I recently need to build a Expression tree so I wrote a Test method like so...
/// <summary>
///
/// </summary>
[TestMethod()]
[DeploymentItem("WATrust.Shared.Infrastructure.dll")]
public void BuildForeignKeysContainsPredicate_shoud_build_contains_predicate()
{
RemoteEntityRefLoader_Accessor<ReferencedEntity> target = CreateRe...
I am using Rhino mocks for unit test mocking of objects. Our DAL uses codesmith to generate code from .netTiers templates, which creates these DataRepository classes that contain all the methods for CRUD type transaction to the datasource. In unit testing, I am trying to mock this data repository object which has no interface class to us...
Its been a while I have ready Mcconnell's "Code Complete". Now I read it again in Hunt & Thomas' "The Pragmatic Programmer": Use assertions! Note: Not Unit Testing assertions, I mean Debug.Assert().
Following the SO questions When should I use Debug.Assert()? and When to use assertion over exceptions in domain classes assertions are use...
I have the following schema:
create table statuslookup
{
statusid int primary key,
statusname string unique,
description string
}
create table job
{
jobid int primary key,
jobname string unique,
status_id foreign key reference statuslookup(statusid)
}
The table statuslookup will, of course, be prepopulated during the sche...
I created some POX services using the REST Starter kit.
At first, it was a little complicated to create the unit tests for the service layer, but in the end, it was well designed and I succeed in mocking the context and set expectations.
But, I'm starting in with the client side now, and I'm having some problems figuring out how to mock...
Hi guys,
I am a TDD noob and I don't know how to solve the following problem.
I have pretty large class which generates text file in a specific format, for import into the external system. I am going to refactor this class and I want to write unit tests before.
How should these tests look like? Actually the main goal - do not break th...
I would like to run my Silverlight Unit Tests from Visual Studio instead of opening a new instance of my Silverlight Test App in the browser.
Apparently it is possible (http://www.jeff.wilcox.name/2008/09/rc0-new-test-features/ - search for "Visual Studio Team Test log provider output")....but I don't understand how you enable this, doe...
I am looking into adding unit tests at work. I used MbUnit in the past, and have some sample UT's in Gallio framework. We are using VS08 which comes with its own testing suite.
What are pros and cons of using VS08 TFS UT vs Gallio? What is the general recommendation on which framework to use?
Thanks!
...
I'm putting together BDD inspired unit tests for the API part of my application. (Yeah, I know, BDD is supposed to be about the domain and talking to the suits, but I'd rather try out BDD on something less visible first)
Ordinary use. The developer uses the
API methods with ordinary parameter values.
Extreme use. The developer invokes...
Hi,
I am trying to Unit Test the application using VSTS 2008 unit Testing.
My Problem is:
I want to invoke two test case in an order.
I am using the ordered Test case feature of VSTS 2008 for this.
Problem i facing is I increment the value of one variable(X) in TestA and on the basis of that value i am chekcing something in TestB.
But wh...
In NMocks2 you can mock up the result of a method you don't know the arguments to before hand using
Stub.On(aMock)
.Method( ... )
.WithAnyArguments()
.Will(Return.Value( ... );
from NMocks2 Cheatsheet. My question is, is there a similar mechanism for Rhino mocks when you don't care about the arguments? I want to make a ...
How does one test a method that does some interactions with the local D-Bus (accessing a HAL object)?
Results of tests will differ depending on the system that the test is run on, so I don't know how to provide the method reliable input.
I'm working in Python, by the way.
...
I've taken my first baby steps into Unit Testing and, due to a better understanding of the domain, have made a change to a domain model that has broken a unit test. So this brought up the question:
When is it permissible to change previously working unit tests?
I figure I'm missing an important aspect of unit testing in having to ask t...
We have a large body of legacy code, several portions of which are scheduled for refactoring or replacement. We wish to optimise parts that currently impact on the user-experience, facilitate reuse in a new product being planned, and hopefully improve maintainability too.
We have quite good/comprehensive functional tests for an existing...
How to unit test Silverlight 3 Out-Of-Browser application?
...
I am using the provided Unit Test Engine in Visual Studio 2005 and am wondering if there is a way for me to specify the order of tests. I have numerous test classes and numerous test methods inside of each. I would like to control the order in which the test classes are executed and the order of the test methods in each.
...
I would like to create a series of automated unit tests for an MSMQ application I am writing. As I see it, the challenge is how to accommodate the event handlers from the test method. That is, I send a message from the test method and need to return a result back to that test method that the message has been received and handled. I ha...
Let's say I want to write a function that validates an email address
with a regex. I write a little test to check my function and write the
actual function. Make it pass.
However, I can come up with a bunch of different ways to test the same
function ([email protected]; [email protected]; test.test.com, etc).
Do I put all the incantations t...
I am in process of building up a small framework that does unit testing for JSPs. These JSPs have some custom tags, otherwise they are not any special.
Although there are numerous Java unit testing solutions available, I prefer not to use the method where a separate full-blown JSP container is launched, application deployed and results ...
I am looking at the Unit Tests I wrote for an email service (unsing SMTP) and I am wondering if one test inparticular is suffient. Here is a snippet of my email service:
[PluginFamily("EmailService")]
public interface IEmailService
{
Boolean SendEmail( string toAddress, string fromAddress, string bccAddress, string ccAddress, stri...