Exemple #1
0
 public void TestRedirectOnMock()
 {
     var url = new Redirect();
     var response = new MockResponse();
     var model = new TagModel(this, new MockSessionState(), null, response);
     url.Url = new MockAttribute(new Constant("www.sharptiles.org"));
     Assert.IsNull(response.LastRedirectUrl);
     url.Evaluate(model);
     Assert.That(response.LastRedirectUrl, Is.EqualTo("www.sharptiles.org"));
 }
Exemple #2
0
 public void TestRedirectNoRepsonseSet()
 {
     var url = new Redirect();
     url.Url = new MockAttribute(new Constant("www.sharptiles.org"));
     try
     {
         url.Evaluate(new TagModel(this));
     }
     catch (TagException Te)
     {
         Assert.AreEqual(Te.Message, TagException.HttpResponseNotAvailable().Message);
     }
 }