Ejemplo n.º 1
0
        public async Task ScenarioSettings()
        {
            var api = new Api(_serverCredential);

            var systemInfo = await api.GetSystemInfoAsync();
            Assert.False(string.IsNullOrWhiteSpace(systemInfo.Versions.FirstOrDefault().Value));

            var randomPort = new Random().Next(1025, 65534);
            var initialSettings = await api.GetSettings();
            initialSettings.BindPort = randomPort;
            await api.SetSettings(initialSettings);
            Thread.Sleep(1500);
            var settingAfterChange = await api.GetSettings();
            Assert.Equal(randomPort, settingAfterChange.BindPort);

            var result = await api.ListDirectories();
            if (result.Count > 0)
            {
                Assert.False(string.IsNullOrWhiteSpace(result.First().Path));
                Assert.True(result.First().Available > 0);
                Thread.Sleep(2 * 1000);
            }
        }