public void VifGeneratorGenerateVif_GivenValidInputParam_ShouldReturnValidVifStringObject() { var vifHeader = (VifHeader)GetVifHeader(); var vifTrailer = (VifTrailer)GetVifTrailer(); var vifDetails = GetVifDetails(); var vifGen = new VifGenerator(vifHeader, vifDetails, vifTrailer); var actual = vifGen.GenerateVif(); var expected = new StringBuilder(); expected.AppendLine("A38356BQL201505200830290820376"+GetEmptyString(120, " ")); //Header 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 expected.AppendLine("Z2015052000000000000050000000000000000500000000200002" + GetEmptyString(40, "0")); //Trailer Assert.AreEqual(expected.ToString().Trim(), actual); }
public void WhenStringFromObjectCalled() { var generator = new VifGenerator(header, details, trailer); output = generator.GenerateVif(); }