Commit c793f18f authored by Johan Vervloet's avatar Johan Vervloet

Closes #5671 - Fixed broken mapping.

parent 5f130fe5
......@@ -2,4 +2,4 @@
use gap
exec auth.spTijdelijkeGebruiker 'mg /0816','chiropublic\johan4'
exec auth.spTijdelijkeGebruikerAd 'og /1206',39198
/*
Copyright 2017 Chirojeugd-Vlaanderen vzw
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
using Chiro.Kip.ServiceContracts.DataContracts;
using NUnit.Framework;
namespace Chiro.CiviSync.Logic.Test
{
/// <summary>
/// Tests voor AdresLogic.
/// </summary>
[TestFixture]
public class AdresLogicTest
{
[Test]
public void BuitenlandseProvincieMappen()
{
var adres = new Adres
{
Straat = "Vosselmanstraat",
HuisNr = 299,
PostNr = "7311 CL",
WoonPlaats = "Apeldoorn",
Land = "Nederland"
};
int? result = AdresLogic.ProvincieId(adres);
Assert.IsNull(result);
}
}
}
\ No newline at end of file
......@@ -55,6 +55,7 @@
<Otherwise />
</Choose>
<ItemGroup>
<Compile Include="AdresLogicTest.cs" />
<Compile Include="MembershipLogicTest.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RelationshipLogicTest.cs" />
......@@ -72,6 +73,10 @@
<Project>{3CCD93C2-0CB6-4562-B017-E2DF3F9AB0A4}</Project>
<Name>Chiro.CiviSync.Logic</Name>
</ProjectReference>
<ProjectReference Include="..\Chiro.Kip.ServiceContracts\Chiro.Kip.ServiceContracts.csproj">
<Project>{6E81A10A-AD85-47A0-8B5D-70361F393CDD}</Project>
<Name>Chiro.Kip.ServiceContracts</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
......
/*
Copyright 2015,2016 Chirojeugd-Vlaanderen vzw
Copyright 2015,2016,2017 Chirojeugd-Vlaanderen vzw
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
......@@ -15,9 +15,7 @@
*/
using System;
using Chiro.CiviCrm.Api.DataContracts;
using Chiro.Kip.ServiceContracts.DataContracts;
using System.Diagnostics;
namespace Chiro.CiviSync.Logic
{
......@@ -43,13 +41,13 @@ public static string StraatNrBus(Adres src)
/// </summary>
/// <param name="src">Adres</param>
/// <returns>Het Civi-provincie-ID voor dat adres.</returns>
public static int ProvincieId(Adres src)
public static int? ProvincieId(Adres src)
{
if (!String.IsNullOrEmpty(src.Land) &&
!src.Land.StartsWith("Belgi", StringComparison.InvariantCultureIgnoreCase))
{
// trek uw plan met provincies in het buitenland.
return 0;
return null;
}
int nr = int.Parse(src.PostNr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment