示例#1
0
        public void TestPingWithError()
        {
            IptFlowControlClient client = new IptFlowControlClient();
            StatusType           status = null;
            SIFHeaderType        header = createHeader();

            header.SourceId = "Olympus"; // Triggers an error in the server
            bool exceptionThrown = false;

            try
            {
                status = client.Ping(ref header, new PingType());
            }
            catch (FaultException <DataModelErrorType> ex)
            {
                exceptionThrown = true;
                Assert.AreEqual(ex.Detail.Category, InfrastructureErrorCategoryType.Item11, "Expected Category of 11");
                Assert.AreEqual(ex.Detail.Code, "1", "Expected Code of 1");
            }
            catch (Exception ex)
            {
                Assert.Fail("Unable to parse SOAP Fault into expected exception type: " + ex.ToString());
            }

            Assert.IsTrue(exceptionThrown, "A SOAP Fault was not returned");
        }
示例#2
0
        public void TestPing()
        {
            IptFlowControlClient client = new IptFlowControlClient();
            StatusType status = null;
            SIFHeaderType header = createHeader();
            //PingRequest  request = new PingRequest( header, new PingType() );
            status = client.Ping(ref header, new PingType());
            runAssertions(header);
            Console.WriteLine("Invoked with return code " + status.Code);

            Assert.AreEqual(status.Code, InfrastructureStatusCodeType.Item0);
            Assert.AreEqual(status.Desc, "Success");
        }
示例#3
0
        public void TestWakeup()
        {
            IptFlowControlClient client = new IptFlowControlClient();
            StatusType           status = null;
            SIFHeaderType        header = createHeader();

            status = client.Wakeup(ref header, new WakeupType());
            runAssertions(header);
            Console.WriteLine("Invoked with return code " + status.Code);

            Assert.AreEqual(status.Code, InfrastructureStatusCodeType.Item0);
            Assert.AreEqual(status.Desc, "Success");
        }
示例#4
0
        public void TestPingWithError()
        {
            IptFlowControlClient client = new IptFlowControlClient();
            StatusType status = null;
            SIFHeaderType header = createHeader();
            header.SourceId = "Olympus"; // Triggers an error in the server
            bool exceptionThrown = false;
            try
            {
                status = client.Ping(ref header, new PingType());

            }
            catch (FaultException<DataModelErrorType> ex)
            {
                exceptionThrown = true;
                Assert.AreEqual(ex.Detail.Category, InfrastructureErrorCategoryType.Item11, "Expected Category of 11");
                Assert.AreEqual(ex.Detail.Code, "1", "Expected Code of 1");

            }
            catch (Exception ex)
            {
                Assert.Fail("Unable to parse SOAP Fault into expected exception type: " + ex.ToString());
            }

            Assert.IsTrue(exceptionThrown, "A SOAP Fault was not returned");
        }