Inheritance: IEsbManagementEndpoint
        public void FetchCurrentServerLogConstructorWithDefaultExpectedInitializesServerLogPath()
        {
            var serverLogPath = Path.Combine(EnvironmentVariables.ApplicationPath, "WareWolf-Server.log");

            var esb = new FetchCurrentServerLog();
            Assert.AreEqual(serverLogPath, esb.ServerLogPath);
        }
        public void FetchCurrentServerLogExecuteWithNonExistingLogExpectedReturnsEmptyString()
        {
            var serverLogPath = Path.Combine(_testDir, string.Format("ServerLog_{0}.txt", Guid.NewGuid()));

            var esb = new FetchCurrentServerLog(serverLogPath);
            var actual = esb.Execute(null, null);
            var msg = ConvertToMsg(actual);
            Assert.AreEqual(string.Empty, msg.Message.ToString());
        }
        public void FetchCurrentServerLogExecuteWithExistingLogExpectedReturnsContentsOfLog()
        {
            const string Expected = "Hello world";
            var serverLogPath = Path.Combine(_testDir, string.Format("ServerLog_{0}.txt", Guid.NewGuid()));
            File.WriteAllText(serverLogPath, Expected);

            var esb = new FetchCurrentServerLog(serverLogPath);
            var actual = esb.Execute(null, null);
            var msg = ConvertToMsg(actual);
            Assert.AreEqual(Expected, msg.Message.ToString());
        }
 public void FetchCurrentServerLogHandlesTypeExpectedReturnsFetchCurrentServerLogService()
 {
     var esb = new FetchCurrentServerLog();
     var result = esb.HandlesType();
     Assert.AreEqual("FetchCurrentServerLogService", result);
 }
        public void FetchCurrentServerLogCreateServiceEntryExpectedReturnsDynamicService()
        {
            var esb = new FetchCurrentServerLog();
            var result = esb.CreateServiceEntry();
            Assert.AreEqual(esb.HandlesType(), result.Name);
            Assert.AreEqual("<DataList><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);
        }