Пример #1
0
        public void GetModifications()
        {
            string changes = @"
info: Change 3328 on 2002/10/31 by someone@somewhere 'Something important '
info: Change 3327 on 2002/10/31 by someone@somewhere 'Joe's test '
info: Change 332 on 2002/10/31 by someone@somewhere 'thingy'
exit: 0
";

            P4 p4 = CreateP4();

            ProcessInfo info = new ProcessInfo("p4.exe");

            processInfoCreatorMock.ExpectAndReturn("CreateProcessInfo", info, p4, "changes -s submitted ViewData@0001/01/01:00:00:00");
            mockProcessExecutor.ExpectAndReturn("Execute", new ProcessResult(changes, "", 0, false), info);
            processInfoCreatorMock.ExpectAndReturn("CreateProcessInfo", info, p4, "describe -s 3328 3327 332");
            mockProcessExecutor.ExpectAndReturn("Execute", new ProcessResult(P4Mother.P4_LOGFILE_CONTENT, "", 0, false), info);

            p4.View           = "ViewData";
            p4.P4WebURLFormat = "http://*****:*****@md=d&cd=//&c=3IB@/{0}?ac=10";
            Modification[] result = p4.GetModifications(new IntegrationResult(), new IntegrationResult());

            VerifyAll();
            Assert.AreEqual(7, result.Length);
            Assert.AreEqual("http://*****:*****@md=d&cd=//&c=3IB@/3328?ac=10", result[0].Url);
            Assert.AreEqual("http://*****:*****@md=d&cd=//&c=3IB@/3327?ac=10", result[3].Url);
        }