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.");
        }
Ejemplo n.º 2
0
        public void TestConnectionToFakeServer()
        {
            MFilesServerConnection con = new MFilesServerConnection();

            con.ServerName = "ThisIsNotARealServerName";
            con.Connect();
        }
Ejemplo n.º 3
0
        public void TestConnectToServer()
        {
            MFilesServerConnection library = new MFilesServerConnection();

            library.Connect();
            Assert.IsTrue(library.IsConnectedtoServer, "Server Not Connected");
        }
Ejemplo n.º 4
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");
        }
Ejemplo n.º 5
0
        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");
            }
        }
Ejemplo n.º 6
0
        public void TestNewServerInstanceStartsDisconnected()
        {
            MFilesServerConnection con = new MFilesServerConnection();

            Assert.IsFalse(con.IsConnectedtoServer, "The brand new connection ");
        }