Add test case for LockFilePatcher under design time
This commit is contained in:
parent
e176c1d3b9
commit
32ed90afb2
1 changed files with 26 additions and 0 deletions
|
@ -78,6 +78,15 @@ namespace Microsoft.DotNet.ProjectModel.Tests
|
|||
Assert.Throws<FileFormatException>(() => LockFileReader.Read(lockFilePath, designTime: false));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TestMissingExportUnderDesignTime()
|
||||
{
|
||||
var lockFilePath = GetLockFilePath("invalid_nofragment");
|
||||
|
||||
// not throw under design time scenario
|
||||
Assert.NotNull(LockFileReader.Read(lockFilePath, designTime: true));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TestMissingExportsThrow()
|
||||
{
|
||||
|
@ -86,6 +95,15 @@ namespace Microsoft.DotNet.ProjectModel.Tests
|
|||
Assert.Throws<FileFormatException>(() => LockFileReader.Read(lockFilePath, designTime: false));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TestMissingExportsUnderDesignTime()
|
||||
{
|
||||
var lockFilePath = GetLockFilePath("invalid_missing-exports");
|
||||
|
||||
// not throw under design time scenario
|
||||
Assert.NotNull(LockFileReader.Read(lockFilePath, designTime: true));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TestMissmatchingFileVersionsThrows()
|
||||
{
|
||||
|
@ -94,6 +112,14 @@ namespace Microsoft.DotNet.ProjectModel.Tests
|
|||
Assert.Throws<FileFormatException>(() => LockFileReader.Read(lockFilePath, designTime: false));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TestMissmatchingFileVersionsUnderDesignTime()
|
||||
{
|
||||
var lockFilePath = GetLockFilePath("invalid_missmatching-versions");
|
||||
|
||||
Assert.NotNull(LockFileReader.Read(lockFilePath, designTime: true));
|
||||
}
|
||||
|
||||
private static int LibraryNumberFromName(Microsoft.DotNet.ProjectModel.Graph.LockFileTargetLibrary library)
|
||||
{
|
||||
var libraryName = library.Name;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue