diff --git a/BasicNodes/Functions/VariableMatch.cs b/BasicNodes/Functions/VariableMatch.cs index 39a0b432..60ae85c1 100644 --- a/BasicNodes/Functions/VariableMatch.cs +++ b/BasicNodes/Functions/VariableMatch.cs @@ -69,6 +69,7 @@ public class VariableMatch : Node } var variableString = variable?.ToString(); + args.Logger.ILog($"Variables[{variableName}]: " + variableString); if (string.IsNullOrWhiteSpace(variableString)) { diff --git a/BasicNodes/Tests/HasHardLinksTest.cs b/BasicNodes/Tests/HasHardLinksTest.cs index b2837234..39ba02d9 100644 --- a/BasicNodes/Tests/HasHardLinksTest.cs +++ b/BasicNodes/Tests/HasHardLinksTest.cs @@ -89,6 +89,20 @@ public class HasHardLinksTest : TestBase Assert.AreEqual(1, result); } + [TestMethod] + public void HasHardLink2() + { + testFile = Path.Combine(TempPath, Guid.NewGuid().ToString()); + CreateHardLinkFile(testFile, 1); + + var args = new FileFlows.Plugin.NodeParameters(testFile, Logger, false, string.Empty, MockFileService.Object); + + HasHardLinks element = new (); + + var result = element.Execute(args); + Assert.AreEqual(1, result); + } + [TestMethod] public void NoHardLinks() { diff --git a/BasicNodes/Tests/VariableMatchTests.cs b/BasicNodes/Tests/VariableMatchTests.cs index d2b33e3e..56a04f12 100644 --- a/BasicNodes/Tests/VariableMatchTests.cs +++ b/BasicNodes/Tests/VariableMatchTests.cs @@ -6,7 +6,7 @@ using FileFlows.BasicNodes.Functions; using Microsoft.VisualStudio.TestTools.UnitTesting; [TestClass] -public class VariableMatchTests +public class VariableMatchTests : TestBase { FileFlows.Plugin.NodeParameters Args; @@ -15,11 +15,11 @@ public class VariableMatchTests /Bobby Drake/ "; - [TestInitialize] - public void TestStarting() + protected override void TestStarting() { - Args = new FileFlows.Plugin.NodeParameters(@"c:\test\testfile.mkv", new TestLogger(), false, string.Empty, null);; + Args = new FileFlows.Plugin.NodeParameters(@"c:\test\testfile.mkv", Logger, false, string.Empty, null);; Args.GetToolPathActual = (arg) => TestVariable; + Args.Variables["test"] = TestVariable; } @@ -28,7 +28,7 @@ public class VariableMatchTests { VariableMatch vm = new VariableMatch(); vm.Variable = new FileFlows.Plugin.ObjectReference() { Name = "test" }; - vm.Input = "bobby drake"; + vm.Input = "*bobby drake*"; vm.PreExecute(Args); var result = vm.Execute(Args); Assert.AreEqual(1, result); @@ -39,10 +39,10 @@ public class VariableMatchTests { VariableMatch vm = new VariableMatch(); vm.Variable = new FileFlows.Plugin.ObjectReference() { Name = "test" }; - vm.Input = "BOBBY Two"; + vm.Input = "*BOBBY Two*"; vm.PreExecute(Args); var result = vm.Execute(Args); - Assert.AreEqual(1, result); + Assert.AreEqual(2, result); } [TestMethod] @@ -50,25 +50,18 @@ public class VariableMatchTests { VariableMatch vm = new VariableMatch(); vm.Variable = new FileFlows.Plugin.ObjectReference() { Name = "test" }; - vm.Input = "Robert Drake"; + vm.Input = "*Robert Drake*"; vm.PreExecute(Args); var result = vm.Execute(Args); Assert.AreEqual(2, result); } - - - - - - - [TestMethod] public void VariableMatch_Match_New() { VariableMatch vm = new VariableMatch(); vm.VariableName = "test"; - vm.Input = "bobby drake"; + vm.Input = "*bobby drake*"; vm.PreExecute(Args); var result = vm.Execute(Args); Assert.AreEqual(1, result); @@ -79,10 +72,10 @@ public class VariableMatchTests { VariableMatch vm = new VariableMatch(); vm.VariableName = "test"; - vm.Input = "BOBBY Two"; + vm.Input = "*BOBBY Two*"; vm.PreExecute(Args); var result = vm.Execute(Args); - Assert.AreEqual(1, result); + Assert.AreEqual(2, result); } [TestMethod] @@ -90,7 +83,7 @@ public class VariableMatchTests { VariableMatch vm = new VariableMatch(); vm.VariableName = "test"; - vm.Input = "Robert Drake"; + vm.Input = "*Robert Drake*"; vm.PreExecute(Args); var result = vm.Execute(Args); Assert.AreEqual(2, result); diff --git a/FileFlows.Plugin.dll b/FileFlows.Plugin.dll index 60eb0ffb..fdeb9522 100644 Binary files a/FileFlows.Plugin.dll and b/FileFlows.Plugin.dll differ diff --git a/FileFlows.Plugin.pdb b/FileFlows.Plugin.pdb index 53f13592..e44b6949 100644 Binary files a/FileFlows.Plugin.pdb and b/FileFlows.Plugin.pdb differ