Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Updated the following for Tests:
ProgramTests.Main_When_Valid_MinMax_Command_With_Returns_Expected_Cities_With_Min_Max:
-Added "Expected/" to all the expectedFile parameter InlineData entries, as that's where the files were being stored.
-Updated all the Tests/Expected files to have the property, Copy to Output Directory, set to Copy if newer, as the files weren't being copied over during testing.
-Swapped around the expectedFile parameter InlineData entries to match their respective cmd parameter, as the -money and -items were flipped compared to their expectedFile (cmd "city -money -max" had the expectedFile "CityItemsMax" and cmd "city -items -max" had the expectedFile "CityMoneyMax").
ProgramTests.Main_When_Valid_Time_Command_Creates_File_And_Writes_Stats_For_Every_Hour:
-AssertMatchingContents was missing "+ extension" on the OutputFile variable.
ProgramTests.Main_When_Valid_Time_Command_With_Range_Creates_File_And_Writes_Stats_For_Every_Hour_Belonging_To_Range:
-Main() call was missing "+ extension" on the ValidTransactionsFile variable.
ProgramTests.Main_When_Transactions_File_Empty_Or_Not_Found_Throws_NoTransactionsException:
-No changes made, but this test will never pass, as the call to Main() only includes the inputFile parameter and doesn't include the command nor the outputFile. So InvalidCommandException will always be thrown before before the inputFile is checked to be able to throw NoTransactionsFoundException.
Expected/FullDay.json and .xml:
-Hour 23's Earned field is "€10.05". Looking at the Input/Transactions.json and .xml files, the 2 entries for that hour are "€9" and "€12", which average to "€10.5" not "€10.05". Fixed this in both files.
Expected/FullDay.json:
-"RushHour" has extra spacing before and after the following ":" as well as at the end of the line, which isn't common JSON formatting. Changed ""RushHour" : 22 " to ""RushHour": 22".
Expected/FullDay.xml:
-Missing Time entry for Hour 0 that the .json version of the file has. -Hour 22 is set as just 2.
Expected/Night.json and .xml:
-Results in both files are only the Times and don't include RushHour. HW 9 includes RushHour and HW 11 makes no mention that this functionality should be removed. Both the Night and FullDay files also come from the same "time" command. Updated both Night.json and .xml to include RushHour = 22 and follow the formatting from FullDay.json and .xml respectively.
Expected/Night.xml:
-Hour 22 is set as just 2.
-Hour 23's Earned field is "€10.05". The .json version has "€10.5".
-Cloned files over from CH3 HW 9.
-Created TransactionDTO and EarningsDTO classes.
-Created TransactionSerializer class to serialize/deserialize json/xml files using the new DTO classes.
-Updated TransactionCommand class to have command functions return object instead of string to be serialized.
-Updated Transaction class to include the string version of the Price property to simplify mapping to the DTO version.
-Updated Main() to utilize these new changes.