-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from dolittle/fix-apply-public
Setting public to true when applying public events
- Loading branch information
Showing
3 changed files
with
17 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
Source/aggregates/for_AggregateRoot/when_applying_public_events.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Copyright (c) Dolittle. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
import { EventSourceId, EventType, EventTypeId, Generation } from '@dolittle/sdk.events'; | ||
import { AggregateRoot } from '../AggregateRoot'; | ||
|
||
describe('when applying public events', () => { | ||
const event = { something: 42 }; | ||
|
||
const eventType = new EventType(EventTypeId.from('7b078c73-5843-434e-9b4d-ecae4e91469e'), Generation.first); | ||
const aggregateRoot = new AggregateRoot(EventSourceId.from('8f58f9d5-fded-49f3-8334-a3c1f447d4da')); | ||
aggregateRoot.applyPublic(event, eventType); | ||
|
||
it('should have one event applied', () => aggregateRoot.appliedEvents.length.should.equal(1)); | ||
it('should have the event applied be public', () => aggregateRoot.appliedEvents[0].isPublic.should.be.true); | ||
}); |
This file was deleted.
Oops, something went wrong.