/Mercurial.Net.Tests/RollbackTests.cs

# · C# · 29 lines · 25 code · 4 blank · 0 comment · 0 complexity · 982b6ef49a93605839af98c346d0f40a MD5 · raw file

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