~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to external/ngit/NGit.Test/NGit.Api/StashApplyCommandTest.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
397
397
 
398
398
                /// <exception cref="System.Exception"></exception>
399
399
                [NUnit.Framework.Test]
 
400
                public virtual void StashChangeInANewSubdirectory()
 
401
                {
 
402
                        string subdir = "subdir";
 
403
                        string fname = "file2.txt";
 
404
                        string path = subdir + "/" + fname;
 
405
                        string otherBranch = "otherbranch";
 
406
                        WriteTrashFile(subdir, fname, "content2");
 
407
                        git.Add().AddFilepattern(path).Call();
 
408
                        RevCommit stashed = git.StashCreate().Call();
 
409
                        NUnit.Framework.Assert.IsNotNull(stashed);
 
410
                        NUnit.Framework.Assert.IsTrue(git.Status().Call().IsClean());
 
411
                        git.BranchCreate().SetName(otherBranch).Call();
 
412
                        git.Checkout().SetName(otherBranch).Call();
 
413
                        ObjectId unstashed = git.StashApply().Call();
 
414
                        NUnit.Framework.Assert.AreEqual(stashed, unstashed);
 
415
                        Status status = git.Status().Call();
 
416
                        NUnit.Framework.Assert.IsTrue(status.GetChanged().IsEmpty());
 
417
                        NUnit.Framework.Assert.IsTrue(status.GetConflicting().IsEmpty());
 
418
                        NUnit.Framework.Assert.IsTrue(status.GetMissing().IsEmpty());
 
419
                        NUnit.Framework.Assert.IsTrue(status.GetRemoved().IsEmpty());
 
420
                        NUnit.Framework.Assert.IsTrue(status.GetModified().IsEmpty());
 
421
                        NUnit.Framework.Assert.IsTrue(status.GetUntracked().IsEmpty());
 
422
                        NUnit.Framework.Assert.AreEqual(1, status.GetAdded().Count);
 
423
                        NUnit.Framework.Assert.IsTrue(status.GetAdded().Contains(path));
 
424
                }
 
425
 
 
426
                /// <exception cref="System.Exception"></exception>
 
427
                [NUnit.Framework.Test]
400
428
                public virtual void UnstashNonStashCommit()
401
429
                {
402
430
                        try