Basic sanity test ;)
Inheritance: IEsbManagementEndpoint
Exemplo n.º 1
0
        public void Ping_Constructor_InitializesProperties()
        {
            //------------Setup for test--------------------------

            //------------Execute Test---------------------------
            var ping = new Ping();

            //------------Assert Results-------------------------
            Assert.IsNotNull(ping.Now);
        }
Exemplo n.º 2
0
        public void Ping_HandlesType_Returns_Ping()
        {
            //------------Setup for test--------------------------
            var ping = new Ping();

            //------------Execute Test---------------------------
            var handlesType = ping.HandlesType();

            //------------Assert Results-------------------------
            Assert.AreEqual("Ping", handlesType);
        }
Exemplo n.º 3
0
        public void Ping_Execute_Returns_Pong()
        {
            //------------Setup for test--------------------------
            var now = DateTime.Now;
            var ping = new Ping { Now = () => now };
            var expected = "Pong @ " + now.ToString("yyyy-MM-dd hh:mm:ss.fff");

            //------------Execute Test---------------------------
            var result = ping.Execute(It.IsAny<Dictionary<string, StringBuilder>>(), It.IsAny<IWorkspace>());

            var ser = new Dev2JsonSerializer();
            var msg = ser.Deserialize<ExecuteMessage>(result);

            //------------Assert Results-------------------------
            Assert.AreEqual(expected, msg.Message.ToString());
        }
Exemplo n.º 4
0
        public void Ping_CreateServiceEntry_Correct()
        {
            //------------Setup for test--------------------------
            var ping = new Ping();
            const string ExpectedName = "Ping";

            //------------Execute Test---------------------------
            var result = ping.CreateServiceEntry();

            //------------Assert Results-------------------------
            Assert.AreEqual(ExpectedName, result.Name);

            Assert.AreEqual(1, result.Actions.Count);
            Assert.AreEqual(ExpectedName, result.Actions[0].Name);
            Assert.AreEqual(ExpectedName, result.Actions[0].SourceMethod);
            Assert.AreEqual(enActionType.InvokeManagementDynamicService, result.Actions[0].ActionType);
            Assert.AreEqual("<DataList><Dev2System.ManagmentServicePayload ColumnIODirection=\"Both\"></Dev2System.ManagmentServicePayload></DataList>", result.Actions[0].DataListSpecification.ToString());
        }