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
Welcome to Typemock Community! Here you can ask and receive answers from other community members. If you liked or disliked an answer or thread: react with an up- or downvote.
0 votes
Hi,
always using TestDriven.Net addin i get the above error when trying to execute the following
using System;
using MbUnit.Core.Framework;
using MbUnit.Framework;
using TypeMock;

namespace MCH.Reports
{
   [TestFixture]
   public class Class1
   {
      [Test]
      public void MethodName()
      {
         MockManager.Init();
         Mock mock = MockManager.Mock(typeof(ClassName),Constructor.Mocked);
            mock.ExpectAndReturn("MethodName",new Type[1]).Args(mEnum.a|mEnum.b );
         ClassName className=new ClassName();
            className.MethodName(  mEnum.a|mEnum.b);

      }
   }

   public class ClassName
   {
      public Type[] MethodName(  mEnum mEnum)
      {
         return new  Type[0];
      }
   }

   public enum mEnum
   {
      a,
      b
   }
}
asked by tolisss (28.8k points)

2 Answers

0 votes
Hi,
Thanks for the example. 8)
This is a bug :twisted: , it happens when returning arrays.
We will fix it and will send you a fix offline.
answered by scott (32k points)
0 votes
This is fixed in version 2.2.2 (will be out soon)
answered by scott (32k points)
...