private GroupHeader39 GenerateGroupHeader_GrpHdr(
            DateTime generationDateTime,
            DirectDebitRemittance directDebitRemmitance,
            PartyIdentification32 initiationParty_InitgPty)
        {
            Authorisation1Choice[] authorisation_authstn = new Authorisation1Choice[] { null };

            DateTime creatingdDateTime =
                DateTime.SpecifyKind(generationDateTime, DateTimeKind.Unspecified).Truncate(TimeSpan.FromSeconds(1));

            GroupHeader39 groupHeader_grpHdr = new GroupHeader39(
                directDebitRemmitance.MessageID,                        //<MsgID>
                creatingdDateTime,                                      //<CreDtTm>
                authorisation_authstn,                                  //<Authstn> - Not used in SEPA. Array of null instead of null to avoid null reference exception
                directDebitRemmitance.NumberOfTransactions.ToString(),  //<NbOfTxs>
                directDebitRemmitance.ControlSum,                       //<CtrlSum>
                true,                                                   //Control sum is specified
                initiationParty_InitgPty,                               //<InitgPty>
                null);                                                  //<FwdgAgt> - Not used by creditor in SEPA COR

            return groupHeader_grpHdr;
        }
        public void GroupHeader_GrpHdr_IsCorrectlyCreated()
        {
            PartyIdentification32 initiationParty_initgPty = XMLSerializer.XMLDeserializeFromFile<PartyIdentification32>(@"XML Test Files\InitiatingParty.xml", "InitgPty", xMLNamespace);

            Authorisation1Choice[] authorisation_authstn = new Authorisation1Choice[] { null };

            DateTime creatingdDateTime =
                DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Unspecified).Truncate(TimeSpan.FromSeconds(1));

            GroupHeader39 groupHeader_grpHdr = new GroupHeader39(
                "TestSEPARemitance0001",    //<MsgID>
                creatingdDateTime,          //<CreDtTm>
                authorisation_authstn,      //<Authstn> - Not used in SEPA. Array of null instead of null to avoid null reference exception
                "2",                        //<NbOfTxs>
                (decimal)100.50,            //<CtrlSum>
                true,                       //Control sum is specified
                initiationParty_initgPty,   //<InitgPty>
                null);                      //<FwdgAgt> - Not used by creditor in SEPA COR

            string xmlString = XMLSerializer.XMLSerializeToString<GroupHeader39>(groupHeader_grpHdr, "GrpHdr", xMLNamespace);
            string validatingErrors = XMLValidator.ValidateXMLNodeThroughModifiedXSD(
                "GrpHdr", "GroupHeader39", xMLNamespace, xmlString, xSDFilePath);
            Assert.AreEqual("", validatingErrors);
        }