public void TestFileResponseBaseProcessMultipleDirectories() { UpdatedResponse response = new UpdatedResponse(); IList<string> lines = new List<string> { "mod1/mod2/mod3/", "/usr/local/cvsroot/sandbox/mod1/mod2/mod3/file1.cs", "/file1.cs/1.2.3.4///", "u=rw,g=rw,o=rw", "74" }; response.Initialize(lines); response.Process(); Assert.AreEqual("mod1/mod2/mod3/", response.Module); Assert.AreEqual("/file1.cs/1.2.3.4///", response.EntryLine); Assert.AreEqual("/usr/local/cvsroot/sandbox/mod1/mod2/mod3/file1.cs", response.RepositoryPath); Assert.AreEqual("file1.cs", response.Name); Assert.AreEqual("1.2.3.4", response.Revision); Assert.AreEqual("u=rw,g=rw,o=rw", response.Properties); Assert.AreEqual(74, response.Length); Assert.AreEqual(5, response.LineCount); }
/// <summary> /// Gets the mock updated response. /// </summary> /// <param name="path">The file path.</param> /// <param name="name">The file name.</param> /// <returns>a mock UpdateResponse instance</returns> public static UpdatedResponse GetMockUpdatedResponse(string path, string name) { UpdatedResponse res = new UpdatedResponse(); IList<string> lines = new List<string> { path, "/usr/local/cvsroot/sandbox/" + path + name, "/" + name + "/1.1.1.1///", "u=rw,g=rw,o=rw", "5" }; res.Initialize(lines); string text = "abcde"; res.Contents = text.Encode(); return res; }