public void GivenHttpRequest_AndApplicationPathDoesNotTerminateWithSlash_WhenIGetApplicationUri_ThenApplicationUriIsExtractedFromRequest_AndApplicationUriIsterminatedWithSlash() { HttpRequestBase request = MockRepository.GenerateMock <HttpRequestBase>(); request.Expect(m => m.Url).Return(new Uri("http://bob.com/management/address")); request.Expect(m => m.ApplicationPath).Return("/management"); request.Expect(m => m.Headers).Return(new NameValueCollection()); string actual = AuthenticationUtility.GetApplicationUri(request); Assert.AreEqual("http://bob.com/management/", actual); }
public void GivenNullHttpRequest_WhenIGetApplicationUri_ThenThrowException() { TestExtensions.ExpectException <ArgumentNullException>(() => AuthenticationUtility.GetApplicationUri(null)); }