I've been working on a large project where much of the code is not under test. I have been able to add some unit tests to functional areas of the code, and also to start mocking services but I have a question about how much mocking to do on other areas.
This application and endpoints are primary based on .NET remoting so there are a lot of "data objects" that are being manipulated over the channel.
In testing some functions that operate on the object I'm unsure if I should be mocking the data object or instantiating one.
Here is an example:
[TestMethod()]
public void Test_GetAgeTest()
{
//Arrange
var familyMemberData = new FamilyMemberData
{
Demographics = { DoB = new DVDateTime(2000, 01, 01, 0, 0, 0) }
};
var year = DateTime.Today.Year;
//Act
var age = Translators.Test_GetAge(familyMemberData);
//Assert
Assert.AreEqual(year - 2000, age);
}
Translators is a static class, and GetAge is a function that does some calculation on the FamilyMemberData to get the age (Test_GetAge exposes it publicly).
Should FamilyMemberData be a Mock Object, or a Fake, or in cases like these just use them as is?