public void DirectoryExecuteSearchUnsuccessful() { // given var appDataPathExtended = SetUp(TestContext.CurrentContext.Test.Name); // when var res = DirectorySearchHelper.DirectoryExecuteSearch(Path.Combine(appDataPathExtended, "Test3")); // then Assert.IsFalse(res); }
public void DirectoryExecuteSearchSuccessful() { // given var appDataPathExtended = SetUp(TestContext.CurrentContext.Test.Name); // when var res = DirectorySearchHelper.DirectoryExecuteSearch(appDataPathExtended); // then Assert.IsTrue(res); }
public void FindNewGamesWithoutNewGames() { // given var appDataPathExtended = SetUp(TestContext.CurrentContext.Test.Name); var gameDirectory = new GameDirectory(appDataPathExtended); // when var newGames = DirectorySearchHelper.FindNewGames(gameDirectory); // then CollectionAssert.IsEmpty(newGames); }
public void GetAllGamesFromPath() { // given var appDataPathExtended = SetUp(TestContext.CurrentContext.Test.Name); // when var games = DirectorySearchHelper.GetAllGamesFromPath(appDataPathExtended); // then CollectionAssert.IsNotEmpty(games); Assert.AreEqual(games.Count, 2); CollectionAssert.Contains(games, new Game(Path.Combine(appDataPathExtended, "Test1"))); }
public void FindNotExistingGamesWithNoMissingGame() { // given var appDataPathExtended = SetUp(TestContext.CurrentContext.Test.Name); // when var gameDirectory = new GameDirectory(appDataPathExtended); var games = DirectorySearchHelper.FindNotExistingGames(gameDirectory); // then Assert.AreEqual(0, games.Count); Assert.AreEqual(2, gameDirectory.GetGames().Count); }
public void FindNotExistingGamesSuccessful() { // given var appDataPathExtended = SetUp(TestContext.CurrentContext.Test.Name); // when var gameDirectory = new GameDirectory(appDataPathExtended); Directory.Delete(Path.Combine(appDataPathExtended, "Test1"), true); var games = DirectorySearchHelper.FindNotExistingGames(gameDirectory); // then Assert.AreEqual(1, games.Count); Assert.AreEqual(2, gameDirectory.GetGames().Count); Assert.AreEqual(new Game(Path.Combine(appDataPathExtended, "Test1")), games[0]); }
public void FindNewGamesSuccessful() { // given var appDataPathExtended = SetUp(TestContext.CurrentContext.Test.Name); var gameDirectory = new GameDirectory(appDataPathExtended); Directory.CreateDirectory(Path.Combine(appDataPathExtended, "Test3", "Test31")); using FileStream fs1 = File.Create(Path.Combine(appDataPathExtended, "Test3", "Test31", "test3.exe")); // when var newGames = DirectorySearchHelper.FindNewGames(gameDirectory); // then CollectionAssert.IsNotEmpty(newGames); CollectionAssert.Contains(newGames, new Game(Path.Combine(appDataPathExtended, "Test3"))); Assert.AreEqual(newGames.Count, 1); }
public GameDirectory(string path) : this() { _directory = path; _games = DirectorySearchHelper.FindNewGames(this); }