Пример #1
0
        public void TestForget()
        {
            string path = GetTemporaryPath();
            string file = Path.Combine(path, "foo");
            IDictionary <string, Status> statuses = null;

            CommandClient.Initialize(path, MercurialPath);
            using (var client = new CommandClient(path, null, null, MercurialPath)) {
                File.WriteAllText(file, string.Empty);
                client.Add(file);
                statuses = client.Status(null);

                Assert.IsNotNull(statuses);
                Assert.That(statuses.ContainsKey("foo"), "No status received for foo");
                Assert.AreEqual(Status.Added, statuses ["foo"]);

                client.Forget(file);
                statuses = client.Status();
            }
            Assert.That(statuses.ContainsKey("foo"), "foo is no longer known");
            Assert.AreEqual(Status.Unknown, statuses ["foo"], "foo was not forgotten");
        }