We started out with a fairly basic exploration, looking at how Substitute.For
_engine.Recieved().Rev();
would also validate when expressed like:
_engine.Recieved();
_engine.Rev();
After the break we decided to look at how NSubstitute deals with raising events. To do this we built a Car class to take an IEngine (part of the tests in NSubstitute) and wrote a test, as you might in the 'real world' which raised the IEngine Stopped event. We used NSubstitute to create a fake of IEngine and injected it into Car and then raised the Stopped event using:
_engine.Stopped += Raise.Event(...);
From there we dug (pun absolutely intended) into the call stack to work out how event raising was implemented.
In conclusion the choice of NSubstitute was both good and bad. On the good side was the opportunity to look through some beautiful and clean code. The flip side was that the structure of the code, Overenthusiastic OO, as Dave Tchepak calls it, was probably a bit much to tackle at the same time. It would have also been really good to have had a more detailed look at the structure of the unit tests, but in the end there just wasn't time to look at it all. Maybe another time...
10bet slot review【WG】top10 best slots and casinos list
ReplyDelete10bet slot review,【WG98.vip】⚡, 10bet slot list,slots play,online casino,slots play,online bet365 casino,slot link 12bet games,playstation 10bet 5 games