The main point behind this request is to add new command line option to JustMockRunner in order to enable profiler without need for being registered, more details about this feature can be found on MSDN at https://msdn.microsoft.com/en-us/library/ee471451(v=vs.100).aspx
MbUnitContextResolver gets wrongly initialized because of the weak check based on Gallio.Framework.Assertions.AssertionException type presence in the current app domain. Needs to be improved with some additional type check from mbunit assembly, MbUnit.Framework.TestFixtureAttribute for example.
If there are more that one mock objects existing in the test, Mock.Assert wrongly succeeds while evaluating arrangements for each mock, but not the very first one. This is a regression compared to an older version from 2012. The following sample demonstrates the case: public interface IFoo { void Bar(); } [TestClass] public class UnitTest1 { [TestMethod] public void TestMethod1() { var bar = Mock.Create<IFoo>(); Mock.Arrange(() => bar.Bar()).OccursOnce(); var foo = Mock.Create<IFoo>(); Mock.Arrange(() => foo.Bar()).OccursOnce(); Mock.Assert(foo); // Would wrongly succeed Mock.Assert(bar); // Would fail as expected } }
Currently, there is no out of the box support for passing "out" and "ref" parameters for nonpublic API.
Types that implement ISerializable can't be mocked anymore with the 2019.1.115.2 version resulting in System.ArgumentException. The issue is a regression compared to older versions of JustMock.
Example of such type is System.Reflection.Assembly.
Let's have the following class and unit test:
public delegate Task<int> SomeDelegate();
private async Task<int> DoSomeStuff()
{
await Task.Delay(100);
return 1;
}
}
// Assert
Mock.Assert(next);
Assert.AreEqual(3, sum);
}
JustMock public API lacks of convenient way to assert that particular task has been awaited. Potential workaround involves some "insider knowledge" that awaiting a Task internally results in a calls to some of its members.
Values from already mocked methods are not taken into account when initializing a static constructor from the Telerik.JustMock.PrivateAccessor class.
Here is an example: PrivateAccessor.ForType(typeof(Foo)).SetField("someStringField", "stringvalue");
A workaround is to call the: Mock.Intercept(typeof(Foo)); before calling the PrivateAccessor.
I just installed it onto desktop, loaded Visual Studio 2019 (Ent) and i see no visual reference or otherwise to JustMock.
Honestly If i had have spent the $$ by now i'd have uninstalled and given up.
Implement integration between JustMock and the code coverage provided by Visual Studio for .net core applications.
Steps representing the missing feature:
Create a .net core test project.
Include JustMock tests.
Execute the tests with code coverage provided by Visual Studio Enterprise.
After upgrading to .NET Core 3.0 an exception is thrown for some of the JustMock methods like DoNothing() and Throw(). In the case for DoNothing() the exception is thrown only for methods that are returning value.
Here is the full exception:
System.InvalidCastException : Unable to cast object of type 'System.AppDomainSetup' to type 'YourType'