public void Given1(string batchNumber)
        {
            var batch = batchNumber.PadRight(8, ' ');

            using (var context = GenerateCorrespondingVoucherBus.CreateContext())
            {
                context.Database.ExecuteSqlCommand("DELETE FROM [Queue] WHERE [S_BATCH] = @p0", batch);
                context.Database.ExecuteSqlCommand("DELETE FROM [NabChq] WHERE [S_BATCH] = @p0", batch);
                context.Database.ExecuteSqlCommand("DELETE FROM [DB_INDEX] WHERE [BATCH] = @p0", batch);
            }
        }
Ejemplo n.º 2
0
 public void Given1(string firstTraceNumber, string secondTraceNumber)
 {
     using (var context = GenerateCorrespondingVoucherBus.CreateContext())
     {
         context.Database.ExecuteSqlCommand("DELETE FROM [Queue] WHERE [S_TRACE] = @p0", firstTraceNumber);
         context.Database.ExecuteSqlCommand("DELETE FROM [NabChq] WHERE [S_TRACE] = @p0", firstTraceNumber);
         context.Database.ExecuteSqlCommand("DELETE FROM [DB_INDEX] WHERE [TRACE] = @p0", firstTraceNumber);
         context.Database.ExecuteSqlCommand("DELETE FROM [Queue] WHERE [S_TRACE] = @p0", secondTraceNumber);
         context.Database.ExecuteSqlCommand("DELETE FROM [NabChq] WHERE [S_TRACE] = @p0", secondTraceNumber);
         context.Database.ExecuteSqlCommand("DELETE FROM [DB_INDEX] WHERE [TRACE] = @p0", secondTraceNumber);
     }
 }
Ejemplo n.º 3
0
        public void Given2(string batchNumber, Table table)
        {
            using (var context = GenerateCorrespondingVoucherBus.CreateContext())
            {
                var dbRows = table.CreateSet <DipsNabChq>();

                foreach (var dbRow in dbRows)
                {
                    context.NabChqPods.Add(dbRow);
                }

                context.SaveChanges();
            }
        }
Ejemplo n.º 4
0
        public void Given1(string batchNumber, Table table)
        {
            var batch = batchNumber.PadRight(8, ' ');

            using (var context = GenerateCorrespondingVoucherBus.CreateContext())
            {
                context.Database.ExecuteSqlCommand("DELETE FROM [Queue] WHERE [S_BATCH] = @p0", batch);
                context.Database.ExecuteSqlCommand("DELETE FROM [NabChq] WHERE [S_BATCH] = @p0", batch);
                context.Database.ExecuteSqlCommand("DELETE FROM [DB_INDEX] WHERE [BATCH] = @p0", batch);

                var queue = table.CreateInstance <DipsQueue>();

                context.Queues.Add(queue);

                context.SaveChanges();
            }
        }
Ejemplo n.º 5
0
        public void Then1(Table table)
        {
            var expected = table.CreateInstance <DipsQueue>();

            DipsQueue actual;

            using (var context = GenerateCorrespondingVoucherBus.CreateContext())
            {
                actual = context.Queues.SingleOrDefault(q => q.S_TRACE == expected.S_TRACE);
            }

            Assert.IsNotNull(actual, "Could not find queue row with trace {0} in the database", expected.S_TRACE);

            TrimAllProperties(actual);

            table.CompareToInstance(actual);
        }
Ejemplo n.º 6
0
        public void Then3(Table table)
        {
            var expected = table.CreateSet <DipsDbIndex>();

            var dbRows = new List <DipsDbIndex>();

            using (var context = GenerateCorrespondingVoucherBus.CreateContext())
            {
                foreach (var dbIndex in expected)
                {
                    var actual = context.DbIndexes.SingleOrDefault(i => i.TRACE == dbIndex.TRACE);

                    Assert.IsNotNull(actual, string.Format("Could not find DB_INDEX row with trace {0} in the database", dbIndex.TRACE));

                    TrimAllProperties(actual);

                    dbRows.Add(actual);
                }
            }

            table.CompareToSet(dbRows);
        }
Ejemplo n.º 7
0
        public void Then2(Table table)
        {
            var expected = table.CreateSet <DipsNabChq>();

            var dbRows = new List <DipsNabChq>();

            using (var context = GenerateCorrespondingVoucherBus.CreateContext())
            {
                foreach (var chqPod in expected)
                {
                    var actual = context.NabChqPods.SingleOrDefault(c => c.S_TRACE == chqPod.S_TRACE);

                    Assert.IsNotNull(actual, string.Format("Could not find NabChqScanPod row with trace {0} in the database", chqPod.S_TRACE));

                    TrimAllProperties(actual);

                    dbRows.Add(actual);
                }
            }

            table.CompareToSet(dbRows);
        }