examples of testing the domain using joliver commondomain/eventstore

北城以北 提交于 2020-01-12 18:51:55

问题


I'm looking for good examples of testing the domain using JOlivers CommonDomain and EventStore

I have been watching greg youngs videos and he has a nice simple abstract aggregate root test fixture.

is there anything like that which can be used with these libs?


回答1:


Edit: due to the immaturity of and forced inheritance in CommonDomain, Documently/develop now rolls its own simpler EventRouter

Yes, I have a sample here: https://github.com/haf/Documently that shows how you can use it together and there are tests in there as well.

Basically, what it does is that is uses CommonDomain and EventStore together with a RavenDB database.

This is not an article, so I'm not including any essential parts of it. It's a sample project, which is what the questioner asks for. I don't know if the admins are stupid enough to believe the answer "I don't have any samples" is the true answer, but if they want to assert their authority, then why don't they delete the non answer that was selected as the "answer" by the questioner instead of deleting real and true answers.




回答2:


I just pushed up NEventStoreExample with code I gathered in various places (StackOverflow, Documently, Greg Young's skillcast).

It's a very basic implementation of NEventStore that uses CommonDomain to rebuild aggregate state and an EventSpecification base test class to test aggregate behaviour.




回答3:


I doubt that there's any public sample code out there for testing a domain model using the CommonDomain and EventStore libraries. In many regards, there is very little public code on testing domain models that implement CQRS.

Notwithstanding, the same kinds of conventions found in Greg Young's sample code can easily be applied to the CommonDomain library. Furthermore, everything in both of those libraries adheres to an interface which should be relatively easy to mock, if necessary.

It sounds like I need to create a blog post on the subject.




回答4:


I found a very interesting spike here: http://pastebin.com/upZS72W0



来源:https://stackoverflow.com/questions/6948338/examples-of-testing-the-domain-using-joliver-commondomain-eventstore

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!