public UpdateLabels( PublicServiceId publicServiceId, Dictionary <LabelType, LabelValue> labels) { PublicServiceId = publicServiceId; Labels = labels; }
public SetLegislativeDocumentId( PublicServiceId publicServiceId, LegislativeDocumentId legislativeDocumentId) { PublicServiceId = publicServiceId; LegislativeDocumentId = legislativeDocumentId; }
public RemoveStageFromLifeCycle( PublicServiceId publicServiceId, LifeCycleStageId lifeCycleStageId) { PublicServiceId = publicServiceId; LifeCycleStageId = lifeCycleStageId; }
public Task WhenIpdcCodeWasSet() { var clockProviderStub = new ClockProviderStub(Today); var publicServiceId = new PublicServiceId("DVR000000001"); var publicServiceName = new PublicServiceName("Test"); var events = new object[] { new PublicServiceWasRegistered(publicServiceId, publicServiceName, PrivateZoneId.Unregistered), new IpdcCodeWasSet(publicServiceId, new IpdcCode("1234")), }; return(new PublicServiceListProjections(clockProviderStub) .Scenario() .Given(events) .Expect(new PublicServiceListItem { Name = publicServiceName, PublicServiceId = publicServiceId, CurrentLifeCycleStageType = null, CurrentLifeCycleStageId = null, CurrentLifeCycleStageEndsAt = null, IpdcCode = "1234" })); }
public async Task WhenPublicServiceWasRegistered() { var projection = new PublicServiceListProjections(new ClockProviderStub(DateTime.Now)); var resolver = ConcurrentResolve.WhenEqualToHandlerMessageType(projection.Handlers); var publicServiceId = PublicServiceId.FromNumber(123); var publicServiceWasRegistered = new PublicServiceWasRegistered(publicServiceId, new PublicServiceName("Ophaling huisvuil"), PrivateZoneId.Unregistered); await new ConnectedProjectionScenario <BackofficeContext>(resolver) .Given( new Envelope <PublicServiceWasRegistered>(new Envelope( publicServiceWasRegistered, new Dictionary <string, object>()))) .Verify(async context => { var publicService = await context.PublicServiceList.FirstAsync(a => a.PublicServiceId == publicServiceId); publicService.PublicServiceId.Should().Be("DVR000000123"); publicService.Name.Should().Be("Ophaling huisvuil"); publicService.CompetentAuthorityCode.Should().BeNullOrEmpty(); publicService.CompetentAuthorityName.Should().BeNullOrEmpty(); publicService.ExportToOrafin.Should().Be(false); return(VerificationResult.Pass()); }) .Assert(); }
public Task DoesNotClearLifeCycleStageWhenAnotherLifeCycleStageNoLongerOverlapsWithToday() { var clockProviderStub = new ClockProviderStub(Today); var publicServiceId = new PublicServiceId("DVR000000001"); var publicServiceName = new PublicServiceName("Test"); var events = new object[] { new PublicServiceWasRegistered(publicServiceId, publicServiceName, PrivateZoneId.Unregistered), new StageWasAddedToLifeCycle(publicServiceId, LifeCycleStageId.FromNumber(1), LifeCycleStageType.Active, PeriodOverlappingWithToday), new StageWasAddedToLifeCycle(publicServiceId, LifeCycleStageId.FromNumber(2), LifeCycleStageType.PhasingOut, PeriodOverlappingWithTomorrow), new PeriodOfLifeCycleStageWasChanged(publicServiceId, LifeCycleStageId.FromNumber(2), PeriodOverlappingWithYesterday), }; return(new PublicServiceListProjections(clockProviderStub) .Scenario() .Given(events) .Expect(new PublicServiceListItem { Name = publicServiceName, PublicServiceId = publicServiceId, CurrentLifeCycleStageType = "Active", CurrentLifeCycleStageId = 1, CurrentLifeCycleStageEndsAt = LocalDate.FromDateTime(Today), })); }
public Task DoesNotSetNextLifeCycleStageWhenDayHasPassedWhenThatLifeCycleStageWasRemoved() { var clockProviderStub = new ClockProviderStub(Today); var publicServiceId = new PublicServiceId("DVR000000001"); var publicServiceName = new PublicServiceName("Test"); var events = new object[] { new PublicServiceWasRegistered(publicServiceId, publicServiceName, PrivateZoneId.Unregistered), new StageWasAddedToLifeCycle(publicServiceId, LifeCycleStageId.FromNumber(1), LifeCycleStageType.Active, PeriodOverlappingWithToday), new StageWasAddedToLifeCycle(publicServiceId, LifeCycleStageId.FromNumber(2), LifeCycleStageType.PhasingOut, PeriodOverlappingWithTomorrow), new LifeCycleStageWasRemoved(publicServiceId, LifeCycleStageId.FromNumber(2)), new ClockHasTicked(Tomorrow), }; return(new PublicServiceListProjections(clockProviderStub) .Scenario() .Given(events) .Expect(new PublicServiceListItem { Name = publicServiceName, PublicServiceId = publicServiceId, CurrentLifeCycleStageType = null, CurrentLifeCycleStageId = null, CurrentLifeCycleStageEndsAt = null, })); }
public PublicServiceWasRemoved( PublicServiceId publicServiceId, ReasonForRemoval reasonForRemoval) { PublicServiceId = publicServiceId; ReasonForRemoval = reasonForRemoval; }
public static RegisterPublicService Map( RegisterPublicServiceRequest message, PublicServiceId publicServiceId) => new RegisterPublicService( publicServiceId, new PublicServiceName(message.Naam), PrivateZoneId.Unregistered);
public SetIpdcCode( PublicServiceId publicServiceId, IpdcCode ipdcCode) { PublicServiceId = publicServiceId; IpdcCode = ipdcCode; }
private void When(PublicServiceWasRegistered @event) { _id = new PublicServiceId(@event.PublicServiceId); _name = new PublicServiceName(@event.Name); _lifeCycle.Route(@event); }
public RemovePublicService( PublicServiceId publicServiceId, ReasonForRemoval reasonForRemoval) { PublicServiceId = publicServiceId; ReasonForRemoval = reasonForRemoval; }
public OrafinExportPropertyWasSet( PublicServiceId publicServiceId, bool exportToOrafin) { PublicServiceId = publicServiceId; ExportToOrafin = exportToOrafin; }
public LifeCycleStageWasRemoved( PublicServiceId publicServiceId, LifeCycleStageId lifeCycleStageId) { PublicServiceId = publicServiceId; LifeCycleStageId = lifeCycleStageId; }
public void CannotPerformSimpleUpdateOnRemovedPublicService( PublicServiceId publicServiceId, PublicServiceName publicServiceName, PublicServiceName publicServiceRename, ReasonForRemoval reasonForRemoval, OvoNumber ovoNumber, Organisation organisation) { _mocker.MockOrganisationProvider(ovoNumber, organisation); Assert(new Scenario() .Given(publicServiceId, new PublicServiceWasRegistered(publicServiceId, publicServiceName, PrivateZoneId.Unregistered), new PublicServiceWasRemoved(publicServiceId, reasonForRemoval)) .When(new UpdatePublicService(publicServiceId, publicServiceRename, null, false)) .Throws(new CannotPerformActionOnRemovedPublicService())); Assert(new Scenario() .Given(publicServiceId, new PublicServiceWasRegistered(publicServiceId, publicServiceName, PrivateZoneId.Unregistered), new PublicServiceWasRemoved(publicServiceId, reasonForRemoval)) .When(new UpdatePublicService(publicServiceId, publicServiceName, ovoNumber, false)) .Throws(new CannotPerformActionOnRemovedPublicService())); Assert(new Scenario() .Given(publicServiceId, new PublicServiceWasRegistered(publicServiceId, publicServiceName, PrivateZoneId.Unregistered), new PublicServiceWasRemoved(publicServiceId, reasonForRemoval)) .When(new UpdatePublicService(publicServiceId, publicServiceName, null, true)) .Throws(new CannotPerformActionOnRemovedPublicService())); }
public void WithEveryPropertyChanged( OvoNumber ovoNumber, Organisation organisation, PublicServiceId publicServiceId, PublicServiceName publicServiceName, PrivateZoneId privateZoneId) { _mocker.MockOrganisationProvider(ovoNumber, organisation); var newPublicServiceName = new PublicServiceName("Uitreiken identiteitskaart"); Assert( new Scenario() .Given(publicServiceId, new PublicServiceWasRegistered(publicServiceId, publicServiceName, privateZoneId)) .When(new UpdatePublicService(publicServiceId, newPublicServiceName, ovoNumber, true)) .Then(publicServiceId, new PublicServiceWasRenamed(publicServiceId, newPublicServiceName), new CompetentAuthorityWasAssigned( publicServiceId, organisation.OvoNumber, organisation.Name, organisation.Provenance), new OrafinExportPropertyWasSet( publicServiceId, true))); }
public void WithOvoNumberChanged( Fixture fixture, OvoNumber ovoNumber, Organisation organisation, PublicServiceId publicServiceId, PublicServiceName publicServiceName, PrivateZoneId privateZoneId) { _mocker.MockOrganisationProvider(ovoNumber, organisation); var newOvoNumber = fixture.Create <OvoNumber>(); var newOrganisation = fixture.Create <Organisation>(); _mocker.MockOrganisationProvider(newOvoNumber, newOrganisation); Assert( new Scenario() .Given(publicServiceId, new PublicServiceWasRegistered(publicServiceId, publicServiceName, privateZoneId), new CompetentAuthorityWasAssigned( publicServiceId, organisation.OvoNumber, organisation.Name, organisation.Provenance)) .When(new UpdatePublicService(publicServiceId, publicServiceName, newOvoNumber, false)) .Then(publicServiceId, new CompetentAuthorityWasAssigned( publicServiceId, newOrganisation.OvoNumber, newOrganisation.Name, newOrganisation.Provenance))); }
public IpdcCodeWasSet( PublicServiceId publicServiceId, IpdcCode ipdcCode) { PublicServiceId = publicServiceId; IpdcCode = ipdcCode; }
public PublicServiceWasRenamed( PublicServiceId publicServiceId, PublicServiceName newName) { PublicServiceId = publicServiceId; NewName = newName; }
public RegisterPublicService( PublicServiceId publicServiceId, PublicServiceName publicServiceName, PrivateZoneId privateZoneId) { PublicServiceId = publicServiceId; PublicServiceName = publicServiceName; PrivateZoneId = privateZoneId; }
public AddStageToLifeCycle( PublicServiceId publicServiceId, LifeCycleStageType lifeCycleStageType, LifeCycleStagePeriod lifeCycleStagePeriod) { PublicServiceId = publicServiceId; LifeCycleStageType = lifeCycleStageType; LifeCycleStagePeriod = lifeCycleStagePeriod; }
public PublicServiceWasRegistered( PublicServiceId publicServiceId, PublicServiceName name, PrivateZoneId privateZoneId) { PublicServiceId = publicServiceId; Name = name; PrivateZoneId = privateZoneId; }
public static void CustomizeLabelWasAssigned(this IFixture fixture) => fixture.Customize <LabelWasAssigned>(customization => customization .FromFactory(generator => new LabelWasAssigned( PublicServiceId.FromNumber(fixture.Create <int>()), LabelType.All[generator.Next() % LabelType.All.Length], new LabelValue(fixture.Create <string>()) )).OmitAutoProperties());
public static void CustomizePublicServiceWasRegistered(this IFixture fixture) => fixture.Customize <PublicServiceWasRegistered>(customization => customization .FromFactory(generator => new PublicServiceWasRegistered( PublicServiceId.FromNumber(fixture.Create <int>()), new PublicServiceName(fixture.Create <string>()), PrivateZoneId.Unregistered )).OmitAutoProperties());
public ChangePeriodOfLifeCycleStage( PublicServiceId publicServiceId, LifeCycleStageId lifeCycleStageId, LifeCycleStagePeriod lifeCycleStagePeriod) { PublicServiceId = publicServiceId; LifeCycleStageId = lifeCycleStageId; LifeCycleStagePeriod = lifeCycleStagePeriod; }
public LabelWasAssigned( PublicServiceId publicServiceId, LabelType labelType, LabelValue labelValue) { PublicServiceId = publicServiceId; LabelType = labelType; LabelValue = labelValue; }
public PeriodOfLifeCycleStageWasChanged( PublicServiceId publicServiceId, LifeCycleStageId lifeCycleStageId, LifeCycleStagePeriod period) { PublicServiceId = publicServiceId; LifeCycleStageId = lifeCycleStageId; From = period.Start; To = period.End; }
public static PublicService Register( PublicServiceId id, PublicServiceName name, PrivateZoneId privateZoneId) { var publicService = Factory(); publicService.ApplyChange(new PublicServiceWasRegistered(id, name, privateZoneId)); return(publicService); }
public static void CustomizeStageWasAddedToLifeCycle(this IFixture fixture) => fixture.Customize <StageWasAddedToLifeCycle>(customization => customization .FromFactory(generator => new StageWasAddedToLifeCycle( PublicServiceId.FromNumber(fixture.Create <int>()), LifeCycleStageId.FromNumber(fixture.Create <int>()), LifeCycleStageType.All[generator.Next() % LifeCycleStageType.All.Length], fixture.Create <LifeCycleStagePeriod>() )).OmitAutoProperties());
private async Task <bool> StreamExists(PublicServiceId publicServiceId) { var pageReadStatus = await _streamStore .ReadStreamForwards( streamId : publicServiceId.ToString(), fromVersionInclusive : StreamVersion.Start, maxCount : 1, prefetchJsonData : false); return(pageReadStatus.Status != PageReadStatus.StreamNotFound); }