Completed
Last Updated: 17 May 2013 12:29 by Stefan
ADMIN
Created by: Mihail
Comments: 0
Type: Feature Request
1
By default JustMock matches the mock parameters via Object.ReferenceEquals(...). It would be nice to match the mock parameters via Object.Equals(...) as well.

http://www.telerik.com/community/forums/justmock/general-discussions/parameter-matching.aspx
Rejected
Last Updated: 17 May 2013 12:29 by Mohd
ADMIN
Created by: Mihail
Comments: 1
Type: Bug Report
1
Since JustMock Q1 2013 Mock.DoNotUseProfiler() is marked as an obsolete method and I cannot compile my test project. Revert it back.
Completed
Last Updated: 17 May 2013 12:23 by Kaloyan
Created by: Kaloyan
Comments: 0
Type: Feature Request
0
I'd like to intercept a call to a generic method similar to:

public  class MyClass
{
    public void MyMethod<T>()
    {
        //
    }
}

Now I want to arrange a MyClass instance so I can assert that the method has been call only once for an specific type and never for any other type. I'm tryig to do something similar to:

var service = Mock.Create<MyClass>();
Mock.Arrange(() => service.MyMethod<T>()).OccursNever();

So I can assert the generic method is never called.
Completed
Last Updated: 17 May 2013 12:23 by David
I'm getting this argument exception:
System.ArgumentException : The type or method has 3 generic parameter(s), but 2 generic argument(s) were provided. A generic argument must be provided for each generic parameter.
   at System.RuntimeType.SanityCheckGenericArguments(RuntimeType[] genericArguments, RuntimeType[] genericParamters)
   at System.Reflection.RuntimeMethodInfo.MakeGenericMethod(Type[] methodInstantiation)
   at .š.(Type ‹, MethodBase „†, BindingFlags )
   at .š.(Type ‚, MethodBase „†)
   at ”.“.Create(Object š, MethodInfo ›, Boolean ’)
   at ..(˜ )
   at ..(Expression`1 )
   at Telerik.JustMock.Mock..Ž( )
   at ..—[,—]( , Func`2 )
   at Telerik.JustMock.Mock.Arrange[TResult](Expression`1 expression)

Heres an example of a failing test:

        [Test]
        public void GenericTestCanMockTwoGenericMethods()
        {
            var mocked = Mock.Create<GenericTest>();
            IEnumerable<EVENT_CODE> n = null;
            Mock.Arrange(() => mocked.Query<EVENT_CODE, ALARM_CODE>(Arg.AnyString, Arg.IsAny<object>())).Returns(n).MustBeCalled();
        }

        public interface GenericTest
        {
            IEnumerable<T1> Query<T1, T2>(string arg1, params object[] args);

            IEnumerable<T1> Query<T1, T2, T3>(string arg1, params object[] args);
        }
Completed
Last Updated: 14 May 2013 12:13 by ADMIN
Created by: Philip Japikse
Comments: 1
Type: Feature Request
0
As a developer, I want to be able to automock classes that have concrete classes injected
Completed
Last Updated: 14 May 2013 12:12 by ADMIN
Please allow automocking support for classes with multiple constructors. This is important for projects not using DI containers but using dependency injection. A classic example is ASP.NET MVC and ASP.NET Web API where standard routing requires a constructor with no parameters. When using DI via constructors but without containers, the overloaded ctor specifies services/repositories and the default ctor passes the default services/repositories.
Completed
Last Updated: 22 Nov 2012 15:00 by Philip Japikse
If I have a constructor like this: public Foo(IAccount fromAccount, IAccount toAccount) { //code }, I need to be able to distinguish between the two accounts when automocking.
container.Arrange<IAccount>() won't work.  Perhaps container.Arrange<IAccount>[0] would. 
Completed
Last Updated: 21 Nov 2012 00:37 by Philip Japikse
Created by: Philip Japikse
Comments: 0
Type: Feature Request
0
Currently, I can only assert all when automocking.  It would be nice to be able to assert individually.  container.Assert<IAccount>().  If we implement my other item (http://feedback.telerik.com/Project/105/Feedback/Details/850-distinguish-between-automocked-items-when-multiple-of-the-same-are-in-the-constru) then it would be container.Assert<IAccount>[0] if there were more than one IAccount in the constructor.
1 2 3 4