public void ActionSetsError(string action) { FileTo fileTo = this.GetFileTo(action); Routable message = this.GetRoutable(); fileTo.Process(message); Assert.NotNull(message.Error); }
public void CanDeleteFile() { string randomFileName = $"{Guid.NewGuid().ToString("N")}.txt"; FileTo fileTo = this.Setup("Delete", randomFileName); Dictionary <string, string> routableHeaders = new Dictionary <string, string>() { { "FullSource", $"test/{randomFileName}" }, { "SourceFile", randomFileName } }; fileTo.Process(new Core.Entities.Routable(routableHeaders, System.Text.Encoding.UTF8.GetBytes("test file"))); Assert.IsFalse(System.IO.File.Exists($"test/{randomFileName}")); }
public void CanDoAction(string action, string bodyType) { string randomFileName = $"{Guid.NewGuid().ToString("N")}.txt"; FileTo fileTo = this.Setup(action, randomFileName); Dictionary <string, string> routableHeaders = new Dictionary <string, string>() { { "FullSource", $"test/{randomFileName}" }, { "SourceFile", randomFileName } }; Core.Entities.Routable routable = new Core.Entities.Routable(routableHeaders, System.Text.Encoding.UTF8.GetBytes("test file")); routable.SetBody <Byte[]>(System.Text.Encoding.UTF8.GetBytes("Test")); if (bodyType == "String") { routable.SetBody <string>("Test"); } fileTo.Process(routable); Assert.IsTrue(System.IO.File.Exists($"{this.fileLocation}/target/{randomFileName}")); }