ArgumentNullException on Mock.Create()

4 posts, 0 answers
  1. Benjamin
    Benjamin avatar
    2 posts
    Member since:
    Jul 2010

    Posted 22 Jan 2013 Link to this post

    Hi,

    I want to mock the webservice proxy class autogenerated by VS 2012, and when I call Mock.Create<portailSOAPClient>(), I have an ArgumentNullException.

       à System.IO.BinaryReader..ctor(Stream input, Encoding encoding, Boolean leaveOpen)
       à System.IO.BinaryReader..ctor(Stream input)
       à Telerik.JustMock.AssemblyBuilderHelper.ReadStrongKeyNamePairFromManifest()
       à Telerik.JustMock.AssemblyBuilderHelper.GetModuleBuilder(Boolean strongNamedAssembly)
       à Telerik.JustMock.AssemblyBuilderHelper.DefineModule(Type targetType)
       à Telerik.JustMock.Weaver.WeaverAssemblyBuilder.BuildDynamicAssembly(MethodBase methodBase, ModuleBuilder& moduleBuilder)
       à Telerik.JustMock.Weaver.DynamicInjector.Inject(Type targetType, MethodBase methodBase, MethodBase containerMethodInfo)
       à Telerik.JustMock.Weaver.DynamicInjector.Inject(Type targetType, MethodBase methodBase, MethodBase injectingMethod, Boolean force)
       à Telerik.JustMock.Weaver.DynamicInjector.Inject(Type targetType, MethodBase methodBase)
       à Telerik.JustMock.MockManager.SetupMock(Behavior behavior, Boolean static)
       à Telerik.JustMock.MockManager.CreateInstance()
       à Telerik.JustMock.FluentMock.Create()
       à Telerik.JustMock.Mock.Create(Type target, Action`1 settings)
       à Telerik.JustMock.Mock.Create(Type targetType, Constructor constructor, Behavior behavior)
       à Telerik.JustMock.Mock.Create[T](Constructor constructor)  

    The proxy class generated by VS2012 is :
    public partial class portailSOAPClient : System.ServiceModel.ClientBase<FiduPortail.portailSOAP>, FiduPortail.portailSOAP {}
         
    Do you know how to resolve this issue.

    Regards,
  2. Mihail
    Admin
    Mihail avatar
    75 posts

    Posted 24 Jan 2013 Link to this post

    Hello Benjamin,

    Thank you for reporting this bug. We identified a possible reason for the issue. In order to investigate it further can you provide more information about your test runner?


    All the best,
    Mihail
    the Telerik team
    Share what you think about JustTrace & JustMock with us, so we can become even better! You can use the built-in feedback tool inside JustTrace, our forums, or our JustTrace or JustMock portals.
  3. DevCraft R3 2016 release webinar banner
  4. Benjamin
    Benjamin avatar
    2 posts
    Member since:
    Jul 2010

    Posted 25 Jan 2013 Link to this post

    I use MSTest in Visual Studio 2012 Premium.
    Here is the beginnning of the test :

    		[TestMethod()]		
    		public void GetLicencesFromPortail_SIMEO()
    		{
    			string codeClientPortail = "PEB10";
    			string codePersonnel = "ZIOZ";
    			string codeServiceSimeo = "59";
    			string dateDebutSimeo = "2013/02/01";
    			string codeModuleSimeo = "SW";
    			
    			var mock = Mock.Create<FiduPortail.portailSOAPClient>();
    

    The ArgumentNullException is thrown on the last line.
  5. Mihail
    Admin
    Mihail avatar
    75 posts

    Posted 28 Jan 2013 Link to this post

    Hello Benjamin,

    We fixed the issue. The fix will be included in the next JustMock release scheduled for the end of February. In case you want to try it earlier, I would recommend you to open a support ticket in order to get a private JustMock build.


    Regards,
    Mihail
    the Telerik team
    Share what you think about JustTrace & JustMock with us, so we can become even better! You can use the built-in feedback tool inside JustTrace, our forums, or our JustTrace or JustMock portals.
Back to Top