Imported Upstream version 5.8.0.22

Former-commit-id: df344e34b07851d296efb3e6604c8db42b6f7aa3
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-10-19 20:04:20 +00:00
parent 5f4a27cc8a
commit 7d05485754
5020 changed files with 114082 additions and 186061 deletions

View File

@@ -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>

View File

@@ -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);
}
}
}

View File

@@ -0,0 +1,21 @@
// 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 ExportMetadataAttributeTests
{
[Theory]
[InlineData(null, null)]
[InlineData("Name", "Value")]
public void Ctor_Name_Value(string name, string value)
{
var attribute = new ExportMetadataAttribute(name, value);
Assert.Equal(name ?? string.Empty, attribute.Name);
Assert.Equal(value, attribute.Value);
}
}
}

View File

@@ -0,0 +1,27 @@
// 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 ImportAttributeTests
{
[Fact]
public void Ctor_Default()
{
var attribute = new ImportAttribute();
Assert.Null(attribute.ContractName);
}
[Theory]
[InlineData(null)]
[InlineData("ContractName")]
public void Ctor_ContractName(string contractName)
{
var attribute = new ImportAttribute(contractName);
Assert.Equal(contractName, attribute.ContractName);
}
}
}

View File

@@ -0,0 +1,27 @@
// 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 ImportManyAttributeTests
{
[Fact]
public void Ctor_Default()
{
var attribute = new ImportManyAttribute();
Assert.Null(attribute.ContractName);
}
[Theory]
[InlineData(null)]
[InlineData("ContractName")]
public void Ctor_ContractName(string contractName)
{
var attribute = new ImportManyAttribute(contractName);
Assert.Equal(contractName, attribute.ContractName);
}
}
}

View File

@@ -0,0 +1,21 @@
// 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 ImportMetadataConstraintAttributeTests
{
[Theory]
[InlineData(null, null)]
[InlineData("Name", "Value")]
public void Ctor_Name_Value(string name, string value)
{
var attribute = new ImportMetadataConstraintAttribute(name, value);
Assert.Equal(name, attribute.Name);
Assert.Equal(value, attribute.Value);
}
}
}

View File

@@ -0,0 +1,18 @@
// 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 ImportingConstructorAttributeTests
{
[Fact]
public void Ctor_Default()
{
var attribute = new ImportingConstructorAttribute();
Assert.Equal(typeof(ImportingConstructorAttribute), attribute.TypeId);
}
}
}

View File

@@ -0,0 +1,18 @@
// 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 MetadataAttributeAttributeTests
{
[Fact]
public void Ctor_Default()
{
var attribute = new MetadataAttributeAttribute();
Assert.Equal(typeof(MetadataAttributeAttribute), attribute.TypeId);
}
}
}

View File

@@ -0,0 +1,27 @@
// 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 PartMetadataAttributeTests
{
[Theory]
[InlineData("", null)]
[InlineData("Name", "Value")]
public void Ctor_Name_Value(string name, string value)
{
var attribute = new PartMetadataAttribute(name, value);
Assert.Equal(name, attribute.Name);
Assert.Equal(value, attribute.Value);
}
[Fact]
public void Ctor_NullName_ThrowsArgumentNullException()
{
AssertExtensions.Throws<ArgumentNullException>("name", () => new PartMetadataAttribute(null, "value"));
}
}
}

View File

@@ -0,0 +1,18 @@
// 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 PartNotDiscoverableAttributeTests
{
[Fact]
public void Ctor_Default()
{
var attribute = new PartNotDiscoverableAttribute();
Assert.Equal(typeof(PartNotDiscoverableAttribute), attribute.TypeId);
}
}
}

View File

@@ -0,0 +1,31 @@
// 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 SharedAttributeTests
{
[Fact]
public void Ctor_Default()
{
var attribute = new SharedAttribute();
Assert.Null(attribute.SharingBoundary);
Assert.Equal("SharingBoundary", attribute.Name);
Assert.Null(attribute.Value);
}
[Theory]
[InlineData(null)]
[InlineData("Name")]
public void Ctor_SharingBoundaryName(string sharingBoundaryName)
{
var attribute = new SharedAttribute(sharingBoundaryName);
Assert.Equal(sharingBoundaryName, attribute.SharingBoundary);
Assert.Equal("SharingBoundary", attribute.Name);
Assert.Equal(sharingBoundaryName, attribute.Value);
}
}
}

View File

@@ -0,0 +1,33 @@
// 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 System.Collections.Generic;
using Xunit;
namespace System.Composition.Tests
{
public class SharingBoundaryAttributeTests
{
public static IEnumerable<object[]> SharingBoundaryNames_TestData()
{
yield return new object[] { new string[0] };
yield return new object[] { new string[] { "1", null, "2" } };
}
[Theory]
[MemberData(nameof(SharingBoundaryNames_TestData))]
public void Ctor_SharingBoundaryNames(string[] sharingBoundaryNames)
{
var attribute = new SharingBoundaryAttribute(sharingBoundaryNames);
Assert.Equal(sharingBoundaryNames, attribute.SharingBoundaryNames);
}
[Fact]
public void Ctor_NullSharingBoundaryNames_ThrowsArgumentNullException()
{
AssertExtensions.Throws<ArgumentNullException>("sharingBoundaryNames", () => new SharingBoundaryAttribute(null));
}
}
}

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<ProjectGuid>{853BB14F-8A5B-42B4-A053-21DE1AEBB335}</ProjectGuid>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Release|AnyCPU'" />
<ItemGroup>
<Compile Include="SharingBoundaryAttributeTests.cs" />
<Compile Include="SharedAttributeTests.cs" />
<Compile Include="PartNotDiscoverableAttributeTests.cs" />
<Compile Include="PartMetadataAttributeTests.cs" />
<Compile Include="MetadataAttributeAttributeTests.cs" />
<Compile Include="ImportMetadataConstraintAttributeTests.cs" />
<Compile Include="ImportManyAttributeTests.cs" />
<Compile Include="ImportingConstructorAttributeTests.cs" />
<Compile Include="ImportAttributeTests.cs" />
<Compile Include="ExportMetadataAttributeTests.cs" />
<Compile Include="ExportAttributeTests.cs" />
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
</Project>