protected VisualisableType(IContainer factory, Type type, VisualisableTypeData data, SubjectOrAssociate subjectOrAssociate)
        {
            if (type == null)
            {
                throw new ArgumentNullResourceException("type", Resources.General_Given_Parameter_Cannot_Be_Null);
            }

            this.doNotUseFactory = factory;
            this.NetType = type;
            this.PersistentDataField = data;
            this.SubjectOrAssociate = subjectOrAssociate;
            this.PersistentDataField.Modifiers = new ModifiersData(type);
            this.AssemblyName = type.Assembly.GetName().Name;
            this.AssemblyFullName = type.Assembly.FullName;
            this.AssemblyFileName = type.Assembly.Location;
            var genericNameHelper = new TypeDescriptorHelper(type);
            this.Id = genericNameHelper.GenerateId(); // It is not reliable to use type.GUID different generic parameters do not yeild different guids.
            this.Name = genericNameHelper.IsGeneric ? genericNameHelper.GenerateName() : type.Name;
            this.AssemblyQualifiedName = type.AssemblyQualifiedName ?? string.Format(CultureInfo.InvariantCulture, "{0}, {1}", type.Name, this.AssemblyFullName);
            this.ThisTypeNamespace = type.Namespace;
            if (type.IsEnum)
            {
                this.EnumMemberCount = Enum.GetNames(type).Length;
            }

            this.SetToolTip(type);
            this.SetAssociations(type);
            this.SetLinesOfCodeAndStaticAssociations(type);
        }
        public static void ClassInitialize(TestContext testContext)
        {
            container = DependencyResolution.IoC.Initialize();
            var contextFactory = container.GetInstance<IDbContextFactory<HealthCheckDbContext>>();
            dbContext = contextFactory.Build();

            Assert.IsNotNull(dbContext);
        }
Example #3
0
        public ScopeContainer(StructureMap.IContainer container)
        {
            if (container == null)
            {
                throw new ArgumentNullException("container");
            }
            this.container = container; 

        }
Example #4
0
        public static RestOptions InitializeAndMockWithStructureMap(this Rest restConfiguration, IContainer container)
        {
            if (container == null)
            {
                throw new ArgumentNullException("container");
            }

            return RestConfigurator.Configure(container, true);
        }
Example #5
0
        public static void SetupHubDistributr(DB_TestingHelper dbTestingHelper, IContainer structureMapContainer)
        {
//hub sql dist
            CokeDataContext ctxHubDist = structureMapContainer.GetInstance<CokeDataContext>();
            TI.trace("Remove all tables from Hub distributr db");
            dbTestingHelper.RemoveAllHubDistTables();
            TI.trace("Setup Hub distributr db");
            dbTestingHelper.SetupHubDistSql(ctxHubDist);
        }
Example #6
0
        /// <summary>
        /// Creates a new instance of the service locator with the provided StructureMap container. This method is used for unit testing.
        /// </summary>
        /// <param name="restConfiguration">The REST configuration object.</param>
        /// <param name="container">The StructureMap container.</param>
        /// <param name="mockContext">A value indicating whether to inject mocked service context.</param>
        /// <returns>The service locator.</returns>
        public static IServiceLocator CreateServiceLocatorForStructureMap(this Rest restConfiguration, IContainer container, bool mockContext)
        {
            if (restConfiguration == null)
            {
                throw new ArgumentNullException("restConfiguration");
            }

            if (container == null)
            {
                throw new ArgumentNullException("container");
            }

            return RestConfigurator.CreateServiceLocator(container, mockContext);
        }
Example #7
0
        protected BaseStage(ILog log, IContainer container)
        {
            if (log == null)
            {
                throw new ArgumentNullException(nameof(log));
            }

            if (container == null)
            {
                throw new ArgumentNullException(nameof(container));
            }

            m_id = Guid.NewGuid();
            m_log = log;
            m_container = container;
            m_keyProvider = RequiredKeyProvider.Create(this);
        }
        public static void ClassCleanup()
        {
            dbContext.Dispose();

            if (!dbCreated)
            {
                return;
            }

            var builder =
                new SqlConnectionStringBuilder(
                    System.Configuration.ConfigurationManager.ConnectionStrings["HealthCheckEntities"].ConnectionString);

            using (var conn = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["HealthCheckEntities"].ConnectionString))
            {
                conn.Open();
                var command = conn.CreateCommand();
                command.CommandText =
                    string.Format("use master; alter database {0} set single_user with rollback immediate; drop database {0}", builder.InitialCatalog);
                command.ExecuteNonQuery();
            }

            container = null;
        }
 public static Configure StructureMap(this Configure config, StructureMap.IContainer container)
 {
     config.Container = new Internal.Container(container);
     return(config);
 }
 public StructureMapContainerAdapter(StructureMap.IContainer container)
 {
     _container = container;
 }
 public RepositoryFactory(Nuclear.Messaging.Bus bus, StructureMap.IContainer container)
 {
     // TODO: Complete member initialization
     this.bus       = bus;
     this.container = container;
 }
Example #12
0
 public StructureMapModuleRegistrar(StructureMap.IContainer container)
 {
     this._container = container;
     //Register interception behaviour if any
 }
Example #13
0
 public StructureMapAdapter(StructureMap.IContainer structureMapContainer)
 {
     this.structureMapContainer = structureMapContainer;
 }
Example #14
0
 public ObjectProvider(StructureMap.IContainer container)
 {
     _container = container;
 }
 public void Init()
 {
     // Uses System Under Test (WebApi) for IoC/DI initializations.
     _smContainer = IoC.Initialize();
 }
 public StructureMapDependencyResolver(StructureMap.IContainer container)
 {
     _container = container;
 }
Example #17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="StructureMapDependencyResolver"/> class.
 /// </summary>
 /// <param name="container">
 /// The container.
 /// </param>
 public StructureMapDependencyResolver(StructureMap.IContainer container)
     : base(container)
 {
 }
Example #18
0
 /// <summary>
 /// The begin scope.
 /// </summary>
 /// <returns>
 /// The System.Web.Http.Dependencies.IDependencyScope.
 /// </returns>
 public IDependencyScope BeginScope()
 {
     StructureMap.IContainer child = this.Container.GetNestedContainer();
     return(new StructureMapDependencyResolver(child));
 }
Example #19
0
 public Container(StructureMap.IContainer container)
 {
     _container = container;
 }