-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from digipost/f_testdekning
F testdekning - OK
- Loading branch information
Showing
33 changed files
with
879 additions
and
457 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
72 changes: 36 additions & 36 deletions
72
Digipost.Api.Client.Domain/Message.cs → ...post.Api.Client.Domain/Message/Message.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,37 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
using System.Diagnostics; | ||
using System.Xml.Serialization; | ||
|
||
namespace Digipost.Api.Client.Domain | ||
{ | ||
[Serializable] | ||
[DebuggerStepThrough] | ||
[DesignerCategory("code")] | ||
[XmlType(TypeName = "message", Namespace = "http://api.digipost.no/schema/v6")] | ||
[XmlRoot(Namespace = "http://api.digipost.no/schema/v6", IsNullable = false)] | ||
public class Message : RequestContent | ||
{ | ||
private Message() | ||
{ | ||
/**Must exist for serialization.**/ | ||
} | ||
|
||
public Message(Recipient recipient, Document primaryDocument) | ||
{ | ||
Recipient = recipient; | ||
PrimaryDocument = primaryDocument; | ||
Attachments = new List<Document>(); | ||
} | ||
|
||
[XmlElement("recipient")] | ||
public Recipient Recipient { get; set; } | ||
|
||
[XmlElement("primary-document")] | ||
public Document PrimaryDocument { get; set; } | ||
|
||
[XmlElement("attachment")] | ||
public List<Document> Attachments { get; set; } | ||
} | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
using System.Diagnostics; | ||
using System.Xml.Serialization; | ||
|
||
namespace Digipost.Api.Client.Domain | ||
{ | ||
[Serializable] | ||
[DebuggerStepThrough] | ||
[DesignerCategory("code")] | ||
[XmlType(TypeName = "message", Namespace = "http://api.digipost.no/schema/v6")] | ||
[XmlRoot(Namespace = "http://api.digipost.no/schema/v6", IsNullable = false)] | ||
public class Message : RequestContent | ||
{ | ||
private Message() | ||
{ | ||
/**Must exist for serialization.**/ | ||
} | ||
|
||
public Message(Recipient recipient, Document primaryDocument) | ||
{ | ||
Recipient = recipient; | ||
PrimaryDocument = primaryDocument; | ||
Attachments = new List<Document>(); | ||
} | ||
|
||
[XmlElement("recipient")] | ||
public Recipient Recipient { get; set; } | ||
|
||
[XmlElement("primary-document")] | ||
public Document PrimaryDocument { get; set; } | ||
|
||
[XmlElement("attachment")] | ||
public List<Document> Attachments { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
132 changes: 66 additions & 66 deletions
132
Digipost.Api.Client.Domain/Recipient.cs → ....Api.Client.Domain/Recipient/Recipient.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,67 @@ | ||
using System; | ||
using System.ComponentModel; | ||
using System.Diagnostics; | ||
using System.Xml.Serialization; | ||
using Digipost.Api.Client.Domain.Enums; | ||
using Digipost.Api.Client.Domain.Print; | ||
|
||
namespace Digipost.Api.Client.Domain | ||
{ | ||
[Serializable] | ||
[DebuggerStepThrough] | ||
[DesignerCategory("code")] | ||
[XmlType(TypeName = "message-recipient", Namespace = "http://api.digipost.no/schema/v6")] | ||
[XmlRoot("message-recipient", Namespace = "http://api.digipost.no/schema/v6", IsNullable = false)] | ||
public class Recipient | ||
{ | ||
private Recipient() | ||
{ | ||
/**Must exist for serialization.**/ | ||
} | ||
|
||
/// <summary> | ||
/// Preferred digital delivery with fallback to physical delivery. | ||
/// </summary> | ||
public Recipient(RecipientByNameAndAddress recipientByNameAndAddress, PrintDetails printDetails = null) | ||
{ | ||
IdentificationValue = recipientByNameAndAddress; | ||
IdentificationType = IdentificationChoice.NameAndAddress; | ||
PrintDetails = printDetails; | ||
} | ||
|
||
/// <summary> | ||
/// Preferred digital delivery with fallback to physical delivery. | ||
/// </summary> | ||
public Recipient(IdentificationChoice identificationChoice, string id, PrintDetails printDetails = null) | ||
{ | ||
if (identificationChoice == IdentificationChoice.NameAndAddress) | ||
throw new ArgumentException(string.Format("Not allowed to set identification choice by {0} " + | ||
"when using string as id", | ||
IdentificationChoice.NameAndAddress)); | ||
IdentificationValue = id; | ||
IdentificationType = identificationChoice; | ||
PrintDetails = printDetails; | ||
} | ||
|
||
/// <summary> | ||
/// Preferred physical delivery. (not Digital) | ||
/// </summary> | ||
public Recipient(PrintDetails printDetails) | ||
{ | ||
PrintDetails = printDetails; | ||
} | ||
|
||
[XmlElement("digipost-address", typeof (string))] | ||
[XmlElement("name-and-address", typeof (RecipientByNameAndAddress))] | ||
[XmlElement("organisation-number", typeof (string))] | ||
[XmlElement("personal-identification-number", typeof (string))] | ||
[XmlChoiceIdentifier("IdentificationType")] | ||
public object IdentificationValue { get; set; } | ||
|
||
[XmlElement("print-details")] | ||
public PrintDetails PrintDetails { get; set; } | ||
|
||
[XmlIgnore] | ||
public IdentificationChoice IdentificationType { get; set; } | ||
} | ||
using System; | ||
using System.ComponentModel; | ||
using System.Diagnostics; | ||
using System.Xml.Serialization; | ||
using Digipost.Api.Client.Domain.Enums; | ||
using Digipost.Api.Client.Domain.Print; | ||
|
||
namespace Digipost.Api.Client.Domain | ||
{ | ||
[Serializable] | ||
[DebuggerStepThrough] | ||
[DesignerCategory("code")] | ||
[XmlType(TypeName = "message-recipient", Namespace = "http://api.digipost.no/schema/v6")] | ||
[XmlRoot("message-recipient", Namespace = "http://api.digipost.no/schema/v6", IsNullable = false)] | ||
public class Recipient | ||
{ | ||
private Recipient() | ||
{ | ||
/**Must exist for serialization.**/ | ||
} | ||
|
||
/// <summary> | ||
/// Preferred digital delivery with fallback to physical delivery. | ||
/// </summary> | ||
public Recipient(RecipientByNameAndAddress recipientByNameAndAddress, PrintDetails printDetails = null) | ||
{ | ||
IdentificationValue = recipientByNameAndAddress; | ||
IdentificationType = IdentificationChoice.NameAndAddress; | ||
PrintDetails = printDetails; | ||
} | ||
|
||
/// <summary> | ||
/// Preferred digital delivery with fallback to physical delivery. | ||
/// </summary> | ||
public Recipient(IdentificationChoice identificationChoice, string id, PrintDetails printDetails = null) | ||
{ | ||
if (identificationChoice == IdentificationChoice.NameAndAddress) | ||
throw new ArgumentException(string.Format("Not allowed to set identification choice by {0} " + | ||
"when using string as id", | ||
IdentificationChoice.NameAndAddress)); | ||
IdentificationValue = id; | ||
IdentificationType = identificationChoice; | ||
PrintDetails = printDetails; | ||
} | ||
|
||
/// <summary> | ||
/// Preferred physical delivery. (not Digital) | ||
/// </summary> | ||
public Recipient(PrintDetails printDetails) | ||
{ | ||
PrintDetails = printDetails; | ||
} | ||
|
||
[XmlElement("digipost-address", typeof (string))] | ||
[XmlElement("name-and-address", typeof (RecipientByNameAndAddress))] | ||
[XmlElement("organisation-number", typeof (string))] | ||
[XmlElement("personal-identification-number", typeof (string))] | ||
[XmlChoiceIdentifier("IdentificationType")] | ||
public object IdentificationValue { get; set; } | ||
|
||
[XmlElement("print-details")] | ||
public PrintDetails PrintDetails { get; set; } | ||
|
||
[XmlIgnore] | ||
public IdentificationChoice IdentificationType { get; set; } | ||
} | ||
} |
Oops, something went wrong.