Hi Wilke and welcome to the forum 8)
If you mean that you don't have to write your own stub class and use it in your test instead of the 'real' class than the the answer is yes.
You don't have to create it, Typemock Isolator will that for you.
However you still have to write some code that will instruct the Isolator how
your faked object should behave.
For example suppose you want to test ClassUnderTest.MethodToTest()
public class ClassUnderTest
{
public int MethodToTest(ClassToIsolate classToIsolate)
{
int x = classToIsolate.MethodReturningInt();
//do some logic here ...
return x + 5;
}
}
public class ClassToIsolate
{
public int MethodReturningInt()
{
return 1;
}
}
You want to isolate ClassToIsolate.MethodReturningInt and set it to return a faked value.
Here is the test:
[Test]
public void Test()
{
//Arrange
var fake = Isolate.Fake.Instance<ClassToIsolate>();
Isolate.WhenCalled(() => fake.MethodReturningInt()).WillReturn(100);
Isolate.Swap.NextInstance<ClassToIsolate>().With(fake);
//Act
ClassUnderTest classUnderTest = new ClassUnderTest();
int actual = classUnderTest.MethodToTest(fake);
//Assert
int expcted = 105;
Assert.AreEqual(expcted, actual);
}
As you can see you still have to write some code but it's much shorter, faster and less error prone than writing your own stub class.
You can see more detailed articles about the Isolator usage in our
blog here