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
|
@ -77,6 +77,15 @@ namespace Microsoft.DotNet.ProjectModel.Tests
|
||||||
|
|
||||||
Assert.Throws<FileFormatException>(() => LockFileReader.Read(lockFilePath, designTime: false));
|
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]
|
[Fact]
|
||||||
public void TestMissingExportsThrow()
|
public void TestMissingExportsThrow()
|
||||||
|
@ -86,6 +95,15 @@ namespace Microsoft.DotNet.ProjectModel.Tests
|
||||||
Assert.Throws<FileFormatException>(() => LockFileReader.Read(lockFilePath, designTime: false));
|
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]
|
[Fact]
|
||||||
public void TestMissmatchingFileVersionsThrows()
|
public void TestMissmatchingFileVersionsThrows()
|
||||||
{
|
{
|
||||||
|
@ -94,6 +112,14 @@ namespace Microsoft.DotNet.ProjectModel.Tests
|
||||||
Assert.Throws<FileFormatException>(() => LockFileReader.Read(lockFilePath, designTime: false));
|
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)
|
private static int LibraryNumberFromName(Microsoft.DotNet.ProjectModel.Graph.LockFileTargetLibrary library)
|
||||||
{
|
{
|
||||||
var libraryName = library.Name;
|
var libraryName = library.Name;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue