generated from VeyronSakai/RoslynAnalyzerTemplate
-
Notifications
You must be signed in to change notification settings - Fork 0
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 #8 from VeyronSakai/refactor-tests
Add tests
- Loading branch information
Showing
10 changed files
with
183 additions
and
15 deletions.
There are no files selected for viewing
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
17 changes: 17 additions & 0 deletions
17
VContainerAnalyzer.Test/TestData/ConstructorWithInjectAttributeClass.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,17 @@ | ||
// Copyright (c) 2020-2024 VeyronSakai. | ||
// This software is released under the MIT License. | ||
|
||
using System; | ||
using VContainer; | ||
|
||
namespace VContainerAnalyzer.Test.TestData | ||
{ | ||
public class ConstructorWithInjectAttributeClass : IInterface1, IInterface2, IInterface3 | ||
{ | ||
[Inject] | ||
public ConstructorWithInjectAttributeClass(EmptyClassStub stub1, EmptyClassStub stub2) | ||
{ | ||
Console.WriteLine(""); | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Copyright (c) 2020-2024 VeyronSakai. | ||
// This software is released under the MIT License. | ||
|
||
namespace VContainerAnalyzer.Test.TestData | ||
{ | ||
public class EmptyClassStub | ||
{ | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
VContainerAnalyzer.Test/TestData/RegisterConstructorWithInjectAttributeClassLifetimeScope.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,21 @@ | ||
// Copyright (c) 2020-2024 VeyronSakai. | ||
// This software is released under the MIT License. | ||
|
||
using VContainer; | ||
|
||
namespace VContainerAnalyzer.Test.TestData | ||
{ | ||
public class RegisterConstructorWithInjectAttributeClassLifetimeScope | ||
{ | ||
// ReSharper disable once UnusedMember.Global | ||
public void Configure(IContainerBuilder builder) | ||
{ | ||
builder.Register<ConstructorWithInjectAttributeClass>(Lifetime.Singleton); | ||
builder.Register<ConstructorWithInjectAttributeClass>(Lifetime.Singleton).As<IInterface1>(); | ||
builder.Register<IInterface1, ConstructorWithInjectAttributeClass>(Lifetime.Singleton); | ||
builder.Register<IInterface1, IInterface2, ConstructorWithInjectAttributeClass>(Lifetime.Singleton); | ||
builder.Register<IInterface1, IInterface2, IInterface3, ConstructorWithInjectAttributeClass>( | ||
Lifetime.Singleton); | ||
} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
VContainerAnalyzer.Test/TestData/RegisterDefaultConstructorClassLifetimeScope.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,15 @@ | ||
// Copyright (c) 2020-2024 VeyronSakai. | ||
// This software is released under the MIT License. | ||
|
||
using VContainer; | ||
|
||
namespace VContainerAnalyzer.Test.TestData | ||
{ | ||
public class RegisterDefaultConstructorClassLifetimeScope | ||
{ | ||
public void Configure(IContainerBuilder builder) | ||
{ | ||
builder.Register<DefaultConstructorClass>(Lifetime.Singleton); | ||
} | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...lyzer.Test/TestData/RegisterEntryPointConstructorWithInjectAttributeClassLifetimeScope.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,18 @@ | ||
// Copyright (c) 2020-2024 VeyronSakai. | ||
// This software is released under the MIT License. | ||
|
||
using VContainer; | ||
using VContainer.Unity; | ||
|
||
namespace VContainerAnalyzer.Test.TestData | ||
{ | ||
public class RegisterEntryPointConstructorWithInjectAttributeClassLifetimeScope | ||
{ | ||
// ReSharper disable once UnusedMember.Global | ||
public void Configure(IContainerBuilder builder) | ||
{ | ||
builder.RegisterEntryPoint<ConstructorWithInjectAttributeClass>(); | ||
builder.RegisterEntryPoint<ConstructorWithInjectAttributeClass>(Lifetime.Singleton); | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
VContainerAnalyzer.Test/TestData/VContainer/InjectAttribute.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,25 @@ | ||
// Copyright (c) 2020-2024 VeyronSakai. | ||
// This software is released under the MIT License. | ||
|
||
using System; | ||
|
||
// ReSharper disable once CheckNamespace | ||
namespace VContainer | ||
{ | ||
public class PreserveAttribute : Attribute | ||
{ | ||
} | ||
|
||
[AttributeUsage( | ||
AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field, | ||
AllowMultiple = false, Inherited = true)] | ||
public class InjectAttribute : PreserveAttribute | ||
{ | ||
} | ||
|
||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface, | ||
AllowMultiple = false, Inherited = true)] | ||
public class InjectIgnoreAttribute : Attribute | ||
{ | ||
} | ||
} |
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