Skip to content

Commit

Permalink
test: remove dependencies packing #54
Browse files Browse the repository at this point in the history
  • Loading branch information
joaoopereira committed Oct 22, 2021
1 parent 3bca78b commit f6ac706
Showing 1 changed file with 1 addition and 39 deletions.
40 changes: 1 addition & 39 deletions tests/Specs/Pack.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
using Cmf.Common.Cli.Commands;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.CommandLine;
using System.CommandLine.Invocation;
using System.CommandLine.IO;
using System.IO;
using System.IO.Abstractions;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace tests.Specs
{
Expand All @@ -22,9 +16,7 @@ public void Args_Paths_BothSpecified()
{
string _workingDir = null;
string _outputDir = null;
string _repo = null;
bool? _force = null;
bool? _skipDependencies = null;

var packCommand = new PackCommand();
var cmd = new Command("pack");
Expand All @@ -35,34 +27,26 @@ public void Args_Paths_BothSpecified()
{
_workingDir = workingDir.Name;
_outputDir = outputDir.Name;
_repo = repo;
_force = force;
_skipDependencies = skipDependencies;
});


var console = new TestConsole();
cmd.Invoke(new[] {
"-o", "test_package_dir", "working_dir"
}, console);

Assert.AreEqual("working_dir", _workingDir);
Assert.AreEqual("test_package_dir", _outputDir);
Assert.IsNull(_repo);
Assert.IsNotNull(_force);
Assert.IsFalse(_force ?? true);
Assert.IsNotNull(_skipDependencies);
Assert.IsFalse(_skipDependencies ?? true);
}

[TestMethod]
public void Args_Paths_WorkDirSpecified()
{
string _workingDir = null;
string _outputDir = null;
string _repo = null;
bool? _force = null;
bool? _skipDependencies = null;

var packCommand = new PackCommand();
var cmd = new Command("pack");
Expand All @@ -73,34 +57,26 @@ public void Args_Paths_WorkDirSpecified()
{
_workingDir = workingDir.Name;
_outputDir = outputDir.Name;
_repo = repo;
_force = force;
_skipDependencies = skipDependencies;
});


var console = new TestConsole();
cmd.Invoke(new[] {
"working_dir"
}, console);

Assert.AreEqual("working_dir", _workingDir);
Assert.AreEqual("Package", _outputDir);
Assert.IsNull(_repo);
Assert.IsNotNull(_force);
Assert.IsFalse(_force ?? true);
Assert.IsNotNull(_skipDependencies);
Assert.IsFalse(_skipDependencies ?? true);
}

[TestMethod]
public void Args_Paths_OutDirSpecified()
{
string _workingDir = null;
string _outputDir = null;
string _repo = null;
bool? _force = null;
bool? _skipDependencies = null;

var packCommand = new PackCommand();
var cmd = new Command("pack");
Expand All @@ -111,12 +87,9 @@ public void Args_Paths_OutDirSpecified()
{
_workingDir = workingDir.Name;
_outputDir = outputDir.Name;
_repo = repo;
_force = force;
_skipDependencies = skipDependencies;
});


var console = new TestConsole();
cmd.Invoke(new[] {
"-o", "test_package_dir"
Expand All @@ -125,21 +98,16 @@ public void Args_Paths_OutDirSpecified()
var curDir = new DirectoryInfo(System.IO.Directory.GetCurrentDirectory());
Assert.AreEqual(curDir.Name, _workingDir);
Assert.AreEqual("test_package_dir", _outputDir);
Assert.IsNull(_repo);
Assert.IsNotNull(_force);
Assert.IsFalse(_force ?? true);
Assert.IsNotNull(_skipDependencies);
Assert.IsFalse(_skipDependencies ?? true);
}

[TestMethod]
public void Args_Paths_NoneSpecified()
{
string _workingDir = null;
string _outputDir = null;
string _repo = null;
bool? _force = null;
bool? _skipDependencies = null;

var packCommand = new PackCommand();
var cmd = new Command("pack");
Expand All @@ -150,12 +118,9 @@ public void Args_Paths_NoneSpecified()
{
_workingDir = workingDir.Name;
_outputDir = outputDir.Name;
_repo = repo;
_force = force;
_skipDependencies = skipDependencies;
});


var console = new TestConsole();
cmd.Invoke(new string[] {
}, console);
Expand All @@ -164,11 +129,8 @@ public void Args_Paths_NoneSpecified()

Assert.AreEqual(curDir.Name, _workingDir);
Assert.AreEqual("Package", _outputDir);
Assert.IsNull(_repo);
Assert.IsNotNull(_force);
Assert.IsFalse(_force ?? true);
Assert.IsNotNull(_skipDependencies);
Assert.IsFalse(_skipDependencies ?? true);
}
}
}
}

0 comments on commit f6ac706

Please sign in to comment.