Esempio n. 1
0
 public static MunicipalityWasImportedFromCrab ToLegacyEvent(
     this ImportMunicipalityFromCrab importMunicipalityFromCrab)
 {
     return(new MunicipalityWasImportedFromCrab(
                importMunicipalityFromCrab.MunicipalityId,
                importMunicipalityFromCrab.NisCode,
                importMunicipalityFromCrab.PrimaryLanguage,
                importMunicipalityFromCrab.SecondaryLanguage,
                importMunicipalityFromCrab.NumberOfFlags,
                importMunicipalityFromCrab.Lifetime,
                importMunicipalityFromCrab.Geometry,
                importMunicipalityFromCrab.Timestamp,
                importMunicipalityFromCrab.Operator,
                importMunicipalityFromCrab.Modification,
                importMunicipalityFromCrab.Organisation));
 }
        public WhenImportMunicipalityFromCrab(ITestOutputHelper testOutputHelper) : base(testOutputHelper)
        {
            _fixture = new Fixture();
            _fixture.Customize(new WithFixedProvenance());
            _fixture.Customize(new NodaTimeCustomization());

            _importMunicipalityFromCrab = _fixture
                                          .Build <ImportMunicipalityFromCrab>()
                                          .With(x => x.PrimaryLanguage, CrabLanguage.Dutch)
                                          .With(x => x.SecondaryLanguage, CrabLanguage.French)
                                          .With(x => x.FacilityLanguage, CrabLanguage.English)
                                          .With(x => x.Lifetime, new CrabLifetime(_fixture.Create <LocalDateTime>(), null))
                                          .With(x => x.Geometry, new WkbGeometry(GeometryHelpers.ExampleWkb))
                                          .Create();

            _municipalityId = new MunicipalityId(_importMunicipalityFromCrab.MunicipalityId.CreateDeterministicId());

            _fixture
            .Build <MunicipalityId>()
            .FromFactory(() => _municipalityId)
            .Create();

            _fixture.Freeze <MunicipalityId>();
        }