Exemplo n.º 1
0
        public void IsOpenForDeleteTest()
        {
            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.DeleteFile(filePath, out message);
                Assert.IsTrue(result, "DeleteFile should have succeeded: " + message);

                FileState state = target.GetVsFileState(filePath, out message);
                Assert.AreEqual(state, FileState.OpenForDelete, "Should have been OpenForDelete: " + message);

                target.Disconnect();
                target.Dispose();
            }
        }
Exemplo n.º 2
0
        public void IsOpenForDeleteTest()
        {
            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.DeleteFile(filePath, out message);
                Assert.IsTrue(result, "DeleteFile should have succeeded: " + message);

                FileState state = target.GetVsFileState(filePath, out message);
                Assert.AreEqual(state, FileState.OpenForDelete, "Should have been OpenForDelete: " + message);

                target.Disconnect();
                target.Dispose();
            }
        }
Exemplo n.º 3
0
        public void IsOpenForAddTest()
        {
            P4Service target = new P4Service(settings.PerforceServer, settings.PerforceUser, PASSWORD, settings.PerforceWorkspace, false, null, new Map());

            try
            {
                target.Connect();
            }
            finally
            {
                Assert.IsTrue(target.IsConnected, "Unable to connect");
                string filePath = GetTempFileName(settings.WorkspacePath);


                string message;
                bool   result = target.AddFile(filePath, out message);
                Assert.IsTrue(result, "AddFileTest error: " + message);

                FileState state = target.GetVsFileState(filePath, out message);
                Assert.AreEqual(state, FileState.OpenForAdd, "Should have been OpenForAdd: " + message);

                target.Disconnect();
                target.Dispose();
            }
        }
Exemplo n.º 4
0
        public void IsNotInPerforceTest()
        {
            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;
                FileState state = target.GetVsFileState(filePath, out message);
                Assert.AreEqual(state, FileState.NotInPerforce, "Should have been NotInPerforce: " + message);

                target.Disconnect();
                target.Dispose();
            }
        }
Exemplo n.º 5
0
        public void IsNotInPerforceTest()
        {
            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;
                FileState state = target.GetVsFileState(filePath, out message);
                Assert.AreEqual(state, FileState.NotInPerforce, "Should have been NotInPerforce: " + message);

                target.Disconnect();
                target.Dispose();
            }
        }