Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Submit CH3 HW 11 #803

Open
wants to merge 1 commit into
base: Chapter3/Homework/11
Choose a base branch
from

Conversation

TMason11095
Copy link

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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant