Ejemplo n.º 1
0
        public Model( ModelParametersDTO parameters, 
                      ModelDependenciesDTO dependencies )
        {
            this.Initialize( parameters, dependencies );

            this.UpdateCachedProperties();
        }
Ejemplo n.º 2
0
        private void InitializePrivateProperties( ModelParametersDTO @params, ModelDependenciesDTO dependencies )
        {
            this._linkFactory = dependencies.LinkFactory;
            this._osChecker = dependencies.OsChecker;

            var factoryParam = new OsConfigurationParameters
            {
                ApplicationInfo = @params.ApplicationInfo,
                OsConfigurationInfo = @params.OsConfigurationInfo
            };
            this._osConfiguration = dependencies.OsConfigurationFactory.Get( factoryParam );

            this._osConfigurationInfo = @params.OsConfigurationInfo;
        }
Ejemplo n.º 3
0
        private void InitializePublicProperties( ModelParametersDTO @params )
        {
            this.IsInstalled = @params.IsInstalled;

            var links = new List<ILink>();
            foreach ( var linkInfo in this._osConfigurationInfo.Links )
            {
                var paramsDTO = new Win32.Model.LinkParametersDTO
                {
                    ApplicationInfo = @params.ApplicationInfo, 
                    LinkInfo = linkInfo
                };
                var link = this._linkFactory.Get( paramsDTO );
                links.Add( link );
            }
            this.Links = links;
        }
Ejemplo n.º 4
0
 private void Initialize( ModelParametersDTO @params, ModelDependenciesDTO dependencies )
 {
     this.InitializeCommands();
     this.InitializePrivateProperties( @params, dependencies );
     this.InitializePublicProperties( @params );
 }
Ejemplo n.º 5
0
        private void InitializeTarget()
        {
            var parameters = new ModelParametersDTO
            {
                ApplicationInfo = Arg.IsAny<IApplicationInfo>(),
                IsInstalled = this._isInstalledValue,
                OsConfigurationInfo = Mock.Create<IOsConfigurationInfo>()
            };

            var dependencies = new ModelDependenciesDTO
            {
                LinkFactory = null,
                OsConfigurationFactory = this.CreateOsConfigFactoryMock(),
                OsChecker = this.CreateOsCheckerMock()
            };
            this._target = new Model( parameters, dependencies );
        }