chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
0 votes
Hi,

The following test illustrates the issue. It is not a serious problem, but can be a bit confusing.

I'm running VS2008 & Vista 32 bit.

[TestFixture]
   public class SanityFacts
   {
      [Test]
      public void ThereShouldBeAMeaningfulErrorMessageWhenCallsAreInWrongOrder()
      {
         Isolate.WhenCalled(() => DbHelper.Get("foo")).WithExactArguments().WillReturn("bar");

         try
         {
            Isolate.WhenCalled(() => DbHelper.Get(null)).WillReturn("baz");
         }
         catch (NullReferenceException e)
         {
            Assert.Fail("Expected InvalidOperationException or TypeMockException! Actual exception: " + e);
         }
      }
   }

   public static class DbHelper
   {
      public static string Get(string sql)
      {
         return "foo";
      }
   }
asked by pma (2.3k points)

1 Answer

0 votes
This seems like a bug, we need to investigate this further...

Thank you for reporting!
answered by igal (5.7k points)
...