-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
test/Microsoft.ComponentDetection.Orchestrator.Tests/Commands/BaseSettingsTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
namespace Microsoft.ComponentDetection.Orchestrator.Tests.Commands; | ||
|
||
using System.IO; | ||
using FluentAssertions; | ||
using Microsoft.ComponentDetection.Orchestrator.Commands; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
[TestClass] | ||
[TestCategory("Governance/All")] | ||
[TestCategory("Governance/ComponentDetection")] | ||
public class BaseSettingsTests | ||
{ | ||
[TestMethod] | ||
public void Validate_FailsNegativeTimeout() | ||
{ | ||
var settings = new TestBaseSettings | ||
{ | ||
Timeout = -1, | ||
}; | ||
|
||
var result = settings.Validate(); | ||
|
||
result.Successful.Should().BeFalse(); | ||
} | ||
|
||
[TestMethod] | ||
public void Validate_Success_Empty_Output() | ||
{ | ||
var settings = new TestBaseSettings | ||
{ | ||
Output = string.Empty, | ||
}; | ||
|
||
var result = settings.Validate(); | ||
|
||
result.Successful.Should().BeTrue(); | ||
} | ||
|
||
[TestMethod] | ||
public void Validate_Fails_Output_NotExists() | ||
{ | ||
var setting = new TestBaseSettings | ||
{ | ||
Output = Path.Combine(Path.GetTempPath(), Path.GetTempFileName()), | ||
}; | ||
|
||
var result = setting.Validate(); | ||
|
||
result.Successful.Should().BeFalse(); | ||
} | ||
|
||
private class TestBaseSettings : BaseSettings | ||
{ | ||
} | ||
} |