Closed herou closed 4 years ago
This is a great start. If all the tests pass, you're ready to continue. I think the best next step is to tackle point number 4 from #777. Test that events come in the proper order, not just that they exist.
Here is an example of a line that tests that an event exists but doesn't check that it's the first event emitted. There are many of these cases in the recipes. The idea is that we want to test not only tha tsome events exist but that no additional events exist ad the events come in the correct order.
Hi @JoshOrndorff I got your idea and I am trying to solve it. To check if the events come in the correct order we should use .next() method, so it is going to be something like this: assert_eq!(System::events().iter().next(), Some(& /excpected event/ ));
Give me a hint, what should be instead of /expected event/ ?
@JoshOrndorff Do you have any suggestions?
@JoshOrndorff I made the required changes for only the charity pallet tests. Please take a look and let me know if it is okay, so I can go further with the other pallets as well.
You're doing great @herou Make these changes throughout all of the pallets. Let me know if you have more questions.
@JoshOrndorff , I made the required changes by you and all the tests passed. Please take a look.
I renamed ExtBuilder to ExternalityBuilder and made ExtBuilder private. @JoshOrndorff Please take a look and tell me if the first two points are done correctly. I ran all the tests locally after I made those changes.