Explanation of tests in crowdcoin.test.js Tests have been written in accordance to truffle testing dynamics. Usage of beforeEach() has been made to deploy a new set of contracts before every test. Hence the test accounts will not have sufficient ETH if tests are run again and again (approx 10-12 times).
Basic test to check if deployment has been made
Create a new campaign and check under deployed campaigns
Check if the user who created the campaign has been assigned the role of manager
Deploy multiple campaigns and get a list of ongoing campaigns
Deploy multiple campaigns and after a delay which is enough to cross the deadlines, get a list of completed campaigns
Checks if users who contributed to a campaign are listed as backers of the same.
Checks if the user's contribution qualifies is equal to or more than the minimum for the campaign
Manager can create a request to use the funds raised for his Campaign
Manager can process a request once it has been approved by more than 50% of the backers
Checks if a user is able to withdraw his/her contribution before the deadline
Users cannot contribute to a Campaign after a deadline has passed
If the goal of the campaign is not reached then requests cannot be created.
Incase the manager of the campaign decided to refund the funds even after the deadline has passed
Disallow creation of campaigns if the creator of the contracts activates emergency stop on CampaignFactory.