diff options
| author | mokhan <mokhan@da190166-9cfc-4ee1-ae03-434a172be219> | 2009-02-21 21:44:27 +0000 |
|---|---|---|
| committer | mokhan <mokhan@da190166-9cfc-4ee1-ae03-434a172be219> | 2009-02-21 21:44:27 +0000 |
| commit | 1dfdccb8118aeaa3cd844ac8de2a672c93312166 (patch) | |
| tree | 4b19e7f816ab1019f180a46b68572af4b66fe4bc /slips/src/test/Marina.Test/Unit/Web/Views/ViewTest.cs | |
| parent | 42d66bcab8262c7b8b2452615df535e694a3ec1c (diff) | |
git-svn-id: http://svn.xp-dev.com/svn/mokhan-sait@2 da190166-9cfc-4ee1-ae03-434a172be219
Diffstat (limited to 'slips/src/test/Marina.Test/Unit/Web/Views/ViewTest.cs')
| -rw-r--r-- | slips/src/test/Marina.Test/Unit/Web/Views/ViewTest.cs | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/slips/src/test/Marina.Test/Unit/Web/Views/ViewTest.cs b/slips/src/test/Marina.Test/Unit/Web/Views/ViewTest.cs new file mode 100644 index 0000000..a3b2d08 --- /dev/null +++ b/slips/src/test/Marina.Test/Unit/Web/Views/ViewTest.cs @@ -0,0 +1,48 @@ +using Marina.Web.Http;
+using Marina.Web.Views;
+using MbUnit.Framework;
+using Rhino.Mocks;
+using Rhino.Mocks.Constraints;
+
+namespace Marina.Test.Unit.Web.Views {
+ [TestFixture]
+ public class ViewTest {
+ private MockRepository _mockery;
+ private string _pageName;
+ private IHttpGateway _mockGateway;
+
+ [SetUp]
+ public void Setup() {
+ _mockery = new MockRepository( );
+ _mockGateway = _mockery.DynamicMock< IHttpGateway >( );
+ _pageName = string.Empty;
+ }
+
+ public IView CreateSUT() {
+ return new View( _pageName, _mockGateway );
+ }
+
+ [Test]
+ public void Should_return_the_name_of_the_page_it_was_created_with() {
+ _pageName = "TestPage.aspx";
+
+ using ( _mockery.Record( ) ) {}
+
+ using ( _mockery.Playback( ) ) {
+ Assert.AreEqual( _pageName, CreateSUT( ).Name( ) );
+ }
+ }
+
+ [Test]
+ public void Should_redirect_to_page() {
+ using ( _mockery.Record( ) ) {
+ _mockGateway.RedirectTo( null );
+ LastCall.Constraints( Is.NotNull( ) );
+ }
+
+ using ( _mockery.Playback( ) ) {
+ CreateSUT( ).Render( );
+ }
+ }
+ }
+}
\ No newline at end of file |
