Skip to content

Commit

Permalink
chore: Added Tests for finalizer
Browse files Browse the repository at this point in the history
  • Loading branch information
samtrion committed Jun 24, 2024
1 parent a398d49 commit 80835d1
Show file tree
Hide file tree
Showing 5 changed files with 228 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace NetEvolve.ArchiDuct.Tests.Integration.Internals;

using System;
using NetEvolve.ArchiDuct.Tests.Integration._internals;

public class Decompiler_ExampleFinalizer_Tests(FinalizerClassTypeProvider provider)
: TestCaseBase<FinalizerClassTypeProvider>(provider) { }

public sealed class FinalizerClassTypeProvider() : TypeProviderBase(typeof(FinalizerClass)) { }

public class FinalizerClass
{
public override string ToString() => GetType().Name;

~FinalizerClass() => Console.WriteLine($"The {ToString()} finalizer is executing.");

Check warning on line 15 in tests/NetEvolve.ArchiDuct.Tests.Integration/Internals/Decompiler_ExampleFinalizer_Tests.cs

View workflow job for this annotation

GitHub Actions / Build & Tests / CodeQL / Run CodeQL

The symbol 'Console.WriteLine(string?)' is banned in this project: Don't use Console.WriteLine for logging, use Microsoft.Extensions.Logging.ILogger instead. (https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.BannedApiAnalyzers/BannedApiAnalyzers.Help.md)

Check warning on line 15 in tests/NetEvolve.ArchiDuct.Tests.Integration/Internals/Decompiler_ExampleFinalizer_Tests.cs

View workflow job for this annotation

GitHub Actions / Build & Tests / CodeQL / Run CodeQL

The symbol 'Console.WriteLine(string?)' is banned in this project: Don't use Console.WriteLine for logging, use Microsoft.Extensions.Logging.ILogger instead. (https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.BannedApiAnalyzers/BannedApiAnalyzers.Help.md)

Check warning on line 15 in tests/NetEvolve.ArchiDuct.Tests.Integration/Internals/Decompiler_ExampleFinalizer_Tests.cs

View workflow job for this annotation

GitHub Actions / Build & Tests / Tests / Testing .NET solution

The symbol 'Console.WriteLine(string?)' is banned in this project: Don't use Console.WriteLine for logging, use Microsoft.Extensions.Logging.ILogger instead. (https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.BannedApiAnalyzers/BannedApiAnalyzers.Help.md)

Check warning on line 15 in tests/NetEvolve.ArchiDuct.Tests.Integration/Internals/Decompiler_ExampleFinalizer_Tests.cs

View workflow job for this annotation

GitHub Actions / Build & Tests / Tests / Testing .NET solution

The symbol 'Console.WriteLine(string?)' is banned in this project: Don't use Console.WriteLine for logging, use Microsoft.Extensions.Logging.ILogger instead. (https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.BannedApiAnalyzers/BannedApiAnalyzers.Help.md)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
NetEvolve.ArchiDuct.Tests.Integration, Version=0.2.0.0, M:NetEvolve.ArchiDuct.Tests.Integration.Internals.FinalizerClass.#ctor: {
Accessibility: Public,
FullName: NetEvolve.ArchiDuct.Tests.Integration, Version=0.2.0.0, M:NetEvolve.ArchiDuct.Tests.Integration.Internals.FinalizerClass.#ctor,
Id: M:NetEvolve.ArchiDuct.Tests.Integration.Internals.FinalizerClass.#ctor,
Kind: Constructor,
Name: .ctor,
ParentId: T:NetEvolve.ArchiDuct.Tests.Integration.Internals.FinalizerClass
},
NetEvolve.ArchiDuct.Tests.Integration, Version=0.2.0.0, M:NetEvolve.ArchiDuct.Tests.Integration.Internals.FinalizerClass.Finalize: {
Accessibility: Protected,
Attributes: [
{
FullName: System.Runtime.Versioning.NonVersionableAttribute,
Id: T:System.Runtime.Versioning.NonVersionableAttribute,
Kind: Attribute,
Name: NonVersionableAttribute
}
],
FullName: NetEvolve.ArchiDuct.Tests.Integration, Version=0.2.0.0, M:NetEvolve.ArchiDuct.Tests.Integration.Internals.FinalizerClass.Finalize,
Id: M:NetEvolve.ArchiDuct.Tests.Integration.Internals.FinalizerClass.Finalize,
Kind: Destructor,
Modifiers: [
Override
],
Name: Finalize,
ParentId: T:NetEvolve.ArchiDuct.Tests.Integration.Internals.FinalizerClass,
ReturnType: {
Id: T:System.Void,
IsNullable: false
}
},
NetEvolve.ArchiDuct.Tests.Integration, Version=0.2.0.0, M:NetEvolve.ArchiDuct.Tests.Integration.Internals.FinalizerClass.ToString: {
Accessibility: Public,
FullName: NetEvolve.ArchiDuct.Tests.Integration, Version=0.2.0.0, M:NetEvolve.ArchiDuct.Tests.Integration.Internals.FinalizerClass.ToString,
Id: M:NetEvolve.ArchiDuct.Tests.Integration.Internals.FinalizerClass.ToString,
IsLocal: false,
Kind: Method,
Modifiers: [
Override
],
Name: ToString,
ParentId: T:NetEvolve.ArchiDuct.Tests.Integration.Internals.FinalizerClass,
ReturnType: {
Id: T:System.String,
IsNullable: false
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
NetEvolve.ArchiDuct.Tests.Integration, Version=0.2.0.0, M:NetEvolve.ArchiDuct.Tests.Integration.Internals.FinalizerClass.#ctor: {
Accessibility: Public,
FullName: NetEvolve.ArchiDuct.Tests.Integration, Version=0.2.0.0, M:NetEvolve.ArchiDuct.Tests.Integration.Internals.FinalizerClass.#ctor,
Id: M:NetEvolve.ArchiDuct.Tests.Integration.Internals.FinalizerClass.#ctor,
Kind: Constructor,
Name: .ctor,
ParentId: T:NetEvolve.ArchiDuct.Tests.Integration.Internals.FinalizerClass
},
NetEvolve.ArchiDuct.Tests.Integration, Version=0.2.0.0, M:NetEvolve.ArchiDuct.Tests.Integration.Internals.FinalizerClass.Finalize: {
Accessibility: Protected,
Attributes: [
{
FullName: System.Runtime.Versioning.NonVersionableAttribute,
Id: T:System.Runtime.Versioning.NonVersionableAttribute,
Kind: Attribute,
Name: NonVersionableAttribute
}
],
FullName: NetEvolve.ArchiDuct.Tests.Integration, Version=0.2.0.0, M:NetEvolve.ArchiDuct.Tests.Integration.Internals.FinalizerClass.Finalize,
Id: M:NetEvolve.ArchiDuct.Tests.Integration.Internals.FinalizerClass.Finalize,
Kind: Destructor,
Modifiers: [
Override
],
Name: Finalize,
ParentId: T:NetEvolve.ArchiDuct.Tests.Integration.Internals.FinalizerClass,
ReturnType: {
Id: T:System.Void,
IsNullable: false
}
},
NetEvolve.ArchiDuct.Tests.Integration, Version=0.2.0.0, M:NetEvolve.ArchiDuct.Tests.Integration.Internals.FinalizerClass.ToString: {
Accessibility: Public,
FullName: NetEvolve.ArchiDuct.Tests.Integration, Version=0.2.0.0, M:NetEvolve.ArchiDuct.Tests.Integration.Internals.FinalizerClass.ToString,
Id: M:NetEvolve.ArchiDuct.Tests.Integration.Internals.FinalizerClass.ToString,
IsLocal: false,
Kind: Method,
Modifiers: [
Override
],
Name: ToString,
ParentId: T:NetEvolve.ArchiDuct.Tests.Integration.Internals.FinalizerClass,
ReturnType: {
Id: T:System.String,
IsNullable: false
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
NetEvolve.ArchiDuct.Tests.Integration, Version=0.2.0.0, T:NetEvolve.ArchiDuct.Tests.Integration.Internals.FinalizerClass: {
Accessibility: Public,
Attributes: [
{
FullName: System.SerializableAttribute,
Id: T:System.SerializableAttribute,
Kind: Attribute,
Name: SerializableAttribute
},
{
FullName: System.Runtime.InteropServices.ClassInterfaceAttribute,
Id: T:System.Runtime.InteropServices.ClassInterfaceAttribute,
Kind: Attribute,
Name: ClassInterfaceAttribute
},
{
FullName: System.Runtime.InteropServices.ComVisibleAttribute,
Id: T:System.Runtime.InteropServices.ComVisibleAttribute,
Kind: Attribute,
Name: ComVisibleAttribute
},
{
FullName: System.Runtime.CompilerServices.TypeForwardedFromAttribute,
Id: T:System.Runtime.CompilerServices.TypeForwardedFromAttribute,
Kind: Attribute,
Name: TypeForwardedFromAttribute
}
],
BaseTypes: [
T:System.Object
],
FullName: NetEvolve.ArchiDuct.Tests.Integration, Version=0.2.0.0, T:NetEvolve.ArchiDuct.Tests.Integration.Internals.FinalizerClass,
Id: T:NetEvolve.ArchiDuct.Tests.Integration.Internals.FinalizerClass,
InheritedMembers: [
M:System.Object.GetType,
M:System.Object.MemberwiseClone,
M:System.Object.Finalize,
M:System.Object.ToString,
M:System.Object.Equals(System.Object),
M:System.Object.Equals(System.Object,System.Object),
M:System.Object.ReferenceEquals(System.Object,System.Object),
M:System.Object.GetHashCode
],
IsNested: false,
IsRecord: false,
Kind: Class,
Members: [
M:NetEvolve.ArchiDuct.Tests.Integration.Internals.FinalizerClass.ToString,
M:NetEvolve.ArchiDuct.Tests.Integration.Internals.FinalizerClass.Finalize,
M:NetEvolve.ArchiDuct.Tests.Integration.Internals.FinalizerClass.#ctor
],
Name: FinalizerClass,
NamespaceId: N:NetEvolve.ArchiDuct.Tests.Integration.Internals,
ParentId: N:NetEvolve.ArchiDuct.Tests.Integration.Internals
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
NetEvolve.ArchiDuct.Tests.Integration, Version=0.2.0.0, T:NetEvolve.ArchiDuct.Tests.Integration.Internals.FinalizerClass: {
Accessibility: Public,
Attributes: [
{
FullName: System.SerializableAttribute,
Id: T:System.SerializableAttribute,
Kind: Attribute,
Name: SerializableAttribute
},
{
FullName: System.Runtime.InteropServices.ClassInterfaceAttribute,
Id: T:System.Runtime.InteropServices.ClassInterfaceAttribute,
Kind: Attribute,
Name: ClassInterfaceAttribute
},
{
FullName: System.Runtime.InteropServices.ComVisibleAttribute,
Id: T:System.Runtime.InteropServices.ComVisibleAttribute,
Kind: Attribute,
Name: ComVisibleAttribute
},
{
FullName: System.Runtime.CompilerServices.TypeForwardedFromAttribute,
Id: T:System.Runtime.CompilerServices.TypeForwardedFromAttribute,
Kind: Attribute,
Name: TypeForwardedFromAttribute
}
],
BaseTypes: [
T:System.Object
],
FullName: NetEvolve.ArchiDuct.Tests.Integration, Version=0.2.0.0, T:NetEvolve.ArchiDuct.Tests.Integration.Internals.FinalizerClass,
Id: T:NetEvolve.ArchiDuct.Tests.Integration.Internals.FinalizerClass,
InheritedMembers: [
M:System.Object.GetType,
M:System.Object.MemberwiseClone,
M:System.Object.Finalize,
M:System.Object.ToString,
M:System.Object.Equals(System.Object),
M:System.Object.Equals(System.Object,System.Object),
M:System.Object.ReferenceEquals(System.Object,System.Object),
M:System.Object.GetHashCode
],
IsNested: false,
IsRecord: false,
Kind: Class,
Members: [
M:NetEvolve.ArchiDuct.Tests.Integration.Internals.FinalizerClass.ToString,
M:NetEvolve.ArchiDuct.Tests.Integration.Internals.FinalizerClass.Finalize,
M:NetEvolve.ArchiDuct.Tests.Integration.Internals.FinalizerClass.#ctor
],
Name: FinalizerClass,
NamespaceId: N:NetEvolve.ArchiDuct.Tests.Integration.Internals,
ParentId: N:NetEvolve.ArchiDuct.Tests.Integration.Internals
}
}

0 comments on commit 80835d1

Please sign in to comment.