I was looking at code for a colleague and stumbled upon a test in the unit test class, which looked like this:
// setup
Foo f = ...
FooToBarConverter ftb = ...
Bar b = ftb.Convert(f); // It is easier to create a Bar by converting it from a Foo than making one 'from scratch'
// test
systemUnderTest.DoSomething(bar);
// assert
Assert.IsTrue(...)
Obviously, this is an integration test because it tests the FooToBarConverter, as well as the system under test, since it is the only test that covers the DoSomething () method. I suggested moving this test to a test integration solution, however, this reduces the coverage of unit test code. We aim to cover the code with a 100% unit test (and yes - I know that 100% coverage is a means to an end, not an end, and a 100% code is not necessarily a 100% correct code).
Is there a reason for creating unit tests to bring back coverage if we move the integration test?
100% - unit test? 100% - ( 100% )?
.
/UPDATE:
, unit test ( , unit test, , unit test), FooToBarConverter. , : ? ?