//-----------------------------------------------------------------------------------------------------------------------------------------------------

        public MicroserviceController(
            RunMode runMode,
            string microservicePath,
            MicroserviceConfig microserviceConfig,
            EnvironmentConfig environmentConfig,
            string cliDirectory = null)
        {
            _runMode            = runMode;
            _microservicePath   = microservicePath;
            _microserviceConfig = microserviceConfig;
            _environmentConfig  = environmentConfig;
            _cliDirectory       = cliDirectory;
            _exceptions         = ImmutableList <Exception> .Empty;
        }
        public void SerializeMicroserviceConfig()
        {
            //-- arrange

            var config = new MicroserviceConfig()
            {
                Name             = "test",
                InjectionAdapter = new MicroserviceConfig.InjectionAdapterElement()
                {
                    Assembly = "InjectionAdapter"
                },
                FrameworkModules = new MicroserviceConfig.ModuleConfig[]
                {
                    new MicroserviceConfig.ModuleConfig()
                    {
                        Assembly = "FrameworkAssembly"
                    }
                },
                ApplicationModules = new MicroserviceConfig.ModuleConfig[]
                {
                    new MicroserviceConfig.ModuleConfig()
                    {
                        Assembly = "TestAssembly"
                    }
                }
            };

            //-- act

            var serializer = new XmlSerializer(typeof(MicroserviceConfig));
            var writer     = new StringWriter();

            serializer.Serialize(writer, config);

            var xml = writer.ToString();
        }
Example #3
0
 public BlogService(HttpClient httpClient, MicroserviceConfig micros)
 {
     this.httpClient = httpClient;
     this.micros     = micros;
 }