public void Utility_TestServerOperations(MFilesServerConnection serverConnection) { // Get the library and see if the server is where we expect it to be. MFilesServerConnection con = serverConnection; Assert.IsNotNull(con); Assert.IsFalse(con.IsConnectedtoServer, "MFilesServerconnection just created, but seems to be connected to the server."); con.Connect(); // Verify that you're connected to the server Assert.IsTrue(con.IsConnectedtoServer, "After connecting... Library not connected."); // Get a list of vaults we can connect to. var vaults = con.GetVaults(); Assert.IsNotNull(vaults); Assert.AreNotEqual(0, vaults.Count()); // The first vault has a name and a Guid that could be used to connect to it. var FirstVault = vaults[0]; Assert.IsNotNull(FirstVault.Name); Assert.AreNotEqual(Guid.Empty, FirstVault.VaultGuid); // Disconnect from the server, just to tidy things up. con.Disconnect(); Assert.IsFalse(con.IsConnectedtoServer, "After disconnection... Library is still connected."); }
public void TestGetVaultsReturnsNameAndGuid() { MFilesServerConnection con = new MFilesServerConnection(); con.Connect(); if (!con.IsConnectedtoServer) { Assert.Inconclusive("Can't continue without server connection."); } foreach (VaultInfo vaultInfo in con.GetVaults()) { Assert.IsNotNull(vaultInfo); Assert.IsNotNull(vaultInfo.Name, "VaultInfo name not set"); Assert.AreNotEqual(Guid.Empty, vaultInfo.VaultGuid, "VaultInfo Guid not set"); } }