2019-11-08 23:38:06 +00:00
|
|
|
|
using System;
|
|
|
|
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
|
|
|
using Storj;
|
|
|
|
|
|
|
|
|
|
namespace StorjTests
|
|
|
|
|
{
|
|
|
|
|
[TestClass]
|
|
|
|
|
public class ExtractInstallDirTests
|
|
|
|
|
{
|
|
|
|
|
[TestMethod]
|
|
|
|
|
public void NullServiceCmd()
|
|
|
|
|
{
|
2019-11-14 12:02:03 +00:00
|
|
|
|
Assert.IsNull(new CustomActionRunner().ExtractInstallDir(null));
|
2019-11-08 23:38:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[TestMethod]
|
|
|
|
|
public void EmptyServiceCmd()
|
|
|
|
|
{
|
2019-11-14 12:02:03 +00:00
|
|
|
|
Assert.IsNull(new CustomActionRunner().ExtractInstallDir(""));
|
2019-11-08 23:38:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[TestMethod]
|
|
|
|
|
public void MissingConfigDirFlag()
|
|
|
|
|
{
|
2019-11-14 12:02:03 +00:00
|
|
|
|
Assert.IsNull(new CustomActionRunner().ExtractInstallDir("\"C:\\Program Files\\Storj\\Storage Node\\storagenode.exe\" run"));
|
2019-11-08 23:38:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[TestMethod]
|
|
|
|
|
public void ValidServiceCmd()
|
|
|
|
|
{
|
|
|
|
|
Assert.AreEqual("C:\\Program Files\\Storj\\Storage Node\\\\",
|
2019-11-14 12:02:03 +00:00
|
|
|
|
new CustomActionRunner().ExtractInstallDir("\"C:\\Program Files\\Storj\\Storage Node\\storagenode.exe\" run --config-dir \"C:\\Program Files\\Storj\\Storage Node\\\\\""));
|
2019-11-08 23:38:06 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|