Can anyone point me in the direction of how I could get a NUnit test to run a .sql file to Create / Setup a database.
I know about the the TestFixtureSetUp and TestFixtureTearDown attributes / methods in NUnit.
So I KNOW how to call methods before and after all or each unit tests.
I'm just unsure of how to load and execute the conten...
I saw nHibernate video during the weekend. In the tutorial, the programmer was using MBunit to test his code. One neat thing i liked about nhibernate was, if you tell nhibernate to 'showSql', it displays sql in Mbunit dialog box after the unit test. I was wondering if there is something similar for ibatis using nUnit?
...
I'm trying to write a unit test that will raise an event on a mock object which my test class is bound to.
What I'm keen to test though is that when my test class gets its eventhandler called, it should only call a method on certain values of the eventhandler's parameters.
My test seems to pass even if I comment the code that calls Pro...
If I have a rich AJAX-driven GUI in ASP.NET MVC, how would I unit test that effectively using a framework like NUnit?
...
Hi,
Does anyone know if it's possible to use MSpec with MBUnit instead of NUnit? Gallio seems to ignore all my tests when using MSpec?
...
Following is the code. create a class lib add the ref to NUnit framework 2.5.3.9345 and Moq.dll 4.0.0.0 and paste the following code. Try running it on my machine it throws
TestCase
'MoqTest.TryClassTest.IsMessageNotNull'
failed: Moq.MockException : Expected
invocation on the mock at least once,
but was never performed: v =...
I seem to have missed something - in this step through it talks through downloading nunit and changing the original MSTest reference to NUnit. Which seems fine until it talks about running the test with UnitRun from JetBrains.
I would have thought I could run nUnit to be able to run the test - but I load my project in the nUnit gui and...
When I have a unit test that requires the System.Xml or System.Xml.Linq namespaces, I get the following error when I run the test:
System.IO.FileNotFoundException : Could
not load file or assembly
'System.Xml.Linq, Version=2.0.5.0,
Culture=neutral,
PublicKeyToken=31bf3856ad364e35' or
one of its dependencies.
Things I've v...
Hello,
I have the following test method (VB.NET)
<RowTest()> _
<Row(1, 2, 3)> _
Public Sub AddMultipleNumbers(ByVal number1 As Integer, ByVal number2 As Integer, ByVal result As Integer)
Dim dvbc As VbClass = New VbClass()
Dim actual As Integer = dvbc.Add(number1, number2)
Assert.That(actual, [Is].SameAs(result))
End Sub...
I've seen mspec used with nunit on some blogs and discussions. In fact, most of the examples on the web that I've seen demonstrate mspec with some kind of nunit dependancy or integration. My team is attempting to use mspec without nunit on a new ASP.NET MVC2 project. We're not at the spec-writing stage yet, so I can't tell what is better...
Are there any books or articles that show you how to use NUnit to test entire features of a program? Is there a name for this type of testing?
This is different from the typical use of NUnit for unit testing where you test individual classes. This is similar to acceptance testing except that it is written by the developer to discern tha...
I'm somewhat new to Unity and dependency injection. I'm trying to write a unit test that goes something like this:
[Test]
public void Test()
{
UnityContainer container = new UnityContainer();
DynamicMock myMock = new DynamicMock(typeof(IMyInterface));
container.RegisterInstance(typeof(IMyInterface), myMock.MockInstance); //...
Hey guys, I'm pretty new to Unit Testing so bear with me.
I realize that best best practice is not to auto generate unit tests, however I'd like to use Code Generation to set-up the basic skeleton of the tests.
Now, I know Visual Studio 2008 already has the built in "create tests", however, it just creates a flat list of all the classe...
Exception:
ProcessModel: Default DomainUsage: Single
Execution Runtime: net-4.0
Unhandled Exception:
System.ArgumentException: The net-4.0 framework is not available
Parameter name: framework
at NUnit.Util.TestAgency.GetAgent(RuntimeFramework framework, Int32 waitTime, Boolean enableDebug)
at NUnit.Util.ProcessRunner.Load(TestPa...
I have this dataAccess mock object and I'm trying to verify that one of its methods is being invoked, and that the argument passed into this method fulfills certain constraints. As best I can tell, this method is indeed being invoked, and with the constraints fulfilled. This line of the test throws a MockException:
data.Verify(d => d....
I am having problems running tests with the command line NUnit test runner.
I am using version 2.5.4 with .NET 4 on an x64 machine.
Using the following line results in a failure "Could not load file or assembly 'bar' or one of
its dependencies. The system cannot find the file specified."
nunit-console-x86 foo.dll bar.dll /framework=4....
I am relatively new to C# and I noticed something interesting today that I guess I have never noticed or perhaps I am missing something. Here is an NUnit test to give an example:
object boolean1 = false;
object booloan2 = false;
Assert.That(boolean1 == booloan2);
This unit test fails, but this one passes:
object string1 = "string";
o...
I'm currently reading the book Professional Enterprise .NET and I've noticed this warning in some of the example programs:
'NUnit.Framework.Assert.IsInstanceOfType(System.Type, object)' is obsolete
Now I may have already answered my own question but, to fix this warning is it simply a case of replacing Assert.IsInstanceOfType() with A...
I have an MSBuild script that uses NUnit to run tests in two assemblies. These were on .NET Framework 3.5 and it worked perfectly for a long time.
The command line was:
(actual paths & names simplified)
nunit-console tests1\bin\debug\tests1.dll tests2\bin\debug\tests2.dll
I've upgraded to VS2010 and have now made the two test assembl...
I have this property:
public SubjectStatus Status
{
get { return status; }
set
{
if (Enum.IsDefined(typeof(SubjectStatus), value))
{
status = value;
}
else
{
Debug.Fail("Error setting Subject.Status", "There is no ...