Пример #1
0
        [Test] public void Test_Ind()
        {
            SourceVersionAttribute ind = SourceVersionAttribute.GetVersion(typeof(vInd));

            Assert.AreEqual(
                "$" + @"Header: C:\Prj\Dognapper\Microsoft\Common\src\com.ilg.Util\Test\VersionTest.cs, 1, 02/12/2001 6:25:04 PM, Joe Hildebrand" + "$",
                ind.ToString());
        }
Пример #2
0
        [Test] public void Test_Empty()
        {
            SourceVersionAttribute foo = SourceVersionAttribute.GetVersion(typeof(vFoo));

            Assert.AreEqual(null, foo.Revision, "Revision");
            Assert.AreEqual(DateTime.MinValue, foo.Date, "Date");
            Assert.AreEqual(null, foo.Author, "Date");
            Assert.AreEqual(null, foo.Version, "Version");
            Assert.AreEqual(null, foo.Archive, "Archive");
        }
Пример #3
0
        [Test] public void Test_PlainRev()
        {
            SourceVersionAttribute baz = SourceVersionAttribute.GetVersion(typeof(vBaz));

            Assert.AreEqual("11", baz.Revision);
            Assert.AreEqual(
                new DateTime(2001, 2, 12, 18, 25, 4),
                baz.Date);
            Assert.AreEqual("Joe Hildebrand", baz.Author);
            Assert.AreEqual(new Version(1, 11), baz.Version);
            Assert.AreEqual(@"C:\Prj\Dognapper\Microsoft\Common\src\com.ilg.Util\Test\VersionTest.cs", baz.Archive);
        }
Пример #4
0
        public void Test_SVN()
        {
            SVNAttribute c = (SVNAttribute)SourceVersionAttribute.GetVersion(typeof(SvnVer));

            Assert.AreEqual("148", c.Revision);
            Assert.AreEqual(
                new DateTime(2002, 7, 28, 21, 30, 43),
                c.Date);
            Assert.AreEqual("sally", c.Author);
            Assert.AreEqual(new Version(1, 148), c.Version);
            Assert.AreEqual(@"calc.c", c.Archive);
        }
Пример #5
0
        [Test] public void Test_VSS()
        {
            SourceSafeAttribute c = (SourceSafeAttribute)SourceVersionAttribute.GetVersion(typeof(VssVer));

            Assert.AreEqual("1", c.Revision);
            Assert.AreEqual(
                new DateTime(2001, 2, 12, 18, 25, 0),
                c.Date);
            Assert.AreEqual("Hildebzj", c.Author);
            Assert.AreEqual(new Version(1, 1), c.Version);
            Assert.AreEqual(@"/t.cs", c.Archive);
        }
Пример #6
0
        [Test] public void Test_RCS()
        {
            RCSAttribute c = (RCSAttribute)SourceVersionAttribute.GetVersion(typeof(RCSVer));

            Assert.AreEqual("1.1", c.Revision);
            Assert.AreEqual(
                new DateTime(2001, 2, 12, 18, 25, 4),
                c.Date);
            Assert.AreEqual("kingdon", c.Author);
            Assert.AreEqual(new Version(1, 1), c.Version);
            Assert.AreEqual(@"/u1/html/cvsroot/www.cyclic.com/RCS-html/info-ref.html,v", c.Archive);
            Assert.AreEqual("Exp", c.State);
        }
Пример #7
0
        [Test] public void Test_GetAll()
        {
            SourceVersionCollection tv = SourceVersionAttribute.GetVersion();

            Assert.IsTrue(tv["test.bedrock.util.VersionTest+vFoo"] != null);
            Assert.IsTrue(tv[typeof(vBar).FullName] != null);
            Assert.IsTrue(tv[typeof(vBaz)] != null);
            Assert.IsTrue(tv["test.bedrock.util.VersionTest+RCSVer"] != null);
            Assert.IsTrue(tv["test.bedrock.util.VersionTest+VssVer"] != null);
            Assert.IsTrue(tv["test.bedrock.util.VersionTest+SvnVer"] != null);
            Assert.IsTrue(tv["test.bedrock.util.VersionTest+vBax"] == null);
            foreach (string c in tv)
            {
                //Console.WriteLine("<{0}>", c);
                Assert.IsTrue(tv[c] != null);
            }
        }