Removing 'Locked-file' test; CLI:release/2.1.3xx (#9604)

* Removing 'Locked-file' test: ItFailsInLessThanOneSecondWhenTheProjectAssetsJsonDoesNotExist
This commit is contained in:
John Beisner 2018-07-03 16:23:35 +00:00 committed by GitHub
parent dbca58f8b7
commit 460788c91a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 49 deletions

View file

@ -216,3 +216,5 @@ License
-------
By downloading the .zip you are agreeing to the terms in the project [EULA](https://aka.ms/dotnet-core-eula).

View file

@ -1,49 +0,0 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Diagnostics;
using System.IO;
using FluentAssertions;
using Microsoft.DotNet.Cli;
using Microsoft.DotNet.Cli.Utils;
using Microsoft.DotNet.InternalAbstractions;
using Microsoft.DotNet.TestFramework;
using Microsoft.DotNet.Tools.Test.Utilities;
using NuGet.Frameworks;
using NuGet.ProjectModel;
using Xunit;
namespace Microsoft.DotNet.Cli.Utils.Tests
{
public class GivenThatWeWantToReadLockFilesQuickly : TestBase
{
[Fact]
public void ItFailsInLessThanOneSecondWhenTheProjectAssetsJsonDoesNotExist()
{
var testInstance = TestAssets.Get("TestAppWithProjDepTool")
.CreateInstance()
.WithSourceFiles();
var assetsFile = testInstance.Root.GetDirectory("obj").GetFile("project.assets.json").FullName;
var expectedMessage = string.Join(
Environment.NewLine,
string.Format(LocalizableStrings.FileNotFound, assetsFile),
LocalizableStrings.ProjectNotRestoredOrRestoreFailed);
Action action = () =>
{
var lockFile = new LockFileFormat()
.ReadWithLock(assetsFile)
.Result;
};
var stopWatch = Stopwatch.StartNew();
action.ShouldThrow<GracefulException>().WithMessage(expectedMessage);
stopWatch.Stop();
stopWatch.ElapsedMilliseconds.Should().BeLessThan(1000);
}
}
}