1

I added an NUNit test (NUnit newby here):

[Test]
public void TestHHSDeliveryInterface()
{
    var Delivery = IOC.container.Resolve<IHHSDelivery>();

    var i = Delivery.GetCount();

    Assert.Greater(i, 16);
}

...based on an existing one that works:

[Test]
public void TestHHSInterface()
{
    var HHSClient = IOC.container.Resolve<IHHSClient>();

    var s = HHSClient.GetTestMessage("Dom", "Paz");

    Assert.Greater(s.Value.Length, 0);
}

...for some context, the class starts this way:

[TestFixture, Category(SSCSCOMMON.UnitTests.Categories.IntegrationTest)]
public class HHSClientIntegrationTests
{

The method (Delivery.GetCount();) is returning a "canned" value (17) for now. So it itself works. So why is the test failing? Unfortunately, the test code is not breakpointable - at least, I have a breakpoint in it, and it doesn't ever get reached, which it should if it's failing, I would think, normally. NUnit looks like this after I run the app and the tests:

enter image description here

With the problematic test commented out, the others run fine.

UPDATE

It turns out that solving this problem also solved this one.

Community
  • 1
  • 1
B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862
  • 2
    It's hard to tell without the code lines in your example. But the error message is saying that the failure is on line 59 of `RESTHHSDelivery.cs` Are you sure you are getting back the correct `IHHSDelivery` instance from `IOC.container.Resolve()` in your test? – Caleb Jun 24 '14 at 00:06
  • 1
    Can you show the `RESTHHSDelivery.cs` code? It would seem that something in there is throwing a `System.NotImplementedException`. This is often the case when you create classes and methods using IDE tools. Check your constructors, and the implementation for `GetCount()` – Caleb Jun 24 '14 at 00:10
  • It turns out that solving [this problem][1] also solved this one. [1]: http://stackoverflow.com/questions/24375991/how-can-i-add-a-dependency-that-can-be-used-as-type-parameter-timpl-for-castle – B. Clay Shannon-B. Crow Raven Jun 24 '14 at 22:13

1 Answers1

1

Using my psychic debug skills:

So why is the test failing? Unfortunately, the test code is not breakpointable - at least, I have a breakpoint in it, and it doesn't ever get reached, which it should if it's failing, I would think, normally.

You are not running the unit test on the dll you think you are debugging. I guess your debug breakpoint tells you the code you are running differs form the source code. Clean your deployment directories/ and your project (all dlls) and recompile.

Peter
  • 27,590
  • 8
  • 64
  • 84