public void DeleteTest() { bool unicode = false; string server = "localhost:6666"; string user = "******"; string pass = string.Empty; string ws_client = "admin_space"; for (int i = 0; i < 2; i++) // run once for ascii, once for unicode { Process p4d = Utilities.DeployP4TestServer(TestDir, unicode); try { using (P4Server target = new P4Server(server, user, pass, ws_client)) { //P4JobList expected = null; P4Job actual; actual = new P4Job(target, "job000001"); Assert.IsTrue(actual.Delete(false)); } } catch (Exception ex) { Assert.Fail("Exception Thrown: {0} : {1}", ex.ToString(), ex.Message); } finally { Utilities.RemoveTestServer(p4d, TestDir); } unicode = !unicode; } }
public void ParseTest() { P4Server pserver = new P4Server(false); P4Job target = new P4Job(pserver, "new"); bool expected = true; bool actual; actual = target.Parse(spec); Assert.AreEqual(expected, actual); Assert.AreEqual("job042236", target.JobId); Assert.AreEqual("ksawicki", target["OwnedBy"]); // currently, the base parser doesn't save tags without values //Assert.IsTrue(String.IsNullOrEmpty(target["P4Blog"])); }
public void JobIdTest() { P4Server pserver = new P4Server(false); string expected = "Job1"; P4Job target = new P4Job(pserver, expected); string actual; actual = target.JobId; Assert.AreEqual(expected, actual); expected = "Job2"; target.JobId = expected; actual = target.JobId; Assert.AreEqual(expected, actual); }