Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add BoxCodec #25

Merged
merged 5 commits into from
Oct 26, 2019
Merged

Add BoxCodec #25

merged 5 commits into from
Oct 26, 2019

Conversation

bartelink
Copy link
Collaborator

FsCodec.Box.Codec is a drop-in-equivalent for FsCodec.NewtonsoftJson.Codec with equivalent .Create overloads which encode as ITimelineEvent<obj> (as opposed to ITimelineEvent<byte[]>.

This is useful when storing events in a MemoryStore as it allows one to take the perf cost and ancillary yak shaving induced by round-tripping arbitrary event payloads out of the picture when writing property based tests.

NOTE this does not imply one should avoid testing this aspect; the opposite in fact -- one should apply the Test Pyramid principles:

  • have a focused series of tests which validate that the various data represented in the event bodies are round-trippable a) in the chosen encoding format (i.e. UTF8 json) b) with the selected concrete json encoder (i.e. json.net for now 🙁)
  • integration tests can in general can use BoxEncoder and MemoryStore
  • you should of course have acceptance tests that apply the actual serialization encoding with the real store for a representative number of scenarios at the top of the pyramid

@bartelink bartelink merged commit c197d5f into master Oct 26, 2019
@bartelink bartelink deleted the add-box-codec branch October 26, 2019 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants