public void VersionExistsStaticMethodExceptionsTest() { Assert.ThrowsException <ArgumentException>(() => HeroesDataDirectory.VersionExists(null !, new HeroesDataVersion(1, 1, 1, 1))); Assert.ThrowsException <ArgumentException>(() => HeroesDataDirectory.VersionExists(string.Empty, new HeroesDataVersion(1, 1, 1, 1))); Assert.ThrowsException <ArgumentException>(() => HeroesDataDirectory.VersionExists(" ", new HeroesDataVersion(1, 1, 1, 1))); Assert.ThrowsException <ArgumentNullException>(() => HeroesDataDirectory.VersionExists("path", null !)); }
public void NoVersionsLoadedTest() { HeroesDataDirectory heroesDataDirectory = new HeroesDataDirectory(Path.Join("heroesdataTestFolders", "someOther")); Assert.IsNull(heroesDataDirectory.NewestVersion); Assert.IsNull(heroesDataDirectory.OldestVersion); }
public void GetVersionsStaticMethodTest() { List <HeroesDataVersion> list = HeroesDataDirectory.GetVersions(_testFolder).OrderByDescending(x => x).ToList(); Assert.AreEqual(0, list.Where(x => x.IsPtr).Count()); Assert.AreEqual(6, list.Count); List <HeroesDataVersion> listWithPtr = HeroesDataDirectory.GetVersions(_testFolder, true).OrderByDescending(x => x).ToList(); Assert.IsTrue(listWithPtr.Where(x => x.IsPtr).Any()); Assert.AreEqual(8, listWithPtr.Count); }
public HeroesDataDirectoryTests() { _heroesDataDirectory = new HeroesDataDirectory("heroesdataTestFolders"); }
public void VersionExistsStaticMethodTest() { Assert.IsTrue(HeroesDataDirectory.VersionExists(_testFolder, new HeroesDataVersion(2, 47, 3, 76124))); Assert.IsTrue(HeroesDataDirectory.VersionExists(_testFolder, new HeroesDataVersion(2, 48, 0, 76268, true))); Assert.IsFalse(HeroesDataDirectory.VersionExists(_testFolder, new HeroesDataVersion(77, 23, 1, 76268, true))); }
public void GetVersionsStaticMethodExceptionsTest() { Assert.ThrowsException <ArgumentException>(() => HeroesDataDirectory.GetVersions(null !).ToList()); Assert.ThrowsException <ArgumentException>(() => HeroesDataDirectory.GetVersions(string.Empty).ToList()); Assert.ThrowsException <ArgumentException>(() => HeroesDataDirectory.GetVersions(" ").ToList()); }