Beispiel #1
0
        public void TestGetDeletions()
        {
            StatusCache cache = new StatusCache();

            this.Client.Delete(Path.Combine(this.WcPath, "Class1.cs"));
            this.Client.Delete(Path.Combine(this.WcPath, "WindowsApplication.sln"));

            // should be two deletions now
            cache.Status(this.WcPath, SvnDepth.Infinity);
            IList deletions = cache.GetDeletions(this.WcPath);

            Assert.AreEqual(2, deletions.Count);

            // undelete one
            this.Client.Revert(Path.Combine(this.WcPath, "Class1.cs"));
            deletions = cache.GetDeletions(this.WcPath);
            Assert.AreEqual(1, deletions.Count);

            // this one should still be deleted
            Assert.AreEqual(Path.Combine(this.WcPath, "WindowsApplication.sln"),
                            ((SvnItem)deletions[0]).Path);

            // undelete all
            SvnRevertArgs a = new SvnRevertArgs();

            a.Depth = SvnDepth.Infinity;
            this.Client.Revert(this.WcPath, a);
            deletions = cache.GetDeletions(this.WcPath);
            Assert.AreEqual(0, deletions.Count);
        }
Beispiel #2
0
        public void TestGetDeletions()
        {
            StatusCache cache = new StatusCache();
            this.Client.Delete(Path.Combine( this.WcPath, "Class1.cs" ));
            this.Client.Delete(Path.Combine( this.WcPath, "WindowsApplication.sln" ));

            // should be two deletions now
            cache.Status(this.WcPath, SvnDepth.Infinity);
            IList deletions = cache.GetDeletions( this.WcPath );
            Assert.AreEqual( 2, deletions.Count );

            // undelete one
            this.Client.Revert(Path.Combine( this.WcPath, "Class1.cs" ));
            deletions = cache.GetDeletions( this.WcPath );
            Assert.AreEqual( 1, deletions.Count );

            // this one should still be deleted
            Assert.AreEqual( Path.Combine( this.WcPath, "WindowsApplication.sln" ),
                ((SvnItem)deletions[0]).Path);

            // undelete all
            SvnRevertArgs a = new SvnRevertArgs();
            a.Depth = SvnDepth.Infinity;
            this.Client.Revert(this.WcPath, a);
            deletions = cache.GetDeletions( this.WcPath );
            Assert.AreEqual( 0, deletions.Count );
        }
Beispiel #3
0
        public void TestGetPathNotInInitialStatus()
        {
            StatusCache cache = new StatusCache();

            cache.Status(Path.Combine(this.WcPath, "doc"), SvnDepth.Infinity);
            using (StreamWriter w = new StreamWriter(Path.Combine(this.WcPath, "Form1.cs")))
                w.WriteLine("Foo");

            SvnItem item = cache[Path.Combine(this.WcPath, "Form1.cs")];

            Assert.AreEqual(SvnStatus.Modified, item.Status.LocalContentStatus);
        }
Beispiel #4
0
        public void TestVariousPathVariations()
        {
            StatusCache cache = new StatusCache();

            cache.Status(this.WcPath, SvnDepth.Infinity);

            string formPath = Path.Combine(this.WcPath, "Form1.cs");

            SvnItem item = cache[formPath];

            Assert.AreEqual(SvnStatus.Normal, item.Status.LocalContentStatus);

            item = cache[formPath.ToLower()];
            Assert.AreEqual(SvnStatus.Normal, item.Status.LocalContentStatus);

            item = cache[formPath.ToUpper()];
            Assert.AreEqual(SvnStatus.Normal, item.Status.LocalContentStatus);
        }
Beispiel #5
0
        public void TestGetPathNotInInitialStatus()
        {
            StatusCache cache = new StatusCache();
            cache.Status(Path.Combine(this.WcPath, "doc"), SvnDepth.Infinity);
            using( StreamWriter w = new StreamWriter(Path.Combine(this.WcPath, "Form1.cs")) )
                w.WriteLine( "Foo" );

            SvnItem item = cache[Path.Combine(this.WcPath, "Form1.cs")];
            Assert.AreEqual( SvnStatus.Modified, item.Status.LocalContentStatus );
        }
Beispiel #6
0
        public void TestVariousPathVariations()
        {
            StatusCache cache = new StatusCache();
            cache.Status(this.WcPath, SvnDepth.Infinity);

            string formPath = Path.Combine(this.WcPath, "Form1.cs");

            SvnItem item = cache[formPath];
            Assert.AreEqual( SvnStatus.Normal, item.Status.LocalContentStatus );

            item = cache[formPath.ToLower()];
            Assert.AreEqual(SvnStatus.Normal, item.Status.LocalContentStatus);

            item = cache[formPath.ToUpper()];
            Assert.AreEqual(SvnStatus.Normal, item.Status.LocalContentStatus);
        }