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

How to have accurate expected-actual test after Level-7? #66

Closed
iamgenechua opened this issue Aug 24, 2020 · 2 comments
Closed

How to have accurate expected-actual test after Level-7? #66

iamgenechua opened this issue Aug 24, 2020 · 2 comments

Comments

@iamgenechua
Copy link

After level 7, we will be able to persist data on our harddrive.
Now, everytime we start up our program, we continue to have the tasks from before.
These tasks are ever changing, and the 'list' command will show different tasks depending on what i have done.
My expected output will behave as if it is the first time we run the program.
How do i do my testing accurately then?

@erisjacey
Copy link

erisjacey commented Aug 24, 2020

If by testing you mean continuing to use .bat or .sh files to script testing, the way I did it was pretty rudimentary:

I created a feature to support the "delete all" user input command. This command (as its name suggests) deletes all existing tasks (if any) in the list of tasks.

All I did afterwards was make sure this command was the first line of my input.txt. This allowed the task list to "reset" every time the script is run.

A cool side effect to adding this command is that users of my Duke chatbot will be able to use it in normal circumstances as well (because I think the default implementation of delete 2, etc. can be quite clunky especially for substantially big lists).

I'm sure there are more clever ways to go about doing this though.

@dianneloh9
Copy link

For me, for the .sh (or .bat) file, I added a line that deleted the data file before running the test if the file exists initially. So that the test can run from a clean slate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants