Changed to use Authenticate asp.net event instead of Authorize
[castle.git] / MonoRail / Castle.MonoRail.Framework.Views.NVelocity.Tests / NVelocityRescueTestCase.cs
bloba14dae0e86cf91e9f88ebf8d604f4e8e58f521d1
1 // Copyright 2004-2007 Castle Project - http://www.castleproject.org/
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 namespace Castle.MonoRail.Framework.Views.NVelocity.Tests
17 using NUnit.Framework;
18 using Castle.MonoRail.Framework.Tests;
20 [TestFixture]
21 public class NVelocityRescueTestCase : RescueTestCase
23 [Test]
24 public void RescueWithSkipRescue()
26 DoGet("rescuable/MethodWithSkipRescue.rails");
27 AssertStatusCode(500);
30 [Test]
31 public void RescueWithAppExceptionType()
33 DoGet("rescuable/RescueWithExceptionsByType.rails", "exceptionType=appException");
35 AssertSuccess();
37 AssertReplyEqualTo( "appException" );
40 [Test]
41 public void RescueWithArgExceptionType()
43 DoGet("rescuable/RescueWithExceptionsByType.rails", "exceptionType=argException");
45 AssertSuccess();
47 AssertReplyEqualTo( "argException" );
50 [Test]
51 public void RescueWithControllerDefaultExceptionType()
53 DoGet("rescuable/RescueWithExceptionsByType.rails");
55 AssertSuccess();
57 AssertReplyEqualTo( "An error happened" );
60 [Test]
61 public void RescueWithMethodDefaultArgExceptionType()
63 DoGet("rescuable/RescueWithExceptionsByTypeWithDefaultException.rails", "exceptionType=argException");
65 AssertSuccess();
67 AssertReplyEqualTo( "argException" );
70 [Test]
71 public void RescueWithMethodDefaultExceptionType()
73 DoGet("rescuable/RescueWithExceptionsByTypeWithDefaultException.rails");
75 AssertSuccess();
77 AssertReplyEqualTo( "methodDefaultException" );
80 [Test, Ignore("Attributes order cannot be guaranted")]
81 public void RescueAndConrollerInheritance1()
83 DoGet("rescuable2/Save.rails");
84 AssertReplyEqualTo("An error happened during save");
86 DoGet("rescuable2/Save2.rails");
87 AssertReplyEqualTo("An error happened during update");
90 [Test]
91 public void AccessibleThroughAndRescues()
93 DoGet("rescuable/OnlyPost.rails");
94 AssertReplyEqualTo("An error happened");