forked from dotnet/corefx
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request dotnet#20962 from hughbe/composition-attributemode…
…l-tests Add System.Composition.AttributedModel tests
- Loading branch information
Showing
24 changed files
with
402 additions
and
50 deletions.
There are no files selected for viewing
23 changes: 21 additions & 2 deletions
23
src/System.Composition.AttributedModel/System.Composition.AttributedModel.sln
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,45 @@ | ||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 14 | ||
VisualStudioVersion = 14.0.25420.1 | ||
# Visual Studio 15 | ||
VisualStudioVersion = 15.0.26430.6 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Composition.AttributedModel", "src\System.Composition.AttributedModel.csproj", "{C6257381-C624-494A-A9D9-5586E60856EA}" | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{E107E9C1-E893-4E87-987E-04EF0DCEAEFD}" | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{DB303F4D-3697-4882-B6B9-FF221B6034A1}" | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Composition.AttributeModel.Tests", "tests\System.Composition.AttributeModel.Tests.csproj", "{853BB14F-8A5B-42B4-A053-21DE1AEBB335}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
netstandard-Debug|Any CPU = netstandard-Debug|Any CPU | ||
netstandard-Release|Any CPU = netstandard-Release|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{C6257381-C624-494A-A9D9-5586E60856EA}.Debug|Any CPU.ActiveCfg = netstandard-Debug|Any CPU | ||
{C6257381-C624-494A-A9D9-5586E60856EA}.Debug|Any CPU.Build.0 = netstandard-Debug|Any CPU | ||
{C6257381-C624-494A-A9D9-5586E60856EA}.netstandard-Debug|Any CPU.ActiveCfg = netstandard-Debug|Any CPU | ||
{C6257381-C624-494A-A9D9-5586E60856EA}.netstandard-Debug|Any CPU.Build.0 = netstandard-Debug|Any CPU | ||
{C6257381-C624-494A-A9D9-5586E60856EA}.netstandard-Release|Any CPU.ActiveCfg = netstandard-Release|Any CPU | ||
{C6257381-C624-494A-A9D9-5586E60856EA}.netstandard-Release|Any CPU.Build.0 = netstandard-Release|Any CPU | ||
{C6257381-C624-494A-A9D9-5586E60856EA}.Release|Any CPU.ActiveCfg = netstandard-Release|Any CPU | ||
{C6257381-C624-494A-A9D9-5586E60856EA}.Release|Any CPU.Build.0 = netstandard-Release|Any CPU | ||
{853BB14F-8A5B-42B4-A053-21DE1AEBB335}.Debug|Any CPU.ActiveCfg = netstandard-Debug|Any CPU | ||
{853BB14F-8A5B-42B4-A053-21DE1AEBB335}.Debug|Any CPU.Build.0 = netstandard-Debug|Any CPU | ||
{853BB14F-8A5B-42B4-A053-21DE1AEBB335}.netstandard-Debug|Any CPU.ActiveCfg = netstandard-Debug|Any CPU | ||
{853BB14F-8A5B-42B4-A053-21DE1AEBB335}.netstandard-Debug|Any CPU.Build.0 = netstandard-Debug|Any CPU | ||
{853BB14F-8A5B-42B4-A053-21DE1AEBB335}.netstandard-Release|Any CPU.ActiveCfg = netstandard-Release|Any CPU | ||
{853BB14F-8A5B-42B4-A053-21DE1AEBB335}.netstandard-Release|Any CPU.Build.0 = netstandard-Release|Any CPU | ||
{853BB14F-8A5B-42B4-A053-21DE1AEBB335}.Release|Any CPU.ActiveCfg = netstandard-Release|Any CPU | ||
{853BB14F-8A5B-42B4-A053-21DE1AEBB335}.Release|Any CPU.Build.0 = netstandard-Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(NestedProjects) = preSolution | ||
{C6257381-C624-494A-A9D9-5586E60856EA} = {E107E9C1-E893-4E87-987E-04EF0DCEAEFD} | ||
{853BB14F-8A5B-42B4-A053-21DE1AEBB335} = {DB303F4D-3697-4882-B6B9-FF221B6034A1} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
src/System.Composition.AttributedModel/tests/Configurations.props
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<BuildConfigurations> | ||
netstandard; | ||
</BuildConfigurations> | ||
</PropertyGroup> | ||
</Project> |
49 changes: 49 additions & 0 deletions
49
src/System.Composition.AttributedModel/tests/ExportAttributeTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using Xunit; | ||
|
||
namespace System.Composition.Tests | ||
{ | ||
public class ExportAttributeTests | ||
{ | ||
[Fact] | ||
public void Ctor_Default() | ||
{ | ||
var attribute = new ExportAttribute(); | ||
Assert.Null(attribute.ContractName); | ||
Assert.Null(attribute.ContractType); | ||
} | ||
|
||
[Theory] | ||
[InlineData(null)] | ||
[InlineData("ContractName")] | ||
public void Ctor_ContractName(string contractName) | ||
{ | ||
var attribute = new ExportAttribute(contractName); | ||
Assert.Equal(contractName, attribute.ContractName); | ||
Assert.Null(attribute.ContractType); | ||
} | ||
|
||
[Theory] | ||
[InlineData(null)] | ||
[InlineData(typeof(string))] | ||
public void Ctor_ContractName(Type contractType) | ||
{ | ||
var attribute = new ExportAttribute(contractType); | ||
Assert.Null(attribute.ContractName); | ||
Assert.Equal(contractType, attribute.ContractType); | ||
} | ||
|
||
[Theory] | ||
[InlineData(null, null)] | ||
[InlineData("ContractName", typeof(string))] | ||
public void Ctor_ContractName_ContractType(string contractName, Type contractType) | ||
{ | ||
var attribute = new ExportAttribute(contractName, contractType); | ||
Assert.Equal(contractName, attribute.ContractName); | ||
Assert.Equal(contractType, attribute.ContractType); | ||
} | ||
} | ||
} |
Oops, something went wrong.