Skip to content

Commit

Permalink
Merge pull request #404 from AArnott/libtemplateUpdate
Browse files Browse the repository at this point in the history
Merge latest Library.Template
  • Loading branch information
AArnott authored Jul 10, 2023
2 parents 8767da8 + c21fd26 commit 683d9b0
Show file tree
Hide file tree
Showing 16 changed files with 28 additions and 24 deletions.
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ updates:
directory: /
schedule:
interval: weekly
ignore:
# This package has unlisted versions on nuget.org that are not supported. Avoid them.
- dependency-name: dotnet-format
versions: ["6.x", "7.x", "8.x"]
10 changes: 5 additions & 5 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>

<MicroBuildVersion>2.0.130</MicroBuildVersion>
<MicroBuildVersion>2.0.131</MicroBuildVersion>
<CodeAnalysisVersionForAnalyzers>3.11.0</CodeAnalysisVersionForAnalyzers>
<CodeAnalysisVersion>4.6.0</CodeAnalysisVersion>
<CodefixTestingVersion>1.1.1</CodefixTestingVersion>
Expand Down Expand Up @@ -36,11 +36,11 @@
<PackageVersion Include="System.Reflection.Emit" Version="4.7.0" />
<PackageVersion Include="System.Reflection.Metadata" Version="7.0.0" />
<PackageVersion Include="System.Threading.Tasks.Dataflow" Version="7.0.0" />
<PackageVersion Include="xunit.extensibility.execution" Version="2.4.2" />
<PackageVersion Include="xunit.runner.console" Version="2.4.2" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.4.5" />
<PackageVersion Include="xunit.extensibility.execution" Version="2.5.0" />
<PackageVersion Include="xunit.runner.console" Version="2.5.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.0" />
<PackageVersion Include="Xunit.SkippableFact" Version="1.4.13" />
<PackageVersion Include="xunit" Version="2.4.2" />
<PackageVersion Include="xunit" Version="2.5.0" />
</ItemGroup>
<ItemGroup Condition="'$(IsAnalyzerProject)'=='true'">
<!-- Analyzers need to use older references to work in existing C# compilers. -->
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

- template: install-dependencies.yml

- script: dotnet tool run nbgv cloud -ca
- script: dotnet nbgv cloud -ca
displayName: ⚙ Set build number

- ${{ if eq(variables['system.collectionId'], '011b8bdf-6d56-4f87-be0d-0092136884d9') }}:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public void NonSharedPartProduction()
{
ComposablePartDefinition? result = this.DiscoveryService.CreatePart(typeof(NonSharedPart));
Assert.NotNull(result);
Assert.Equal(1, result!.ExportedTypes.Count);
Assert.Single(result!.ExportedTypes);
Assert.Empty(result.ImportingMembers);
Assert.False(result.IsShared);
}
Expand All @@ -34,7 +34,7 @@ public void SharedPartProduction()
{
ComposablePartDefinition? result = this.DiscoveryService.CreatePart(typeof(SharedPart));
Assert.NotNull(result);
Assert.Equal(1, result!.ExportedTypes.Count);
Assert.Single(result!.ExportedTypes);
Assert.Empty(result.ImportingMembers);
Assert.True(result.IsShared);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public async Task CreateFromTypesOmitsNonParts(PartDiscovery discovery)
{
var catalog = ComposableCatalog.Create(discovery.Resolver).AddParts(
await discovery.CreatePartsAsync(typeof(NonExportingType), typeof(ExportingType)));
Assert.Equal(1, catalog.Parts.Count);
Assert.Single(catalog.Parts);
Assert.Equal(typeof(ExportingType), catalog.Parts.Single().Type);
}

Expand All @@ -63,7 +63,7 @@ public void AddPartNullThrows()
[Fact]
public void GetAssemblyInputs_Empty()
{
Assert.Equal(0, TestUtilities.EmptyCatalog.GetInputAssemblies().Count);
Assert.Empty(TestUtilities.EmptyCatalog.GetInputAssemblies());
}

[Theory]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public void ExceptionIsSerializable()
try
{
configuration.ThrowOnErrors();
Assert.True(false, "Expected exception not thrown.");
Assert.Fail("Expected exception not thrown.");
}
catch (CompositionFailedException ex)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public class UninstantiatedNonSharedPart : IDisposable
{
public UninstantiatedNonSharedPart()
{
Assert.False(true, "This should never be instantiated.");
Assert.Fail("This should never be instantiated.");
}

public void Dispose()
Expand Down Expand Up @@ -176,7 +176,7 @@ public void PartDisposedWhenThrows(IContainer container)
try
{
container.GetExportedValue<ThrowingPart>();
Assert.False(true, "An exception should have been thrown.");
Assert.Fail("An exception should have been thrown.");
}
catch { }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public void ExportedMethodFuncOf2WrongTypeArgs(IContainer container)
try
{
container.GetExportedValue<Func<string, string, bool>>("Method");
Assert.False(true, "Expected exception not thrown.");
Assert.Fail("Expected exception not thrown.");
}
catch (MefV1.ImportCardinalityMismatchException) { }
catch (Microsoft.VisualStudio.Composition.CompositionFailedException) { } // V2/V3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ private static void AssertThrowsV1(Func<object?> action)
try
{
action();
Assert.False(true, "Expected exception not thrown.");
Assert.Fail("Expected exception not thrown.");
}
catch (CompositionFailedException ex)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public void ImportManyIListWithNone(IContainer container)
var extendable = container.GetExportedValue<ExtendableIList>();
Assert.NotNull(extendable);
Assert.NotNull(extendable.Extensions);
Assert.Equal(0, extendable.Extensions.Count);
Assert.Empty(extendable.Extensions);
}

[MefFact(CompositionEngines.V2Compat, typeof(ExtendableIList), typeof(ExtensionOne))]
Expand All @@ -112,7 +112,7 @@ public void ImportManyIListWithOne(IContainer container)
var extendable = container.GetExportedValue<ExtendableIList>();
Assert.NotNull(extendable);
Assert.NotNull(extendable.Extensions);
Assert.Equal(1, extendable.Extensions.Count);
Assert.Single(extendable.Extensions);
Assert.IsAssignableFrom<ExtensionOne>(extendable.Extensions.Single());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public void UncreatableLazyImportedPartV1(IContainer container)
try
{
var throws = part.ImportOfUncreatablePart.Value;
Assert.False(true, "Expected exception not thrown.");
Assert.Fail("Expected exception not thrown.");
}
catch (CompositionFailedException) { }
catch (MefV1.CompositionException) { }
Expand Down Expand Up @@ -187,7 +187,7 @@ public void UncreatableLazyImportedPartWithImportingPropertyV1(IContainer contai
try
{
var throws = part.LazyImportOfUncreatablePart.Value;
Assert.False(true, "Expected exception not thrown.");
Assert.Fail("Expected exception not thrown.");
}
catch (CompositionFailedException) { }
catch (MefV1.CompositionException) { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public class ExportWithLazyImportOfBaseType
public void LazyImportMany(IContainer container)
{
var lazyImport = container.GetExportedValue<ExportWithListOfLazyImport>();
Assert.Equal(1, lazyImport.AnotherExports.Count);
Assert.Single(lazyImport.AnotherExports);
Assert.Equal(0, AnotherExport.ConstructionCount);
Assert.False(lazyImport.AnotherExports[0].IsValueCreated);
AnotherExport anotherExport = lazyImport.AnotherExports[0].Value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void LazyImportOfPartWithMissingImportingConstructor(IContainer container
try
{
var expectFailure = exports[0].ImportOfBrokenPart.Value;
Assert.False(true, "Some type of composition exception was expected here.");
Assert.Fail("Some type of composition exception was expected here.");
}
catch (CompositionFailedException)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public void InvalidImportAcrossSharingBoundary(IContainer container)
// But that's not really a tenable prospect and it's harder to reason over anyway.
// It makes sense that MEFv2 didn't allow this.
root.Factory.CreateExport();
Assert.False(true, "Expected exception not thrown.");
Assert.Fail("Expected exception not thrown.");
}
catch (CompositionFailedException) { }
catch (System.Composition.Hosting.CompositionFailedException) { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public class SharedRootPartOnlyImportedFromChildScope
{
public SharedRootPartOnlyImportedFromChildScope()
{
Assert.False(true, "This type should ever be constructed. It should be imported lazily and never constructed as part of a GC test.");
Assert.Fail("This type should ever be constructed. It should be imported lazily and never constructed as part of a GC test.");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public bool QueueMessage(IMessageSinkMessage message)
else if (message is TestPassed)
{
var passedMessage = (TestPassed)message;
message = new TestFailed(passedMessage.Test, passedMessage.ExecutionTime, passedMessage.Output, new AssertActualExpectedException(false, true, "Expected invalid configuration but no exception thrown."));
message = new TestFailed(passedMessage.Test, passedMessage.ExecutionTime, passedMessage.Output, new XunitException("Expected invalid configuration but no exception thrown."));
this.InvertedSuccesses++;
}
}
Expand Down

0 comments on commit 683d9b0

Please sign in to comment.