Skip to content

Commit

Permalink
- adds additional unit tests for parameters validation
Browse files Browse the repository at this point in the history
  • Loading branch information
baywet committed May 20, 2021
1 parent 31af590 commit 1290efb
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions tests/Kiota.Tests/KiotaHostTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,23 @@ public class KiotaHostTests
{
[Fact]
public async Task ThrowsOnInvalidOutputPath() {
await KiotaHost.GetRootCommand().InvokeAsync(new string[] { "-o", "X:\\doesnexit" });
await KiotaHost.GetRootCommand().InvokeAsync(new string[] { "-o", "A:\\doesnexit" });
}
[Fact]
public async Task ThrowsOnInvalidInputPath() {
await KiotaHost.GetRootCommand().InvokeAsync(new string[] { "-d", "X:\\doesnexit" });
await KiotaHost.GetRootCommand().InvokeAsync(new string[] { "-d", "https://nonexistentdomain.net/doesnexit" });
await KiotaHost.GetRootCommand().InvokeAsync(new string[] { "-d", "A:\\doesnexit" });
}
[Fact]
public async Task ThrowsOnInvalidInputUrl() {
await KiotaHost.GetRootCommand().InvokeAsync(new string[] { "-d", "https://nonexistentdomain56a535ba-bda6-405e-b5e2-ef5f11bf1003.net/doesnexit" });
}
[Fact]
public async Task ThrowsOnInvalidLanguage() {
await KiotaHost.GetRootCommand().InvokeAsync(new string[] { "-l", "Pascal" });
}
[Fact]
public async Task ThrowsOnInvalidClassName() {
await KiotaHost.GetRootCommand().InvokeAsync(new string[] { "-c", ".Graph" });
}
}
}

0 comments on commit 1290efb

Please sign in to comment.