예제 #1
0
        public void Http_ShouldThrowGivenNotFoundPhysicalPath()
        {
            string path = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());

            if (Directory.Exists(path))
            {
                Directory.Delete(path, recursive: true);
            }
            Assert.Throws <DirectoryNotFoundException>(() => IisExpress.Http().PhysicalPath(path));
        }
예제 #2
0
 public void Http_ShouldThrowGivenOutOfRangeHttpPort()
 {
     Assert.Throws <ArgumentOutOfRangeException>(() => IisExpress.Http().Port(0));
 }
예제 #3
0
 public void Start_ShouldThrowGivenUnsetPort()
 {
     Assert.Throws <InvalidOperationException>(() => IisExpress.Http().PhysicalPath(Path.GetTempPath()).Start());
 }
예제 #4
0
 static HttpIisExpressOptions CreateHttpOptions() =>
 IisExpress.Http().PhysicalPath(Hosting.GetHostingDirectory()).Port(8080);