public void GetChangelistWithUTCConversionNoTZDetailsTest() { bool unicode = false; string uri = "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, 6, unicode); Server server = new Server(new ServerAddress(uri)); try { Repository rep = new Repository(server); using (Connection con = rep.Connection) { con.UserName = user; con.Client = new Client(); con.Client.Name = ws_client; bool connected = con.Connect(null); Assert.IsTrue(connected); Assert.AreEqual(con.Status, ConnectionStatus.Connected); P4Command cmd = new P4Command(rep, "describe", true, "5"); Changelist fromDescribeCommand = new Changelist(); P4CommandResult results = cmd.Run(null); if (results.Success) { fromDescribeCommand.FromChangeCmdTaggedOutput((results.TaggedOutput[0]), string.Empty, FormBase.DSTMismatch(server.Metadata)); } DateTime unconverted = fromDescribeCommand.ModifiedDate; fromDescribeCommand = new Changelist(); results = cmd.Run(null); if (results.Success) { fromDescribeCommand.FromChangeCmdTaggedOutput((results.TaggedOutput[0]), "-200", FormBase.DSTMismatch(server.Metadata)); } Assert.AreEqual(unconverted.AddHours(-2), fromDescribeCommand.ModifiedDate); fromDescribeCommand = new Changelist(); results = cmd.Run(null); if (results.Success) { fromDescribeCommand.FromChangeCmdTaggedOutput((results.TaggedOutput[0]), "+200", FormBase.DSTMismatch(server.Metadata)); } Assert.AreEqual(unconverted.AddHours(2), fromDescribeCommand.ModifiedDate); fromDescribeCommand = new Changelist(); results = cmd.Run(null); if (results.Success) { fromDescribeCommand.FromChangeCmdTaggedOutput((results.TaggedOutput[0]), "200", FormBase.DSTMismatch(server.Metadata)); } Assert.AreEqual(unconverted.AddHours(2), fromDescribeCommand.ModifiedDate); } } finally { Utilities.RemoveTestServer(p4d, TestDir); } unicode = !unicode; } }
public void GetChangelistWithUTCConversionTest() { bool unicode = false; string uri = "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, 6, unicode); Server server = new Server(new ServerAddress(uri)); try { Repository rep = new Repository(server); using (Connection con = rep.Connection) { con.UserName = user; con.Client = new Client(); con.Client.Name = ws_client; bool connected = con.Connect(null); Assert.IsTrue(connected); Assert.AreEqual(con.Status, ConnectionStatus.Connected); Utilities.SetClientRoot(rep, TestDir, unicode, ws_client); P4Command cmd = new P4Command(rep, "change", true, "5"); Options opts = new Options(); opts["-o"] = null; Changelist fromChangeCommand = new Changelist(); P4CommandResult results = cmd.Run(opts); if (results.Success) { fromChangeCommand.initialize(rep.Connection); fromChangeCommand.FromChangeCmdTaggedOutput((results.TaggedOutput[0]), server.Metadata.DateTimeOffset, FormBase.DSTMismatch(server.Metadata)); } SubmitResults sr = fromChangeCommand.Submit(null); int submitted = 17; if (unicode) { submitted = 13; } cmd = new P4Command(rep, "change", true, submitted.ToString()); opts = new Options(); opts["-o"] = null; fromChangeCommand = new Changelist(); results = cmd.Run(opts); if (results.Success) { fromChangeCommand.initialize(rep.Connection); fromChangeCommand.FromChangeCmdTaggedOutput((results.TaggedOutput[0]), server.Metadata.DateTimeOffset, FormBase.DSTMismatch(server.Metadata)); } Changelist fromDescribeCommand = rep.GetChangelist(submitted, null); Assert.AreEqual(fromDescribeCommand.ModifiedDate, fromChangeCommand.ModifiedDate); } } finally { Utilities.RemoveTestServer(p4d, TestDir); } unicode = !unicode; } }