I'm building a class library that will have some public & private methods. I want to be able to unit test the private methods (mostly while developing, but also it could be useful for future refactoring).
What is the best way to do this?
...
We have a large application in Ruby on Rails with many filters. Some of these filters can be complex. I am looking for a way to individually test these filters with a unit test. Right now I test them by testing them through an action that uses them with a functional test. This just doesn't feel like the right way.
Does anyone have ad...
I'm running VS2008's Code Coverage against a unit-tested DLL that I'm developing. For some of the functions it claims that 2 blocks are not covered and 50 or so are. When I view the function with the VS2008 highlighting it can't find the uncovered blocks.
The highlighting appears to work with some functions though as it correctly shows ...
I need to use JUnit 4.4 (or newer) in a set of eclipse plugin tests, but I've run into the following problem:
Tests are not detected when running with the junit 4.4 or 4.5 bundles from springsource
([junit44] and [junit45]). The org.junit4 bundle that can be obtained with eclipse supplies junit 4.3 (as of Ganymead / Eclipse 3.4). The ...
I am a rookie was using the Visual Studio 2008 built-in Unit Testing components, what would be the best way to record or display your results in a unit test?
I want to test my service method when it returns a System.GUID and an empty System.GUID
[TestMethod]
public void GetGUID()
{
MyWcfServiceService.MyWcfServiceClient proxy = new ...
A very often scenario of unit test is as follows:
public void SetUp()
{
this.callLog = new StringBuilder();
}
public void TestBuzzBar()
{
var bar = new Bar(new MockFoo(callLog));
bar.Buzz(17);
Assert.AreEqual("MockFoo.Init(17) MockFoo.PrepareStuff MockFoo.DoTheJob ", callLog.ToString());
}
... with MockFoo implementing an IFo...
We use a simple object model for our low level networking code at work where struct pointers are passed around to functions which are pretending to be methods. I've inherited most of this code which was written by consultants with passable C/C++ experience at best and I've spent many late nights trying to refactor code into something tha...
Hey all,
I've decided to integrate NUnit with VWD2008.
I did the following-
1) Installed NUnit - Ran a Sample project that was included with the installation all the tests were fine.
2) Installed TestDriven.Net 2.0 - Personal distribution.
3) I have written on an MVC Project a test and when I try to right click the context and run the ...
I've written some custom model binders (implementing IModelBinder) in our ASP.NET MVC application. I'm wondering what is a good approach to unittest them (binders)?
...
I'm trying to generate code coverage reports with EMMA using tests of which some use JMockit as a mocking framework. For the most part, it works, but a few of my tests crash with a ClassFormatError, like so:
java.lang.ClassFormatError
at sun.instrument.InstrumentationImpl.redefineClasses0(Native Method)
at sun.instrument.Instrum...
Hello,
I have the following code:
private static void WriteStartupInfo()
{
Settings settings = Settings.Default;
TimeSpan interval = settings.CleanupInterval;
TimeSpan span = settings.ExpiryTimeSpan;
string url = settings.TeamFoundationServerUrl;
StringBuilder sb = new StringBuilder();
...
I've been struggling coming up with a good solution to separate my testing data from unit
tests (hard coded values). Until it dawned on me that I could create beans with spring
and use those beans to hold my data.
Are there any draw backs to coding my unit tests this way? Albeit they run a bit slower
seeing as how spring has to c...
I'm struggling with Test::Unit. When I think of unit tests, I think of one simple test per file. But in Ruby's framework, I must instead write:
class MyTest < Test::Unit::TestCase
def setup
end
def test_1
end
def test_1
end
end
But setup and teardown run for every invocation of a test_* method. This is exa...
NOTE: I mention the next couple of paragraphs as background. If you just want a TL;DR, feel free to skip down to the numbered questions as they are only indirectly related to this info.
I'm currently writing a python script that does some stuff with POSIX dates (among other things). Unit testing these seems a little bit difficult tho...
Hello
In some my project I notice that during executing unit tests under VSTS2008 its VSTestHost's memory consuming grows. As I have very many tests in my solution it leads to OutOfMemroyException eventually.
That looks very strange for me as I was sure that MSTest creates a new AppDomain for each unit test. Otherwise how would it reset...
I have a method that, given an angle for North and an angle for a bearing, returns a compass point value from 8 possible values (North, NorthEast, East, etc.). I want to create a unit test that gives decent coverage of this method, providing different values for North and Bearing to ensure I have adequate coverage to give me confidence t...
I have been looking in to doing some test driven development for one of the applications that I'm currently writing(OLE wrapper for an OLE object). The only problem is that I am using the express versions of Visual Studio(for now), at the moment I am using VB express but sometimes I use C# express.
Is it possible to do TDD in the exp...
I have a large project for which I am attempting to use TDD.
I am using Tut as my test framework, which has its flaws but is sufficient for what I need.
I need to exploit link time test seams, each test must be in its own executable. The project for this executable then launches itself as a post build step.
Unfortunately, this means t...
G'day,
I am working with a group of offshore developers who have been using the term unit testing quite loosely.
Their QA document talks about writing unit tests and then performing unit testing of the system.
This doesn't line up with my interpretation of what unit testing is at all.
I am used to unit testing being a test or suite o...
I'm writing a discovery test against the Cocoa API as I ramp up on all things Mac related. I'm currently trying to discover the best method for URL encoding a string. Using the Google toolbox for Mac I have a unit test that I intentionally cause a failure in:
NSString* expected = @"ab%%20c";
NSString* encoded = @"ab c";
STAssertEqual...