examples of testing the domain using joliver commondomain/eventstore
Asked Answered
W

4

7

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?

Womanish answered 4/8, 2011 at 20:50 Comment(0)
G
2

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.

Glamorize answered 23/1, 2012 at 9:17 Comment(6)
not sure what you're talking about with the last paragraph but thanks for the link - i'll take a look later :)Womanish
line 46 on github.com/haf/Documently/blob/develop/src/… seems to have a duplicate UsingRavenPersistence - is that a bug?Womanish
also, line 24 of github.com/pjvds/Scrumr/blob/master/src/Scrumr.Domain.Tests/… - the PublishedEvents property is now a list of UncommittedEvent and not SourcedEvent - do you have any idea what thats all about?Womanish
No, haven't seen that project. I haven't gone into NCQRS because it assumes 2PC and I don't want that (I want to have choice to have it). Fixed that bug - I know a slew more bugs in that solution, including some in common domain's caching of event streams in the repository, message re-ordering and such, but we're working on making Documently the no. 1 go-to place for these types of questions.Glamorize
Hey - is there some place I can ask about documently? I see github.com/haf/Documently/blob/develop/src/Documently.Specs/… has been commnented out? Do you know why?Womanish
You can use the issues of the project to discuss it. Since it's a project for showcasing things, it's an issue if something is unclear. It's been commented out because I didn't have a use-case where I cared about Document AR state, so I didn't need it. I realize there are cases where I might need it though in the future though. I have removed it now.Glamorize
H
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.

Hildie answered 7/3, 2014 at 17:36 Comment(0)
K
1

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.

Katiakatie answered 7/8, 2011 at 4:38 Comment(0)
M
1

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

Mastin answered 5/4, 2013 at 5:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.