public void Test1()
        {
            var header = new Hnshk(2, "1234", "0", DateTime.Now, 76550000, "760794644");
            var ser    = header.Serialize();

            var header2 = FinTsParser.Parse <Hnshk>(ser);

            Assert.Equal(ser, header2.Serialize());
        }
Beispiel #2
0
        public void ShouldParse()
        {
            var input = "?+?:?'???@";
            var prepare = FinTsParser.UnescapeInput(input);

            var el = FinTsParser.Parse<AlphanumericElement>(prepare);

            Assert.Equal("+:'?@", el.Value);            
        }
        public void Test1()
        {
            var header1     = new Hnhbk(1, 0);
            var serialized1 = header1.Serialize();

            var header2     = FinTsParser.Parse <Hnhbk>(serialized1);
            var serialized2 = header2.Serialize();

            Assert.Equal(serialized1, serialized2);
        }
        public void Test1()
        {
            var feedback1   = CreateExample();
            var serialized1 = feedback1.Serialize();

            var feedback2   = FinTsParser.Parse <ResponseFeedback>(serialized1);
            var serialized2 = feedback2.Serialize();

            Assert.Equal(serialized1, serialized2);
        }
Beispiel #5
0
        public static void TestSerialization <T>(T element)
            where T : IFinTsElement, new()
        {
            var ser = element.Serialize();

            var element2 = FinTsParser.Parse <T>(ser);
            var ser2     = element2.Serialize();

            Assert.Equal(ser, ser2);
        }
        public void Test1()
        {
            var footer1     = new Hnhbs(1, 0);
            var serialized1 = footer1.Serialize();

            var footer2     = FinTsParser.Parse <Hnhbs>(serialized1);
            var serialized2 = footer2.Serialize();

            Assert.Equal(serialized1, serialized2);
        }
Beispiel #7
0
        public override void Parse(string str)
        {
            var regex = new Regex(@"HNVSD:999:1\+@[0-9]+@(.+')'");
            var rest  = regex.Match(str).Groups[1].Value;

            Data = FinTsParser.Parse <T>(rest);
            str  = regex.Replace(str, "");

            base.Parse(str);
        }
Beispiel #8
0
        public void Test1()
        {
            var response1 = new CancellationResponse
            {
                Header   = new Hnhbk(1, 0),
                Feedback = ResponseFeedbackTests.CreateExample(),
                Footer   = new Hnhbs(1, 0)
            };
            var serialized1 = response1.Serialize();

            var response2   = FinTsParser.Parse <CancellationResponse>(serialized1);
            var serialized2 = response2.Serialize();

            Assert.Equal(serialized1, serialized2);
        }