Publish and verify files

This commit is contained in:
Mike Harder 2018-05-01 00:06:32 -07:00 committed by GitHub
parent 8fe927d40d
commit 9cf79dcc1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 328 additions and 9 deletions

View File

@ -62,6 +62,20 @@ namespace AspNetCoreSdkTests
}
}
[Test]
[TestCaseSource(typeof(TemplateData), nameof(TemplateData.Current))]
public void Publish(Template template, NuGetConfig nuGetConfig)
{
using (var context = new DotNetContext())
{
context.New(template);
context.Restore(nuGetConfig);
context.Publish();
CollectionAssert.AreEquivalent(template.ExpectedFilesAfterPublish, context.GetPublishFiles());
}
}
private HttpResponseMessage GetAsync(Uri requestUri)
{
while (true)

View File

@ -1,4 +1,8 @@
namespace AspNetCoreSdkTests.Templates
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace AspNetCoreSdkTests.Templates
{
public class AngularTemplate : SpaBaseTemplate
{
@ -7,5 +11,21 @@
protected AngularTemplate() { }
public override string Name => "angular";
public override IEnumerable<string> ExpectedFilesAfterPublish => Enumerable.Concat(base.ExpectedFilesAfterPublish, new[]
{
Path.Combine("wwwroot", "favicon.ico"),
Path.Combine("ClientApp", "dist", "3rdpartylicenses.txt"),
Path.Combine("ClientApp", "dist", "glyphicons-halflings-regular.448c34a56d699c29117a.woff2"),
Path.Combine("ClientApp", "dist", "glyphicons-halflings-regular.89889688147bd7575d63.svg"),
Path.Combine("ClientApp", "dist", "glyphicons-halflings-regular.e18bbf611f2a2e43afc0.ttf"),
Path.Combine("ClientApp", "dist", "glyphicons-halflings-regular.f4769f9bdb7466be6508.eot"),
Path.Combine("ClientApp", "dist", "glyphicons-halflings-regular.fa2772327f55d8198301.woff"),
Path.Combine("ClientApp", "dist", "index.html"),
Path.Combine("ClientApp", "dist", "inline.318b50c57b4eba3d437b.bundle.js"),
Path.Combine("ClientApp", "dist", "main.d2eed1593a6df639e365.bundle.js"),
Path.Combine("ClientApp", "dist", "polyfills.bf95165a1d5098766b92.bundle.js"),
Path.Combine("ClientApp", "dist", "styles.2727681ffee5a66f9fe6.bundle.css"),
});
}
}

View File

@ -34,5 +34,12 @@ namespace AspNetCoreSdkTests.Templates
$"{Name}.dll",
$"{Name}.pdb",
}.Select(p => Path.Combine(OutputPath, p));
public override IEnumerable<string> ExpectedFilesAfterPublish => new[]
{
$"{Name}.deps.json",
$"{Name}.dll",
$"{Name}.pdb",
};
}
}

View File

@ -22,5 +22,10 @@ namespace AspNetCoreSdkTests.Templates
$"{Name}.runtimeconfig.dev.json",
$"{Name}.runtimeconfig.json",
}.Select(p => Path.Combine(OutputPath, p)));
public override IEnumerable<string> ExpectedFilesAfterPublish => Enumerable.Concat(base.ExpectedFilesAfterPublish, new[]
{
$"{Name}.runtimeconfig.json",
});
}
}

View File

@ -4,7 +4,7 @@ using System.Linq;
namespace AspNetCoreSdkTests.Templates
{
public class MvcTemplate : RazorApplicationBaseTemplate
public class MvcTemplate : RazorBootstrapJQueryTemplate
{
public new static MvcTemplate Instance { get; } = new MvcTemplate();

View File

@ -22,5 +22,13 @@ namespace AspNetCoreSdkTests.Templates
$"{Name}.runtimeconfig.dev.json",
$"{Name}.runtimeconfig.json",
}.Select(p => Path.Combine(OutputPath, p)));
public override IEnumerable<string> ExpectedFilesAfterPublish => Enumerable.Concat(base.ExpectedFilesAfterPublish, new[]
{
"appsettings.Development.json",
"appsettings.json",
$"{Name}.runtimeconfig.json",
"web.config",
});
}
}

View File

@ -24,5 +24,11 @@ namespace AspNetCoreSdkTests.Templates
$"{Name}.Views.dll",
$"{Name}.Views.pdb",
}.Select(p => Path.Combine(OutputPath, p)));
public override IEnumerable<string> ExpectedFilesAfterPublish => Enumerable.Concat(base.ExpectedFilesAfterPublish, new[]
{
$"{Name}.Views.dll",
$"{Name}.Views.pdb",
});
}
}

View File

@ -0,0 +1,54 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace AspNetCoreSdkTests.Templates
{
public abstract class RazorBootstrapJQueryTemplate : RazorApplicationBaseTemplate
{
public override IEnumerable<string> ExpectedFilesAfterPublish => Enumerable.Concat(base.ExpectedFilesAfterPublish, new[]
{
Path.Combine("wwwroot", "favicon.ico"),
Path.Combine("wwwroot", "css", "site.css"),
Path.Combine("wwwroot", "css", "site.min.css"),
Path.Combine("wwwroot", "images", "banner1.svg"),
Path.Combine("wwwroot", "images", "banner2.svg"),
Path.Combine("wwwroot", "images", "banner3.svg"),
Path.Combine("wwwroot", "js", "site.js"),
Path.Combine("wwwroot", "js", "site.min.js"),
Path.Combine("wwwroot", "lib", "bootstrap", ".bower.json"),
Path.Combine("wwwroot", "lib", "bootstrap", "LICENSE"),
Path.Combine("wwwroot", "lib", "bootstrap", "dist", "css", "bootstrap-theme.css"),
Path.Combine("wwwroot", "lib", "bootstrap", "dist", "css", "bootstrap-theme.css.map"),
Path.Combine("wwwroot", "lib", "bootstrap", "dist", "css", "bootstrap-theme.min.css"),
Path.Combine("wwwroot", "lib", "bootstrap", "dist", "css", "bootstrap-theme.min.css.map"),
Path.Combine("wwwroot", "lib", "bootstrap", "dist", "css", "bootstrap.css"),
Path.Combine("wwwroot", "lib", "bootstrap", "dist", "css", "bootstrap.css.map"),
Path.Combine("wwwroot", "lib", "bootstrap", "dist", "css", "bootstrap.min.css"),
Path.Combine("wwwroot", "lib", "bootstrap", "dist", "css", "bootstrap.min.css.map"),
Path.Combine("wwwroot", "lib", "bootstrap", "dist", "fonts", "glyphicons-halflings-regular.eot"),
Path.Combine("wwwroot", "lib", "bootstrap", "dist", "fonts", "glyphicons-halflings-regular.svg"),
Path.Combine("wwwroot", "lib", "bootstrap", "dist", "fonts", "glyphicons-halflings-regular.ttf"),
Path.Combine("wwwroot", "lib", "bootstrap", "dist", "fonts", "glyphicons-halflings-regular.woff"),
Path.Combine("wwwroot", "lib", "bootstrap", "dist", "fonts", "glyphicons-halflings-regular.woff2"),
Path.Combine("wwwroot", "lib", "bootstrap", "dist", "js", "bootstrap.js"),
Path.Combine("wwwroot", "lib", "bootstrap", "dist", "js", "bootstrap.min.js"),
Path.Combine("wwwroot", "lib", "bootstrap", "dist", "js", "npm.js"),
Path.Combine("wwwroot", "lib", "jquery", ".bower.json"),
Path.Combine("wwwroot", "lib", "jquery", "LICENSE.txt"),
Path.Combine("wwwroot", "lib", "jquery", "dist", "jquery.js"),
Path.Combine("wwwroot", "lib", "jquery", "dist", "jquery.min.js"),
Path.Combine("wwwroot", "lib", "jquery", "dist", "jquery.min.map"),
Path.Combine("wwwroot", "lib", "jquery-validation", ".bower.json"),
Path.Combine("wwwroot", "lib", "jquery-validation", "LICENSE.md"),
Path.Combine("wwwroot", "lib", "jquery-validation", "dist", "additional-methods.js"),
Path.Combine("wwwroot", "lib", "jquery-validation", "dist", "additional-methods.min.js"),
Path.Combine("wwwroot", "lib", "jquery-validation", "dist", "jquery.validate.js"),
Path.Combine("wwwroot", "lib", "jquery-validation", "dist", "jquery.validate.min.js"),
Path.Combine("wwwroot", "lib", "jquery-validation-unobtrusive", ".bower.json"),
Path.Combine("wwwroot", "lib", "jquery-validation-unobtrusive", "jquery.validate.unobtrusive.js"),
Path.Combine("wwwroot", "lib", "jquery-validation-unobtrusive", "jquery.validate.unobtrusive.min.js"),
Path.Combine("wwwroot", "lib", "jquery-validation-unobtrusive", "LICENSE.txt"),
});
}
}

View File

@ -137,5 +137,150 @@ namespace AspNetCoreSdkTests.Templates
Path.Combine("refs", "System.Xml.XPath.dll"),
Path.Combine("refs", "System.Xml.XPath.XDocument.dll"),
}.Select(p => Path.Combine(OutputPath, p)));
public override IEnumerable<string> ExpectedFilesAfterPublish => Enumerable.Concat(base.ExpectedFilesAfterPublish, new[]
{
"Microsoft.AspNetCore.Antiforgery.dll",
"Microsoft.AspNetCore.Authentication.Abstractions.dll",
"Microsoft.AspNetCore.Authentication.Core.dll",
"Microsoft.AspNetCore.Authorization.dll",
"Microsoft.AspNetCore.Authorization.Policy.dll",
"Microsoft.AspNetCore.Cors.dll",
"Microsoft.AspNetCore.Cryptography.Internal.dll",
"Microsoft.AspNetCore.DataProtection.Abstractions.dll",
"Microsoft.AspNetCore.DataProtection.dll",
"Microsoft.AspNetCore.Diagnostics.Abstractions.dll",
"Microsoft.AspNetCore.Hosting.Abstractions.dll",
"Microsoft.AspNetCore.Hosting.Server.Abstractions.dll",
"Microsoft.AspNetCore.Html.Abstractions.dll",
"Microsoft.AspNetCore.Http.Abstractions.dll",
"Microsoft.AspNetCore.Http.dll",
"Microsoft.AspNetCore.Http.Extensions.dll",
"Microsoft.AspNetCore.Http.Features.dll",
"Microsoft.AspNetCore.JsonPatch.dll",
"Microsoft.AspNetCore.Localization.dll",
"Microsoft.AspNetCore.Mvc.Abstractions.dll",
"Microsoft.AspNetCore.Mvc.ApiExplorer.dll",
"Microsoft.AspNetCore.Mvc.Core.dll",
"Microsoft.AspNetCore.Mvc.Cors.dll",
"Microsoft.AspNetCore.Mvc.DataAnnotations.dll",
"Microsoft.AspNetCore.Mvc.dll",
"Microsoft.AspNetCore.Mvc.Formatters.Json.dll",
"Microsoft.AspNetCore.Mvc.Localization.dll",
"Microsoft.AspNetCore.Mvc.Razor.dll",
"Microsoft.AspNetCore.Mvc.Razor.Extensions.dll",
"Microsoft.AspNetCore.Mvc.RazorPages.dll",
"Microsoft.AspNetCore.Mvc.TagHelpers.dll",
"Microsoft.AspNetCore.Mvc.ViewFeatures.dll",
"Microsoft.AspNetCore.Razor.dll",
"Microsoft.AspNetCore.Razor.Language.dll",
"Microsoft.AspNetCore.Razor.Runtime.dll",
"Microsoft.AspNetCore.ResponseCaching.Abstractions.dll",
"Microsoft.AspNetCore.Routing.Abstractions.dll",
"Microsoft.AspNetCore.Routing.dll",
"Microsoft.AspNetCore.WebUtilities.dll",
"Microsoft.CodeAnalysis.CSharp.dll",
"Microsoft.CodeAnalysis.dll",
"Microsoft.CodeAnalysis.Razor.dll",
"Microsoft.CSharp.dll",
"Microsoft.DotNet.PlatformAbstractions.dll",
"Microsoft.Extensions.Caching.Abstractions.dll",
"Microsoft.Extensions.Caching.Memory.dll",
"Microsoft.Extensions.Configuration.Abstractions.dll",
"Microsoft.Extensions.DependencyInjection.Abstractions.dll",
"Microsoft.Extensions.DependencyInjection.dll",
"Microsoft.Extensions.DependencyModel.dll",
"Microsoft.Extensions.FileProviders.Abstractions.dll",
"Microsoft.Extensions.FileProviders.Composite.dll",
"Microsoft.Extensions.FileSystemGlobbing.dll",
"Microsoft.Extensions.Hosting.Abstractions.dll",
"Microsoft.Extensions.Localization.Abstractions.dll",
"Microsoft.Extensions.Localization.dll",
"Microsoft.Extensions.Logging.Abstractions.dll",
"Microsoft.Extensions.ObjectPool.dll",
"Microsoft.Extensions.Options.dll",
"Microsoft.Extensions.Primitives.dll",
"Microsoft.Extensions.WebEncoders.dll",
"Microsoft.Net.Http.Headers.dll",
"Microsoft.Win32.Registry.dll",
"Newtonsoft.Json.Bson.dll",
"Newtonsoft.Json.dll",
Path.Combine("runtimes", "debian.8-x64", "native", "System.Security.Cryptography.Native.OpenSsl.so"),
Path.Combine("runtimes", "fedora.23-x64", "native", "System.Security.Cryptography.Native.OpenSsl.so"),
Path.Combine("runtimes", "fedora.24-x64", "native", "System.Security.Cryptography.Native.OpenSsl.so"),
Path.Combine("runtimes", "opensuse.13.2-x64", "native", "System.Security.Cryptography.Native.OpenSsl.so"),
Path.Combine("runtimes", "opensuse.42.1-x64", "native", "System.Security.Cryptography.Native.OpenSsl.so"),
Path.Combine("runtimes", "osx", "lib", "netstandard1.6", "System.Security.Cryptography.Algorithms.dll"),
Path.Combine("runtimes", "osx.10.10-x64", "native", "System.Security.Cryptography.Native.Apple.dylib"),
Path.Combine("runtimes", "osx.10.10-x64", "native", "System.Security.Cryptography.Native.OpenSsl.dylib"),
Path.Combine("runtimes", "rhel.7-x64", "native", "System.Security.Cryptography.Native.OpenSsl.so"),
Path.Combine("runtimes", "ubuntu.14.04-x64", "native", "System.Security.Cryptography.Native.OpenSsl.so"),
Path.Combine("runtimes", "ubuntu.16.04-x64", "native", "System.Security.Cryptography.Native.OpenSsl.so"),
Path.Combine("runtimes", "ubuntu.16.10-x64", "native", "System.Security.Cryptography.Native.OpenSsl.so"),
Path.Combine("runtimes", "unix", "lib", "netstandard1.1", "System.Runtime.InteropServices.RuntimeInformation.dll"),
Path.Combine("runtimes", "unix", "lib", "netstandard1.3", "System.Diagnostics.FileVersionInfo.dll"),
Path.Combine("runtimes", "unix", "lib", "netstandard1.3", "System.IO.Compression.dll"),
Path.Combine("runtimes", "unix", "lib", "netstandard1.3", "System.Security.Cryptography.Csp.dll"),
Path.Combine("runtimes", "unix", "lib", "netstandard1.3", "System.Security.Cryptography.Encoding.dll"),
Path.Combine("runtimes", "unix", "lib", "netstandard1.3", "System.Text.Encoding.CodePages.dll"),
Path.Combine("runtimes", "unix", "lib", "netstandard1.6", "System.Security.Cryptography.Algorithms.dll"),
Path.Combine("runtimes", "unix", "lib", "netstandard1.6", "System.Security.Cryptography.OpenSsl.dll"),
Path.Combine("runtimes", "unix", "lib", "netstandard1.6", "System.Security.Cryptography.X509Certificates.dll"),
Path.Combine("runtimes", "unix", "lib", "netstandard2.0", "Microsoft.Win32.Registry.dll"),
Path.Combine("runtimes", "win", "lib", "netstandard1.1", "System.Runtime.InteropServices.RuntimeInformation.dll"),
Path.Combine("runtimes", "win", "lib", "netstandard1.3", "System.Diagnostics.FileVersionInfo.dll"),
Path.Combine("runtimes", "win", "lib", "netstandard1.3", "System.IO.Compression.dll"),
Path.Combine("runtimes", "win", "lib", "netstandard1.3", "System.Security.AccessControl.dll"),
Path.Combine("runtimes", "win", "lib", "netstandard1.3", "System.Security.Cryptography.Csp.dll"),
Path.Combine("runtimes", "win", "lib", "netstandard1.3", "System.Security.Cryptography.Encoding.dll"),
Path.Combine("runtimes", "win", "lib", "netstandard1.3", "System.Security.Principal.Windows.dll"),
Path.Combine("runtimes", "win", "lib", "netstandard1.3", "System.Text.Encoding.CodePages.dll"),
Path.Combine("runtimes", "win", "lib", "netstandard1.6", "System.Security.Cryptography.Algorithms.dll"),
Path.Combine("runtimes", "win", "lib", "netstandard1.6", "System.Security.Cryptography.Cng.dll"),
Path.Combine("runtimes", "win", "lib", "netstandard1.6", "System.Security.Cryptography.X509Certificates.dll"),
Path.Combine("runtimes", "win", "lib", "netstandard2.0", "Microsoft.Win32.Registry.dll"),
Path.Combine("runtimes", "win", "lib", "netstandard2.0", "System.Security.Cryptography.Pkcs.dll"),
"System.AppContext.dll",
"System.Buffers.dll",
"System.Collections.Concurrent.dll",
"System.Collections.Immutable.dll",
"System.ComponentModel.Annotations.dll",
"System.Diagnostics.DiagnosticSource.dll",
"System.Diagnostics.StackTrace.dll",
"System.Dynamic.Runtime.dll",
"System.IO.FileSystem.Primitives.dll",
"System.Linq.dll",
"System.Linq.Expressions.dll",
"System.Memory.dll",
"System.Numerics.Vectors.dll",
"System.ObjectModel.dll",
"System.Reflection.Emit.dll",
"System.Reflection.Emit.ILGeneration.dll",
"System.Reflection.Emit.Lightweight.dll",
"System.Reflection.Metadata.dll",
"System.Reflection.TypeExtensions.dll",
"System.Runtime.CompilerServices.Unsafe.dll",
"System.Runtime.Numerics.dll",
"System.Security.AccessControl.dll",
"System.Security.Cryptography.Cng.dll",
"System.Security.Cryptography.OpenSsl.dll",
"System.Security.Cryptography.Pkcs.dll",
"System.Security.Cryptography.Primitives.dll",
"System.Security.Cryptography.Xml.dll",
"System.Security.Permissions.dll",
"System.Security.Principal.Windows.dll",
"System.Text.Encodings.Web.dll",
"System.Text.RegularExpressions.dll",
"System.Threading.dll",
"System.Threading.Tasks.Extensions.dll",
"System.Threading.Tasks.Parallel.dll",
"System.Threading.Thread.dll",
"System.ValueTuple.dll",
"System.Xml.ReaderWriter.dll",
"System.Xml.XDocument.dll",
"System.Xml.XmlDocument.dll",
"System.Xml.XPath.dll",
"System.Xml.XPath.XDocument.dll",
});
}
}

View File

@ -4,7 +4,7 @@ using System.Linq;
namespace AspNetCoreSdkTests.Templates
{
public class RazorTemplate : RazorApplicationBaseTemplate
public class RazorTemplate : RazorBootstrapJQueryTemplate
{
public new static RazorTemplate Instance { get; } = new RazorTemplate();

View File

@ -1,4 +1,7 @@
namespace AspNetCoreSdkTests.Templates
using System.Collections.Generic;
using System.Linq;
namespace AspNetCoreSdkTests.Templates
{
public class ReactReduxTemplate : ReactTemplate
{
@ -7,5 +10,9 @@
protected ReactReduxTemplate() { }
public override string Name => "reactredux";
public override IEnumerable<string> ExpectedFilesAfterPublish =>
from f in base.ExpectedFilesAfterPublish
select f.Replace("main.31eb739b.js", "main.485d93fa.js");
}
}

View File

@ -1,4 +1,8 @@
namespace AspNetCoreSdkTests.Templates
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace AspNetCoreSdkTests.Templates
{
public class ReactTemplate : SpaBaseTemplate
{
@ -7,5 +11,23 @@
protected ReactTemplate() { }
public override string Name => "react";
public override IEnumerable<string> ExpectedFilesAfterPublish => Enumerable.Concat(base.ExpectedFilesAfterPublish, new[]
{
Path.Combine("ClientApp", "build", "asset-manifest.json"),
Path.Combine("ClientApp", "build", "favicon.ico"),
Path.Combine("ClientApp", "build", "index.html"),
Path.Combine("ClientApp", "build", "manifest.json"),
Path.Combine("ClientApp", "build", "service-worker.js"),
Path.Combine("ClientApp", "build", "static", "css", "main.8302bbea.css"),
Path.Combine("ClientApp", "build", "static", "css", "main.8302bbea.css.map"),
Path.Combine("ClientApp", "build", "static", "js", "main.31eb739b.js"),
Path.Combine("ClientApp", "build", "static", "js", "main.31eb739b.js.map"),
Path.Combine("ClientApp", "build", "static", "media", "glyphicons-halflings-regular.448c34a5.woff2"),
Path.Combine("ClientApp", "build", "static", "media", "glyphicons-halflings-regular.89889688.svg"),
Path.Combine("ClientApp", "build", "static", "media", "glyphicons-halflings-regular.e18bbf61.ttf"),
Path.Combine("ClientApp", "build", "static", "media", "glyphicons-halflings-regular.f4769f9b.eot"),
Path.Combine("ClientApp", "build", "static", "media", "glyphicons-halflings-regular.fa277232.woff"),
});
}
}

View File

@ -1,8 +1,6 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace AspNetCoreSdkTests.Templates
{

View File

@ -20,6 +20,8 @@ namespace AspNetCoreSdkTests.Templates
public abstract IEnumerable<string> ExpectedBinFilesAfterBuild { get; }
public abstract IEnumerable<string> ExpectedFilesAfterPublish { get; }
public override string ToString() => Name;
}
}

View File

@ -1,4 +1,7 @@
namespace AspNetCoreSdkTests.Templates
using System.Collections.Generic;
using System.Linq;
namespace AspNetCoreSdkTests.Templates
{
public class WebApiTemplate : WebTemplate
{
@ -9,5 +12,11 @@
public override string Name => "webapi";
public override string RelativeUrl => "/api/values";
public override IEnumerable<string> ExpectedFilesAfterPublish => Enumerable.Concat(base.ExpectedFilesAfterPublish, new[]
{
"appsettings.Development.json",
"appsettings.json",
});
}
}

View File

@ -20,5 +20,10 @@ namespace AspNetCoreSdkTests.Templates
$"{Name}.RazorAssemblyInfo.cs",
$"{Name}.RazorTargetAssemblyInfo.cache",
}.Select(p => Path.Combine(OutputPath, p)));
public override IEnumerable<string> ExpectedFilesAfterPublish => Enumerable.Concat(base.ExpectedFilesAfterPublish, new[]
{
"web.config",
});
}
}

View File

@ -49,6 +49,11 @@ namespace AspNetCoreSdkTests.Util
}
}
public string Publish()
{
return DotNetUtil.Publish(Path);
}
public IEnumerable<string> GetObjFiles()
{
return IOUtil.GetFiles(System.IO.Path.Combine(Path, "obj"));
@ -59,6 +64,11 @@ namespace AspNetCoreSdkTests.Util
return IOUtil.GetFiles(System.IO.Path.Combine(Path, "bin"));
}
public IEnumerable<string> GetPublishFiles()
{
return IOUtil.GetFiles(System.IO.Path.Combine(Path, DotNetUtil.PublishOutput));
}
public override void Dispose()
{
// Must stop process to release filehandles before calling base.Dispose() which deletes app dir

View File

@ -9,6 +9,8 @@ namespace AspNetCoreSdkTests.Util
{
internal static class DotNetUtil
{
public static string PublishOutput => "pub";
private static IEnumerable<KeyValuePair<string, string>> GetEnvironment(string workingDirectory)
{
// Set NUGET_PACKAGES to an empty folder to ensure all packages are loaded from either NuGetFallbackFolder or configured sources,
@ -38,6 +40,11 @@ namespace AspNetCoreSdkTests.Util
return StartDotNet("run --no-restore --urls http://127.0.0.1:0;https://127.0.0.1:0", workingDirectory, GetEnvironment(workingDirectory));
}
public static string Publish(string workingDirectory)
{
return RunDotNet($"publish --no-restore -o {PublishOutput}", workingDirectory, GetEnvironment(workingDirectory));
}
private static string RunDotNet(string arguments, string workingDirectory,
IEnumerable<KeyValuePair<string, string>> environment = null, bool throwOnError = true)
{