1
namespace Castle
.MonoRail
.Framework
.Tests
.Providers
4 using Castle
.MonoRail
.Framework
.Providers
;
9 public class DefaultRescueDescriptorProviderTestCase
11 private DefaultRescueDescriptorProvider provider
= new DefaultRescueDescriptorProvider();
14 public void CanCollectLayoutFromClass()
16 RescueDescriptor
[] descs
= provider
.CollectRescues(typeof(RescueOnController
));
18 Assert
.IsNotNull(descs
);
19 Assert
.AreEqual(1, descs
.Length
);
20 Assert
.AreEqual("general", descs
[0].ViewName
);
21 Assert
.AreEqual(typeof(Exception
), descs
[0].ExceptionType
);
25 public void CanCollectLayoutFromMethod()
27 RescueDescriptor
[] descs
= provider
.CollectRescues(typeof(RescueOnActionController
).GetMethod("Action1"));
29 Assert
.IsNotNull(descs
);
30 Assert
.AreEqual(1, descs
.Length
);
31 Assert
.AreEqual("action", descs
[0].ViewName
);
32 Assert
.AreEqual(typeof(ArgumentNullException
), descs
[0].ExceptionType
);
38 public class RescueOnController
: Controller
42 public class RescueOnActionController
: Controller
44 [Rescue("action", typeof(ArgumentNullException
))]