Пример #1
0
        public void TestMatchingSixthAction()
        {
            var mockTestControler = new MockTestController();
            var requestMessage    = new TestRequestMessage();

            var response = mockTestControler.TestMethod1(6, requestMessage, "test1", true, "My text parameter3");

            response.Wait();
            Trace.WriteLine($"response message:\n{response.Result.ToYamlString()}");
        }
Пример #2
0
        public void TestMatching101Action()
        {
            var mockTestControler = new MockTestController();
            var requestMessage    = new TestRequestMessage();

            try
            {
                var response = mockTestControler.TestMethod1(101, requestMessage, "test1", true, "My text parameter3");
                response.Wait();
                Trace.WriteLine($"response message:\n{response.Result.ToYamlString()}");
            }
            catch (System.AggregateException e)
            {
                throw e.InnerException;
            }
        }
Пример #3
0
        public void TestMatchingThirdAction()
        {
            var mockTestControler = new MockTestController();
            var requestMessage    = new TestRequestMessage();

            try
            {
                var response = mockTestControler.TestMethod1(3, requestMessage, "test1", true, "My text parameter3");
                response.Wait();
                Assert.Fail("Did not throw an exception");
            }
            catch (System.AggregateException e)
            {
                if ("MockEngine.MockEngineException" != e.InnerException.GetType().FullName)
                {
                    Trace.WriteLine(e);
                }
                Assert.AreEqual("MockEngine.MockEngineException", e.InnerException.GetType().FullName, "Should have returned an HttpResponseException");
            }
        }