Currently, there are several test classes that independently create their own BlockModel instance from scratch. To name a few, we have AbsolutePathCorrectionEngineTest, all the ...SuggestionCommandParserTest classes, etc.
To reduce code duplication in our test cases, we can create a factory method for a dummy BlockModel instance. Then, all these test cases that currently create their own BlockModel instance independently can use this factory method to initialize their BlockModels. Currently, com.notably.testutil.TypicalBlockModel can be tweaked to achieve that purpose.
What needs to be changed in com.notably.testutil.TypicalBlockModel for this to happen:
Create public static fields for the AbsolutePath to each Block.
Create a public static field for the AbsolutePath to the initially opened Block.
Currently, there are several test classes that independently create their own
BlockModel
instance from scratch. To name a few, we haveAbsolutePathCorrectionEngineTest
, all the...SuggestionCommandParserTest
classes, etc.To reduce code duplication in our test cases, we can create a factory method for a dummy
BlockModel
instance. Then, all these test cases that currently create their ownBlockModel
instance independently can use this factory method to initialize theirBlockModel
s. Currently,com.notably.testutil.TypicalBlockModel
can be tweaked to achieve that purpose.What needs to be changed in
com.notably.testutil.TypicalBlockModel
for this to happen:AbsolutePath
to eachBlock
.AbsolutePath
to the initially openedBlock
.