Upgrade to xunit 2.3.0-beta4
This commit is contained in:
parent
312e0da556
commit
e7541e99a7
|
|
@ -6,9 +6,9 @@
|
||||||
<NETStandardImplicitPackageVersion>2.0.0-*</NETStandardImplicitPackageVersion>
|
<NETStandardImplicitPackageVersion>2.0.0-*</NETStandardImplicitPackageVersion>
|
||||||
<NETStandardLibraryNETFrameworkVersion>2.0.0-*</NETStandardLibraryNETFrameworkVersion>
|
<NETStandardLibraryNETFrameworkVersion>2.0.0-*</NETStandardLibraryNETFrameworkVersion>
|
||||||
<RuntimeFrameworkVersion Condition="'$(TargetFramework)'=='netcoreapp2.0'">2.0.0-*</RuntimeFrameworkVersion>
|
<RuntimeFrameworkVersion Condition="'$(TargetFramework)'=='netcoreapp2.0'">2.0.0-*</RuntimeFrameworkVersion>
|
||||||
<TestSdkVersion>15.3.0-*</TestSdkVersion>
|
<TestSdkVersion>15.3.0</TestSdkVersion>
|
||||||
<WindowsApiSetsVersion>1.0.1</WindowsApiSetsVersion>
|
<WindowsApiSetsVersion>1.0.1</WindowsApiSetsVersion>
|
||||||
<XunitVersion>2.3.0-beta2-*</XunitVersion>
|
<XunitVersion>2.3.0-beta4-build3742</XunitVersion>
|
||||||
<MoqVersion>4.7.49</MoqVersion>
|
<MoqVersion>4.7.49</MoqVersion>
|
||||||
<SerilogExtensionsLoggingVersion>1.4.0</SerilogExtensionsLoggingVersion>
|
<SerilogExtensionsLoggingVersion>1.4.0</SerilogExtensionsLoggingVersion>
|
||||||
<SerilogFileSinkVersion>3.2.0</SerilogFileSinkVersion>
|
<SerilogFileSinkVersion>3.2.0</SerilogFileSinkVersion>
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ namespace Microsoft.AspNetCore.Certificates.Configuration.Tests
|
||||||
Mock.Of<ICertificateStoreLoader>());
|
Mock.Of<ICertificateStoreLoader>());
|
||||||
|
|
||||||
var loadedCertificates = certificateLoader.Load(configuration.GetSection("TestConfig:Certificate"));
|
var loadedCertificates = certificateLoader.Load(configuration.GetSection("TestConfig:Certificate"));
|
||||||
Assert.Equal(1, loadedCertificates.Count());
|
Assert.Single(loadedCertificates);
|
||||||
Assert.Same(certificate, loadedCertificates.ElementAt(0));
|
Assert.Same(certificate, loadedCertificates.ElementAt(0));
|
||||||
certificateFileLoader.VerifyAll();
|
certificateFileLoader.VerifyAll();
|
||||||
}
|
}
|
||||||
|
|
@ -126,7 +126,7 @@ namespace Microsoft.AspNetCore.Certificates.Configuration.Tests
|
||||||
certificateStoreLoader.Object);
|
certificateStoreLoader.Object);
|
||||||
|
|
||||||
var loadedCertificates = certificateLoader.Load(configuration.GetSection("TestConfig:Certificate"));
|
var loadedCertificates = certificateLoader.Load(configuration.GetSection("TestConfig:Certificate"));
|
||||||
Assert.Equal(1, loadedCertificates.Count());
|
Assert.Single(loadedCertificates);
|
||||||
Assert.Same(certificate, loadedCertificates.ElementAt(0));
|
Assert.Same(certificate, loadedCertificates.ElementAt(0));
|
||||||
certificateStoreLoader.VerifyAll();
|
certificateStoreLoader.VerifyAll();
|
||||||
}
|
}
|
||||||
|
|
@ -158,7 +158,7 @@ namespace Microsoft.AspNetCore.Certificates.Configuration.Tests
|
||||||
certificateStoreLoader.Object);
|
certificateStoreLoader.Object);
|
||||||
|
|
||||||
var loadedCertificates = certificateLoader.Load(configuration.GetSection("TestConfig:Certificate"));
|
var loadedCertificates = certificateLoader.Load(configuration.GetSection("TestConfig:Certificate"));
|
||||||
Assert.Equal(0, loadedCertificates.Count());
|
Assert.Empty(loadedCertificates);
|
||||||
certificateStoreLoader.VerifyAll();
|
certificateStoreLoader.VerifyAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -480,7 +480,7 @@ namespace Microsoft.AspNetCore.Certificates.Configuration.Tests
|
||||||
["Certificates:Certificate2:Subject"] = "localhost",
|
["Certificates:Certificate2:Subject"] = "localhost",
|
||||||
["Certificates:Certificate2:StoreName"] = "My",
|
["Certificates:Certificate2:StoreName"] = "My",
|
||||||
["Certificates:Certificate2:StoreLocation"] = "CurrentUser",
|
["Certificates:Certificate2:StoreLocation"] = "CurrentUser",
|
||||||
["TestConfig:Certificate"] = "Certificate1;Certificate2"
|
["TestConfig:Certificate"] = certificateNames,
|
||||||
})
|
})
|
||||||
.Build();
|
.Build();
|
||||||
|
|
||||||
|
|
@ -504,7 +504,7 @@ namespace Microsoft.AspNetCore.Certificates.Configuration.Tests
|
||||||
certificateStoreLoader.Object);
|
certificateStoreLoader.Object);
|
||||||
|
|
||||||
var loadedCertificates = certificateLoader.Load(configuration.GetSection("TestConfig:Certificate"));
|
var loadedCertificates = certificateLoader.Load(configuration.GetSection("TestConfig:Certificate"));
|
||||||
Assert.Equal(1, loadedCertificates.Count());
|
Assert.Single(loadedCertificates);
|
||||||
Assert.Same(certificate, loadedCertificates.ElementAt(0));
|
Assert.Same(certificate, loadedCertificates.ElementAt(0));
|
||||||
certificateFileLoader.VerifyAll();
|
certificateFileLoader.VerifyAll();
|
||||||
certificateStoreLoader.VerifyAll();
|
certificateStoreLoader.VerifyAll();
|
||||||
|
|
@ -537,7 +537,7 @@ namespace Microsoft.AspNetCore.Certificates.Configuration.Tests
|
||||||
Mock.Of<ICertificateStoreLoader>());
|
Mock.Of<ICertificateStoreLoader>());
|
||||||
|
|
||||||
var loadedCertificates = certificateLoader.Load(configuration.GetSection("TestConfig:Certificate"));
|
var loadedCertificates = certificateLoader.Load(configuration.GetSection("TestConfig:Certificate"));
|
||||||
Assert.Equal(1, loadedCertificates.Count());
|
Assert.Single(loadedCertificates);
|
||||||
Assert.Same(certificate, loadedCertificates.ElementAt(0));
|
Assert.Same(certificate, loadedCertificates.ElementAt(0));
|
||||||
certificateFileLoader.VerifyAll();
|
certificateFileLoader.VerifyAll();
|
||||||
}
|
}
|
||||||
|
|
@ -599,7 +599,7 @@ namespace Microsoft.AspNetCore.Certificates.Configuration.Tests
|
||||||
certificateStoreLoader.Object);
|
certificateStoreLoader.Object);
|
||||||
|
|
||||||
var loadedCertificates = certificateLoader.Load(configuration.GetSection("TestConfig:Certificate"));
|
var loadedCertificates = certificateLoader.Load(configuration.GetSection("TestConfig:Certificate"));
|
||||||
Assert.Equal(1, loadedCertificates.Count());
|
Assert.Single(loadedCertificates);
|
||||||
Assert.Same(certificate, loadedCertificates.ElementAt(0));
|
Assert.Same(certificate, loadedCertificates.ElementAt(0));
|
||||||
certificateStoreLoader.VerifyAll();
|
certificateStoreLoader.VerifyAll();
|
||||||
}
|
}
|
||||||
|
|
@ -627,7 +627,7 @@ namespace Microsoft.AspNetCore.Certificates.Configuration.Tests
|
||||||
certificateStoreLoader.Object);
|
certificateStoreLoader.Object);
|
||||||
|
|
||||||
var loadedCertificates = certificateLoader.Load(configuration.GetSection("TestConfig:Certificate"));
|
var loadedCertificates = certificateLoader.Load(configuration.GetSection("TestConfig:Certificate"));
|
||||||
Assert.Equal(0, loadedCertificates.Count());
|
Assert.Empty(loadedCertificates);
|
||||||
certificateStoreLoader.Verify(loader => loader.Load("localhost", "My", StoreLocation.CurrentUser, It.IsAny<bool>()));
|
certificateStoreLoader.Verify(loader => loader.Load("localhost", "My", StoreLocation.CurrentUser, It.IsAny<bool>()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -785,7 +785,7 @@ namespace Microsoft.AspNetCore.Certificates.Configuration.Tests
|
||||||
certificateStoreLoader.Object);
|
certificateStoreLoader.Object);
|
||||||
|
|
||||||
var loadedCertificates = certificateLoader.Load(configuration.GetSection("TestConfig:Certificates"));
|
var loadedCertificates = certificateLoader.Load(configuration.GetSection("TestConfig:Certificates"));
|
||||||
Assert.Equal(1, loadedCertificates.Count());
|
Assert.Single(loadedCertificates);
|
||||||
Assert.Same(certificate, loadedCertificates.ElementAt(0));
|
Assert.Same(certificate, loadedCertificates.ElementAt(0));
|
||||||
certificateStoreLoader.Verify(loader => loader.Load("notfound.com", "Root", StoreLocation.LocalMachine, It.IsAny<bool>()));
|
certificateStoreLoader.Verify(loader => loader.Load("notfound.com", "Root", StoreLocation.LocalMachine, It.IsAny<bool>()));
|
||||||
certificateStoreLoader.Verify(loader => loader.Load("localhost", "My", StoreLocation.CurrentUser, It.IsAny<bool>()));
|
certificateStoreLoader.Verify(loader => loader.Load("localhost", "My", StoreLocation.CurrentUser, It.IsAny<bool>()));
|
||||||
|
|
@ -927,7 +927,7 @@ namespace Microsoft.AspNetCore.Certificates.Configuration.Tests
|
||||||
certificateStoreLoader.Object);
|
certificateStoreLoader.Object);
|
||||||
|
|
||||||
var loadedCertificates = certificateLoader.Load(configuration.GetSection("TestConfig:Certificates"));
|
var loadedCertificates = certificateLoader.Load(configuration.GetSection("TestConfig:Certificates"));
|
||||||
Assert.Equal(1, loadedCertificates.Count());
|
Assert.Single(loadedCertificates);
|
||||||
Assert.Same(certificate, loadedCertificates.ElementAt(0));
|
Assert.Same(certificate, loadedCertificates.ElementAt(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1003,7 +1003,7 @@ namespace Microsoft.AspNetCore.Certificates.Configuration.Tests
|
||||||
Mock.Of<ICertificateStoreLoader>());
|
Mock.Of<ICertificateStoreLoader>());
|
||||||
|
|
||||||
var loadedCertificates = certificateLoader.Load(configuration.GetSection("TestConfig:Certificates"));
|
var loadedCertificates = certificateLoader.Load(configuration.GetSection("TestConfig:Certificates"));
|
||||||
Assert.Equal(0, loadedCertificates.Count());
|
Assert.Empty(loadedCertificates);
|
||||||
Assert.Single(logger.LogMessages, logMessage =>
|
Assert.Single(logger.LogMessages, logMessage =>
|
||||||
logMessage.LogLevel == LogLevel.Warning &&
|
logMessage.LogLevel == LogLevel.Warning &&
|
||||||
logMessage.Message == "Unable to find a matching certificate for subject 'localhost' in store 'My' in 'CurrentUser'.");
|
logMessage.Message == "Unable to find a matching certificate for subject 'localhost' in store 'My' in 'CurrentUser'.");
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ namespace Microsoft.AspNetCore.Hosting.Tests
|
||||||
// Act
|
// Act
|
||||||
var context = hostingApplication.CreateContext(features);
|
var context = hostingApplication.CreateContext(features);
|
||||||
|
|
||||||
Assert.Equal(1, logger.Scopes.Count);
|
Assert.Single(logger.Scopes);
|
||||||
var pairs = ((IReadOnlyList<KeyValuePair<string, object>>)logger.Scopes[0]).ToDictionary(p => p.Key, p => p.Value);
|
var pairs = ((IReadOnlyList<KeyValuePair<string, object>>)logger.Scopes[0]).ToDictionary(p => p.Key, p => p.Value);
|
||||||
Assert.Equal("some correlation id", pairs["CorrelationId"].ToString());
|
Assert.Equal("some correlation id", pairs["CorrelationId"].ToString());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -154,7 +154,7 @@ namespace Microsoft.AspNetCore.Hosting.Internal
|
||||||
Assert.Equal(EventLevel.Informational, eventData.Level);
|
Assert.Equal(EventLevel.Informational, eventData.Level);
|
||||||
Assert.Same(hostingEventSource, eventData.EventSource);
|
Assert.Same(hostingEventSource, eventData.EventSource);
|
||||||
Assert.Null(eventData.Message);
|
Assert.Null(eventData.Message);
|
||||||
Assert.Equal(0, eventData.Payload.Count);
|
Assert.Empty(eventData.Payload);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
|
@ -176,7 +176,7 @@ namespace Microsoft.AspNetCore.Hosting.Internal
|
||||||
Assert.Equal(EventLevel.Error, eventData.Level);
|
Assert.Equal(EventLevel.Error, eventData.Level);
|
||||||
Assert.Same(hostingEventSource, eventData.EventSource);
|
Assert.Same(hostingEventSource, eventData.EventSource);
|
||||||
Assert.Null(eventData.Message);
|
Assert.Null(eventData.Message);
|
||||||
Assert.Equal(0, eventData.Payload.Count);
|
Assert.Empty(eventData.Payload);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Exception GetException()
|
private static Exception GetException()
|
||||||
|
|
|
||||||
|
|
@ -244,7 +244,7 @@ namespace Microsoft.AspNetCore.Hosting.Tests
|
||||||
app.ApplicationServices = startup.ConfigureServicesDelegate(serviceCollection);
|
app.ApplicationServices = startup.ConfigureServicesDelegate(serviceCollection);
|
||||||
|
|
||||||
var ex = Assert.Throws<TargetInvocationException>(() => startup.ConfigureDelegate(app));
|
var ex = Assert.Throws<TargetInvocationException>(() => startup.ConfigureDelegate(app));
|
||||||
Assert.IsAssignableFrom(typeof(InvalidOperationException), ex.InnerException);
|
Assert.IsAssignableFrom<InvalidOperationException>(ex.InnerException);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
|
@ -259,7 +259,7 @@ namespace Microsoft.AspNetCore.Hosting.Tests
|
||||||
var app = new ApplicationBuilder(services);
|
var app = new ApplicationBuilder(services);
|
||||||
app.ApplicationServices = startup.ConfigureServicesDelegate(serviceCollection);
|
app.ApplicationServices = startup.ConfigureServicesDelegate(serviceCollection);
|
||||||
|
|
||||||
Assert.IsType(typeof(MyContainer), app.ApplicationServices);
|
Assert.IsType<MyContainer>(app.ApplicationServices);
|
||||||
Assert.True(((MyContainer)app.ApplicationServices).FancyMethodCalled);
|
Assert.True(((MyContainer)app.ApplicationServices).FancyMethodCalled);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -275,7 +275,7 @@ namespace Microsoft.AspNetCore.Hosting.Tests
|
||||||
var app = new ApplicationBuilder(services);
|
var app = new ApplicationBuilder(services);
|
||||||
app.ApplicationServices = startup.ConfigureServicesDelegate(serviceCollection);
|
app.ApplicationServices = startup.ConfigureServicesDelegate(serviceCollection);
|
||||||
|
|
||||||
Assert.IsType(typeof(MyContainer), app.ApplicationServices);
|
Assert.IsType<MyContainer>(app.ApplicationServices);
|
||||||
Assert.True(((MyContainer)app.ApplicationServices).FancyMethodCalled);
|
Assert.True(((MyContainer)app.ApplicationServices).FancyMethodCalled);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -291,7 +291,7 @@ namespace Microsoft.AspNetCore.Hosting.Tests
|
||||||
var app = new ApplicationBuilder(services);
|
var app = new ApplicationBuilder(services);
|
||||||
app.ApplicationServices = startup.ConfigureServicesDelegate(serviceCollection);
|
app.ApplicationServices = startup.ConfigureServicesDelegate(serviceCollection);
|
||||||
|
|
||||||
Assert.IsType(typeof(MyContainer), app.ApplicationServices);
|
Assert.IsType<MyContainer>(app.ApplicationServices);
|
||||||
Assert.Equal(((MyContainer)app.ApplicationServices).Environment, EnvironmentName.Production);
|
Assert.Equal(((MyContainer)app.ApplicationServices).Environment, EnvironmentName.Production);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -338,7 +338,7 @@ namespace Microsoft.AspNetCore.Hosting.Tests
|
||||||
app.ApplicationServices = startup.ConfigureServicesDelegate(serviceCollection);
|
app.ApplicationServices = startup.ConfigureServicesDelegate(serviceCollection);
|
||||||
|
|
||||||
Assert.NotNull(app.ApplicationServices);
|
Assert.NotNull(app.ApplicationServices);
|
||||||
Assert.IsNotType(typeof(MyContainer), app.ApplicationServices);
|
Assert.IsNotType<MyContainer>(app.ApplicationServices);
|
||||||
}
|
}
|
||||||
|
|
||||||
public class MyContainerStartupWithOverloads
|
public class MyContainerStartupWithOverloads
|
||||||
|
|
|
||||||
|
|
@ -768,7 +768,7 @@ namespace Microsoft.AspNetCore.Hosting
|
||||||
using (var host = (WebHost)builder.Build())
|
using (var host = (WebHost)builder.Build())
|
||||||
{
|
{
|
||||||
var sink = host.Services.GetRequiredService<ITestSink>();
|
var sink = host.Services.GetRequiredService<ITestSink>();
|
||||||
Assert.True(sink.Writes.Any(w => w.State.ToString() == "From startup"));
|
Assert.Contains(sink.Writes, w => w.State.ToString() == "From startup");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -865,7 +865,7 @@ namespace Microsoft.AspNetCore.Hosting
|
||||||
using (var host = (WebHost)builder.Build())
|
using (var host = (WebHost)builder.Build())
|
||||||
{
|
{
|
||||||
var sink = host.Services.GetRequiredService<ITestSink>();
|
var sink = host.Services.GetRequiredService<ITestSink>();
|
||||||
Assert.True(sink.Writes.Any(w => w.Exception?.Message == "Startup exception"));
|
Assert.Contains(sink.Writes, w => w.Exception?.Message == "Startup exception");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -887,7 +887,7 @@ namespace Microsoft.AspNetCore.Hosting
|
||||||
Assert.Throws<InvalidOperationException>(() => builder.Build());
|
Assert.Throws<InvalidOperationException>(() => builder.Build());
|
||||||
|
|
||||||
Assert.NotNull(testSink);
|
Assert.NotNull(testSink);
|
||||||
Assert.True(testSink.Writes.Any(w => w.Exception?.Message == "Startup exception"));
|
Assert.Contains(testSink.Writes, w => w.Exception?.Message == "Startup exception");
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
|
|
||||||
|
|
@ -920,7 +920,7 @@ namespace Microsoft.AspNetCore.Hosting
|
||||||
.UseStartup<BadConfigureServicesStartup>();
|
.UseStartup<BadConfigureServicesStartup>();
|
||||||
|
|
||||||
var ex = Assert.Throws<InvalidOperationException>(() => builder.Build());
|
var ex = Assert.Throws<InvalidOperationException>(() => builder.Build());
|
||||||
Assert.True(ex.Message.Contains("ConfigureServices"));
|
Assert.Contains("ConfigureServices", ex.Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
public class BadConfigureServicesStartup
|
public class BadConfigureServicesStartup
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue