Refactor pacserver

This commit is contained in:
2023-06-12 02:19:07 +02:00
parent a9ac6d8bc2
commit 013bc2fe33
6 changed files with 61 additions and 72 deletions

View File

@ -4,10 +4,15 @@ namespace Pacserver.Tests;
public class TranserFilesTest {
[Fact]
public void TransferPacmanCacheTest() {
string result = PacserverUtils.determinePacmanCacheDirectory();
PacserverUtils.TransferPacmanCache();
public void transferPacmanCache_doesNotFail() {
// Arrange
PacserverUtils utils = new PacserverUtils();
// Act
utils.readPacmanConfig();
utils.transferPacmanCache();
// Assert
//Assert.NotEmpty(Directory.GetFiles("/home/rene/test/"));
}
}

View File

@ -1,13 +0,0 @@
using Pacserver.Utils;
namespace Pacserver.Tests;
public class pacmanCache_Test {
[Fact]
public void doesPacmanCacheExist() {
string result = PacserverUtils.determinePacmanCacheDirectory();
Assert.Equivalent(result, "/var/cache/pacman/pkg/");
}
}

View File

@ -1,12 +0,0 @@
using Pacserver.Utils;
namespace Pacserver.Tests;
public class pacmanDatabase_Test {
[Fact]
public void doesPacmanDatabaseExist() {
string result = PacserverUtils.determinePacmanDatabaseDirectory();
Assert.Equivalent(result, "/var/lib/pacman/");
}
}

View File

@ -0,0 +1,18 @@
using Pacserver.Utils;
namespace Pacserver.Tests;
public class readPacmanConfigTest {
[Fact]
public void readPacmanConfig_returnsNoException() {
// Arrange
PacserverUtils utils = new PacserverUtils();
// Act
var exception = Record.Exception(() => utils.readPacmanConfig());
// Assert
Assert.Null(exception);
}
}