Exemplo n.º 1
0
        public void IsOpenForAddTest()
        {
            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);

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

                target.Disconnect();
                target.Dispose();
            }
        }
Exemplo n.º 2
0
        public void IsOpenForAddTest()
        {
            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.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.º 3
0
        public void AddFileTest()
        {
            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);
                target.Disconnect();
                target.Dispose();
            }
        }
Exemplo n.º 4
0
        public void AddFileTest()
        {
            _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);
                target.Disconnect();
                target.Dispose();
            }
        }
Exemplo n.º 5
0
        public void RevertFileDeletedTest()
        {
            _map = new Map();
            P4Service 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(settings.WorkspacePath);

                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();
            }
        }