Ejemplo n.º 1
0
 public TestCommandBatchPreparer(
     ModificationCommandBatchFactory modificationCommandBatchFactory,
     ParameterNameGeneratorFactory parameterNameGeneratorFactory,
     ModificationCommandComparer modificationCommandComparer)
     : base(modificationCommandBatchFactory, parameterNameGeneratorFactory, modificationCommandComparer)
 {
 }
Ejemplo n.º 2
0
 public TestCommandBatchPreparer(
     ModificationCommandBatchFactory modificationCommandBatchFactory,
     ParameterNameGeneratorFactory parameterNameGeneratorFactory,
     ModificationCommandComparer modificationCommandComparer,
     IBoxedValueReaderSource boxedValueReaderSource)
     : base(modificationCommandBatchFactory, parameterNameGeneratorFactory, modificationCommandComparer, boxedValueReaderSource)
 {
 }
Ejemplo n.º 3
0
        private static CommandBatchPreparer CreateCommandBatchPreparer(ModificationCommandBatchFactory modificationCommandBatchFactory = null)
        {
            modificationCommandBatchFactory =
                modificationCommandBatchFactory ?? new TestModificationCommandBatchFactory(new Mock <SqlGenerator>().Object);

            return(new TestCommandBatchPreparer(modificationCommandBatchFactory,
                                                new ParameterNameGeneratorFactory(),
                                                new ModificationCommandComparer()));
        }
        private static CommandBatchPreparer CreateCommandBatchPreparer(ModificationCommandBatchFactory modificationCommandBatchFactory = null)
        {
            modificationCommandBatchFactory =
                modificationCommandBatchFactory ?? new ModificationCommandBatchFactory(new Mock <SqlGenerator>().Object);

            return(new CommandBatchPreparer(modificationCommandBatchFactory,
                                            new ParameterNameGeneratorFactory(),
                                            new BidirectionalAdjacencyListGraphFactory(),
                                            new ModificationCommandComparer()));
        }
 private static CommandBatchPreparer CreateCommandBatchPreparer(ModificationCommandBatchFactory modificationCommandBatchFactory = null)
 {
     return(new CommandBatchPreparer(
                modificationCommandBatchFactory ?? new ModificationCommandBatchFactory(new Mock <SqlGenerator> {
         CallBase = true
     }.Object, new Mock <DbContextConfiguration>().Object),
                new ParameterNameGeneratorFactory(),
                new BidirectionalAdjacencyListGraphFactory(),
                new ModificationCommandComparer()));
 }
Ejemplo n.º 6
0
        public void AddCommand_delegates()
        {
            var sqlGenerator = new Mock <SqlGenerator>().Object;
            var factory      = new ModificationCommandBatchFactory(sqlGenerator);

            var modificationCommandBatchMock = new Mock <ModificationCommandBatch>();
            var mockModificationCommand      = new Mock <ModificationCommand>().Object;

            factory.AddCommand(modificationCommandBatchMock.Object, mockModificationCommand);

            modificationCommandBatchMock.Verify(mcb => mcb.AddCommand(mockModificationCommand));
        }
Ejemplo n.º 7
0
        public void Create_returns_new_instances()
        {
            var factory = new ModificationCommandBatchFactory(
                new Mock <SqlGenerator>().Object);

            var firstBatch  = factory.Create();
            var secondBatch = factory.Create();

            Assert.NotNull(firstBatch);
            Assert.NotNull(secondBatch);
            Assert.NotSame(firstBatch, secondBatch);
        }