public void MoveFileTest_Negative() { TestHelper.DeleteFile(@"..\..\..\..\Test\BizUnit.TestSteps.Tests\TestData\PurchaseOrder001.testdel2xml"); TestHelper.DeleteFile(@"..\..\..\..\Test\BizUnit.TestSteps.Tests\TestData\PurchaseOrder001.testdel1xml"); System.IO.File.Copy(@"..\..\..\..\Test\BizUnit.TestSteps.Tests\TestData\PurchaseOrder001.xml", @"..\..\..\..\Test\BizUnit.TestSteps.Tests\TestData\PurchaseOrder001.testdel1xml"); var step = new MoveStep { SourcePath = string.Empty, DestinationPath = @"..\..\..\..\Test\BizUnit.TestSteps.Tests\TestData\PurchaseOrder001.testdel2xml" }; try { step.Validate(new Context()); } catch (ArgumentException ex) { Assert.IsTrue(ex.Message.Contains("SourcePath is either null or of zero length")); } step.SourcePath = @"..\..\..\..\Test\BizUnit.TestSteps.Tests\TestData\PurchaseOrder001.testdel1xml"; step.DestinationPath = string.Empty; try { step.Validate(new Context()); } catch (ArgumentException ex) { Assert.IsTrue(ex.Message.Contains("DestinationPath is either null or of zero length")); } step.SourcePath = @"..\..\..\..\Test\BizUnit.TestSteps.Tests\TestData\PurchaseOrder001.testdel1xmlerror"; step.DestinationPath = @"..\..\..\..\Test\BizUnit.TestSteps.Tests\TestData\PurchaseOrder001.testdel1xmlerror"; try { var context = new Context(); step.Validate(context); step.Execute(context); } catch (FileNotFoundException fex) { Assert.IsTrue(fex.Message.Contains("Could not find file")); } }
public void MoveFileTest_Negative() { TestHelper.DeleteFile(Path.Combine(TestContext.CurrentContext.TestDirectory, @"TestData\PurchaseOrder001.testdel2xml")); TestHelper.DeleteFile(Path.Combine(TestContext.CurrentContext.TestDirectory, @"TestData\PurchaseOrder001.testdel1xml")); System.IO.File.Copy( Path.Combine(TestContext.CurrentContext.TestDirectory, @"TestData\PurchaseOrder001.xml"), Path.Combine(TestContext.CurrentContext.TestDirectory, @"TestData\PurchaseOrder001.testdel1xml")); var step = new MoveStep(); step.SourcePath = string.Empty; step.DestinationPath = Path.Combine(TestContext.CurrentContext.TestDirectory, @"TestData\PurchaseOrder001.testdel2xml"); try { step.Validate(new Context()); } catch (ArgumentException ex) { Assert.IsTrue(ex.Message.Contains("SourcePath is either null or of zero length")); } step.SourcePath = Path.Combine(TestContext.CurrentContext.TestDirectory, @"TestData\PurchaseOrder001.testdel1xml"); step.DestinationPath = string.Empty; try { step.Validate(new Context()); } catch (ArgumentException ex) { Assert.IsTrue(ex.Message.Contains("DestinationPath is either null or of zero length")); } step.SourcePath = Path.Combine(TestContext.CurrentContext.TestDirectory, @"TestData\PurchaseOrder001.testdel1xmlerror"); step.DestinationPath = Path.Combine(TestContext.CurrentContext.TestDirectory, @"TestData\PurchaseOrder001.testdel1xmlerror"); try { var context = new Context(); step.Validate(context); step.Execute(context); } catch (FileNotFoundException fex) { Assert.IsTrue(fex.Message.Contains("Could not find file")); } }
public void MoveFileTest() { TestHelper.DeleteFile(@"..\..\TestData\PurchaseOrder001.testdel2xml"); TestHelper.DeleteFile(@"..\..\TestData\PurchaseOrder001.testdel1xml"); System.IO.File.Copy(@"..\..\TestData\PurchaseOrder001.xml", @"..\..\TestData\PurchaseOrder001.testdel1xml"); var step = new MoveStep(); step.SourcePath = @"..\..\TestData\PurchaseOrder001.testdel1xml"; step.DestinationPath = @"..\..\TestData\PurchaseOrder001.testdel2xml"; step.Execute(new Context()); Assert.IsTrue(System.IO.File.Exists(@"..\..\TestData\PurchaseOrder001.testdel2xml")); }
private void moveToSelectedRecord(BaseEntity entity) { if (entity == null) { return; } while (!CurrentQueryset.Contains(entity)) { if (MoveStep.CanExecute("+")) { MoveStep.Execute("+"); } else { throw new NotImplementedException("DONT KNOW WHAT TO DO"); } } }
public void MoveFileTest() { TestHelper.DeleteFile(Path.Combine(TestContext.CurrentContext.TestDirectory, @"TestData\PurchaseOrder001.testdel2xml")); TestHelper.DeleteFile(Path.Combine(TestContext.CurrentContext.TestDirectory, @"TestData\PurchaseOrder001.testdel1xml")); System.IO.File.Copy( Path.Combine(TestContext.CurrentContext.TestDirectory, @"TestData\PurchaseOrder001.xml"), Path.Combine(TestContext.CurrentContext.TestDirectory, @"TestData\PurchaseOrder001.testdel1xml")); var step = new MoveStep(); step.SourcePath = Path.Combine(TestContext.CurrentContext.TestDirectory, @"TestData\PurchaseOrder001.testdel1xml"); step.DestinationPath = Path.Combine(TestContext.CurrentContext.TestDirectory, @"TestData\PurchaseOrder001.testdel2xml"); step.Execute(new Context()); Assert.IsTrue(System.IO.File.Exists(Path.Combine(TestContext.CurrentContext.TestDirectory, @"TestData\PurchaseOrder001.testdel2xml"))); }