public void CapaKeyFromIrregularFormat2With_ForVbrCaPaKey() { var key = CaPaKey.CreateFrom("11001B0213-02_000"); key.CaPaKeyCrabNotation1.Should().Be("11001_B_0213___000_02"); key.CaPaKeyCrabNotation2.Should().Be("11001B0213/02_000"); key.VbrCaPaKey.ToString().Should().Be("11001B0213-02_000"); }
public void CapaKeyFromIrregularFormat1With0AsEndSeperator() { var key = CaPaKey.CreateFrom("34372_A_0520_0_000_02"); key.CaPaKeyCrabNotation1.Should().Be("34372_A_0520_0_000_02"); key.CaPaKeyCrabNotation2.Should().Be("34372A0520/020000"); key.VbrCaPaKey.ToString().Should().Be("34372A0520-020000"); }
public void CapaKeyWithEqualSizeAsKnownFormatWithSameAmountOfSlashesForVbrCaPaKey() { var key = CaPaKey.CreateFrom("1-1-2-3-2345def-1"); key.CaPaKeyCrabNotation1.Should().BeNullOrEmpty(); key.CaPaKeyCrabNotation2.Should().Be("1/1/2/3/2345def/1"); key.VbrCaPaKey.ToString().Should().Be("1-1-2-3-2345def-1"); }
public void CapaKeyFromIrregularFormat1Without_ForVbrCaPaKey() { var key = CaPaKey.CreateFrom("11001B0009-00A005"); key.CaPaKeyCrabNotation1.Should().Be("11001_B_0009_A_005_00"); key.CaPaKeyCrabNotation2.Should().Be("11001B0009/00A005"); key.VbrCaPaKey.ToString().Should().Be("11001B0009-00A005"); }
public void CapaKeyFromUnknownWithout_IrregularFormatForVbrCaPaKey() { var key = CaPaKey.CreateFrom("123456-abcdef"); key.CaPaKeyCrabNotation1.Should().BeNullOrEmpty(); key.CaPaKeyCrabNotation2.Should().Be("123456/abcdef"); key.VbrCaPaKey.ToString().Should().Be("123456-abcdef"); }
public void CapaKeyWithEqualSizeAsKnownFormatWithSlashForVbrCaPaKey() { var key = CaPaKey.CreateFrom("1-123456123456abcdef1"); key.CaPaKeyCrabNotation1.Should().BeNullOrEmpty(); key.CaPaKeyCrabNotation2.Should().Be("1/123456123456abcdef1"); key.VbrCaPaKey.ToString().Should().Be("1-123456123456abcdef1"); }
public void CapaKeyWithEqualSizeAsKnownFormatWithSameAmountOf_ForVbrCaPaKey() { var key = CaPaKey.CreateFrom("1_1_2_3_23456abcdef_1"); key.CaPaKeyCrabNotation1.Should().BeNullOrEmpty(); key.CaPaKeyCrabNotation2.Should().Be("1_1_2_3_23456abcdef_1"); key.VbrCaPaKey.ToString().Should().Be("1_1_2_3_23456abcdef_1"); }
public void DistinctSameCaPaKeysDifferentNotationReturnsOne() { var key = CaPaKey.CreateFrom("11001B0213/02_000"); key.CaPaKeyCrabNotation1.Should().Be("11001_B_0213___000_02"); key.CaPaKeyCrabNotation2.Should().Be("11001B0213/02_000"); key.VbrCaPaKey.ToString().Should().Be("11001B0213-02_000"); var key2 = CaPaKey.CreateFrom("11001_B_0213___000_02"); key2.CaPaKeyCrabNotation1.Should().Be("11001_B_0213___000_02"); key2.CaPaKeyCrabNotation2.Should().Be("11001B0213/02_000"); key2.VbrCaPaKey.ToString().Should().Be("11001B0213-02_000"); var list = new List <CaPaKey> { key2, key }; list.Distinct().Count().Should().Be(1); }
public CaPaKey ToCaPaKey() => CaPaKey.CreateFrom(Value);
public static IEnumerable <ImportTerrainObjectHouseNumberFromCrab> CreateFor(IEnumerable <tblTerreinObject_huisNummer> terreinObjectHuisNummers, CaPaKey caPaKey) { return(terreinObjectHuisNummers .Select( terreinObjectHuisNummer => { MapLogging.Log("."); return new ImportTerrainObjectHouseNumberFromCrab( new VbrCaPaKey(caPaKey.VbrCaPaKey), new CrabTerrainObjectHouseNumberId(terreinObjectHuisNummer.terreinObject_huisNummer_Id), new CrabTerrainObjectId(terreinObjectHuisNummer.terreinObjectId), new CrabHouseNumberId(terreinObjectHuisNummer.huisNummerId), new CrabLifetime(terreinObjectHuisNummer.beginDatum.ToCrabLocalDateTime(), terreinObjectHuisNummer.eindDatum?.ToCrabLocalDateTime()), new CrabTimestamp(terreinObjectHuisNummer.CrabTimestamp.ToCrabInstant()), new CrabOperator(terreinObjectHuisNummer.Operator), CrabMappings.ParseBewerking(terreinObjectHuisNummer.Bewerking), CrabMappings.ParseOrganisatie(terreinObjectHuisNummer.Organisatie)); })); }
public static IEnumerable <ImportSubaddressFromCrab> CreateFor(IEnumerable <tblSubAdres> subAddresses, CaPaKey caPaKey) { return(subAddresses .Select( subAddress => { MapLogging.Log("."); return new ImportSubaddressFromCrab( new VbrCaPaKey(caPaKey.VbrCaPaKey), new CrabSubaddressId(subAddress.subAdresId), new CrabHouseNumberId(subAddress.huisNummerId), new BoxNumber(subAddress.subAdres), new CrabBoxNumberType(subAddress.aardSubAdresCode), new CrabLifetime(subAddress.beginDatum.ToCrabLocalDateTime(), subAddress.eindDatum?.ToCrabLocalDateTime()), new CrabTimestamp(subAddress.CrabTimestamp.ToCrabInstant()), new CrabOperator(subAddress.Operator), CrabMappings.ParseBewerking(subAddress.Bewerking), CrabMappings.ParseOrganisatie(subAddress.Organisatie)); })); }
public static IEnumerable <ImportSubaddressFromCrab> CreateFor(tblSubAdres subAddress, CaPaKey caPaKey) => CreateFor(new List <tblSubAdres> { subAddress }, caPaKey);
public static IEnumerable <ImportTerrainObjectFromCrab> CreateFor(IEnumerable <tblTerreinObject> terreinObjects, CaPaKey caPaKey) { return(terreinObjects .Select( terreinObject => { MapLogging.Log("."); return new ImportTerrainObjectFromCrab( new VbrCaPaKey(caPaKey.VbrCaPaKey), new CrabTerrainObjectId(terreinObject.terreinObjectId), new CrabIdentifierTerrainObject(terreinObject.identificatorTerreinObject), new CrabTerrainObjectNatureCode(terreinObject.aardTerreinObjectCode), terreinObject.x_coordinaat.HasValue ? new CrabCoordinate(terreinObject.x_coordinaat.Value) : null, terreinObject.y_coordinaat.HasValue ? new CrabCoordinate(terreinObject.y_coordinaat.Value) : null, new CrabBuildingNature(terreinObject.aardGebouw), new CrabLifetime(terreinObject.beginDatum.ToCrabLocalDateTime(), terreinObject.eindDatum?.ToCrabLocalDateTime()), new CrabTimestamp(terreinObject.CrabTimestamp.ToCrabInstant()), new CrabOperator(terreinObject.Operator), CrabMappings.ParseBewerking(terreinObject.Bewerking), CrabMappings.ParseOrganisatie(terreinObject.Organisatie)); })); }