Skip to content

Commit 9b49bfd

Browse files
authored
V1 (#2)
* Adding separate test projects with shared tests for Net40 and .NetStandard1.0 / Removing property getters from Net40 method collection-retrieval methods * Splitting type member tests into separate tests / Increasing test coverage / Type constructor retrieval tests * Extending field and property support and tests * Extending support and tests for retrieving members * Removing dependency on TypeExtensions * Removing TypeExtensions package reference * Removing Shouldy package reference * Updating System.Data.Common and XUnit package versions * Updating Microsoft.NET.Test.Sdk package version * Updating NUnit package version * Extending method support and tests * Extending methods support and tests * Extending method support and tests * Adding Type.GetMethods overloads with parameter type arguments * Adding extra GetMember methods and tests * Updating readme * Remvoing version info * Updating to v1.0
1 parent 8aac87c commit 9b49bfd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+3285
-499
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{5BD3F71B-B71F-4152-A97B-ECBBC209A7F5}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>AgileObjects.NetStandardPolyfills.UnitTests.Net40</RootNamespace>
11+
<AssemblyName>AgileObjects.NetStandardPolyfills.UnitTests.Net40</AssemblyName>
12+
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
</PropertyGroup>
15+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16+
<DebugSymbols>true</DebugSymbols>
17+
<DebugType>full</DebugType>
18+
<Optimize>false</Optimize>
19+
<OutputPath>bin\Debug\</OutputPath>
20+
<DefineConstants>DEBUG;TRACE</DefineConstants>
21+
<ErrorReport>prompt</ErrorReport>
22+
<WarningLevel>4</WarningLevel>
23+
</PropertyGroup>
24+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
25+
<DebugType>pdbonly</DebugType>
26+
<Optimize>true</Optimize>
27+
<OutputPath>bin\Release\</OutputPath>
28+
<DefineConstants>TRACE</DefineConstants>
29+
<ErrorReport>prompt</ErrorReport>
30+
<WarningLevel>4</WarningLevel>
31+
</PropertyGroup>
32+
<ItemGroup>
33+
<Reference Include="nunit.framework, Version=3.8.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
34+
<HintPath>..\packages\NUnit.3.8.1\lib\net40\nunit.framework.dll</HintPath>
35+
</Reference>
36+
<Reference Include="System" />
37+
<Reference Include="System.Core" />
38+
<Reference Include="System.Xml.Linq" />
39+
<Reference Include="System.Data.DataSetExtensions" />
40+
<Reference Include="Microsoft.CSharp" />
41+
<Reference Include="System.Data" />
42+
<Reference Include="System.Xml" />
43+
</ItemGroup>
44+
<ItemGroup>
45+
<Compile Include="Properties\AssemblyInfo.cs" />
46+
<Compile Include="WhenCheckingTypeData.cs" />
47+
<Compile Include="WhenRetrievingTypeCodes.cs" />
48+
<Compile Include="WhenRetrievingTypeConstructors.cs" />
49+
<Compile Include="WhenRetrievingTypeFields.cs" />
50+
<Compile Include="WhenRetrievingTypeMembers.cs" />
51+
<Compile Include="WhenRetrievingTypeMethods.cs" />
52+
<Compile Include="WhenRetrievingTypeProperties.cs" />
53+
</ItemGroup>
54+
<ItemGroup>
55+
<ProjectReference Include="..\NetStandardPolyfills.UnitTests\NetStandardPolyfills.UnitTests.csproj">
56+
<Project>{e55fc755-fa63-46e8-8c0b-573e312ecdff}</Project>
57+
<Name>NetStandardPolyfills.UnitTests</Name>
58+
</ProjectReference>
59+
</ItemGroup>
60+
<ItemGroup>
61+
<None Include="packages.config" />
62+
</ItemGroup>
63+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
64+
</Project>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("NetStandardPolyfills.UnitTests.Net40")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("NetStandardPolyfills.UnitTests.Net40")]
13+
[assembly: AssemblyCopyright("Copyright © 2017")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("5bd3f71b-b71f-4152-a97b-ecbbc209a7f5")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
namespace AgileObjects.NetStandardPolyfills.UnitTests.Net40
2+
{
3+
using NUnit.Framework;
4+
5+
[TestFixture]
6+
public class WhenCheckingTypeData : TypeDataTestsBase
7+
{
8+
[Test]
9+
public override void ShouldFlagAParamsArray() => DoShouldFlagAParamsArray();
10+
11+
[Test]
12+
public override void ShouldFlagANonParamsArray() => DoShouldFlagANonParamsArray();
13+
14+
[Test]
15+
public override void ShouldFindATypeAttribute() => DoShouldFindATypeAttribute();
16+
17+
[Test]
18+
public override void ShouldNotFindATypeAttribute() => DoShouldNotFindATypeAttribute();
19+
20+
[Test]
21+
public override void ShouldFlagAnAnonymousType() => DoShouldFlagAnAnonymousType();
22+
23+
[Test]
24+
public override void ShouldFlagANonAnonymousType() => DoShouldFlagANonAnonymousType();
25+
26+
[Test]
27+
public override void ShouldFlagAPrimitiveType() => DoShouldFlagAPrimitiveType();
28+
29+
[Test]
30+
public override void ShouldFlagANonPrimitiveType() => DoShouldFlagANonPrimitiveType();
31+
}
32+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
namespace AgileObjects.NetStandardPolyfills.UnitTests.Net40
2+
{
3+
using System;
4+
using NUnit.Framework;
5+
6+
[TestFixture]
7+
public class WhenRetrievingTypeCodes : TypeCodeTestsBase
8+
{
9+
[Test]
10+
public override void ShouldReturnEmpty() => DoShouldReturnEmpty();
11+
12+
[Test]
13+
public override void ShouldReturnDbNull() => DoShouldReturnDbNull(typeof(DBNull));
14+
15+
[Test]
16+
public override void ShouldReturnBoolean() => DoShouldReturnBoolean();
17+
18+
[Test]
19+
public override void ShouldReturnString() => DoShouldReturnString();
20+
21+
[Test]
22+
public override void ShouldReturnUnderlyingTypeForAnEnum() => DoShouldReturnUnderlyingTypeForAnEnum();
23+
24+
[Test]
25+
public override void ShouldFallbackToObject() => DoShouldFallbackToObject();
26+
}
27+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
namespace AgileObjects.NetStandardPolyfills.UnitTests.Net40
2+
{
3+
using NUnit.Framework;
4+
5+
[TestFixture]
6+
public class WhenRetrievingTypeConstructors : ConstructorTestsBase
7+
{
8+
[Test]
9+
public override void ShouldFindPublicInstanceConstructors() => DoShouldFindPublicInstanceConstructors();
10+
11+
[Test]
12+
public override void ShouldFindAnImplicitPublicInstanceConstructor() => DoShouldFindAnImplicitPublicInstanceConstructor();
13+
14+
[Test]
15+
public override void ShouldFindAnExplicitPublicInstanceConstructor() =>
16+
DoShouldFindAnExplicitPublicInstanceConstructor();
17+
18+
[Test]
19+
public override void ShouldFindAPublicInstanceConstructorByParameterTypes() =>
20+
DoShouldFindAPublicInstanceConstructorByParameterTypes();
21+
22+
[Test]
23+
public override void ShouldExcludeAPublicInstanceConstructorByParameterTypes() =>
24+
DoShouldExcludeAPublicInstanceConstructorByParameterTypes();
25+
26+
[Test]
27+
public override void ShouldFindNonPublicInstanceConstructors() => DoShouldFindNonPublicInstanceConstructors();
28+
29+
[Test]
30+
public override void ShouldFindANonPublicInstanceConstructor() => DoShouldFindANonPublicInstanceConstructor();
31+
32+
[Test]
33+
public override void ShouldExcludeANonPublicInstanceConstructor() =>
34+
DoShouldExcludeANonPublicInstanceConstructor();
35+
36+
[Test]
37+
public override void ShouldFindANonPublicInstanceConstructorByParameterTypes() =>
38+
DoShouldFindANonPublicInstanceConstructorByParameterTypes();
39+
40+
[Test]
41+
public override void ShouldExcludeANonPublicInstanceConstructorByParameterTypes() =>
42+
DoShouldExcludeANonPublicInstanceConstructorByParameterTypes();
43+
}
44+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
namespace AgileObjects.NetStandardPolyfills.UnitTests.Net40
2+
{
3+
using NUnit.Framework;
4+
5+
[TestFixture]
6+
public class WhenRetrievingTypeFields : FieldTestsBase
7+
{
8+
[Test]
9+
public override void ShouldRetrievePublicStaticFields() => DoShouldRetrievePublicStaticFields();
10+
11+
[Test]
12+
public override void ShouldRetrieveAPublicStaticFieldByName() => DoShouldRetrieveAPublicStaticFieldByName();
13+
14+
[Test]
15+
public override void ShouldExcludeAPublicStaticFieldByName() => DoShouldExcludeAPublicStaticFieldByName();
16+
17+
[Test]
18+
public override void ShouldRetrieveNonPublicStaticFields() => DoShouldRetrieveNonPublicStaticFields();
19+
20+
[Test]
21+
public override void ShouldRetrieveANonPublicStaticFieldByName() =>
22+
DoShouldRetrieveANonPublicStaticFieldByName();
23+
24+
[Test]
25+
public override void ShouldExcludeANonPublicStaticFieldByName() => DoShouldExcludeANonPublicStaticFieldByName();
26+
27+
[Test]
28+
public override void ShouldRetrievePublicInstanceFields() => DoShouldRetrievePublicInstanceFields();
29+
30+
[Test]
31+
public override void ShouldRetrieveAPublicInstanceFieldByName() => DoShouldRetrieveAPublicInstanceFieldByName();
32+
33+
[Test]
34+
public override void ShouldExcludeAPublicInstanceFieldByName() => DoShouldExcludeAPublicInstanceFieldByName();
35+
36+
[Test]
37+
public override void ShouldRetrieveNonPublicInstanceFields() => DoShouldRetrieveNonPublicInstanceFields();
38+
39+
[Test]
40+
public override void ShouldRetrieveANonPublicInstanceFieldByName() =>
41+
DoShouldRetrieveANonPublicInstanceFieldByName();
42+
43+
[Test]
44+
public override void ShouldExcludeANonPublicInstanceFieldByName() =>
45+
DoShouldExcludeANonPublicInstanceFieldByName();
46+
}
47+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
namespace AgileObjects.NetStandardPolyfills.UnitTests.Net40
2+
{
3+
using NUnit.Framework;
4+
5+
[TestFixture]
6+
public class WhenRetrievingTypeMembers : MemberTestsBase
7+
{
8+
[Test]
9+
public override void ShouldRetrievePublicStaticMembers() => DoShouldRetrievePublicStaticMembers();
10+
11+
[Test]
12+
public override void ShouldRetrievePublicStaticMembersByName() => DoShouldRetrievePublicStaticMembersByName();
13+
14+
[Test]
15+
public override void ShouldExcludePublicStaticMembersByName() => DoShouldExcludePublicStaticMembersByName();
16+
17+
[Test]
18+
public override void ShouldRetrievePublicStaticMemberByName() => DoShouldRetrievePublicStaticMemberByName();
19+
20+
[Test]
21+
public override void ShouldRetrievePublicInstanceMembers() => DoShouldRetrievePublicInstanceMembers();
22+
23+
[Test]
24+
public override void ShouldRetrievePublicInstanceMembersByName() => DoShouldRetrievePublicInstanceMembersByName();
25+
26+
[Test]
27+
public override void ShouldExcludePublicInstanceMembersByName() => DoShouldExcludePublicInstanceMembersByName();
28+
29+
[Test]
30+
public override void ShouldRetrievePublicInstanceMemberByName() => DoShouldRetrievePublicInstanceMemberByName();
31+
32+
[Test]
33+
public override void ShouldRetrieveNonPublicStaticMembers() => DoShouldRetrieveNonPublicStaticMembers();
34+
35+
[Test]
36+
public override void ShouldRetrieveNonPublicStaticMembersByName() => DoShouldRetrieveNonPublicStaticMembersByName();
37+
38+
[Test]
39+
public override void ShouldExcludeNonPublicStaticMembersByName() => DoShouldExcludeNonPublicStaticMembersByName();
40+
41+
[Test]
42+
public override void ShouldRetrieveNonPublicStaticMemberByName() =>
43+
DoShouldRetrieveNonPublicStaticMemberByName();
44+
45+
[Test]
46+
public override void ShouldRetrieveNonPublicInstanceMembers() => DoShouldRetrieveNonPublicInstanceMembers();
47+
48+
[Test]
49+
public override void ShouldRetrieveNonPublicInstanceMembersByName() => DoShouldRetrieveNonPublicInstanceMembersByName();
50+
51+
[Test]
52+
public override void ShouldExcludeNonPublicInstanceMembersByName() => DoShouldExcludeNonPublicInstanceMembersByName();
53+
54+
[Test]
55+
public override void ShouldRetrieveNonPublicInstanceMemberByName() =>
56+
DoShouldRetrieveNonPublicInstanceMemberByName();
57+
}
58+
}

0 commit comments

Comments
 (0)