public ServerInfrastructureSettings GetInfrastructure()
        {
            _client.Executor.CheckApiServerVersion();
            IRestRequest request = _client.Builder.GetInfrastructureSettings();
            ApiInfrastructureSettings apiInfrastructureSettings =
                _client.Executor.DoSyncApiCall <ApiInfrastructureSettings>(request, DracoonRequestExecutor.RequestType.GetInfrastructureSettings);

            return(SettingsMapper.FromApiInfrastructureSettings(apiInfrastructureSettings));
        }
Пример #2
0
        public void FromApiInfrastructureSettings_Null()
        {
            // ARRANGE
            ServerInfrastructureSettings expected = null;
            ApiInfrastructureSettings    param    = null;

            // ACT
            ServerInfrastructureSettings actual = SettingsMapper.FromApiInfrastructureSettings(param);

            // ASSERT
            Assert.Equal(expected, actual, new ServerInfrastructureSettingsComparer());
        }
Пример #3
0
        internal static ServerInfrastructureSettings FromApiInfrastructureSettings(ApiInfrastructureSettings apiInfrastructureConfig)
        {
            if (apiInfrastructureConfig == null)
            {
                return(null);
            }

            ServerInfrastructureSettings infrastructure = new ServerInfrastructureSettings {
                MediaServerConfigEnabled = apiInfrastructureConfig.MediaServerConfigEnabled,
                S3DefaultRegion          = apiInfrastructureConfig.S3DefaultRegion,
                SmsConfigEnabled         = apiInfrastructureConfig.SmsConfigEnabled,
                S3EnforceDirectUpload    = apiInfrastructureConfig.S3EnforceDirectUpload
            };

            return(infrastructure);
        }
Пример #4
0
        public void FromApiInfrastructureSettings()
        {
            // ARRANGE
            ServerInfrastructureSettings expected = FactoryServerSettings.ServerInfrastructureSettings;

            ApiInfrastructureSettings param = new ApiInfrastructureSettings {
                MediaServerConfigEnabled = expected.MediaServerConfigEnabled,
                S3DefaultRegion          = expected.S3DefaultRegion,
                SmsConfigEnabled         = expected.SmsConfigEnabled,
                S3EnforceDirectUpload    = expected.S3EnforceDirectUpload
            };

            // ACT
            ServerInfrastructureSettings actual = SettingsMapper.FromApiInfrastructureSettings(param);

            // ASSERT
            Assert.Equal(expected, actual, new ServerInfrastructureSettingsComparer());
        }