public void FFetchDebugItemFileCreateServiceEntryExpectedReturnsDynamicService()
        {
            var esb    = new FetchDebugItemFile();
            var result = esb.CreateServiceEntry();

            Assert.AreEqual(esb.HandlesType(), result.Name);
            Assert.AreEqual("<DataList><DebugItemFilePath ColumnIODirection=\"Input\"></DebugItemFilePath><Dev2System.ManagmentServicePayload ColumnIODirection=\"Both\"></Dev2System.ManagmentServicePayload></DataList>", result.DataListSpecification.ToString());
            Assert.AreEqual(1, result.Actions.Count);

            var serviceAction = result.Actions[0];

            Assert.AreEqual(esb.HandlesType(), serviceAction.Name);
            Assert.AreEqual(enActionType.InvokeManagementDynamicService, serviceAction.ActionType);
            Assert.AreEqual(esb.HandlesType(), serviceAction.SourceMethod);
        }
        public void FetchDebugItemFileExecuteWithExistingLogExpectedReturnsContentsOfLog()
        {
            const string Expected      = "Hello world";
            var          serverLogPath = Path.Combine(_testDir, string.Format("ServerLog_{0}.txt", Guid.NewGuid()));

            File.WriteAllText(serverLogPath, Expected);

            var esb    = new FetchDebugItemFile();
            var actual = esb.Execute(new Dictionary <string, StringBuilder> {
                { "DebugItemFilePath", new StringBuilder(serverLogPath) }
            }, null);
            var msg = ConvertToMsg(actual);

            StringAssert.Contains(msg.Message.ToString(), Expected);
        }
        public void FetchDebugItemFile_Execute_FileHasMultiLines_ReturnedMessageWillBeMultiLines()

        {
            var multiLines = new StringBuilder();

            multiLines.AppendLine("Line One");
            multiLines.AppendLine("Line Two");
            multiLines.AppendLine("Line Three");

            var serverLogPath   = Path.Combine(_testDir, string.Format("ServerLog_{0}.txt", Guid.NewGuid()));
            var multiLineString = multiLines.ToString();

            File.WriteAllText(serverLogPath, multiLineString);

            var esb    = new FetchDebugItemFile();
            var actual = esb.Execute(new Dictionary <string, StringBuilder> {
                { "DebugItemFilePath", new StringBuilder(serverLogPath) }
            }, null);
            var msg = ConvertToMsg(actual);

            StringAssert.Contains(msg.Message.ToString(), multiLineString);
        }