예제 #1
0
        public void VifGeneratorGetTrailer_GivenValidInputParam_ShouldReturnVifTrailer()
        {
            var vifHeader = (VifHeader)GetVifHeader();
            var vifTrailer = (VifTrailer)GetVifTrailer();
            var vifDetails = GetVifDetails();
            var vifGen = new VifGenerator(vifHeader, vifDetails, vifTrailer);
            var actual = vifGen.GetTrailer();

            Assert.AreEqual("Z2015052000000000000050000000000000000500000000200002" + GetEmptyString(40, "0"), actual);
        }
예제 #2
0
        public void VifGeneratorGetHeader_GivenValidInputParam_ShouldReturnVifHeader()
        {
            var vifHeader = (VifHeader) GetVifHeader();
            var vifTrailer = (VifTrailer) GetVifTrailer();
            var vifDetails = GetVifDetails();
            var vifGen = new VifGenerator(vifHeader, vifDetails, vifTrailer);
            var actual = vifGen.GetHeader();

            Assert.AreEqual("A38356BQL201505200830290820376" + GetEmptyString(120, " "), actual);
        }
예제 #3
0
        public void VifGeneratorGetDetails_GivenValidInputParam_ShouldReturnVifDetails()
        {
            var vifHeader = (VifHeader)GetVifHeader();
            var vifTrailer = (VifTrailer)GetVifTrailer();
            var vifDetails = GetVifDetails();
            var vifGen = new VifGenerator(vifHeader, vifDetails, vifTrailer);
            var actual = vifGen.GetDetails();

            var expected = new StringBuilder();
            expected.AppendLine("D06344406344408302983560002 50   100000003000000030000CY  21267121  2126712120000000700000020000000820000000700000000000000000002 0E00302929" + GetEmptyString(10, " ")); //Detail
            expected.AppendLine("D06333306333308302983560002 50   100000004000000020000CY  21111111  2111111120000000500000020000000620000000500000000000000000002 0E00302929" + GetEmptyString(10, " ")); //Detail
            expected.AppendLine("D06555506333308302983560002 12   100000005000000020000DY  21222222  2111111120000000500000020000000620000000700000020000000800002 0E00302929" + GetEmptyString(10, " ")); //Detail
            expected.AppendLine("D06355506333308302983560002 12   100000006000000030000DY  21555555  2111111120000000500000020000000620000000900000020000001000002 0E00302929" + GetEmptyString(10, " ")); //Detail

            Assert.AreEqual(expected.ToString(), actual);
        }
예제 #4
0
 public void WhenStringFromObjectCalled()
 {
     var generator = new VifGenerator(header, details, trailer);
     output = generator.GenerateVif();
 }