public void AssemblyTest() { string path = "NSubversion.dll"; if (File.Exists(path) == false) { path = @"..\..\..\NSubversion\Bin\Debug\NSubversion.dll"; } Assert.IsTrue(File.Exists(path)); Assembly assembly = Assembly.LoadFile(Path.GetFullPath(path)); Assert.IsNotNull(assembly); Assert.AreEqual("NSubversion", assembly.GetName().Name); SvnTag tag = new SvnTag("$I" + "d: SvnTag.cs 48333 2010-07-13 05:54:53Z KAP $"); tag = new SvnTag(tag, assembly.FullName); // Current Version may be different Version version = new Version(1, 0, 3846, 14773); string assemblyFullName = "NSubversion, Version=1.0.3846.14773, Culture=neutral, PublicKeyToken=null"; Assert.AreEqual(tag.FindBeetween(assemblyFullName, "", "="), tag.FindBeetween(assembly.FullName, "", "=")); Assert.AreEqual(tag.FindBeetween(assemblyFullName, "Culture=", ""), tag.FindBeetween(assembly.FullName, "Culture=", "")); Assert.AreEqual("NSubversion", tag.AssemblyName); Assert.IsTrue(version < tag.AssemblyVersion); Assert.AreEqual("null", tag.AssemblyPublicKeyToken); Assert.AreEqual("neutral", tag.AssemblyCulture); }
public void FindBeetweenTest() { SvnTag tag = new SvnTag(""); Assert.AreEqual("Alek", tag.FindBeetween("1234Alek4321", "1234", "4321")); Assert.AreEqual("Alek", tag.FindBeetween("1234Alek4321", "4", "4")); Assert.AreEqual("Alek4321", tag.FindBeetween("1234Alek4321", "1234", "")); Assert.AreEqual("1234Alek", tag.FindBeetween("1234Alek4321", "", "4321")); }