Пример #1
0
        public void InitializeTests()
        {
            const string header = "DATE,NAME,ACCOUNT,COUNTERACCOUNT,CODE,KIND,AMOUNT,KIND,REMARKS";

            mFileWithOnlyHeader = new TestFile("FileWithOnlyHeader", header);

            mFileWithOneRecord = new TestFile("FileWithOneRecord", header);
            mFileWithOneRecord.AddRecord("\"19780921\",\"Freerk\",\"1234567890\",\"0987654321\",\"A\",\"AF\",\"2109,78\",\"PIN\",\"Remarks\"",
                                         new Transaction()
            {
                Date           = new DateTime(1978, 09, 21),
                Name           = "FREERK",
                Account        = "1234567890",
                CounterAccount = "0987654321",
                Code           = "A",
                MutationType   = MutationType.Debit,
                Amount         = -2109.78m,
                MutationKind   = "PIN",
                Remarks        = "REMARKS"
            });

            mFileWithMultipleRecords = new TestFile("FileWithMultipleRecords", header);
            mFileWithMultipleRecords.AddRecord("\"19780921\",\"Freerk\",\"1234567890\",\"0987654321\",\"A\",\"AF\",\"2109,78\",\"PIN\",\"Remarks\"",
                                               new Transaction()
            {
                Date           = new DateTime(1978, 09, 21),
                Name           = "FREERK",
                Account        = "1234567890",
                CounterAccount = "0987654321",
                Code           = "A",
                MutationType   = MutationType.Debit,
                Amount         = -2109.78m,
                MutationKind   = "PIN",
                Remarks        = "REMARKS"
            });

            // Because the remark is 'Duplicate' the data service stub will report this record as a duplicate transaction.
            mFileWithMultipleRecords.AddRecord("\"19780921\",\"Freerk\",\"1234567890\",\"0987654321\",\"A\",\"AF\",\"2109,78\",\"PIN\",\"Duplicate\"",
                                               new Transaction()
            {
                Date           = new DateTime(1978, 09, 21),
                Name           = "FREERK",
                Account        = "1234567890",
                CounterAccount = "0987654321",
                Code           = "A",
                MutationType   = MutationType.Debit,
                Amount         = -2109.78m,
                MutationKind   = "PIN",
                Remarks        = "REMARKS"
            });

            mFileWithMultipleRecords.AddRecord("\"19790713\",\"Djuke\",\"2345678901\",\"9876543210\",\"B\",\"BIJ\",\"19797,13\",\"ACC\",\"\"",
                                               new Transaction()
            {
                Date           = new DateTime(1979, 07, 13),
                Name           = "DJUKE",
                Account        = "2345678901",
                CounterAccount = "9876543210",
                Code           = "B",
                MutationType   = MutationType.Credit,
                Amount         = 19797.13m,
                MutationKind   = "ACC",
                Remarks        = ""
            });

            mFileWithInvalidRecords = new TestFile("FileWithInvalidRecord", header);
            mFileWithInvalidRecords.AddRecord("\"19780921\",\"Freerk\",\"1234567890\",\"0987654321\",\"A\",\"AF\",\"2109,78\",\"PIN\",\"Remarks\"", null);
            // Invalid date
            mFileWithInvalidRecords.AddRecord("\"190713\",\"Djuke\",\"2345678901\",\"9876543210\",\"B\",\"BIJ\",\"19797,13\",\"ACC\",\"\"", null);
            // Invalid kind
            mFileWithInvalidRecords.AddRecord("\"19780921\",\"Djuke\",\"2345678901\",\"9876543210\",\"B\",\"WITH\",\"19797,13\",\"ACC\",\"\"", null);
        }