コード例 #1
0
            public void then_should_throw_expected_exception()
            {
                CommunicationException exception = null;

                try
                {
                    SUT.VerifyResponse <ExampleModel>(restResponse);
                }
                catch (CommunicationException ex)
                {
                    exception = ex;
                }

                exception.ShouldNotBeNull();
                exception.Message.ShouldEqual("Error occured while posting message 'test error'");
            }
コード例 #2
0
            public void then_should_throw_expected_exception()
            {
                CommunicationException exception = null;

                try
                {
                    SUT.VerifyResponse <ExampleModel>(restResponse);
                }
                catch (CommunicationException ex)
                {
                    exception = ex;
                }

                string expectedMessage = $"Error occured while sending message '{restResponse.StatusCode}'";

                exception.ShouldNotBeNull();
                exception.Message.ShouldEqual(expectedMessage);
            }