コード例 #1
0
 public TestCommandBatchPreparer(
     ModificationCommandBatchFactory modificationCommandBatchFactory,
     ParameterNameGeneratorFactory parameterNameGeneratorFactory,
     ModificationCommandComparer modificationCommandComparer)
     : base(modificationCommandBatchFactory, parameterNameGeneratorFactory, modificationCommandComparer)
 {
 }
コード例 #2
0
 public TestCommandBatchPreparer(
     ModificationCommandBatchFactory modificationCommandBatchFactory,
     ParameterNameGeneratorFactory parameterNameGeneratorFactory,
     ModificationCommandComparer modificationCommandComparer,
     IBoxedValueReaderSource boxedValueReaderSource)
     : base(modificationCommandBatchFactory, parameterNameGeneratorFactory, modificationCommandComparer, boxedValueReaderSource)
 {
 }
コード例 #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()));
        }
コード例 #4
0
        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()));
        }
コード例 #5
0
 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()));
 }
コード例 #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));
        }
コード例 #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);
        }