Пример #1
0
        public void CommittingNewDirectoryShouldAddItToTheRepository()
        {
            Using.SvnRepo(url =>
            {
                var provider = new SvnProvider(log, TimeSpan.FromSeconds(30));
                provider.Import(".", url + "/test", "");

                provider.CreateWorkingDirectory(url + "/test", "workingDir");
                Directory.CreateDirectory(@"workingDir\trunk");
                provider.AddDirectory("trunk", "workingDir");
                provider.Commit("workingDir", "");

                Assert.That(provider.Exists(url + "/test/trunk"), log.Contents);
            });
        }
Пример #2
0
        public void CommittingNewFileShouldAddItToTheRepository()
        {
            Using.SvnRepo(url =>
            {
                var provider = new SvnProvider(log, TimeSpan.FromSeconds(30));
                provider.Import(".", url + "/test", "");

                provider.CreateWorkingDirectory(url + "/test", "workingDir");
                File.WriteAllText(@"workingDir\test.txt", "");
                provider.AddFile("test.txt", "workingDir");
                provider.Commit("workingDir", "");

                Assert.That(provider.Exists(url + "/test/test.txt"), log.Contents);
            });
        }
Пример #3
0
        public void CommittingDeletedDirectoryShouldRemoveItFromTheRepository()
        {
            Using.SvnRepo(url =>
            {
                Directory.CreateDirectory("test");
                var provider = new SvnProvider(log, TimeSpan.FromSeconds(30));
                provider.Import(".", url + "/test", "");

                provider.CreateWorkingDirectory(url + "/test", "workingDir");
                provider.DeleteDirectory("test", "workingDir");
                provider.Commit("workingDir", "");

                Assert.That(!provider.Exists(url + "/test/test"), log.Contents);
            });
        }
Пример #4
0
        public void CommittingUpdatedFileShouldChangeItInTheRepository()
        {
            Using.SvnRepo(url =>
            {
                File.WriteAllText("test.txt", "");
                var provider = new SvnProvider(log, TimeSpan.FromSeconds(30));
                provider.Import(".", url + "/test", "");

                provider.CreateWorkingDirectory(url + "/test", "workingDir");
                File.WriteAllText(@"workingDir\test.txt", "update");
                provider.Commit("workingDir", "");
                provider.CreateWorkingDirectory(url + "/test", "validationDir");

                Assert.That(File.ReadAllText(@"validationDir\test.txt"), Is.EqualTo("update"), log.Contents);
            });
        }