Sharp.Augeas/Sharp.Augeas.Test/AugeasTests.cs

43 lines
1.1 KiB
C#
Raw Normal View History

2022-11-08 20:57:02 +03:00
namespace Sharp.Augeas.Test;
public class AugeasTests
{
private Augeas _augeas;
[SetUp]
public void Setup()
{
var rootDir = Environment.CurrentDirectory + "/root";
var lensDir = Environment.CurrentDirectory + "/lens";
_augeas = new Augeas(new AugSettings(rootDir, lensDir));
}
[Test]
public void NoExceptionThrownWhenPrintingVirtualhostTree()
{
var virtualHostConfig = "/etc/apache2/sites-available/00-ci.codeliturgy.com.conf";
_augeas.PrintVirtualHostTree(virtualHostConfig);
Assert.Pass();
}
[Test]
public void NoExceptionThrownWhenPrintingPreview()
{
var virtualHostConfig = "/etc/apache2/sites-available/00-ci.codeliturgy.com.conf";
_augeas.PrintPreview(virtualHostConfig);
Assert.Pass();
}
[Test]
public void GetTreeVirtualHostReturnsDictionaryWithKeys()
{
var virtualHostConfig = "/etc/apache2/sites-available/00-ci.codeliturgy.com.conf";
var tree = _augeas.GetVirtualHostTree(virtualHostConfig);
Assert.That(tree.Count > 0);
}
}