public void RevertFileDeletedTest() { 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.AddFile(filePath, out message); Assert.IsTrue(result, "AddFileTest error: " + message); result = target.RevertFile(filePath, out message); Assert.IsTrue(result, "RevertFile should have succeeded with warning. message: " + message); target.Disconnect(); target.Dispose(); } }
public void RevertFileDeletedTest() { _map = new Map(); P4Service target = new P4Service(SERVER, USER, PASSWORD, WORKSPACE, false, null, _map); try { target.Connect(); } finally { Assert.IsTrue(target.IsConnected, "Unable to connect"); string filePath = GetTempFileName(TESTPATH); string message; bool result = target.AddFile(filePath, out message); Assert.IsTrue(result, "AddFileTest error: " + message); result = target.RevertFile(filePath, out message); Assert.IsTrue(result, "RevertFile should have succeeded with warning. message: " + message); target.Disconnect(); target.Dispose(); } }
public void RevertFileNotExistingTest() { 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); if (File.Exists(filePath)) { File.Delete(filePath); } string message; bool result = target.RevertFile(filePath, out message); Assert.IsTrue(result, "RevertFile should have succeeded with warning. message: " + message); target.Disconnect(); target.Dispose(); } }