Check out MainFragmentTest. You will notice this line: private val repo1 = RepoModel(1, "name1", repoOwner). I want to pull this out and not require having to construct a new RepoModel in each test file. I would like 1 central place that fake RepoModels get constructed.
Make these objects mutable to edit properties easily.
In constructor for fake data, ask for dependencies to resolve them.
Ideas for API:
Get a friend by identifier:
# Generic, fake friend object number 1.
FakeData.getFriend(Fake.FRIEND_1)
# if you want to test UI with a long username
FakeData.getFriend(Fake.FRIEND_LONG_USERNAME)
Get a list of friends:
val numberOfFriendsToGet = 5
FakeData.getFriends(numberOfFriendsToGet)
# FakeData might have a set of 10 fake friend objects constructed ready to go.
Check out
MainFragmentTest
. You will notice this line:private val repo1 = RepoModel(1, "name1", repoOwner)
. I want to pull this out and not require having to construct a newRepoModel
in each test file. I would like 1 central place that fakeRepoModel
s get constructed.Ideas for API:
Get a friend by identifier:
Get a list of friends: