PathExtensionsTests ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  DeltaEngine.Tests.Extensions PathExtensionsTests

Namespace: DeltaEngine.Tests.Extensions
Assembly: DeltaEngine.Tests (in DeltaEngine.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public class PathExtensionsTests

The PathExtensionsTests type exposes the following members.

Constructors

  NameDescription
Public methodPathExtensionsTests
Initializes a new instance of the PathExtensionsTests class
Top
Methods

  NameDescription
Public methodDefaultDeltaEngineSolutionFileShouldBeAvailable
Public methodDeltaEnginePathEnvironmentVariableMustBeAnExistingDirectory
Public methodDeltaEngineSolutionFileHasToBeAvailable
Public methodGetAbsolutePath
Public methodInstallerSetsDeltaEnginePathEnvironmentVariable
Public methodInvalidStartupPathWillBeFixed
Public methodWithoutInstallerDeltaEnginePathEnvironmentVariableIsNotSet
Top
Examples

[Test]
public void InstallerSetsDeltaEnginePathEnvironmentVariable()
{
    MakeSureEnvironmentVariableIsSet();
    Assert.IsTrue(PathExtensions.IsDeltaEnginePathEnvironmentVariableAvailable());
}
[Test]
public void WithoutInstallerDeltaEnginePathEnvironmentVariableIsNotSet()
{
    DeleteEnvironmentVariableIfSet();
    Assert.IsFalse(PathExtensions.IsDeltaEnginePathEnvironmentVariableAvailable());
}
[Test, Ignore]
public void DeltaEnginePathEnvironmentVariableMustBeAnExistingDirectory()
{
    MakeSureEnvironmentVariableIsSet();
    Assert.IsTrue(Directory.Exists(PathExtensions.GetDeltaEngineInstalledDirectory()), 
        PathExtensions.GetDeltaEngineInstalledDirectory());
}
[Test]
public void GetAbsolutePath()
{
    Assert.AreEqual(Environment.CurrentDirectory, PathExtensions.GetAbsolutePath(null));
    Assert.AreEqual(Environment.CurrentDirectory, PathExtensions.GetAbsolutePath(""));
    Assert.AreEqual(Path.Combine(Environment.CurrentDirectory, "File.ext"),
        PathExtensions.GetAbsolutePath("File.ext"));
}
[Test, Ignore]
public void DefaultDeltaEngineSolutionFileShouldBeAvailable()
{
    string defaultSourceCodeDirectory = PathExtensions.GetDeltaEngineSolutionFilePath();
    Assert.IsTrue(File.Exists(defaultSourceCodeDirectory));
}
[Test, Ignore]
public void InvalidStartupPathWillBeFixed()
{
    Directory.SetCurrentDirectory(@"C:\");
    var fixedPath = PathExtensions.GetFallbackEngineSourceCodeDirectory();
    Assert.IsTrue(Directory.Exists(fixedPath), fixedPath);
}
[Test, Ignore]
public void DeltaEngineSolutionFileHasToBeAvailable()
{
    string deltaEngineSolutionFilePath = PathExtensions.GetDeltaEngineSolutionFilePath();
    Assert.IsTrue(deltaEngineSolutionFilePath.Contains(DeltaEngineSolutionFilename));
    Assert.IsTrue(File.Exists(deltaEngineSolutionFilePath));
}
See Also