public void CreateDbCommandDefinition_returns_wrapped_legacy_command_definition()
        {
            var commandDefinition =
                new LegacyDbProviderServicesWrapper(new Mock<SystemDataCommon.DbProviderServices>().Object)
                    .CreateCommandDefinition(
                        new LegacyDbProviderManifestWrapper(LegacyProviderManifest),
                        new DbQueryCommandTree(CreateMetadataWorkspace(), DataSpace.SSpace, DbExpressionBuilder.Constant(42), false));

            Assert.NotNull(commandDefinition);
            Assert.IsType<LegacyDbCommandDefinitionWrapper>(commandDefinition);
        }
Example #2
0
        public void CreateDbCommandDefinition_returns_wrapped_legacy_command_definition()
        {
            var commandDefinition =
                new LegacyDbProviderServicesWrapper(new Mock <SystemDataCommon.DbProviderServices>().Object)
                .CreateCommandDefinition(
                    new LegacyDbProviderManifestWrapper(LegacyProviderManifest),
                    new DbQueryCommandTree(CreateMetadataWorkspace(), DataSpace.SSpace, DbExpressionBuilder.Constant(42), false));

            Assert.NotNull(commandDefinition);
            Assert.IsType <LegacyDbCommandDefinitionWrapper>(commandDefinition);
        }
        public EdmExtensionTests()
        {
            var providerServices =
                new LegacyDbProviderServicesWrapper(
                    ((Legacy.DbProviderServices)
                     ((IServiceProvider)Legacy.DbProviderFactories.GetFactory("System.Data.SqlClient"))
                         .GetService(typeof(Legacy.DbProviderServices))));

            var mockResolver = new Mock<IDbDependencyResolver>();
            mockResolver.Setup(
                r => r.GetService(
                    It.Is<Type>(t => t == typeof(DbProviderServices)),
                    It.IsAny<string>())).Returns(providerServices);

            resolver = mockResolver.Object;
        }