Compare commits

..

No commits in common. "15220e713562971addb146e8b4f02adb9a097119" and "65b15f657dbc285dfe3743b8d59be7b6a73eea0e" have entirely different histories.

View File

@ -7,11 +7,9 @@ public class checkForNewerStuffTest {
public void checkForNewerPackages_throwsExceptionIfNoFilesExist() {
// Arrange
PacserverUtils utils = new PacserverUtils();
File.Delete("/tmp/packages_before.txt");
File.Delete("/tmp/packages_after.txt");
// Act
Action act = () => utils.diff("/tmp/packages_before.txt", "/tmp/packages_after.txt");
Action act = () => utils.diff("/tmp/before_update.txt", "/tmp/after_update.txt");
// Assert
act.Should().Throw<FileNotFoundException>().WithMessage("Necessary files could not be found");
@ -28,8 +26,8 @@ public class checkForNewerStuffTest {
utils.getEveryPackageNameAndVersion("after", "/tmp/packages_after.txt");
// Assert
File.Exists("/tmp/packages_before.txt").Should().BeTrue();
File.Exists("/tmp/packages_before.txt").Should().BeTrue();
File.Exists("/tmp/before_update.txt").Should().BeTrue();
File.Exists("/tmp/after_update.txt").Should().BeTrue();
}
[Fact]
@ -47,14 +45,16 @@ public class checkForNewerStuffTest {
}
[Fact]
public void getEveryPackageNameAndVersionViaFolderName_throwsExceptionIfModeIsNotValid() {
public void getEveryPackageNameAndVersionViaFolderName_throwsExceptionIfListIsEmpty() {
// Arrange
PacserverUtils utils = new PacserverUtils();
Directory.CreateDirectory("/tmp/local");
utils.pacmanDatabaseDirectory = "/tmp/";
// Act
Action act = () => utils.getEveryPackageNameAndVersion("test", "/tmp/test.txt");
Action act = () => utils.getEveryPackageNameAndVersion("before", "/tmp/packages_before.txt");
// Assert
act.Should().Throw<ArgumentException>().WithMessage("No valid mode was given. Valid modes are before and after");
act.Should().Throw<Exception>().WithMessage("How did you execute this without any packages?");
}
}