├── release-notes.txt
├── src
├── LightMock.Generator
│ ├── LightMock.Generator.props
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── AnalyzerReleases.Unshipped.md
│ ├── RefReturnVisitor.cs
│ ├── SymbolDisplayPartExtensions.cs
│ ├── AnalyzerReleases.Shipped.md
│ ├── LightMock.Generator.targets
│ ├── CompilationContext.cs
│ ├── LightMock.Generator.Roslyn40.csproj
│ ├── CodeGenerationContext.cs
│ ├── ExceptionMessages.cs
│ ├── GlobalOptionsNames.cs
│ ├── VariableNames.cs
│ ├── Suffix.cs
│ └── PropertyDefinitionVisitor.cs
├── LightMock.Generator.Tests
│ ├── AbstractClass
│ │ ├── AbstractClassNotGenerated.cs
│ │ ├── CantProcessSealedClass.cs
│ │ ├── Indexer.cs
│ │ ├── DontOverrideSupport.AssemblyInfo.test.cs
│ │ ├── MethodWithInParameter.cs
│ │ ├── MethodWithOutParameter.cs
│ │ ├── MethodWithRefParameter.cs
│ │ ├── RefReturn.cs
│ │ ├── NestedClass.cs
│ │ ├── ArrangeSetter_When.cs
│ │ ├── AbstractClassThrowsExceptionOnRefStruct.cs
│ │ ├── ArrangeSetter_WhenAny.cs
│ │ ├── ObsoleteSupport.cs
│ │ ├── AbstractClassWithConstructors.cs
│ │ ├── ArrangeAddRemove_When.cs
│ │ ├── ArrangeAddRemove_WhenAny.cs
│ │ ├── Indexer.test.cs
│ │ ├── ReservedSymbols.test.cs
│ │ ├── InheritSpecialized.cs
│ │ ├── CantProcessSealedClass.test.cs
│ │ ├── InheritSpecialized.test.cs
│ │ ├── ArrangeSetter_When.test.cs
│ │ ├── AssertSet.cs
│ │ ├── ArrangeSetter.cs
│ │ ├── AssertSet_WhenAny.cs
│ │ ├── ObsoleteSupport.test.cs
│ │ ├── MethodWithInParameter.test.cs
│ │ ├── NestedClass.test.cs
│ │ ├── MethodWithRefParameter.test.cs
│ │ ├── NestedGenericClass.cs
│ │ ├── InheritAbstractClass.test.cs
│ │ ├── DontOverrideSupport.test.cs
│ │ ├── AbstractClassWithEnumerableResult.cs
│ │ ├── ArrangeSetter_WhenAny.test.cs
│ │ ├── MethodWithOutParameter.test.cs
│ │ ├── AbstractClassWithTaskMethod.test.cs
│ │ ├── GenericAbstractClassWithGenericEvent.cs
│ │ ├── AbstractClassWithEventSource.test.cs
│ │ ├── AbstractClassWithGenericMethod.test.cs
│ │ ├── DontOverrideSupport.cs
│ │ ├── TypeCachingWithAbstractClass.cs
│ │ ├── AbstractClassThrowsExceptionOnRefStruct.test.cs
│ │ ├── GenerateForInternalClass.test.cs
│ │ ├── GenericAbstractClassWithGenericEvent.test.cs
│ │ ├── AbstractClassWithEventSourceAndMultipleNamespaces.cs
│ │ ├── AbstractClassWithEnumerableResult.test.cs
│ │ ├── GenericMockAndGenericAbstractClass.test.cs
│ │ ├── AbstractClassWithConstructors.test.cs
│ │ ├── AbstractClassWithEventSource.cs
│ │ ├── NestedGenericClass.test.cs
│ │ ├── InheritAbstractClass.cs
│ │ ├── TypeCachingWithAbstractClass.test.cs
│ │ ├── AbstractClassNotGenerated.test.cs
│ │ ├── ArrangeAddRemove_WhenAny.test.cs
│ │ ├── AbstractClassWithEventSourceAndMultipleNamespaces.test.cs
│ │ ├── AssertSet.test.cs
│ │ ├── AssertSet_WhenAny.test.cs
│ │ ├── TypeCachingWithGenericAbstractClass.test.cs
│ │ ├── TypeCachingWithGenericAbstractClass.cs
│ │ ├── GenericMockAndGenericAbstractClass.cs
│ │ ├── AbstractClassWithBasicMethods.cs
│ │ ├── GenericAbstractClass.cs
│ │ ├── RefReturn.test.cs
│ │ ├── AbstractClassWithMultipleNamespaces.cs
│ │ ├── AssertNoOtherCalls.test.cs
│ │ ├── AbstractClassWithBasicProperty.cs
│ │ ├── GenericAbstractClass.test.cs
│ │ ├── AssertNoOtherCalls_Throws.test.cs
│ │ ├── AbstractClassWithBasicMethods.test.cs
│ │ ├── AssertNoOtherCalls.cs
│ │ ├── AssertNoOtherCalls_Throws.cs
│ │ ├── ArrangeSetter.test.cs
│ │ ├── ArrangeAddRemove_When.test.cs
│ │ ├── AbstractClassWithTaskMethod.cs
│ │ ├── AbstractClassWithBasicProperty.test.cs
│ │ ├── AbstractClassWithMultipleNamespaces.test.cs
│ │ └── AbstractClassWithGenericMethod.cs
│ ├── Interface
│ │ ├── InterfaceNotGenerated.cs
│ │ ├── Indexer.cs
│ │ ├── MethodWithOutParameter.cs
│ │ ├── ArrangeAddRemove_When.cs
│ │ ├── MethodWithRefParameter.cs
│ │ ├── ArrangeAddRemove_WhenAny.cs
│ │ ├── RefReturn.cs
│ │ ├── GenericInterfaceWithVariance.cs
│ │ ├── AssertSet.cs
│ │ ├── AssertSet_WhenAny.cs
│ │ ├── InterfaceWithBasicProperty.cs
│ │ ├── NestedInterface.cs
│ │ ├── ArrangeSetter_When.cs
│ │ ├── InterfaceWithBasicMethods.cs
│ │ ├── TypeCachingWithGenericInterface.cs
│ │ ├── TypeCachingWithInterface.cs
│ │ ├── MethodWithInParameter.cs
│ │ ├── ArrangeSetter.cs
│ │ ├── GenericInterface.cs
│ │ ├── InterfaceWithEventSource.cs
│ │ ├── ArrangeSetter_WhenAny.cs
│ │ ├── InterfaceWithTaskMethod.cs
│ │ ├── InterfaceThrowsExceptionOnRefStruct.cs
│ │ ├── AssertNoOtherCalls.cs
│ │ ├── GenericInterfaceWithGenericEvent.cs
│ │ ├── AssertNoOtherCalls_Throws.cs
│ │ ├── GenericMockAndGenericInterface.cs
│ │ ├── InterfaceWithEventSourceAndMultipleNamespaces.cs
│ │ ├── Indexer.test.cs
│ │ ├── ReservedSymbols.test.cs
│ │ ├── InterfaceWithMultipleNamespaces.cs
│ │ ├── AssertSet_WhenAny.test.cs
│ │ ├── ArrangeSetter_When.test.cs
│ │ ├── AssertNoOtherCalls.test.cs
│ │ ├── InheritSpecialized.test.cs
│ │ ├── InherittedInterface.test.cs
│ │ ├── InterfaceWithEnumerableResult.cs
│ │ ├── ArrangeAddRemove_When.test.cs
│ │ ├── NestedGenericInterface.cs
│ │ ├── ArrangeSetter_WhenAny.test.cs
│ │ ├── MethodWithInParameter.test.cs
│ │ ├── ArrangeAddRemove_WhenAny.test.cs
│ │ ├── AssertNoOtherCalls_Throws.test.cs
│ │ ├── GenericInterface.test.cs
│ │ ├── MethodWithRefParameter.test.cs
│ │ ├── InheritSpecialized.cs
│ │ ├── NestedInterface.test.cs
│ │ ├── InterfaceWithEventSource.test.cs
│ │ ├── InterfaceWithBasicProperty.test.cs
│ │ ├── InterfaceWithGenericMethod.test.cs
│ │ ├── MethodWithOutParameter.test.cs
│ │ ├── InterfaceWithTaskMethod.test.cs
│ │ ├── InterfaceWithBasicMethods.test.cs
│ │ ├── GenericInterfaceWithGenericEvent.test.cs
│ │ ├── AssertSet.test.cs
│ │ ├── GenericInterfaceWithVariance.test.cs
│ │ ├── InterfaceThrowsExceptionOnRefStruct.test.cs
│ │ ├── InterfaceWithGenericMethod.cs
│ │ ├── InterfaceWithMultipleNamespaces.test.cs
│ │ ├── InterfaceWithEnumerableResult.test.cs
│ │ ├── GenericMockAndGenericInterface.test.cs
│ │ ├── TypeCachingWithInterface.test.cs
│ │ ├── InterfaceWithEventSourceAndMultipleNamespaces.test.cs
│ │ ├── InterfaceNotGenerated.test.cs
│ │ ├── NestedGenericInterface.test.cs
│ │ ├── TypeCachingWithGenericInterface.test.cs
│ │ ├── InherittedInterface.cs
│ │ ├── ArrangeSetter.test.cs
│ │ └── RefReturn.test.cs
│ ├── Attributes
│ │ ├── DisableCodeGeneration.cs
│ │ ├── EnableCodeGeneration.test.cs
│ │ └── DisableCodeGeneration.test.cs
│ ├── Friends
│ │ ├── IFoo.cs
│ │ ├── FriendAssembly.test.cs
│ │ └── SameAssembly.test.cs
│ ├── Issues
│ │ ├── HintNames.cs
│ │ ├── TypeOrNamespaceCouldNotBeFound.test.cs
│ │ ├── EnsureExceptionWhenMockIsMissing.cs
│ │ ├── NamespacesIssue.cs
│ │ ├── TypeKeyAttributeRemoved.cs
│ │ ├── EnsureExceptionWhenMockIsMissing.test.cs
│ │ ├── TypeKeyAttributeRemoved.test.cs
│ │ ├── NamespacesIssue.test.cs
│ │ └── HintNames.test.cs
│ ├── TestAbstractions
│ │ ├── ITestScript.cs
│ │ ├── CompilationResult.cs
│ │ ├── TestableSourceText.cs
│ │ └── ValidProgramException.cs
│ ├── Delegate
│ │ ├── NestedDelegate.cs
│ │ ├── GenericDelegate.cs
│ │ ├── NestedDelegateWithGenerics.cs
│ │ ├── BasicDelegate.test.cs
│ │ ├── NestedDelegate.test.cs
│ │ ├── GenericDelegate.test.cs
│ │ ├── DelegateNotGenerated.test.cs
│ │ └── NestedDelegateWithGenerics.test.cs
│ ├── AnalyzerOptions
│ │ ├── DisableCodeGeneration.cs
│ │ └── DisableCodeGeneration.test.cs
│ ├── BaseTests
│ │ ├── IBaz.cs
│ │ ├── IQuux.cs
│ │ ├── BarMock.cs
│ │ ├── TheTests.cs
│ │ ├── PropMock.cs
│ │ ├── ArgumentHelper_Tests.cs
│ │ └── IFoo.cs
│ ├── ExpressionReflect
│ │ ├── Model
│ │ │ ├── CustomStruct.cs
│ │ │ ├── NameIndex.cs
│ │ │ ├── CustomerExtensions.cs
│ │ │ └── TestExtensionMethods.cs
│ │ ├── ActionExtensions.cs
│ │ ├── FuncExtensions.cs
│ │ ├── ActionExecutionTests.cs
│ │ ├── ConditionalTests.cs
│ │ └── LICENSE
│ ├── Mocks
│ │ ├── MockAnalyzerConfigOptions.cs
│ │ └── MockAnalyzerConfigOptionsProvider.cs
│ ├── LightMock.Generator.Tests.csproj
│ ├── Attributes_Test.cs
│ └── LightMock.Generator.Tests.Roslyn40.csproj
├── LightMock.Generator.Common
│ ├── CodeAnalysis
│ │ ├── AllowNullAttribute.cs
│ │ └── MayBeNullAttribute.cs
│ ├── Preferences
│ │ └── AssemblyInfo.cs
│ ├── Generator
│ │ ├── IRefReturnContext.cs
│ │ ├── ILambdaToken.cs
│ │ ├── TypeKeyAttribute.cs
│ │ ├── Mock{T}.cs
│ │ ├── OriginalNameAttribute.cs
│ │ ├── TypeExtensions.cs
│ │ ├── LambdaRequest.cs
│ │ ├── Tags
│ │ │ └── Tags.cs
│ │ ├── IProtectedContext.cs
│ │ ├── IDelegateProvider.cs
│ │ ├── ILambdaRequest.cs
│ │ └── AbstractMockNameofProvider.cs
│ ├── ArgumentHelper.cs
│ ├── PropertyArrangement.cs
│ ├── ILockedCollection.cs
│ ├── ExpressionReflect
│ │ ├── ExpressionExtensions.cs
│ │ └── ExpressionExecutionException.cs
│ ├── IMatchInfo.cs
│ └── LightMock.Generator.Common.csproj
├── Directory.Build.props
├── CodeCoverage.runsettings
└── common.props
└── LICENSE
/release-notes.txt:
--------------------------------------------------------------------------------
1 | * fix: In version 1.2.3 .net 9 compatibility with ignore "allow net struct" on delegates
--------------------------------------------------------------------------------
/src/LightMock.Generator/LightMock.Generator.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/AbstractClass/AbstractClassNotGenerated.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace LightMock.Generator.Tests.AbstractClass
4 | {
5 | public abstract class AAbstractClassNotGenerated { }
6 | }
7 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/Interface/InterfaceNotGenerated.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace LightMock.Generator.Tests.Interface
4 | {
5 | public interface IInterfaceNotGenerated
6 | { }
7 |
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/src/LightMock.Generator/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.CompilerServices;
2 |
3 | [assembly: InternalsVisibleTo("LightMock.Generator.Tests")]
4 | [assembly: InternalsVisibleTo("LightMock.Generator.Tests.Roslyn40")]
5 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/Attributes/DisableCodeGeneration.cs:
--------------------------------------------------------------------------------
1 | namespace LightMock.Generator.Tests.Attributes
2 | {
3 | public interface IDisableCodeGeneration
4 | {
5 | public string SomeProperty { get; }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/Interface/Indexer.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace LightMock.Generator.Tests.Interface
4 | {
5 | public interface IIndexer
6 | {
7 | T this[int index] { get; set; }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/Friends/IFoo.cs:
--------------------------------------------------------------------------------
1 | using LightMock.Generator.Tests.TestAbstractions;
2 | using System;
3 |
4 | namespace LightMock.Generator.Tests.Friends
5 | {
6 | public interface IFoo
7 | {
8 | }
9 | }
10 |
11 |
12 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/Interface/MethodWithOutParameter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace LightMock.Generator.Tests.Interface
4 | {
5 | public interface IMethodWithOutParameter
6 | {
7 | int Foo(out int bar);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/AbstractClass/CantProcessSealedClass.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace LightMock.Generator.Tests.AbstractClass
4 | {
5 | public sealed class SomeSealedClass
6 | {
7 | public void Foo() { }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/Interface/ArrangeAddRemove_When.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace LightMock.Generator.Tests.Interface
4 | {
5 | public interface IArrangeAddRemove_When
6 | {
7 | event EventHandler EventHandler;
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/Interface/MethodWithRefParameter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace LightMock.Generator.Tests.Interface
4 | {
5 | public interface IMethodWithRefParameter
6 | {
7 | string Foo(ref string bar);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/AbstractClass/Indexer.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace LightMock.Generator.Tests.AbstractClass
4 | {
5 | public abstract class AIndexer
6 | {
7 | public abstract T this[int index] { get; set; }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/Interface/ArrangeAddRemove_WhenAny.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace LightMock.Generator.Tests.Interface
4 | {
5 | public interface IArrangeAddRemove_WhenAny
6 | {
7 | event EventHandler EventHandler;
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/Interface/RefReturn.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace LightMock.Generator.Tests.Interface
4 | {
5 | public interface IRefReturn
6 | {
7 | ref string Foo();
8 | ref readonly DateTime Bar();
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/AbstractClass/DontOverrideSupport.AssemblyInfo.test.cs:
--------------------------------------------------------------------------------
1 | using LightMock.Generator;
2 | using LightMock.Generator.Tests.AbstractClass;
3 |
4 | [assembly: DontOverrideAttribute(typeof(SkipThisClass))]
5 | [assembly: DontOverrideAttribute(typeof(SkipThisClass))]
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/Interface/GenericInterfaceWithVariance.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace LightMock.Generator.Tests.Interface
4 | {
5 |
6 | public interface IGenericInterfaceWithVariance
7 | {
8 | void Foo();
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/AbstractClass/MethodWithInParameter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace LightMock.Generator.Tests.AbstractClass
4 | {
5 | public abstract class AMethodWithInParameter
6 | {
7 | public abstract string Foo(in string bar);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/AbstractClass/MethodWithOutParameter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace LightMock.Generator.Tests.AbstractClass
4 | {
5 | public abstract class AMethodWithOutParameter
6 | {
7 | public abstract int Foo(out int bar);
8 | }
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/AbstractClass/MethodWithRefParameter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace LightMock.Generator.Tests.AbstractClass
4 | {
5 | public abstract class AMethodWithRefParameter
6 | {
7 | public abstract string Foo(ref string bar);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/Interface/AssertSet.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace LightMock.Generator.Tests.Interface
4 | {
5 | public interface IAssertSet
6 | {
7 | public string GetAndSet { get; set; }
8 | public string SetOnly { set; }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Common/CodeAnalysis/AllowNullAttribute.cs:
--------------------------------------------------------------------------------
1 | namespace System.Diagnostics.CodeAnalysis
2 | {
3 | [AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property, Inherited = false)]
4 | internal sealed class AllowNullAttribute : Attribute { }
5 | }
6 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/Interface/AssertSet_WhenAny.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace LightMock.Generator.Tests.Interface
4 | {
5 | public interface IAssertSet_WhenAny
6 | {
7 | public string GetAndSet { get; set; }
8 | public string SetOnly { set; }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/Interface/InterfaceWithBasicProperty.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace LightMock.Generator.Tests.Interface
4 | {
5 | public interface IInterfaceWithBasicProperty
6 | {
7 | int OnlyGet { get; }
8 | int GetAndSet { get; set; }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/Interface/NestedInterface.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace LightMock.Generator.Tests.Interface
4 | {
5 | public interface INestedInterface
6 | {
7 | public interface ITest
8 | {
9 | void Foo();
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/Interface/ArrangeSetter_When.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace LightMock.Generator.Tests.Interface
4 | {
5 | public interface IArrangeSetter_When
6 | {
7 | public string GetAndSet { get; set; }
8 | public string SetOnly { set; }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/Interface/InterfaceWithBasicMethods.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace LightMock.Generator.Tests.Interface
4 | {
5 | public interface IInterfaceWithBasicMethods
6 | {
7 | void DoSomething(int someParam);
8 | int ReturnSomething();
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/Interface/TypeCachingWithGenericInterface.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace LightMock.Generator.Tests.Interface
4 | {
5 | public interface ITypeCachingWithGenericInterface
6 | {
7 | T GetSomething();
8 | void DoSomething(T p);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/Interface/TypeCachingWithInterface.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace LightMock.Generator.Tests.Interface
4 | {
5 | public interface ITypeCachingWithInterface
6 | {
7 | void DoSomething(int someParam);
8 | int ReturnSomething();
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/Issues/HintNames.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace LightMock.Generator.Tests.Issues
4 | {
5 | public interface IHintNames { }
6 | public interface IHintNames { }
7 | public abstract class AHintNames { }
8 | public abstract class AHintNames { }
9 | }
10 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/AbstractClass/RefReturn.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace LightMock.Generator.Tests.AbstractClass
4 | {
5 | public abstract class ARefReturn
6 | {
7 | public abstract ref string Foo();
8 | public abstract ref readonly DateTime Bar();
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/Interface/MethodWithInParameter.cs:
--------------------------------------------------------------------------------
1 | using LightMock.Generator.Tests.TestAbstractions;
2 | using System;
3 |
4 | namespace LightMock.Generator.Tests.Interface
5 | {
6 | public interface IMethodWithInParameter
7 | {
8 | string Foo(in string bar);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/LightMock.Generator/AnalyzerReleases.Unshipped.md:
--------------------------------------------------------------------------------
1 | ; Unshipped analyzer release
2 | ; https://github.com/dotnet/roslyn-analyzers/blob/master/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md
3 | ### New Rules
4 | Rule ID | Category | Severity | Notes
5 | --------|----------|----------|-------
6 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/AbstractClass/NestedClass.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace LightMock.Generator.Tests.AbstractClass
4 | {
5 | public class XNestedClass
6 | {
7 | public abstract class ATest
8 | {
9 | public abstract void Foo();
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/TestAbstractions/ITestScript.cs:
--------------------------------------------------------------------------------
1 | namespace LightMock.Generator.Tests.TestAbstractions
2 | {
3 | public interface ITestScript
4 | where T : class
5 | {
6 | IMock Context { get; }
7 | T MockObject { get; }
8 |
9 | int DoRun();
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/Delegate/NestedDelegate.cs:
--------------------------------------------------------------------------------
1 | using LightMock.Generator.Tests.TestAbstractions;
2 | using System;
3 |
4 | namespace LightMock.Generator.Tests.Delegate
5 | {
6 | public class XNestedDelegate
7 | {
8 | public delegate void SomeDelegate(object sender, int args);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/AnalyzerOptions/DisableCodeGeneration.cs:
--------------------------------------------------------------------------------
1 | using LightMock.Generator.Tests.TestAbstractions;
2 | using System;
3 |
4 | namespace LightMock.Generator.Tests.AnalyzerOptions
5 | {
6 | public interface IDisableCodeGeneration
7 | {
8 | public string SomeProperty { get; }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/BaseTests/IBaz.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace LightMock.Generator.Tests.BaseTests
4 | {
5 | interface IBaz
6 | {
7 | void Method();
8 | void Method(int a);
9 | int Func();
10 | int Func(int a);
11 | int Property { get; set; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/BaseTests/IQuux.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace LightMock.Generator.Tests.BaseTests
4 | {
5 | interface IQuux
6 | {
7 | void Method();
8 | void Method(int a);
9 | int Func();
10 | int Func(int a);
11 | int Property { get; set; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/Interface/ArrangeSetter.cs:
--------------------------------------------------------------------------------
1 | using LightMock.Generator.Tests.TestAbstractions;
2 | using System;
3 |
4 | namespace LightMock.Generator.Tests.Interface
5 | {
6 | public interface IArrangeSetter
7 | {
8 | string GetAndSet { get; set; }
9 | string Set { set; }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/TestAbstractions/CompilationResult.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.CodeAnalysis;
2 | using System;
3 | using System.Collections.Immutable;
4 |
5 | namespace LightMock.Generator.Tests.TestAbstractions
6 | {
7 | public record class CompilationResult(ImmutableArray diagnostics, bool success, byte[] assembly);
8 | }
9 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Common/Preferences/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.CompilerServices;
2 |
3 | [assembly:InternalsVisibleTo("LightMock.Generator")]
4 | [assembly:InternalsVisibleTo("LightMock.Generator.v40")]
5 | [assembly:InternalsVisibleTo("LightMock.Generator.Tests")]
6 | [assembly:InternalsVisibleTo("LightMock.Generator.Tests.Roslyn40")]
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/Interface/GenericInterface.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace LightMock.Generator.Tests.Interface
4 | {
5 | public interface IGenericInterface
6 | {
7 | T OnlyGet { get; }
8 | T GetAndSet { get; set; }
9 | T GetSomething();
10 | void DoSomething(T p);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/Interface/InterfaceWithEventSource.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace LightMock.Generator.Tests.Interface
4 | {
5 | public delegate void EventHandler(object source, T data);
6 |
7 | public interface IInterfaceWithEventSource
8 | {
9 | event EventHandler OnEvent;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/Interface/ArrangeSetter_WhenAny.cs:
--------------------------------------------------------------------------------
1 | using LightMock.Generator.Tests.TestAbstractions;
2 | using System;
3 |
4 | namespace LightMock.Generator.Tests.Interface
5 | {
6 | public interface IArrangeSetter_WhenAny
7 | {
8 | string GetAndSet { get; set; }
9 | string SetOnly { set; }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/Issues/TypeOrNamespaceCouldNotBeFound.test.cs:
--------------------------------------------------------------------------------
1 | namespace LightMock.Generator.Tests.Issues
2 | {
3 | public class TypeOrNamespaceCouldNotBeFound
4 | {
5 | public void Foo()
6 | {
7 | var mock = new Mock();
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/TestAbstractions/TestableSourceText.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace LightMock.Generator.Tests.TestAbstractions
8 | {
9 | public record TestableSourceText(string sourceCode, string hint);
10 | }
11 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/Interface/InterfaceWithTaskMethod.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 |
4 | namespace LightMock.Generator.Tests.Interface
5 | {
6 | public interface IInterfaceWithTaskMethod
7 | {
8 | Task FooAsync();
9 | Task BarAsync();
10 | Task BazAsync();
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/Delegate/GenericDelegate.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace LightMock.Generator.Tests.Delegate
4 | {
5 | public delegate TResult SomeGenericDelegate(T1 a1, T2 a2, T3 a3)
6 | where T1 : class
7 | where T2 : struct, IEquatable
8 | where T3 : IEquatable;
9 | }
10 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/ExpressionReflect/Model/CustomStruct.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace LightMock.Generator.Tests.ExpressionReflect.Model
4 | {
5 | struct CustomStruct
6 | {
7 | private readonly int value;
8 |
9 | public CustomStruct(int value) => this.value = value;
10 |
11 | public int Value => this.value;
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/Interface/InterfaceThrowsExceptionOnRefStruct.cs:
--------------------------------------------------------------------------------
1 | using LightMock.Generator.Tests.TestAbstractions;
2 | using System;
3 |
4 | namespace LightMock.Generator.Tests.Interface
5 | {
6 |
7 | public interface IInterfaceThrowsExceptionOnRefStruct
8 | {
9 | void Foo(Span span);
10 | void Bar(Span span);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Common/CodeAnalysis/MayBeNullAttribute.cs:
--------------------------------------------------------------------------------
1 | namespace System.Diagnostics.CodeAnalysis
2 | {
3 | [AttributeUsage(AttributeTargets.Field
4 | | AttributeTargets.Parameter
5 | | AttributeTargets.Property
6 | | AttributeTargets.ReturnValue,
7 | Inherited = false)]
8 | internal sealed class MaybeNullAttribute : Attribute
9 | { }
10 | }
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/Issues/EnsureExceptionWhenMockIsMissing.cs:
--------------------------------------------------------------------------------
1 | namespace LightMock.Generator.Tests.Issues
2 | {
3 | public interface IEnsureExceptionWhenMockIsMissingBase
4 | {
5 | void Foo();
6 | }
7 |
8 | public interface IEnsureExceptionWhenMockIsMissing : IEnsureExceptionWhenMockIsMissingBase
9 | {
10 | void Bar();
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/AbstractClass/ArrangeSetter_When.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace LightMock.Generator.Tests.AbstractClass
4 | {
5 | public abstract class AArrangeSetter_When
6 | {
7 | protected AArrangeSetter_When(object a1, int a2) { }
8 |
9 | public abstract string GetAndSet { get; set; }
10 | public abstract string SetOnly { set; }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/AbstractClass/AbstractClassThrowsExceptionOnRefStruct.cs:
--------------------------------------------------------------------------------
1 | using LightMock.Generator.Tests.TestAbstractions;
2 | using System;
3 |
4 | namespace LightMock.Generator.Tests.AbstractClass
5 | {
6 | public abstract class AAbstractClassThrowsExceptionOnRefStruct
7 | {
8 | public abstract void Foo(Span span);
9 | public abstract void Bar(Span span);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/Delegate/NestedDelegateWithGenerics.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace LightMock.Generator.Tests.Delegate
4 | {
5 | public interface XNestedInterface
6 | where T1: struct, IEquatable
7 | {
8 | public interface XContainer
9 | {
10 | public delegate void SomeDelegate(T1 a1, T2 a2, T3 a3)
11 | where T3 : class;
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/ExpressionReflect/Model/NameIndex.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace LightMock.Generator.Tests.ExpressionReflect.Model
4 | {
5 | sealed class NameIndex
6 | {
7 | private readonly string[] names;
8 |
9 | public NameIndex(params string[] names)
10 | {
11 | this.names = names;
12 | }
13 |
14 | public int this[string name]
15 | {
16 | get { return name.IndexOf(name); }
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/LightMock.Generator.Tests/AbstractClass/ArrangeSetter_WhenAny.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace LightMock.Generator.Tests.AbstractClass
5 | {
6 | public abstract class AArrangeSetter_WhenAny
7 | {
8 | protected AArrangeSetter_WhenAny(object a1, int a2, IEnumerable