Closed LiorBanai closed 1 year ago
Hi! Yes, you can pass an IExtension (https://github.com/appccelerate/statemachine/blob/6ae943467fca0472887aefeeeb9d387cb17354f4/source/Appccelerate.StateMachine/ActiveStateMachine.cs#L287). You can derive from ExtensionBase so that you don't have to implement all callback methods: https://github.com/appccelerate/statemachine/blob/6ae943467fca0472887aefeeeb9d387cb17354f4/source/Appccelerate.StateMachine/Extensions/ExtensionBase.cs#L33
For unit tests, you can use something like I did here: https://github.com/appccelerate/statemachine/blob/6ae943467fca0472887aefeeeb9d387cb17354f4/source/Appccelerate.StateMachine.Specs/Sync/CurrentStateExtension.cs#L24
A word of caution: I'm not actively working on this code at the moment. So if you need to run it on another target, the best way is to fork the repo and change the target yourself. But if you need help, feel free to ask.
@ursenzler thanks!
btw, any reason why the license is apache and not mit (which is commonly used I guess)?
A decision made many many years ago. Is it a problem for you?
not a problem. Thanks again.
Hi, I found this library and it seems great to my needs. I was wondering how than I log changes (events triggering, current state, etc), can I pass Ilogger for example? also how to write unit test that access the internal state after event was fired to verify the correct changes.