-
Notifications
You must be signed in to change notification settings - Fork 0
/
HttpsOptionsTests.cs
37 lines (33 loc) · 1.13 KB
/
HttpsOptionsTests.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System;
using System.IO;
using Xunit;
namespace IISExpressify.Tests
{
public class HttpsOptionsTests
{
[Fact]
public void Https_ShouldThrowGivenNotFoundPhysicalPath()
{
string path = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
if (Directory.Exists(path)) Directory.Delete(path, recursive: true);
Assert.Throws<DirectoryNotFoundException>(() => IisExpress.Https().PhysicalPath(path));
}
[InlineData(44299)]
[InlineData(44399)]
[Theory]
public void Https_ShouldThrowGivenOutOfRangeHttpsPort(ushort port)
{
Assert.Throws<ArgumentOutOfRangeException>(() => IisExpress.Https().Port(port));
}
[Fact]
public void Start_ShouldThrowGivenUnsetPhysicalPath()
{
Assert.Throws<InvalidOperationException>(() => IisExpress.Https().Start());
}
[Fact]
public void Start_ShouldThrowGivenUnsetPort()
{
Assert.Throws<InvalidOperationException>(() => IisExpress.Https().PhysicalPath(Path.GetTempPath()).Start());
}
}
}