I am trying to arrange the following:
TEntity GetByKey(params object[] keyValues);
using:
const long id = 1;
Mock.Arrange(() => _appSettingRepository.GetByKey(id)).Returns(() => null);
This is failing with the following:
Get_app_setting_by_invalid_key_should_return_null' failed: System.NullReferenceException : Object reference not set to an instance of an object.
at ....(UnaryExpression expression)
at ..(Expression expression)
at ....(Expression argExpression)
at ....(Int32 i, Expression chidExp)
at ..[T](IEnumerable`1 enumeration, Action`2 action)
at ..(MethodCallExpression expression)
at ..(Expression expression)
at ..(Object obj, Type mockTarget, MethodInfo method, Expression expression)
at ..(Expression`1 expression)
at Telerik.JustMock.Mock...( x)
at ..[TDelgate,TReturn]( instruction, Func2`2 function)
at Telerik.JustMock.Mock.Arrange[TResult](Expression`1 expression)
TEntity GetByKey(params object[] keyValues);
using:
const long id = 1;
Mock.Arrange(() => _appSettingRepository.GetByKey(id)).Returns(() => null);
This is failing with the following:
Get_app_setting_by_invalid_key_should_return_null' failed: System.NullReferenceException : Object reference not set to an instance of an object.
at ....(UnaryExpression expression)
at ..(Expression expression)
at ....(Expression argExpression)
at ....(Int32 i, Expression chidExp)
at ..[T](IEnumerable`1 enumeration, Action`2 action)
at ..(MethodCallExpression expression)
at ..(Expression expression)
at ..(Object obj, Type mockTarget, MethodInfo method, Expression expression)
at ..(Expression`1 expression)
at Telerik.JustMock.Mock...( x)
at ..[TDelgate,TReturn]( instruction, Func2`2 function)
at Telerik.JustMock.Mock.Arrange[TResult](Expression`1 expression)