Esempio n. 1
0
        public void AddCommand_delegates()
        {
            var sqlGenerator = new Mock <ISqlGenerator>().Object;
            var factory      = new TestModificationCommandBatchFactory(sqlGenerator);

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

            factory.AddCommand(modificationCommandBatchMock.Object, mockModificationCommand);

            modificationCommandBatchMock.Verify(mcb => mcb.AddCommand(mockModificationCommand));
        }
        public void AddCommand_delegates()
        {
            var sqlGenerator = new Mock <ISqlGenerator>().Object;
            var factory      = new TestModificationCommandBatchFactory(sqlGenerator);

            var modificationCommandBatchMock = new Mock <ModificationCommandBatch>(sqlGenerator);
            var mockModificationCommand      = new Mock <ModificationCommand>(
                "T",
                "S",
                new ParameterNameGenerator(),
                (Func <IProperty, IRelationalPropertyExtensions>)(p => p.Relational()),
                Mock.Of <IRelationalValueBufferFactoryFactory>()).Object;

            factory.AddCommand(modificationCommandBatchMock.Object, mockModificationCommand);

            modificationCommandBatchMock.Verify(mcb => mcb.AddCommand(mockModificationCommand));
        }
        public void AddCommand_delegates()
        {
            var sqlGenerator = new Mock<IUpdateSqlGenerator>().Object;
            var factory = new TestModificationCommandBatchFactory(sqlGenerator);

            var modificationCommandBatchMock = new Mock<ModificationCommandBatch>(sqlGenerator);
            var mockModificationCommand = new Mock<ModificationCommand>(
                "T",
                "S",
                new ParameterNameGenerator(),
                (Func<IProperty, IRelationalPropertyAnnotations>)(p => p.TestProvider()),
                Mock.Of<IRelationalValueBufferFactoryFactory>()).Object;

            factory.AddCommand(modificationCommandBatchMock.Object, mockModificationCommand);

            modificationCommandBatchMock.Verify(mcb => mcb.AddCommand(mockModificationCommand));
        }