PageRenderTime 6ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/Mercurial.Net.Tests/RollbackTests.cs

#
C# | 29 lines | 25 code | 4 blank | 0 comment | 0 complexity | 982b6ef49a93605839af98c346d0f40a MD5 | raw file
 1using System.Linq;
 2using NUnit.Framework;
 3
 4namespace Mercurial.Tests
 5{
 6    [TestFixture]
 7    public class RollbackTests : SingleRepositoryTestsBase
 8    {
 9        [Test]
10        [Category("Integration")]
11        public void Rollback_NoRepo_ThrowsMercurialExecutionException()
12        {
13            Assert.Throws<MercurialExecutionException>(() => Repo.Rollback());
14        }
15
16        [Test]
17        [Category("Integration")]
18        public void Rollback_OneChangeset_RemovesChangeset()
19        {
20            Repo.Init();
21            WriteTextFileAndCommit(Repo, "test.txt", "test", "test", true);
22            Repo.Rollback();
23
24            Changeset[] log = Repo.Log().ToArray();
25
26            Assert.That(log, Is.Empty);
27        }
28    }
29}