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
        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());
        }
        public void GetInfrastructure()
        {
            // ARRANGE
            ServerInfrastructureSettings expected = FactoryServerSettings.ServerInfrastructureSettings;
            IInternalDracoonClient       c        = FactoryClients.InternalDracoonClientMock(true);
            DracoonServerSettingsImpl    ss       = new DracoonServerSettingsImpl(c);

            Mock.Arrange(() => c.Builder.GetInfrastructureSettings()).Returns(FactoryRestSharp.RestRequestWithAuth(ApiConfig.ApiGetInfrastructureConfig, Method.GET)).Occurs(1);
            Mock.Arrange(() => c.Executor.DoSyncApiCall <ApiInfrastructureSettings>(Arg.IsAny <IRestRequest>(), RequestType.GetInfrastructureSettings, 0))
            .Returns(FactoryServerSettings.ApiInfrastructureSettings).Occurs(1);
            Mock.Arrange(() => SettingsMapper.FromApiInfrastructureSettings(Arg.IsAny <ApiInfrastructureSettings>()))
            .Returns(FactoryServerSettings.ServerInfrastructureSettings).Occurs(1);

            // ACT
            ServerInfrastructureSettings actual = ss.GetInfrastructure();

            // ASSERT
            Assert.Equal(expected, actual, new ServerInfrastructureSettingsComparer());
            Mock.Assert(() => SettingsMapper.FromApiInfrastructureSettings(Arg.IsAny <ApiInfrastructureSettings>()));
            Mock.Assert(c.Executor);
            Mock.Assert(c.Builder);
        }