Example #1
0
        public void TestCat()
        {
            string path = GetTemporaryPath();
            string file = Path.Combine(path, "foo");

            CommandClient.Initialize(path, MercurialPath);
            using (var client = new CommandClient(path, null, null, MercurialPath)) {
                File.WriteAllText(file, "foo\n");
                client.Add(Path.Combine(path, "foo"));
                client.Commit("Commit all");
                Assert.That(!client.Status().ContainsKey("foo"), "Default commit failed for foo");

                var contents = client.Cat(null, file);
                Assert.AreEqual(1, contents.Count, "Unexpected size of file set");
                Assert.That(contents.ContainsKey(file), "foo not in file set");
                Assert.AreEqual("foo\n", contents [file]);
            }
        }
Example #2
0
        public void TestCatMore()
        {
            string path = GetTemporaryPath();
            string file = Path.Combine(path, "foo");

            Console.WriteLine(Environment.CurrentDirectory);
            CommandClient.Initialize(path, MercurialPath);
            File.Copy("../../../Mercurial/CommandClient.cs", file);
            using (var client = new CommandClient(path, null, null, MercurialPath)) {
                client.Add(file);
                client.Commit("Commit all");
                Assert.That(!client.Status().ContainsKey("foo"), "Default commit failed for foo");

                var contents = client.Cat(null, file);
                Assert.AreEqual(1, contents.Count, "Unexpected size of file set");
                Assert.That(contents.ContainsKey(file), "foo not in file set");
                Assert.AreEqual(File.ReadAllText(file), contents [file]);
            }
        }