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.");
        }
예제 #2
0
        public void TestDisconnectionConnectedInstance()
        {
            MFilesServerConnection library = new MFilesServerConnection();

            library.Connect();
            if (!library.IsConnectedtoServer)
            {
                Assert.Inconclusive("Can't connect to server to test disconnect.");
            }
            library.Disconnect();
            Assert.IsFalse(library.IsConnectedtoServer, "Disconnect failure");
        }