Exemplo n.º 1
0
		public void IsRevisionOnBranch_BranchNotPresent()
		{
			var file = new FileInfo("file.txt").WithBranch("branch1", "1.4.0.2");

			Assert.IsFalse(file.IsRevisionOnBranch(Revision.Create("1.1"), "branch2"));
		}
Exemplo n.º 2
0
		public void IsRevisionOnBranch_BranchFromBranch_NotOnBranch()
		{
			var file = new FileInfo("file.txt")
					.WithBranch("branch1", "1.1.0.2")
					.WithBranch("branch2", "1.4.0.2")
					.WithBranch("branch3", "1.4.2.1.0.2"); // branch from branch2

			Assert.IsFalse(file.IsRevisionOnBranch(Revision.Create("1.1.2.1"), "branch3"));
		}
Exemplo n.º 3
0
		public void IsRevisionOnBranch_RevisionIsSuccessorToBranchpoint()
		{
			var file = new FileInfo("file.txt").WithBranch("branch", "1.4.0.2");

			Assert.IsFalse(file.IsRevisionOnBranch(Revision.Create("1.5"), "branch"));
		}
Exemplo n.º 4
0
		public void IsRevisionOnBranch_ManyBranches()
		{
			var file = new FileInfo("file.txt")
					.WithBranch("branch1", "1.4.0.2")
					.WithBranch("branch2", "1.4.2.3.0.2")
					.WithBranch("branch3", "1.4.2.3.2.1.0.6");

			Assert.IsTrue(file.IsRevisionOnBranch( Revision.Create("1.3"), "branch3"));
			Assert.IsTrue(file.IsRevisionOnBranch( Revision.Create("1.4"), "branch3"));
			Assert.IsTrue(file.IsRevisionOnBranch( Revision.Create("1.4.2.2"), "branch3"));
			Assert.IsTrue(file.IsRevisionOnBranch( Revision.Create("1.4.2.3"), "branch3"));
			Assert.IsFalse(file.IsRevisionOnBranch(Revision.Create("1.4.2.4"), "branch3"));
			Assert.IsFalse(file.IsRevisionOnBranch(Revision.Create("1.4.4.1"), "branch3"));
			Assert.IsTrue(file.IsRevisionOnBranch( Revision.Create("1.4.2.3.2.1"), "branch3"));
			Assert.IsFalse(file.IsRevisionOnBranch(Revision.Create("1.4.2.3.2.2"), "branch3"));
			Assert.IsTrue(file.IsRevisionOnBranch( Revision.Create("1.4.2.3.2.1.6.1"), "branch3"));
			Assert.IsFalse(file.IsRevisionOnBranch(Revision.Create("1.4.2.3.2.1.2.1"), "branch3"));
		}
Exemplo n.º 5
0
		public void IsRevisionOnBranch_RevisionIsPredecessorOnMain()
		{
			var file = new FileInfo("file.txt").WithBranch("branch", "1.4.0.2");

			Assert.IsTrue(file.IsRevisionOnBranch(Revision.Create("1.3"), "branch"));
		}
Exemplo n.º 6
0
		public void IsRevisionOnBranch_RevisionIsDirectlyOnTheBranch()
		{
			var file = new FileInfo("file.txt").WithBranch("branch", "1.4.0.2");

			Assert.IsTrue(file.IsRevisionOnBranch(Revision.Create("1.4.2.5"), "branch"));
		}
Exemplo n.º 7
0
		public void IsRevisionOnBranch_RevisionIsBranchpoint()
		{
			var file = new FileInfo("file.txt").WithBranch("branch", "1.4.0.2");

			Assert.IsTrue(file.IsRevisionOnBranch(Revision.Create("1.4"), "branch"));
		}
Exemplo n.º 8
0
		public void IsRevisionOnBranch_BranchRevisionIsNotOnMain()
		{
			var file = new FileInfo("file.txt");

			Assert.IsFalse(file.IsRevisionOnBranch(Revision.Create("1.1.2.1"), "MAIN"));
		}
Exemplo n.º 9
0
		public void IsRevisionOnBranch_RevisionOnMain()
		{
			var file = new FileInfo("file.txt");

			Assert.IsTrue(file.IsRevisionOnBranch(Revision.Create("1.1"), "MAIN"));
		}