Skip to content

Commit

Permalink
Merge pull request #59 from vescon/feature/netstandard-netcore
Browse files Browse the repository at this point in the history
Feature/netstandard netcore
  • Loading branch information
Martinay authored Jan 7, 2019
2 parents cede97c + f44c73b commit d4025ff
Show file tree
Hide file tree
Showing 206 changed files with 968 additions and 609 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Short sample how a transaction aspect could be implemented.
#### The aspect code

```csharp
using MethodBoundaryAspect.Fody;
using MethodBoundaryAspect.Fody.Attributes;

public sealed class TransactionScopeAttribute : OnMethodBoundaryAspect
{
Expand Down Expand Up @@ -91,7 +91,7 @@ Consider an aspect written like this.

```csharp
using static System.Console;
using MethodBoundaryAspect.Fody;
using MethodBoundaryAspect.Fody.Attributes;

public sealed class LogAttribute : OnMethodBoundaryAspect
{
Expand Down Expand Up @@ -183,7 +183,7 @@ Note that, unlike for synchronous methods, an aspect for an asynchronous method

```csharp
using static System.Console;
using MethodBoundaryAspect.Fody;
using MethodBoundaryAspect.Fody.Attributes;

public sealed class LogAttribute : OnMethodBoundaryAspect
{
Expand Down Expand Up @@ -212,7 +212,7 @@ One additional note about the asynchronous behavior: the `OnExit` handler runs w

```csharp
using static System.Console;
using MethodBoundaryAspect.Fody;
using MethodBoundaryAspect.Fody.Attributes;

public sealed class LogAttribute : OnMethodBoundaryAspect
{
Expand Down
13 changes: 5 additions & 8 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 1.0.{build}
version: 2.0.{build}
image: Visual Studio 2017
configuration: Release
platform: Any CPU
Expand All @@ -12,14 +12,11 @@ dotnet_csproj:
informational_version: '{version}'
before_build:
- cmd: dotnet restore src
build:
verbosity: minimal
project: src\MethodBoundaryAspect.Fody.sln
after_build:
- cmd: >-
nuget pack src\MethodBoundaryAspect.Fody\MethodBoundaryAspect.Fody.nuspec -Properties "version=%APPVEYOR_BUILD_VERSION%" -OutputDirectory src
build_script:
- cmd: dotnet build src\ --configuration Release -p:Version=%APPVEYOR_BUILD_VERSION% --no-restore
test_script:
- cmd: dotnet test src\MethodBoundaryAspect.Fody.UnitTests --configuration Release
- cmd: dotnet test src\MethodBoundaryAspect.Fody.UnitTests.NetFramework --configuration Release
- cmd: dotnet test src\MethodBoundaryAspect.Fody.UnitTests.NetCore --configuration Release
artifacts:
- path: src\MethodBoundaryAspect.Fody\bin\$(configuration)
name: Binaries
Expand Down
7 changes: 7 additions & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Version>1.0-localBuild</Version>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="5.2.0" />
<PackageReference Include="FodyHelpers" Version="3.3.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\MethodBoundaryAspect.Fody.UnitTests.TestAssembly.NetCore\MethodBoundaryAspect.Fody.UnitTests.TestAssembly.NetCore.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using System;
using FluentAssertions;
using MethodBoundaryAspect.Fody.UnitTests.Shared;
using MethodBoundaryAspect.Fody.UnitTests.TestAssembly.NetFramework;
using Xunit;

namespace MethodBoundaryAspect.Fody.UnitTests.NetCore
{
public class SpecialAspectTests : MethodBoundaryAspectTestBase
{
[Fact]
public void IfNetCoreClassIsWeaved_ThenTheAssemblyShouldBeValid()
{
// Arrange
var testClassType = typeof(SpecialAspectMethods);

// Act
Action call = () => WeaveAssemblyClass(testClassType);

// Assert
call.Should().NotThrow();
}

[Fact]
public void IfNetStandardClassIsWeaved_ThenTheAssemblyShouldBeValid()
{
// Arrange
var testClassType = typeof(TestAssembly.NetStandard.SpecialAspectMethods);

// Act
Action call = () => WeaveAssemblyClass(testClassType);

// Assert
call.Should().NotThrow();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
using FluentAssertions;
using System;
using FluentAssertions;
using MethodBoundaryAspect.Fody.UnitTests.TestAssembly;
using System;
using MethodBoundaryAspect.Fody.UnitTests.TestAssembly.NetFramework;
using Xunit;

namespace MethodBoundaryAspect.Fody.UnitTests
namespace MethodBoundaryAspect.Fody.UnitTests.NetFramework
{
public class ArrayTakingAspectTests : MethodBoundaryAspectTestBase
public class ArrayTakingAspectTests : MethodBoundaryAspectNetFrameworkTestBase
{
static readonly Type TestClassType = typeof(ArrayTakingAspectMethod);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using MethodBoundaryAspect.Fody.Ordering;
using Xunit;

namespace MethodBoundaryAspect.Fody.UnitTests
namespace MethodBoundaryAspect.Fody.UnitTests.NetFramework
{
public class AspectOrderTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
using System;
using System.Linq;
using System.Net;
using System.Reflection;
using System.Runtime.Remoting;

namespace MethodBoundaryAspect.Fody.UnitTests
namespace MethodBoundaryAspect.Fody.UnitTests.NetFramework
{
public class AssemblyLoader : MarshalByRefObject
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
using FluentAssertions;
using System;
using FluentAssertions;
using MethodBoundaryAspect.Fody.UnitTests.TestAssembly;
using MethodBoundaryAspect.Fody.UnitTests.TestAssembly.Aspects;
using System;
using MethodBoundaryAspect.Fody.UnitTests.TestAssembly.NetFramework;
using MethodBoundaryAspect.Fody.UnitTests.TestAssembly.NetFramework.Aspects;
using Xunit;

namespace MethodBoundaryAspect.Fody.UnitTests
namespace MethodBoundaryAspect.Fody.UnitTests.NetFramework
{
public class AsyncGenericTests : MethodBoundaryAspectTestBase
public class AsyncGenericTests : MethodBoundaryAspectNetFrameworkTestBase
{
Type OpenClass = typeof(AsyncClass<>);
TypeInfo Closed = typeof(AsyncClass<>).TypeInfoWithGenericParameters(typeof(Placeholder));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
using FluentAssertions;
using MethodBoundaryAspect.Fody.UnitTests.TestAssembly;
using MethodBoundaryAspect.Fody.UnitTests.TestAssembly.NetFramework;
using Xunit;

namespace MethodBoundaryAspect.Fody.UnitTests
namespace MethodBoundaryAspect.Fody.UnitTests.NetFramework
{
public class AsyncTests : MethodBoundaryAspectTestBase
public class AsyncTests : MethodBoundaryAspectNetFrameworkTestBase
{
[Fact]
public void IfAsyncStaticMethodIsWeavedForOnExit_ThenTaskIsPassedToAspectReturnValue()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
using System;
using FluentAssertions;
using MethodBoundaryAspect.Fody.UnitTests.TestAssembly;
using MethodBoundaryAspect.Fody.UnitTests.TestAssembly.NetFramework;
using Xunit;

namespace MethodBoundaryAspect.Fody.UnitTests
namespace MethodBoundaryAspect.Fody.UnitTests.NetFramework
{
public class ClassWithIndexerTests : MethodBoundaryAspectTestBase
public class ClassWithIndexerTests : MethodBoundaryAspectNetFrameworkTestBase
{
[Fact]
public void IfClassContainsIndexer_ThenTheAssemblyShouldBeValid()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
using FluentAssertions;
using MethodBoundaryAspect.Fody.UnitTests.TestAssembly;
using MethodBoundaryAspect.Fody.UnitTests.TestAssemblyAspects;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using FluentAssertions;
using MethodBoundaryAspect.Fody.UnitTests.TestAssembly.NetFramework;
using MethodBoundaryAspect.Fody.UnitTests.TestAssembly.NetFramework.External.Aspects;
using Xunit;

namespace MethodBoundaryAspect.Fody.UnitTests
namespace MethodBoundaryAspect.Fody.UnitTests.NetFramework
{
public class ComplexAspectTests : MethodBoundaryAspectTestBase
public class ComplexAspectTests : MethodBoundaryAspectNetFrameworkTestBase
{
static readonly Type TestClassType = typeof(ComplexAspectTestClass);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
using System.IO;
using FluentAssertions;
using MethodBoundaryAspect.Fody.UnitTests.TestProgram;
using MethodBoundaryAspect.Fody.UnitTests.TestProgram.NetFramework;
using Xunit;

namespace MethodBoundaryAspect.Fody.UnitTests
namespace MethodBoundaryAspect.Fody.UnitTests.NetFramework
{
public class DebugAspectTests : MethodBoundaryAspectTestBase
public class DebugAspectTests : MethodBoundaryAspectNetFrameworkTestBase
{
[Fact(Skip = "Needs to be clarified")]
public void IfWeavedTestProgramIsExecuted_ThenTheDebugSymbolsShouldWorkAndTheDebuggerShouldBeAttachable()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using System;
using FluentAssertions;
using MethodBoundaryAspect.Fody.UnitTests.TestAssembly;
using MethodBoundaryAspect.Fody.UnitTests.TestAssembly.NetFramework;
using Xunit;


namespace MethodBoundaryAspect.Fody.UnitTests
namespace MethodBoundaryAspect.Fody.UnitTests.NetFramework
{
public class DelegateTests : MethodBoundaryAspectTestBase
public class DelegateTests : MethodBoundaryAspectNetFrameworkTestBase
{
[Fact]
public void IfClassWithDelegateIsWeaved_ThenThereShouldBeNoException()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
using FluentAssertions;
using MethodBoundaryAspect.Fody.UnitTests.TestAssembly;
using System;
using System;
using System.Reflection;
using FluentAssertions;
using MethodBoundaryAspect.Fody.UnitTests.TestAssembly;
using MethodBoundaryAspect.Fody.UnitTests.TestAssembly.NetFramework;
using Xunit;

namespace MethodBoundaryAspect.Fody.UnitTests
namespace MethodBoundaryAspect.Fody.UnitTests.NetFramework
{
public class FlowBehaviorTests : MethodBoundaryAspectTestBase
public class FlowBehaviorTests : MethodBoundaryAspectNetFrameworkTestBase
{
private static readonly Type TestClassType = typeof(FlowBehaviorClass);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
using MethodBoundaryAspect.Fody.UnitTests.TestAssembly;
using System;
using System;
using System.Collections.Generic;
using MethodBoundaryAspect.Fody.UnitTests.TestAssembly;
using MethodBoundaryAspect.Fody.UnitTests.TestAssembly.NetFramework;
using Xunit;

namespace MethodBoundaryAspect.Fody.UnitTests
namespace MethodBoundaryAspect.Fody.UnitTests.NetFramework
{
public class GenericClassWithArity1Tests : GenericTestBase
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
using MethodBoundaryAspect.Fody.UnitTests.TestAssembly;
using System.Collections.Generic;
using System.Collections.Generic;
using MethodBoundaryAspect.Fody.UnitTests.TestAssembly;
using MethodBoundaryAspect.Fody.UnitTests.TestAssembly.NetFramework;
using Xunit;

namespace MethodBoundaryAspect.Fody.UnitTests
namespace MethodBoundaryAspect.Fody.UnitTests.NetFramework
{
public class GenericClassWithArity2Tests : GenericTestBase
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
using FluentAssertions;
using MethodBoundaryAspect.Fody.UnitTests.TestAssembly;
using System;
using System;
using System.Collections.Generic;
using FluentAssertions;
using MethodBoundaryAspect.Fody.UnitTests.TestAssembly;
using MethodBoundaryAspect.Fody.UnitTests.TestAssembly.NetFramework;
using Xunit;

namespace MethodBoundaryAspect.Fody.UnitTests
namespace MethodBoundaryAspect.Fody.UnitTests.NetFramework
{
public class GenericForeignAssemblyTests : GenericTestBase
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
using MethodBoundaryAspect.Fody.UnitTests.TestAssembly;
using System.Collections.Generic;
using System.Collections.Generic;
using MethodBoundaryAspect.Fody.UnitTests.TestAssembly;
using MethodBoundaryAspect.Fody.UnitTests.TestAssembly.NetFramework;
using Xunit;

namespace MethodBoundaryAspect.Fody.UnitTests
namespace MethodBoundaryAspect.Fody.UnitTests.NetFramework
{
public class GenericNestedClassTests : GenericTestBase
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
using FluentAssertions;
using MethodBoundaryAspect.Fody.UnitTests.TestAssembly;
using MethodBoundaryAspect.Fody.UnitTests.TestAssemblyAspects;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text.RegularExpressions;
using FluentAssertions;
using MethodBoundaryAspect.Fody.UnitTests.TestAssembly.NetFramework;
using MethodBoundaryAspect.Fody.UnitTests.TestAssembly.NetFramework.External.Aspects;

namespace MethodBoundaryAspect.Fody.UnitTests
namespace MethodBoundaryAspect.Fody.UnitTests.NetFramework
{
public class GenericTestBase : MethodBoundaryAspectTestBase
public class GenericTestBase : MethodBoundaryAspectNetFrameworkTestBase
{
protected static IEnumerable<object[]> GetMethodNames(Type typeToSearch)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using FluentAssertions;
using System.Collections.Generic;
using FluentAssertions;
using MethodBoundaryAspect.Fody.UnitTests.TestAssembly;
using MethodBoundaryAspect.Fody.UnitTests.TestAssembly.NetFramework;
using MethodBoundaryAspect.Fody.UnitTests.UnverifiableTestAssembly;
using System.Collections.Generic;
using MethodBoundaryAspect.Fody.UnitTests.UnverifiableTestAssembly.NetFramework;
using Xunit;

namespace MethodBoundaryAspect.Fody.UnitTests
namespace MethodBoundaryAspect.Fody.UnitTests.NetFramework
{
public class GenericWithRefReturnTests : GenericTestBase
{
Expand Down
Loading

0 comments on commit d4025ff

Please sign in to comment.