public void ToPersonRelationType_NoPnr_Empty( [Values(null, "")] string pnr) { var auth = new ParentalAuthorityType() { RelationPNR = pnr, RelationshipType = 5 }; var ret = ParentalAuthorityType.ToPersonRelationType(new ParentalAuthorityType[] { auth }, new ParentsInformationType(), cpr => Guid.NewGuid()); Assert.AreEqual(0, ret.Length); }
public void ToPersonRelationType_InvalidType_Exception( [Values(0, 1, -2, 7)] decimal relType) { var auth = new ParentalAuthorityType() { RelationshipType = relType }; var par = new ParentsInformationType(); auth.ToPersonRelationType(par, cpr => Guid.NewGuid()); }
public void ToPersonRelationType_PnrWithEndDate_CorrectEndDate( [Values("1234567890", "0123456789")] string pnr) { var auth = new ParentalAuthorityType() { RelationPNR = pnr, CustodyEndDate = DateTime.Today, RelationshipType = 5 }; var ret = auth.ToPersonRelationType(new ParentsInformationType(), cpr => Guid.NewGuid()); Assert.AreEqual(DateTime.Today, ret.Virkning.TilTidspunkt.ToDateTime()); }
public void ToPersonRelationType_PnrWithStartDate_NullStartDate( [Values("1234567890", "0123456789")] string pnr) { var auth = new ParentalAuthorityType() { RelationPNR = pnr, RelationPNRStartDate = DateTime.Today, RelationshipType = 5 }; var ret = auth.ToPersonRelationType(new ParentsInformationType(), cpr => Guid.NewGuid()); Assert.IsNull(ret.Virkning.FraTidspunkt.ToDateTime()); }
public void ToPersonRelationType_NoTypeOrParents_Exception() { var auth = new ParentalAuthorityType(); auth.ToPersonRelationType(null, cpr => Guid.NewGuid()); }