public void LockAndUnlockFileTest() { var target = new P4Service(settings.PerforceServer, settings.PerforceUser, PASSWORD, settings.PerforceWorkspace, false, null, _map); try { target.Connect(); } finally { Assert.IsTrue(target.IsConnected, "Unable to connect"); string filePath = GetTempFileName(); string message; bool result = target.AddAndSubmitFile(filePath, out message); Assert.IsTrue(result, "AddAndSubmitFile error: " + message); result = target.EditFile(filePath, out message); Assert.IsTrue(result, "EditFile should have succeeded: " + message); result = target.LockFile(filePath, out message); Assert.IsTrue(result, "LockFile should have succeeded: " + message); result = target.UnlockFile(filePath, out message); Assert.IsTrue(result, "UnlockFile should have succeeded: " + message); target.Disconnect(); target.Dispose(); } }
public void LockAndUnlockFileTest() { P4Service target = new P4Service(SERVER, USER, PASSWORD, WORKSPACE, false, null, new Map()); try { target.Connect(); } finally { Assert.IsTrue(target.IsConnected, "Unable to connect"); string filePath = GetTempFileName(TESTPATH); string message; bool result = target.AddAndSubmitFile(filePath, out message); Assert.IsTrue(result, "AddAndSubmitFile error: " + message); result = target.EditFile(filePath, out message); Assert.IsTrue(result, "EditFile should have succeeded: " + message); result = target.LockFile(filePath, out message); Assert.IsTrue(result, "LockFile should have succeeded: " + message); result = target.UnlockFile(filePath, out message); Assert.IsTrue(result, "UnlockFile should have succeeded: " + message); target.Disconnect(); target.Dispose(); } }