Esempio n. 1
0
 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);
        }
Esempio n. 3
0
    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);
    }
Esempio n. 4
0
 public HeroesDataDirectoryTests()
 {
     _heroesDataDirectory = new HeroesDataDirectory("heroesdataTestFolders");
 }
Esempio n. 5
0
 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)));
 }
Esempio n. 6
0
 public void GetVersionsStaticMethodExceptionsTest()
 {
     Assert.ThrowsException <ArgumentException>(() => HeroesDataDirectory.GetVersions(null !).ToList());
     Assert.ThrowsException <ArgumentException>(() => HeroesDataDirectory.GetVersions(string.Empty).ToList());
     Assert.ThrowsException <ArgumentException>(() => HeroesDataDirectory.GetVersions(" ").ToList());
 }