public void Run() { var serverInfo = SeafSession.GetServerInfo(_options.ServerUri).Result; Console.WriteLine($"Version: {serverInfo.Version}"); Console.WriteLine("Features:"); foreach (var feature in serverInfo.Features) { Console.WriteLine($"- {feature}"); } }
public void Test_GetServerInfo() { var connection = new MockedSeafConnection(); var message = new HttpResponseMessage(HttpStatusCode.OK) { Content = new StringContent(@"{ ""version"": ""4.0.6"", ""features"": [ ""seafile-basic"", ]}") }; connection.FakeResponseFor <GetServerInfoRequest>(message); var serverInfo = ExecuteSync(() => SeafSession.GetServerInfo(connection, new Uri("http://www.example.com"))); Assert.AreEqual("4.0.6", serverInfo.Version); Assert.IsTrue(serverInfo.Features.Contains("seafile-basic")); }