Robert Welters

JustMock should support .NET Core

Feature Request by Robert Welters Status: Approved Comments: 3 Last update: 2018-06-05T15:43:53 by Mihail Vladov
0
Mihail Vladov

Static method with dynamic argument cannot be mocked if the class is in a different assembly than the unit test

Problem by Mihail Vladov Status: Approved Comments: 1 Attachments: 1 Last update: 2018-02-07T19:59:15 by corporación de alta tecnologia para la defensa
0
Kamen Ivanov
Team Member

Add integration with CodeRush

Feature Request by Kamen Ivanov Status: Approved Comments: 1 Last update: 2018-01-04T09:36:41 by Mihail Vladov
0
Mihail Vladov

Mocking DateTime.UtcNow fails in async test cases

On slow machines, sometimes arrangements lose their context and the expected mocked return value for DateTime.UtcNow fails.
Problem by Mihail Vladov Status: In Development Comments: 0 Last update: 2017-12-11T09:54:15 by Mihail Vladov
0
Mihail Vladov

Implement integration support for AxoCover

Feature Request by Mihail Vladov Status: Approved Comments: 0 Last update: 2017-11-29T14:20:58 by Mihail Vladov
0
Kaloyan Kotorov

Different behaviour for different Arrange() overrides

There is a different behaviour when mocking the same method using the following two Arrange overrides:

public static FuncExpectation<TResult> Arrange<TResult>(Expression<Func<TResult>> expression);
public static FuncExpectation<TResult> Arrange<T, TResult>(T obj, Func<T, TResult> func);

Repro project attached. Steps to reproduce:
1. Open attached solution
2. In Tests.cs, run JustMockArrangeQueryableTest - it passes
3. Run JustMockArrangeQueryableTest2 - it fails with a invalid cast exception on the Residents collection.
Problem by Kaloyan Kotorov Status: New Comments: 0 Attachments: 1 Last update: 2017-11-10T10:25:17 by Kaloyan Kotorov
0
Stacey Michaud

JustMock Profiler causes application hang on "new ReportDocument()"

I am using Visual Studio 2015, Crystal Reports 12.0.2. When running from Visual Studio in debug mode or not, the application hangs on the statement "new ReportDocument()". ReportDocument is a class defined in CrystalReports.

When I disabled the JustMock Profiler, this statement no longer hung.

Just FYI. Hopefully others will see this.
Feedback by Stacey Michaud Status: New Comments: 0 Last update: 2017-10-18T14:56:32 by Stacey Michaud
0
Nick Apps

Allow simple mocking of fluent interfaces

If I define a fluent API, I might have an interface such as this:

public interface IRegistrar {

IRegistrar UsingThis(object someThing);

IRegistrar UsingThat<TThatThing>() }

If I create a mock of this using the default Behaviour.RecursiveLoose and make no arrangements, calls to the methods will return new mocks of the type, rather than the same instance that was called.

It would be nice to have a behaviour type that can return the same instance (in this case the mocked instance) without having to define a stub for each method call.

My code under test might look like:

IRegistrar reg;

reg

.UsingThis(new object())

.UsingThat<int>();

Currently, a test on the second call will fail if written against the mock assigned to 'reg'.
Feature Request by Nick Apps Status: New Comments: 0 Last update: 2017-10-02T10:01:24 by Nick Apps
0
Maxim Peshkov

AssemblyInitialize Mock.SetupStatic

I have logging class which are using everywhere.
I want to Mock this class for all tests. And i tried to use AssemblyInitialize but got problem. I have simulated this problem with JustMock.ElevatedExamples.AdvancedUsage examples:
1) Add BaseTest class
[TestClass]
public class BaseTest
{
[AssemblyInitialize()]
public static void AssemblyInit(TestContext context)
{
Mock.SetupStatic(typeof(Common1), StaticConstructor.Mocked);
// Arranging: When the static(Foo.FooProp_GET) property is called, it should return expected.
var fakeUsed = Mock.Create<LogWriter1>(Constructor.Mocked);
Mock.Arrange(() => Common1.Log).Returns(fakeUsed);
}

[AssemblyCleanup]
public static void Cleanup()
{
//clean up stuff here
}
}
public static class Common1
{
static Common1()
{

Log = new LogWriter1();

}

public static LogWriter1 Log { get; set; }

}

public class LogWriter1
{

}

2) When run test from VS - all ok
3) When run from command line it is not working. Show Message box "Process Starts Now".

SET JUSTMOCK_INSTANCE=1
SET COR_ENABLE_PROFILING=1
SET COR_PROFILER={B7ABE522-A68F-44F2-925B-81E7488E9EC0}
"C:\Program Files (x86)\Telerik\JustMock\Libraries\JustMockRunner.exe" "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\MSTest.exe" /testcontainer:"D:\test\CSExamples\JustMock.ElevatedExamples\bin\Debug\JustMock.ElevatedExamples.dll"

How i can mock logger for all test? It is static public property.

I use MS Test + VS 2015.
Problem by Maxim Peshkov Status: New Comments: 0 Last update: 2017-04-19T08:19:08 by Maxim Peshkov
0
Kamen Ivanov
Team Member

Support for named parameters in Mock.Arrange

It would be good if we could use named parameters inside Mock.Arrange method.
Feature Request by Kamen Ivanov Status: New Comments: 0 Attachments: 1 Last update: 2017-04-07T07:00:10 by Kamen Ivanov
0
Displaying items 1 - 10 of 23