├── .editorconfig ├── .gitattributes ├── .github ├── CONTRIBUTING.md ├── FUNDING.yml ├── ISSUE_TEMPLATE.md ├── PULL_REQUEST_TEMPLATE.md ├── actions │ └── execute-pipeline │ │ └── action.yml ├── release.yml └── workflows │ ├── codeql.yml │ ├── deploy-pages-test.yml │ ├── deploy-pages.yml │ ├── dotnet.yml │ ├── generate-readme.yml │ ├── review-stale.yml │ └── speed-comparison.yml ├── .gitignore ├── .idea └── .idea.TUnit │ └── .idea │ ├── .gitignore │ ├── encodings.xml │ ├── indexLayout.xml │ ├── material_theme_project_new.xml │ └── vcs.xml ├── .vscode ├── launch.json └── tasks.json ├── Analyzer.props ├── Directory.Build.props ├── Directory.Build.targets ├── Directory.Packages.props ├── GitVersion.yml ├── LICENSE ├── Library.props ├── Playground ├── Playground.csproj └── Program.cs ├── Polyfill.props ├── README.md ├── README_Template.md ├── Roslyn.props ├── SourceGenerator.props ├── TUnit.Analyzers.CodeFixers ├── Extensions │ └── DocumentExtensions.cs ├── InheritsTestsCodeFixProvider.cs ├── TUnit.Analyzers.CodeFixers.csproj ├── XUnitMigrationCodeFixProvider.cs └── XUnitUsingDirectiveCodeFixProvider.cs ├── TUnit.Analyzers.Roslyn414 └── TUnit.Analyzers.Roslyn414.csproj ├── TUnit.Analyzers.Roslyn44 └── TUnit.Analyzers.Roslyn44.csproj ├── TUnit.Analyzers.Roslyn47 └── TUnit.Analyzers.Roslyn47.csproj ├── TUnit.Analyzers.Tests ├── AnalyzerTestHelpers.cs ├── ArgumentsAnalyzerTests.cs ├── AsyncVoidAnalyzerTests.cs ├── BaseAnalyzerTests.cs ├── BeforeHookAsyncLocalAnalyzerTests.cs ├── Bugs │ └── 2136 │ │ └── Tests.cs ├── ClassAccessibilityAnalyzerTests.cs ├── ClassConstructorDataSourceAnalyzerTests.cs ├── ClassDataSourceAnalyzerTests.cs ├── ClassParametersAnalyzerTests.cs ├── ConsoleOutAnalyzerTests.cs ├── DataDrivenTestArgumentsAnalyzerTests.cs ├── DataSourceGeneratorAnalyzerTests.cs ├── DependsOnConflictAnalyzerTests.cs ├── DependsOnNotInParallelConflictAnalyzerTests.cs ├── DisposableFieldPropertyAnalyzerTests.cs ├── DynamicTestAwaitExpressionSuppressorTests.cs ├── EnumerableMethodDataTupleTypeTests.cs ├── Extensions │ └── StringExtensions.cs ├── ForbidRedefiningAttributeUsageAnalyzerTests.cs ├── GeneratedDataAnalyzerTests.cs ├── GenericMethodSourceDataTests.cs ├── GlobalTestHooksAnalyzerTests.cs ├── InheritsTestsAnalyzerTests.cs ├── InstanceTestMethodAnalyzerTests.cs ├── InstanceValuesInTestClassAnalyzerTests.cs ├── MarkMethodStaticSuppressorTests.cs ├── MatrixDataSourceAnalyzerTests.cs ├── MethodDataSourceAnalyzerTests.cs ├── MethodDataSourceMatchesConstructorAnalyzerTests.cs ├── MissingTestAttributeAnalyzerTests.cs ├── PropertyAnalyzerTests.cs ├── PsvmAnalyzerTests.cs ├── PublicMethodMissingTestAttributeAnalyzerTests.cs ├── SingleTUnitAttributeAnalyzerTests.cs ├── TUnit.Analyzers.Tests.csproj ├── TestMethodParametersAnalyzerTests.cs ├── Verifiers │ ├── CSharpAnalyzerVerifier.cs │ ├── CSharpAnalyzerVerifier`1.cs │ ├── CSharpCodeFixVerifier.cs │ ├── CSharpCodeFixVerifier`2.cs │ ├── CSharpCodeRefactoringVerifier.cs │ ├── CSharpCodeRefactoringVerifier`1.cs │ └── CSharpVerifierHelper.cs └── XUnitMigrationAnalyzerTests.cs ├── TUnit.Analyzers ├── AnalyzerReleases.Shipped.md ├── AnalyzerReleases.Unshipped.md ├── AssemblyTestHooksAnalyzer.cs ├── AsyncVoidAnalyzer.cs ├── BeforeHookAsyncLocalAnalyzer.cs ├── ClassAccessibilityAnalyzer.cs ├── ClassHooksAnalyzer.cs ├── ClassParametersAnalyzer.cs ├── ConcurrentDiagnosticAnalyzer.cs ├── ConflictingExplicitAttributesAnalyzer.cs ├── ConsoleOutAnalyzer.cs ├── DependsOnConflictAnalyzer.cs ├── DependsOnNotInParallelConflictAnalyzer.cs ├── DisplayFormats.cs ├── DisposableFieldPropertyAnalyzer.cs ├── DynamicTestAwaitExpressionSuppressor.cs ├── Extensions │ ├── AttributeExtensions.cs │ ├── CompilationExtensions.cs │ ├── EnumerableExtensions.cs │ ├── MethodExtensions.cs │ ├── ParameterExtensions.cs │ ├── PropertyExtensions.cs │ ├── SymbolExtensions.cs │ ├── SyntaxExtensions.cs │ ├── TypeExtensions.cs │ └── TypedConstantExtensions.cs ├── ForbidRedefiningAttributeUsageAnalyzer.cs ├── FullyQualifiedTypeName.cs ├── GlobalTestHooksAnalyzer.cs ├── Helpers │ └── WellKnown.cs ├── HookLevel.cs ├── HookType.cs ├── InheritsTestsAnalyzer.cs ├── InstanceTestHooksAnalyzer.cs ├── InstanceTestMethodAnalyzer.cs ├── InstanceValuesInTestClassAnalyzer.cs ├── MarkMethodStaticSuppressor.cs ├── MatrixAnalyzer.cs ├── Migrators │ └── XUnitMigrationAnalyzer.cs ├── MissingTestAttributeAnalyzer.cs ├── Properties │ └── launchSettings.json ├── PropertyAnalyzer.cs ├── PsvmAnalyzer.cs ├── PublicMethodMissingTestAttributeAnalyzer.cs ├── Resources.Designer.cs ├── Resources.resx ├── Rules.cs ├── SingleTUnitAttributeAnalyzer.cs ├── TUnit.Analyzers.csproj ├── TestDataAnalyzer.cs ├── TestMethodParametersAnalyzer.cs └── TimeoutCancellationTokenAnalyzer.cs ├── TUnit.Assertions.Analyzers.CodeFixers.Tests ├── AwaitAssertionCodeFixProviderTests.cs ├── Extensions │ └── StringExtensions.cs ├── TUnit.Assertions.Analyzers.CodeFixers.Tests.csproj ├── Verifiers │ ├── CSharpCodeFixVerifier.cs │ ├── CSharpCodeFixVerifier`2.cs │ ├── CSharpCodeRefactoringVerifier.cs │ ├── CSharpCodeRefactoringVerifier`1.cs │ └── CSharpVerifierHelper.cs └── XUnitAssertionCodeFixProviderTests.cs ├── TUnit.Assertions.Analyzers.CodeFixers ├── AwaitAssertionCodeFixProvider.cs ├── Extensions │ └── DocumentExtensions.cs ├── TUnit.Assertions.Analyzers.CodeFixers.csproj └── XUnitAssertionCodeFixProvider.cs ├── TUnit.Assertions.Analyzers.Tests ├── AwaitAssertionAnalyzerTests.cs ├── AwaitValueTaskAssertThatAnalyzerTests.cs ├── CompilerArgumentsPopulatedAnalyzerTests.cs ├── ConstantInAssertThatAnalyzerTests.cs ├── DynamicInAssertThatAnalyzerTests.cs ├── MixAndOrOperatorsAnalyzerTests.cs ├── ObjectBaseEqualsMethodAnalyzerTests.cs ├── TUnit.Assertions.Analyzers.Tests.csproj └── Verifiers │ ├── CSharpAnalyzerVerifier.cs │ ├── CSharpAnalyzerVerifier`1.cs │ ├── CSharpCodeFixVerifier.cs │ ├── CSharpCodeFixVerifier`2.cs │ ├── CSharpCodeRefactoringVerifier.cs │ ├── CSharpCodeRefactoringVerifier`1.cs │ └── CSharpVerifierHelper.cs ├── TUnit.Assertions.Analyzers ├── AnalyzerReleases.Shipped.md ├── AnalyzerReleases.Unshipped.md ├── AwaitAssertionAnalyzer.cs ├── AwaitValueTaskAssertThatAnalyzer.cs ├── CompilerArgumentsPopulatedAnalyzer.cs ├── ConcurrentDiagnosticAnalyzer.cs ├── ConstantInAssertThatAnalyzer.cs ├── DisplayFormats.cs ├── DynamicInAssertThatAnalyzer.cs ├── Extensions │ ├── SyntaxExtensions.cs │ └── TypeExtensions.cs ├── MixAndOrOperatorsAnalyzer.cs ├── ObjectBaseEqualsMethodAnalyzer.cs ├── Properties │ ├── AssemblyInfo.cs │ └── launchSettings.json ├── Resources.Designer.cs ├── Resources.resx ├── Rules.cs ├── TUnit.Assertions.Analyzers.csproj └── XUnitAssertionAnalyzer.cs ├── TUnit.Assertions.FSharp ├── Extensions.fs ├── TUnit.Assertions.FSharp.fsproj └── TUnit.Assertions.FSharp.props ├── TUnit.Assertions.Tests ├── AssertConditions │ └── BecauseTests.cs ├── AssertMultipleTests.cs ├── AssertionBuilders │ ├── AndAssertionTests.cs │ └── OrAssertionTests.cs ├── AssertionGroupTests.cs ├── Assertions │ └── Delegates │ │ ├── Throws.ExactlyTests.cs │ │ ├── Throws.ExceptionTests.cs │ │ ├── Throws.NothingTests.cs │ │ ├── Throws.OfTypeTests.cs │ │ ├── Throws.WithInnerExceptionTests.cs │ │ ├── Throws.WithMessageMatchingTests.cs │ │ ├── Throws.WithMessageTests.cs │ │ ├── Throws.WithParameterNameTests.cs │ │ └── Throws.cs ├── Bugs │ ├── Tests1600.cs │ ├── Tests1770.cs │ ├── Tests1774.cs │ ├── Tests1860.cs │ ├── Tests1877.cs │ ├── Tests1917.cs │ ├── Tests2117.cs │ ├── Tests2129.cs │ └── Tests2145.cs ├── EnumTests.cs ├── EnumerableTests.cs ├── ExecutionTimeTests.cs ├── FailTests.cs ├── GlobalUsings.cs ├── Helpers │ └── StringDifferenceTests.cs ├── NullabilityInferenceTests.cs ├── Old │ ├── AssertMultipleTests.cs │ ├── AsyncTaskTests.cs │ ├── BoolEqualToAssertionTests.cs │ ├── DateOnlyEqualToAssertionTests.cs │ ├── DateTimeEqualToAssertionTests.cs │ ├── DateTimeOffsetEqualToAssertionTests.cs │ ├── DecimalEqualsToAssertionTests.cs │ ├── DefaultAssertionTests.cs │ ├── DictionaryAssertionTests.cs │ ├── DoubleEqualsToAssertionTests.cs │ ├── DynamicAssertionTests.cs │ ├── EqualityComparerTests.cs │ ├── EqualsAssertionTests.cs │ ├── EquivalentAssertionTests.cs │ ├── ExceptionAssertionTests.cs │ ├── GlobalUsings.cs │ ├── InnerExceptionThrower.cs │ ├── IntegerEqualsToAssertionTests.cs │ ├── LongEqualsToAssertionTests.cs │ ├── MemberTests.cs │ ├── ObjectTests.cs │ ├── ParameterAssertionTests.cs │ ├── RefStructEqualToAssertionTests.cs │ ├── StringAssertionTests.cs │ ├── StringContainsAssertionTests.cs │ ├── StringEqualsAssertionTests.cs │ ├── StringRegexAssertionTests.cs │ ├── TimeOnlyEqualToAssertionTests.cs │ ├── TimeSpanAssertionTests.cs │ ├── TimeSpanEqualToAssertionTests.cs │ └── ZeroAssertionTests.cs ├── SatisfiesTests.cs ├── SkipTests.cs ├── TUnit.Assertions.Tests.csproj ├── TypeInferenceTests.cs └── TypeOfTests.cs ├── TUnit.Assertions ├── Assert.cs ├── AssertConditions │ ├── AssertionResult.cs │ ├── BaseAssertCondition.cs │ ├── BecauseReason.cs │ ├── ChainType.cs │ ├── Connectors │ │ ├── AndAssertCondition.cs │ │ └── OrAssertCondition.cs │ ├── ConvertToAssertCondition.cs │ ├── DelegateAssertCondition.cs │ ├── EnumerableSatisfiesAssertCondition.cs │ ├── Exceptions │ │ ├── ExceptionMessageContainingExpectedValueAssertCondition.cs │ │ ├── ExceptionMessageEndingWithExpectedValueAssertCondition.cs │ │ ├── ExceptionMessageEqualsExpectedValueAssertCondition.cs │ │ ├── ExceptionMessageMatchingExpectedAssertCondition.cs │ │ └── ExceptionMessageStartingWithExpectedValueAssertCondition.cs │ ├── ExpectedValueAssertCondition.cs │ ├── FailureLocation.cs │ ├── FuncValueAssertCondition.cs │ ├── Interfaces │ │ ├── ConvertedDelegateSource.cs │ │ ├── ConvertedValueSource.cs │ │ ├── IDelegateSource.cs │ │ ├── ISource.cs │ │ ├── IValueDelegateSource.cs │ │ └── IValueSource.cs │ ├── NotNullExpectedValueAssertCondition.cs │ ├── NullExpectedValueAssertCondition.cs │ ├── Operators │ │ ├── AssertionType.cs │ │ ├── DelegateAnd.cs │ │ ├── DelegateOr.cs │ │ ├── ValueAnd.cs │ │ ├── ValueDelegateAnd.cs │ │ ├── ValueDelegateOr.cs │ │ └── ValueOr.cs │ ├── SatisfiesAssertCondition.cs │ ├── StringMatcher.cs │ └── ValueAssertCondition.cs ├── AssertionBuilders │ ├── AndAssertionBuilder.cs │ ├── AndConvertedTypeAssertionBuilder.cs │ ├── AssertionBuilder.cs │ ├── AsyncDelegateAssertionBuilder.cs │ ├── AsyncValueDelegateAssertionBuilder.cs │ ├── CastableResultAssertionBuilder.cs │ ├── DelegateAssertionBuilder.cs │ ├── Groups │ │ ├── AndAssertionGroup.cs │ │ ├── AndAssertionGroupInvoker.cs │ │ ├── AssertionGroup.cs │ │ ├── AssertionGroupBuilder.cs │ │ ├── OrAssertionGroup.cs │ │ ├── OrAssertionGroupInvoker.cs │ │ ├── UnknownAssertionGroup.cs │ │ └── UnknownAssertionGroupInvoker.cs │ ├── IAndAssertionBuilder.cs │ ├── IInvokableAssertionBuilder.cs │ ├── IOrAssertionBuilder.cs │ ├── InvokableAssertionBuilder.cs │ ├── InvokableDelegateAssertionBuilder.cs │ ├── InvokableValueAssertionBuilder.cs │ ├── InvokableValueDelegateAssertionBuilder.cs │ ├── MappableResultAssertionBuilder.cs │ ├── OrAssertionBuilder.cs │ ├── ValueAssertionBuilder.cs │ ├── ValueDelegateAssertionBuilder.cs │ └── Wrappers │ │ ├── BetweenAssertionBuilderWrapper.cs │ │ ├── DateOnlyEqualToAssertionBuilderWrapper.cs │ │ ├── DateTimeEqualToAssertionBuilderWrapper.cs │ │ ├── DateTimeOffsetEqualToAssertionBuilderWrapper.cs │ │ ├── EquivalentToAssertionBuilderWrapper.cs │ │ ├── GenericEqualToAssertionBuilderWrapper.cs │ │ ├── GenericNotEqualToAssertionBuilderWrapper.cs │ │ ├── NotBetweenAssertionBuilderWrapper.cs │ │ ├── NotEquivalentToAssertionBuilderWrapper.cs │ │ ├── NotNullAssertionBuilderWrapper.cs │ │ ├── SingleItemAssertionBuilderWrapper.cs │ │ ├── StringContainsAssertionBuilderWrapper.cs │ │ ├── StringEqualToAssertionBuilderWrapper.cs │ │ ├── TimeOnlyEqualToAssertionBuilderWrapper.cs │ │ └── TimeSpanEqualToAssertionBuilderWrapper.cs ├── AssertionData.cs ├── AssertionDecision.cs ├── AssertionMetadata.cs ├── AssertionScope.cs ├── Assertions │ ├── Chronology │ │ ├── Conditions │ │ │ ├── DateOnlyEqualsExpectedValueAssertCondition.cs │ │ │ ├── DateTimeEqualsExpectedValueAssertCondition.cs │ │ │ ├── DateTimeOffsetEqualsExpectedValueAssertCondition.cs │ │ │ ├── TimeOnlyEqualsExpectedValueAssertCondition.cs │ │ │ └── TimeSpanEqualsExpectedValueAssertCondition.cs │ │ ├── DateOnlyIsExtensions.cs │ │ ├── DateTimeIsExtensions.cs │ │ ├── DateTimeOffsetIsExtensions.cs │ │ ├── TimeOnlyIsExtensions.cs │ │ ├── TimeSpanIsExtensions.cs │ │ └── TimeSpanIsNotExtensions.cs │ ├── ClassMembers │ │ └── Conditions │ │ │ ├── Member.cs │ │ │ └── PropertyEqualsExpectedValueAssertCondition.cs │ ├── Collections │ │ ├── CollectionsIsExtensions.cs │ │ ├── CollectionsIsNotExtensions.cs │ │ ├── Conditions │ │ │ ├── EnumerableAllExpectedFuncAssertCondition.cs │ │ │ ├── EnumerableContainsExpectedFuncAssertCondition.cs │ │ │ ├── EnumerableContainsExpectedValueAssertCondition.cs │ │ │ ├── EnumerableCountEqualToExpectedValueAssertCondition.cs │ │ │ ├── EnumerableCountNotEqualToExpectedValueAssertCondition.cs │ │ │ ├── EnumerableDistinctItemsExpectedValueAssertCondition.cs │ │ │ ├── EnumerableEquivalentToExpectedValueAssertCondition.cs │ │ │ ├── EnumerableNotContainsExpectedFuncAssertCondition.cs │ │ │ ├── EnumerableNotContainsExpectedValueAssertCondition.cs │ │ │ ├── EnumerableNotEquivalentToExpectedValueAssertCondition.cs │ │ │ ├── EnumerableOrderedByAssertCondition.cs │ │ │ └── PropertyOrMethodAccessor.cs │ │ ├── DoesExtensions_Dictionary.cs │ │ ├── DoesNotExtensions_Dictionary.cs │ │ ├── HasExtensions_Enumerable.cs │ │ ├── HasExtensions_Exception.cs │ │ ├── HasExtensions_Generic.cs │ │ ├── HasExtensions_ImmutableArray.cs │ │ ├── HasExtensions_String.cs │ │ ├── ImmutableArrayIsExtensions.cs │ │ └── ImmutableArrayIsNotExtensions.cs │ ├── Comparables │ │ ├── ComparableIsExtensions.cs │ │ ├── ComparableIsNotExtensions.cs │ │ └── Conditions │ │ │ ├── BetweenAssertCondition.cs │ │ │ └── NotBetweenAssertCondition.cs │ ├── Delegates │ │ ├── Conditions │ │ │ └── CompleteWithinAssertCondition.cs │ │ └── DelegateExtensions.cs │ ├── Enums │ │ ├── Conditions │ │ │ ├── EnumDoesNotHaveFlagAssertCondition.cs │ │ │ ├── EnumDoesNotHaveSameNameAsCondition.cs │ │ │ ├── EnumDoesNotHaveSameValueAsCondition.cs │ │ │ ├── EnumHasFlagAssertCondition.cs │ │ │ ├── EnumHasSameNameAsCondition.cs │ │ │ ├── EnumHasSameValueAsCondition.cs │ │ │ ├── EnumIsDefinedAssertCondition.cs │ │ │ └── EnumIsNotDefinedAssertCondition.cs │ │ └── EnumHasExtensions.cs │ ├── Generics │ │ ├── Conditions │ │ │ ├── AssignableFromExpectedValueAssertCondition.cs │ │ │ ├── AssignableToExpectedValueAssertCondition.cs │ │ │ ├── ConvertExceptionToValueAssertCondition.cs │ │ │ ├── DefaultAssertionCondition.cs │ │ │ ├── DelegateConversionAssertionCondition.cs │ │ │ ├── EqualsExpectedValueAssertCondition.cs │ │ │ ├── EquivalentToExpectedValueAssertCondition.cs │ │ │ ├── NotAssignableFromExpectedValueAssertCondition.cs │ │ │ ├── NotAssignableToExpectedValueAssertCondition.cs │ │ │ ├── NotDefaultAssertionCondition.cs │ │ │ ├── NotEqualsExpectedValueAssertCondition.cs │ │ │ ├── NotEquivalentToExpectedValueAssertCondition.cs │ │ │ ├── NotSameReferenceExpectedValueAssertCondition.cs │ │ │ ├── NotTypeOfExpectedValueAssertCondition.cs │ │ │ ├── SameReferenceExpectedValueAssertCondition.cs │ │ │ ├── TypeOfExpectedValueAssertCondition.cs │ │ │ └── ValueConversionAssertionCondition.cs │ │ ├── DoesExtensions_Generic.cs │ │ ├── DoesNotExtensions_Generic.cs │ │ ├── GenericIsExtensions.cs │ │ ├── GenericIsNotExtensions.cs │ │ └── GenericSatisfiesExtensions.cs │ ├── Numbers │ │ ├── NumberIsExtensions.cs │ │ └── NumberIsNotExtensions.cs │ ├── Primitives │ │ ├── BooleanIsExtensions.cs │ │ ├── BooleanIsNotExtensions.cs │ │ ├── CharIsExtensions.cs │ │ └── CharIsNotExtensions.cs │ ├── Strings │ │ ├── Conditions │ │ │ ├── StringContainsExpectedValueAssertCondition.cs │ │ │ ├── StringEqualsExpectedValueAssertCondition.cs │ │ │ ├── StringNotContainsExpectedValueAssertCondition.cs │ │ │ └── StringNotEqualsExpectedValueAssertCondition.cs │ │ ├── DoesExtensions_String.cs │ │ ├── DoesNotExtensions_String.cs │ │ ├── StringIsExtensions.cs │ │ └── StringIsNotExtensions.cs │ └── Throws │ │ ├── ThrowsAnyExceptionAssertCondition.cs │ │ ├── ThrowsExactlyAssertCondition.cs │ │ ├── ThrowsException.cs │ │ ├── ThrowsExtensions.cs │ │ ├── ThrowsNothingAssertCondition.cs │ │ ├── ThrowsOfTypeAssertCondition.cs │ │ ├── ThrowsWithMessageAssertCondition.cs │ │ ├── ThrowsWithMessageContainingAssertCondition.cs │ │ ├── ThrowsWithMessageMatchingAssertCondition.cs │ │ ├── ThrowsWithParamNameAssertCondition.cs │ │ └── ThrowsWithinAssertCondition.cs ├── CollectionWrapper.cs ├── Compare.cs ├── CompareOptions.cs ├── ComparisonFailure.cs ├── Enums │ ├── CollectionOrdering.cs │ ├── EquivalencyKind.cs │ └── Order.cs ├── Equality │ ├── CollectionEquivalentToEqualityComparer.cs │ └── EquivalentToEqualityComparer.cs ├── Exceptions │ ├── AssertionException.cs │ ├── BaseAssertionException.cs │ ├── CompleteWithinException.cs │ ├── MaybeCaughtException.cs │ └── MixedAndOrAssertionsException.cs ├── ExceptionsHelper.cs ├── Extensions │ ├── DelegateExtensions.cs │ ├── EnumerableCount.cs │ ├── NumberExtensions.cs │ ├── ReflectionExtensions.cs │ ├── SourceExtensions.cs │ ├── StringExtensions.cs │ ├── StringLength.cs │ ├── TimeSpanExtensions.cs │ └── TypeExtensions.cs ├── Fail.cs ├── Helpers │ ├── ExpressionHelpers.cs │ ├── Formatter.cs │ ├── StringDifference.cs │ └── TimeSpanFormatter.cs ├── MemberType.cs ├── StringUtils.cs ├── TUnit.Assertions.csproj ├── TUnit.Assertions.csproj.DotSettings ├── TUnit.Assertions.props ├── TUnit.Assertions.targets └── Wrappers │ └── UnTypedEnumerableWrapper.cs ├── TUnit.Core.SourceGenerator.Roslyn414 └── TUnit.Core.SourceGenerator.Roslyn414.csproj ├── TUnit.Core.SourceGenerator.Roslyn44 └── TUnit.Core.SourceGenerator.Roslyn44.csproj ├── TUnit.Core.SourceGenerator.Roslyn47 └── TUnit.Core.SourceGenerator.Roslyn47.csproj ├── TUnit.Core.SourceGenerator.Tests ├── AbstractTests.AbstractClass.verified.txt ├── AbstractTests.Concrete1.verified.txt ├── AbstractTests.Concrete2.verified.txt ├── AbstractTests.cs ├── AfterAllTests.Test.verified.txt ├── AfterAllTests.cs ├── AfterEachTests.cs ├── AfterTests.Test.verified.txt ├── ArgsAsArrayTests.Test.verified.txt ├── ArgsAsArrayTests.cs ├── ArgumentWithImplicitConverterTests.Test.verified.txt ├── ArgumentWithImplicitConverterTests.cs ├── AssemblyAfterTests.Test.verified.txt ├── AssemblyAfterTests.cs ├── AssemblyBeforeTests.Test.verified.txt ├── AssemblyBeforeTests.cs ├── AssemblyLoaderTests.Test.DotNet8_0.verified.txt ├── AssemblyLoaderTests.Test.DotNet9_0.verified.txt ├── AssemblyLoaderTests.Test.Net4_7.verified.txt ├── AssemblyLoaderTests.cs ├── AttributeTests.Test.verified.txt ├── AttributeTests.cs ├── Basic.Test.verified.txt ├── BasicTests.Test.verified.txt ├── BasicTests.cs ├── BeforeAllTests.Test.verified.txt ├── BeforeAllTests.cs ├── BeforeEachTests.cs ├── BeforeTests.Test.verified.txt ├── Bugs │ ├── 1432 │ │ ├── ConstantInBaseClassTests.cs │ │ ├── ConstantsInInterpolatedStringsTests.cs │ │ └── EnumMemberNamesTests.cs │ ├── 1538 │ │ └── Tests1538.cs │ ├── 1539 │ │ └── Tests1539.cs │ ├── 1589 │ │ ├── Hooks1589.cs │ │ └── Tests1589.cs │ ├── 1594 │ │ ├── Hooks1594.cs │ │ └── Tests1594.cs │ ├── 1603 │ │ └── Tests1603.cs │ ├── 1692 │ │ └── Tests1692.cs │ ├── 1821 │ │ └── Tests1821.cs │ ├── 1889 │ │ └── Tests1889.cs │ ├── 1899 │ │ └── Tests1899.cs │ ├── 2075 │ │ └── Tests2075.cs │ ├── 2083 │ │ └── Tests2083.cs │ ├── 2085 │ │ └── Tests2085.cs │ ├── 2112 │ │ └── Tests2112.cs │ └── 2136 │ │ └── Tests2136.cs ├── ClassAndMethodArgumentsTests.Test.verified.txt ├── ClassAndMethodArgumentsTests.cs ├── ClassConstructorTest.Test.verified.txt ├── ClassConstructorTest.cs ├── ClassDataSourceDrivenTests.Test.verified.txt ├── ClassDataSourceDrivenTests.cs ├── ClassDataSourceDrivenTests2.Test.verified.txt ├── ClassDataSourceDrivenTests2.cs ├── ClassDataSourceDrivenTestsSharedKeyed.Test.verified.txt ├── ClassDataSourceDrivenTestsSharedKeyed.cs ├── ClassTupleDataSourceDrivenTests.Test.verified.txt ├── ClassTupleDataSourceDrivenTests.Test_index=0_classMethodName=NamedTupleMethod_testMethodName=NamedTupleMethod.verified.txt ├── ClassTupleDataSourceDrivenTests.Test_index=0_classMethodName=NamedTupleMethod_testMethodName=TupleMethod.verified.txt ├── ClassTupleDataSourceDrivenTests.Test_index=0_classMethodName=TupleMethod_testMethodName=NamedTupleMethod.verified.txt ├── ClassTupleDataSourceDrivenTests.Test_index=0_classMethodName=TupleMethod_testMethodName=TupleMethod.verified.txt ├── ClassTupleDataSourceDrivenTests.cs ├── ConcreteClassTests.Test.verified.txt ├── ConcreteClassTests.cs ├── ConstantArgumentsTests.Test.verified.txt ├── ConstantArgumentsTests.cs ├── ConstantInBaseClassTests.Test.verified.txt ├── ConstantsInInterpolatedStringsTests.Test.verified.txt ├── CustomDisplayNameTests.Test.verified.txt ├── CustomDisplayNameTests.cs ├── DataDrivenTests.Test.verified.txt ├── DataDrivenTests.cs ├── DataSourceClassCombinedWithDataSourceMethodTests.Test.verified.txt ├── DataSourceClassCombinedWithDataSourceMethodTests.cs ├── DataSourceGeneratorTests.NonTyped.verified.txt ├── DataSourceGeneratorTests.Test.verified.txt ├── DataSourceGeneratorTests.Typed.verified.txt ├── DataSourceGeneratorTests.cs ├── DisableReflectionScannerTests.Test.DotNet8_0.verified.txt ├── DisableReflectionScannerTests.Test.DotNet9_0.verified.txt ├── DisableReflectionScannerTests.Test.Net4_7.verified.txt ├── DisableReflectionScannerTests.cs ├── Dynamic │ ├── Basic.Test.verified.txt │ └── Basic.cs ├── EnumMemberNamesTests.Test.verified.txt ├── EnumerableDataSourceDrivenTests.Test.verified.txt ├── EnumerableDataSourceDrivenTests.cs ├── EnumerableTupleDataSourceDrivenTests.Test.verified.txt ├── EnumerableTupleDataSourceDrivenTests.cs ├── Extensions │ └── StringExtensions.cs ├── GenericMethodTests.Test.verified.txt ├── GenericMethodTests.cs ├── Git.cs ├── GlobalStaticAfterEachTests.Test.verified.txt ├── GlobalStaticAfterEachTests.cs ├── GlobalStaticBeforeEachTests.Test.verified.txt ├── GlobalStaticBeforeEachTests.cs ├── GlobalUsings.cs ├── Hooks1589.Test.verified.txt ├── Hooks1594.Test.verified.txt ├── InheritedPropertySetterTests.Test.verified.txt ├── InheritedPropertySetterTests.cs ├── InheritedTestsFromDifferentProjectTests.Test.verified.txt ├── InheritedTestsFromDifferentProjectTests.cs ├── MatrixTests.Test.verified.txt ├── MatrixTests.cs ├── MethodDataSourceDrivenTests.Test.verified.txt ├── MethodDataSourceDrivenTests.cs ├── MethodDataSourceDrivenWithCancellationTokenTests.Test.verified.txt ├── MethodDataSourceDrivenWithCancellationTokenTests.cs ├── MultipleClassDataSourceDrivenTests.Test.verified.txt ├── MultipleClassDataSourceDrivenTests.cs ├── NameOfArgumentTests.Test.verified.txt ├── NameOfArgumentTests.cs ├── NuGetDownloader.cs ├── NullableByteArgumentTests.Test.verified.txt ├── NullableByteArgumentTests.cs ├── NumberArgumentTests.Test.verified.txt ├── NumberArgumentTests.TestDE.verified.txt ├── NumberArgumentTests.cs ├── Options │ └── RunTestOptions.cs ├── OptionsProvider.cs ├── PolyfillTests.Test.verified.txt ├── PolyfillTests.Test_With_False_BuildProperty.verified.txt ├── PolyfillTests.Test_Without_BuildProperty.verified.txt ├── PolyfillTests.Test_Without_BuildProperty_WithoutType.verified.txt ├── PolyfillTests.cs ├── PriorityFilteringTests.Test.verified.txt ├── PriorityFilteringTests.cs ├── PropertySetterTests.Test.verified.txt ├── PropertySetterTests.cs ├── ReferencesHelper.cs ├── RepeatTests.Test.verified.txt ├── RepeatTests.cs ├── STAThreadHooksTests.Test.verified.txt ├── STAThreadHooksTests.cs ├── StringArgumentTests.Test.verified.txt ├── StringArgumentTests.cs ├── TUnit.Core.SourceGenerator.Tests.csproj ├── TestDiscoveryHookTests.Test.verified.txt ├── TestDiscoveryHookTests.cs ├── Tests.Test.verified.txt ├── Tests1538.Test.verified.txt ├── Tests1539.Test.verified.txt ├── Tests1589.Test.verified.txt ├── Tests1594.Test.verified.txt ├── Tests1603.Test.verified.txt ├── Tests1692.Test.verified.txt ├── Tests1821.Test.verified.txt ├── Tests1889.Test.DotNet8_0.verified.txt ├── Tests1889.Test.DotNet9_0.verified.txt ├── Tests1889.Test.Net4_7.verified.txt ├── Tests1899.BaseClass.verified.txt ├── Tests1899.Test.verified.txt ├── Tests2075.Test.DotNet8_0.verified.txt ├── Tests2075.Test.DotNet9_0.verified.txt ├── Tests2075.Test.Net4_7.verified.txt ├── Tests2075.Test.verified.txt ├── Tests2083.Test.verified.txt ├── Tests2085.Test.verified.txt ├── Tests2112.Test.verified.txt ├── Tests2136.Test.verified.txt ├── TestsBase.cs ├── TimeoutCancellationTokenTests.Test.verified.txt ├── TimeoutCancellationTokenTests.cs ├── TupleDataSourceDrivenTests.Test.verified.txt ├── TupleDataSourceDrivenTests.cs └── VerifyChecksTests.cs ├── TUnit.Core.SourceGenerator ├── CodeGenerators │ ├── AssemblyLoaderGenerator.cs │ ├── DisableReflectionScannerGenerator.cs │ ├── DynamicTestsGenerator.cs │ ├── Equality │ │ └── PreventCompilationTriggerOnEveryKeystrokeComparer.cs │ ├── Helpers │ │ ├── ArgumentsRetriever.cs │ │ ├── ClassConstructorRetriever.cs │ │ ├── CollectionToArgumentsListRewriter.cs │ │ ├── DataDrivenArgumentsRetriever.cs │ │ ├── DataSourceGeneratorRetriever.cs │ │ ├── DynamicTestSourceDataModelRetriever.cs │ │ ├── FullyQualifiedWithGlobalPrefixRewriter.cs │ │ ├── GenericTypeHelper.cs │ │ ├── HookExecutorHelper.cs │ │ ├── MethodDataSourceRetriever.cs │ │ ├── TestInformationRetriever.cs │ │ ├── TestSourceDataModelRetriever.cs │ │ └── TypedConstantParser.cs │ ├── LanguageVersionCheckGenerator.cs │ ├── PolyfillGenerator.cs │ ├── TestHooksGenerator.cs │ ├── TestsGenerator.cs │ ├── VariableNames.cs │ └── Writers │ │ ├── AttributeWriter.cs │ │ ├── FailedTestInitializationWriter.cs │ │ ├── GenericTestInvocationWriter.cs │ │ ├── Hooks │ │ ├── AssemblyHooksWriter.cs │ │ ├── BaseHookWriter.cs │ │ ├── ClassHooksWriter.cs │ │ ├── GlobalTestHooksWriter.cs │ │ └── TestHooksWriter.cs │ │ ├── NewClassWriter.cs │ │ └── SourceInformationWriter.cs ├── DisplayFormats.cs ├── Enums │ ├── ArgumentsType.cs │ └── HookLocationType.cs ├── Extensions │ ├── AttributeDataExtensions.cs │ ├── CompilationExtensions.cs │ ├── EnumerableExtensions.cs │ ├── ImmutableArrayExtensions.cs │ ├── MethodExtensions.cs │ ├── ParameterExtensions.cs │ ├── StringExtensions.cs │ ├── SymbolExtensions.cs │ ├── SyntaxExtensions.cs │ └── TypeExtensions.cs ├── Models │ ├── Arguments │ │ ├── Argument.cs │ │ ├── ArgumentsAttributeContainer.cs │ │ ├── ArgumentsContainer.cs │ │ ├── BaseContainer.cs │ │ ├── ClassConstructorAttributeContainer.cs │ │ ├── ClassPropertiesContainer.cs │ │ ├── DataSourceAttributeContainer.cs │ │ ├── DataSourceGeneratorContainer.cs │ │ ├── EmptyArgumentsContainer.cs │ │ ├── MethodDataSourceAttributeContainer.cs │ │ └── Variable.cs │ ├── DynamicTestSourceDataModel.cs │ ├── FullyQualifiedTypeName.cs │ ├── HooksDataModel.cs │ ├── InheritsTestsDataModel.cs │ ├── StaticClassDataSourceInjectorModel.cs │ ├── TestCollectionDataModel.cs │ ├── TestGenerationContext.cs │ ├── TestHookCollectionDataModel.cs │ └── TestSourceDataModel.cs ├── Properties │ └── launchSettings.json ├── Readme.md ├── SourceCodeWriter.cs ├── TUnit.Core.SourceGenerator.csproj └── WellKnownFullyQualifiedClassNames.cs ├── TUnit.Core ├── AfterTestContext.cs ├── AsyncConvert.cs ├── AsyncEvent.cs ├── Attributes │ ├── BaseTestAttribute.cs │ ├── ClassConstructorAttribute.cs │ ├── DynamicTestBuilderAttribute.cs │ ├── Executors │ │ ├── CultureAttribute.cs │ │ ├── HookExecutorAttribute.cs │ │ ├── InvariantCultureAttribute.cs │ │ ├── STAThreadExecutorAttribute.cs │ │ └── TestExecutorAttribute.cs │ ├── ParallelGroupAttribute.cs │ ├── ParallelLimiterAttribute.cs │ ├── RunOnDiscoveryAttribute.cs │ ├── SingleTUnitAttribute.cs │ ├── TUnitAttribute.cs │ ├── TestData │ │ ├── ArgumentDisplayFormatter.cs │ │ ├── ArgumentDisplayFormatterAttribute.cs │ │ ├── ArgumentsAttribute.cs │ │ ├── ClassDataSourceAttribute.cs │ │ ├── ClassDataSourceAttribute_2.cs │ │ ├── ClassDataSourceAttribute_3.cs │ │ ├── ClassDataSourceAttribute_4.cs │ │ ├── ClassDataSourceAttribute_5.cs │ │ ├── ClassDataSources.cs │ │ ├── DataSourceGeneratorAttribute.cs │ │ ├── DependencyInjectionDataSourceAttribute.cs │ │ ├── IAccessesInstanceData.cs │ │ ├── IDataAttribute.cs │ │ ├── IDataSourceGeneratorAttribute.cs │ │ ├── INonTypedDataSourceGeneratorAttribute.cs │ │ ├── InstanceMethodDataSourceAttribute.cs │ │ ├── MatrixAttribute.cs │ │ ├── MatrixDataSourceAttribute.cs │ │ ├── MatrixExclusionAttribute.cs │ │ ├── MatrixInstanceMethodAttribute.cs │ │ ├── MatrixMethodAttribute.cs │ │ ├── MatrixRangeAttribute.cs │ │ ├── MethodDataSourceAttribute.cs │ │ ├── NonTypedDataSourceGeneratorAttribute.cs │ │ ├── SharedType.cs │ │ └── TestDataAttribute.cs │ ├── TestHooks │ │ ├── AfterAttribute.cs │ │ ├── AfterEveryAttribute.cs │ │ ├── BeforeAttribute.cs │ │ ├── BeforeEveryAttribute.cs │ │ └── HookAttribute.cs │ ├── TestMetadata │ │ ├── CategoryAttribute.cs │ │ ├── DependsOnAttribute.cs │ │ ├── DisplayNameAttribute.cs │ │ ├── DisplayNameFormatterAttribute.cs │ │ ├── ExplicitAttribute.cs │ │ ├── NotInParallelAttribute.cs │ │ ├── PropertyAttribute.cs │ │ ├── RepeatAttribute.cs │ │ ├── RetryAttribute.cs │ │ ├── SkipAttribute.cs │ │ └── TimeoutAttribute.cs │ └── Tests │ │ ├── InheritsTestsAttribute.cs │ │ └── TestAttribute.cs ├── BeforeTestContext.cs ├── Context.cs ├── Data │ └── GetOnlyDictionary.cs ├── DiscoveredTest.cs ├── DiscoveredTestContext.cs ├── DynamicTestBuilderContext.cs ├── EngineCancellationToken.cs ├── Enums │ ├── DataGeneratorType.cs │ ├── LogLevel.cs │ └── Status.cs ├── Exceptions │ ├── AfterAssemblyException.cs │ ├── AfterClassException.cs │ ├── AfterTestDiscoveryException.cs │ ├── AfterTestException.cs │ ├── AfterTestSessionException.cs │ ├── BeforeAssemblyException.cs │ ├── BeforeClassException.cs │ ├── BeforeTestDiscoveryException.cs │ ├── BeforeTestException.cs │ ├── BeforeTestSessionException.cs │ ├── DependencyConflictException.cs │ ├── FailTestException.cs │ ├── InconclusiveTestException.cs │ ├── SkipTestException.cs │ ├── TUnitException.cs │ ├── TestFailedInitializationException.cs │ ├── TestNotExecutedException.cs │ ├── TestRunCanceledException.cs │ └── TimeoutException.cs ├── Executors │ ├── CultureExecutor.cs │ ├── DedicatedThreadExecutor.cs │ ├── DefaultExecutor.cs │ ├── GenericAbstractExecutor.cs │ └── STAThreadExecutor.cs ├── Extensions │ ├── ClassConstructorExtensions.cs │ ├── ReflectionExtensions.cs │ └── TestContextExtensions.cs ├── FailedDynamicTest.cs ├── FailedTestMetadata.cs ├── GlobalSharedDataKey.cs ├── Helpers │ ├── ArgumentFormatter.cs │ ├── CastHelper.cs │ ├── Counter.cs │ ├── DefaultParallelLimit.cs │ ├── Disposer.cs │ ├── InstanceHelper.cs │ ├── MethodInfoRetriever.cs │ └── ReflectionToSourceModelHelpers.cs ├── HookType.cs ├── Hooks │ ├── AfterAssemblyHookMethod.cs │ ├── AfterClassHookMethod.cs │ ├── AfterTestDiscoveryHookMethod.cs │ ├── AfterTestHookMethod.cs │ ├── AfterTestSessionHookMethod.cs │ ├── BeforeAssemblyHookMethod.cs │ ├── BeforeClassHookMethod.cs │ ├── BeforeTestDiscoveryHookMethod.cs │ ├── BeforeTestHookMethod.cs │ ├── BeforeTestSessionHookMethod.cs │ ├── HookExecutorProvider.cs │ ├── HookMethod.cs │ ├── IExecutableHook.cs │ ├── IHookMessagePublisher.cs │ ├── InstanceHookMethod.cs │ ├── LastTestInAssemblyClassAdapter.cs │ ├── LastTestInClassAdapter.cs │ └── StaticHookMethod.cs ├── IDynamicTestRegistrar.cs ├── ITUnitMessageBus.cs ├── Interfaces │ ├── IAsyncInitializer.cs │ ├── IClassConstructor.cs │ ├── IConfiguration.cs │ ├── IContext.cs │ ├── IEventReceiver.cs │ ├── IFirstTestInAssemblyEventReceiver.cs │ ├── IFirstTestInClassEventReceiver.cs │ ├── IFirstTestInTestSessionEventReceiver.cs │ ├── IHasLoggers.cs │ ├── IHookExecutor.cs │ ├── ILastTestInAssemblyEventReceiver.cs │ ├── ILastTestInClassEventReceiver.cs │ ├── ILastTestInTestSessionEventReceiver.cs │ ├── IParallelConstraint.cs │ ├── IParallelLimit.cs │ ├── ITestDiscoveryEventReceiver.cs │ ├── ITestEndEventReceiver.cs │ ├── ITestExecutor.cs │ ├── ITestFinder.cs │ ├── ITestRegisteredEventReceiver.cs │ ├── ITestRetryEventReceiver.cs │ ├── ITestSkippedEventReceiver.cs │ ├── ITestStartEventReceiver.cs │ └── SourceGenerator │ │ ├── IAssemblyHookSource.cs │ │ ├── IClassHookSource.cs │ │ ├── IDynamicTestSource.cs │ │ ├── ITestDiscoveryHookSource.cs │ │ ├── ITestHookSource.cs │ │ ├── ITestSessionHookSource.cs │ │ └── ITestSource.cs ├── Logging │ ├── DefaultLogger.cs │ ├── ILogger.cs │ ├── LogLevel.cs │ ├── LoggingExtensions.cs │ ├── NullLogger.cs │ └── TUnitLogger.cs ├── Models │ ├── Artifact.cs │ ├── AssemblyHookContext.cs │ ├── BeforeTestDiscoveryContext.cs │ ├── ClassConstructorMetadata.cs │ ├── ClassHookContext.cs │ ├── DataGeneratorMetadata.cs │ ├── Dependency.cs │ ├── DynamicTest.cs │ ├── GlobalContext.cs │ ├── LazyHook.cs │ ├── SourceGenerations │ │ ├── SourceGeneratedAssemblyInformation.cs │ │ ├── SourceGeneratedClassInformation.cs │ │ ├── SourceGeneratedMemberInformation.cs │ │ ├── SourceGeneratedMethodInformation.cs │ │ ├── SourceGeneratedParameterInformation.cs │ │ └── SourceGeneratedPropertyInformation.cs │ ├── TestDiscoveryContext.cs │ ├── TestSessionContext.cs │ └── UntypedDynamicTest.cs ├── NotInParallelConstraint.cs ├── ParallelGroupConstraint.cs ├── ParallelLimitLockProvider.cs ├── ResettableLazy.cs ├── RunHelpers.cs ├── SharedDataKey.cs ├── Skip.cs ├── SourceRegistrar.cs ├── Sources.cs ├── TUnit.Core.csproj ├── TUnit.Core.csproj.DotSettings ├── TUnit.Core.props ├── TUnit.Core.targets ├── TestBuilderContext.cs ├── TestContext.cs ├── TestContextEvents.cs ├── TestContext_Static.cs ├── TestDataContainer.cs ├── TestDetails.cs ├── TestMetadata.cs ├── TestRegisteredContext.cs ├── TestResult.cs ├── Timing.cs ├── UntypedDiscoveredTest.cs ├── UntypedFailedDynamicTest.cs ├── UntypedTestDetails.cs └── UntypedTestMetadata.cs ├── TUnit.Engine.Tests ├── AbstractClassTests.cs ├── AfterTestAttributeTests.cs ├── ArgumentWithImplicitConverterTests.cs ├── AsyncLocalTest.cs ├── Attributes │ ├── SetDisplayNameWithClassAttribute.cs │ └── SkipNetFrameworkAttribute.cs ├── BasicTestsHooksFromLibrary.cs ├── Bugs │ ├── Bug1187.cs │ ├── Bug1410.cs │ ├── Bug1570.cs │ ├── Bug1577.cs │ ├── Bug1603.cs │ ├── Bug1821.cs │ ├── Bug1836.cs │ ├── Bug1899.cs │ ├── Bug1924.cs │ ├── Bug1939.cs │ ├── Bug2067.cs │ ├── Bug2136.cs │ ├── Bug2449.cs │ └── Bug2481.cs ├── CategoryTests.cs ├── ClassConstructorWithEnumerableTests.cs ├── ClassDataSourceDrivenTests.cs ├── ClassHooksExecutionCountTests.cs ├── ComplexDependsOnTests.cs ├── ComplexDependsOnTests2.cs ├── ConcreteBasedOnAbstractClassTests.cs ├── ConfigurationTests.cs ├── ConflictingDependsOnTests.cs ├── ConflictingDependsOnTests2.cs ├── ConflictingDependsOnTests3.cs ├── ConsoleTests.cs ├── CultureTests.cs ├── CustomAssertionTests.cs ├── CustomDisplayNameTests.cs ├── CustomFilteringTests1.cs ├── CustomFilteringTests12.cs ├── CustomFilteringTests2.cs ├── CustomFilteringTests3.cs ├── CustomFilteringTests4.cs ├── CustomFilteringTests5.cs ├── CustomFilteringTests6.cs ├── CustomFilteringTests7.cs ├── CustomFilteringTests8.cs ├── CustomPropertyTests.cs ├── CustomRetryTests.cs ├── DataSourceClassCombinedWithDataSourceMethodTests.cs ├── DebugAssertFailureTests.cs ├── DeepNestedDependencyConflictTests.cs ├── DependencyCountTests.cs ├── DependsOnAndNotInParallelTests.cs ├── DependsOnAndNotInParallelTests2.cs ├── DependsOnTests.cs ├── DependsOnTests2.cs ├── DependsOnTests3.cs ├── DependsOnTestsWithProceedOnFailure.cs ├── DependsOnTestsWithoutProceedOnFailure.cs ├── DependsOnWithBaseTests.cs ├── DisposedReproTests.cs ├── DynamicAddedPropertiesFilteringTests.cs ├── DynamicTests.cs ├── Enums │ └── TestMode.cs ├── EnvironmentVariables.cs ├── ExperimentalTests.cs ├── Extensions │ └── FileInfoExtensions.cs ├── FSharp.cs ├── FailTests.cs ├── FailedInitializationTests.cs ├── FailedInitializationTests2.cs ├── FileSystemHelpers.cs ├── FilterByDynamicAddedPropertyTestsModule.cs ├── GlobalHooks.cs ├── GlobalSettings.cs ├── InheritedPropertySetterTests.cs ├── InheritedTestsFromDifferentProjectTests.cs ├── InvokableTestBase.cs ├── JsonOutputTests.cs ├── MEDITest.cs ├── MatrixTests.cs ├── MatrixTests1.cs ├── MatrixTests2.cs ├── MethodDataSourceDrivenWithCancellationTokenTests.cs ├── MixedMatrixTests.cs ├── NestedBaseTests.cs ├── OrderedByAttributeOrderParameterSetupTests.cs ├── OrderedSetupTests.cs ├── OrderedTests.cs ├── OverrideResultsTests.cs ├── ParallelLimiterTests.cs ├── ParametersTests.cs ├── PassTests.cs ├── PriorityFilteringTests1.cs ├── PriorityFilteringTests2.cs ├── PriorityFilteringTests3.cs ├── PriorityFilteringTests4.cs ├── PriorityFilteringTests5.cs ├── PriorityFilteringTests6.cs ├── PriorityFilteringTests7.cs ├── PriorityFilteringTests8.cs ├── PropertySetterTests.cs ├── RetryTests.cs ├── SkipTests.cs ├── TUnit.Engine.Tests.csproj ├── TestDiscoveryAfterHookTests.cs ├── TestDiscoveryBeforeHookTests.cs ├── TestSessionAfterHookTests.cs ├── TestSessionBeforeHookTests.cs ├── TimeoutTests1.cs ├── TimeoutTests2.cs ├── TimeoutTests3.cs ├── TimeoutTests4.cs ├── TimeoutTests5.cs ├── TrxAsserter.cs ├── UniqueBuilderContextsOnEnumerableDataGeneratorTests.cs ├── UniqueObjectsOnEnumerableDataGeneratorTests.cs └── VB.cs ├── TUnit.Engine ├── Capabilities │ ├── BannerCapability.cs │ ├── StopExecutionCapability.cs │ └── TrxReportCapability.cs ├── CommandLineProviders │ ├── DetailedStacktraceCommandProvider.cs │ ├── DisableLogoCommandProvider.cs │ ├── FailFastCommandProvider.cs │ ├── HideTestOutputCommandProvider.cs │ ├── JsonOutputCommandProvider.cs │ ├── MaximumParallelTestsCommandProvider.cs │ ├── ParametersCommandProvider.cs │ └── ReflectionScannerCommandProvider.cs ├── Constants │ └── TestAdapterConstants.cs ├── Enums │ └── EngineMode.cs ├── Exceptions │ ├── HookFailedException.cs │ ├── TUnitFailedException.cs │ ├── TestFailedException.cs │ └── ThrowListener.cs ├── Extensions │ ├── EnumerableExtensions.cs │ ├── JsonExtensions.cs │ ├── TestApplicationBuilderExtensions.cs │ ├── TestContextExtensions.cs │ ├── TestExtensions.cs │ └── TypeExtensions.cs ├── Framework │ ├── ConfigurationAdapter.cs │ ├── IFilterReceiver.cs │ ├── TUnitExtension.cs │ ├── TUnitServiceProvider.cs │ ├── TUnitTestFramework.cs │ └── TestingPlatformBuilderHook.cs ├── Helpers │ ├── ExceptionsHelper.cs │ ├── ExecutionContextHelper.cs │ ├── FuncHelper.cs │ ├── MethodInfoHelper.cs │ ├── NoOpDisposable.cs │ ├── Timings.cs │ └── TupleHelper.cs ├── Hooks │ ├── AssemblyHookOrchestrator.cs │ ├── ClassHookOrchestrator.cs │ ├── TestDiscoveryHookOrchestrator.cs │ ├── TestHookOrchestrator.cs │ └── TestSessionHookOrchestrator.cs ├── InstanceTracker.cs ├── Json │ ├── ExceptionJson.cs │ ├── JsonContext.cs │ ├── TestAssemblyJson.cs │ ├── TestClassJson.cs │ ├── TestJson.cs │ ├── TestResultJson.cs │ └── TestSessionJson.cs ├── Logging │ ├── ConsoleInterceptor.cs │ ├── MTPLoggerAdapter.cs │ ├── StandardErrorConsoleInterceptor.cs │ ├── StandardOutConsoleInterceptor.cs │ └── TUnitFrameworkLogger.cs ├── Models │ ├── ConstraintKeysCollection.cs │ ├── DiscoveredTestExtensions.cs │ └── GroupedTests.cs ├── PolyfillExtensions.cs ├── PriorityQueue.cs ├── Reporters │ └── GitHubReporter.cs ├── Services │ ├── BaseTestsConstructor.cs │ ├── DependencyCollector.cs │ ├── DynamicTestRegistrar.cs │ ├── FilterParser.cs │ ├── HookMessagePublisher.cs │ ├── HooksCollectorBase.cs │ ├── LogLevelProvider.cs │ ├── OnEndExecutor.cs │ ├── ReflectionHooksCollector.cs │ ├── ReflectionScanner.cs │ ├── ReflectionTestsConstructor.cs │ ├── SingleTestExecutor.cs │ ├── SourceGeneratedHooksCollector.cs │ ├── SourceGeneratedTestsConstructor.cs │ ├── TUnitInitializer.cs │ ├── TUnitRunner.cs │ ├── TUnitTestDiscoverer.cs │ ├── TestFilterService.cs │ ├── TestGrouper.cs │ ├── TestInvoker.cs │ ├── TestsCollector.cs │ ├── TestsExecutor.cs │ └── TestsFinder.cs ├── TUnit.Engine.csproj ├── TUnit.Engine.props ├── TUnit.Engine.targets ├── TUnitMessageBus.cs ├── TestRegistrar.cs └── Verify.cs ├── TUnit.Example.Asp.Net.TestProject ├── GlobalSetup.cs ├── TUnit.Example.Asp.Net.TestProject.csproj ├── Tests.cs └── WebApplicationFactory.cs ├── TUnit.Example.Asp.Net ├── Program.cs ├── Properties │ └── launchSettings.json ├── TUnit.Example.Asp.Net.csproj ├── TUnit.Example.Asp.Net.http ├── appsettings.Development.json └── appsettings.json ├── TUnit.Pipeline ├── EnvironmentVariables.cs ├── Modules │ ├── Abstract │ │ └── TestBaseModule.cs │ ├── AddLocalNuGetRepositoryModule.cs │ ├── CommitFilesModule.cs │ ├── CopyToLocalNuGetModule.cs │ ├── CreateReleaseModule.cs │ ├── GenerateReadMeModule.cs │ ├── GenerateVersionModule.cs │ ├── GetPackageProjectsModule.cs │ ├── PackTUnitFilesModule.cs │ ├── ProcessorParallelLimit.cs │ ├── PublishAOTModule.cs │ ├── PublishSingleFileModule.cs │ ├── PushVersionTagModule.cs │ ├── RunAnalyzersTestsModule.cs │ ├── RunAspNetTestsModule.cs │ ├── RunAssertionsAnalyzersTestsModule.cs │ ├── RunAssertionsCodeFixersTestsModule.cs │ ├── RunAssertionsTestsModule.cs │ ├── RunEngineTestsModule.cs │ ├── RunPlaywrightTestsModule.cs │ ├── RunPublicAPITestsModule.cs │ ├── RunRpcTestsModule.cs │ ├── RunSourceGeneratorTestsModule.cs │ ├── RunTemplateTestsModule.cs │ ├── RunUnitTestsModule.cs │ ├── TestNugetPackageModule.cs │ ├── TestTemplatePackageModule.cs │ └── UploadToNuGetModule.cs ├── NuGetOptions.cs ├── PackedProject.cs ├── Program.cs └── TUnit.Pipeline.csproj ├── TUnit.Playwright ├── BrowserService.cs ├── BrowserTest.cs ├── ContextTest.cs ├── DefaultPlaywrightParallelLimiter.cs ├── IWorkerService.cs ├── PageTest.cs ├── PlaywrightSkipAttribute.cs ├── PlaywrightTest.cs ├── TUnit.Playwright.csproj └── WorkerAwareTest.cs ├── TUnit.PublicAPI ├── TUnit.PublicAPI.csproj ├── Tests.Assertions_Library_Has_No_API_Changes.DotNet2_0.verified.txt ├── Tests.Assertions_Library_Has_No_API_Changes.DotNet8_0.verified.txt ├── Tests.Assertions_Library_Has_No_API_Changes.DotNet9_0.verified.txt ├── Tests.Core_Library_Has_No_API_Changes.DotNet2_0.verified.txt ├── Tests.Core_Library_Has_No_API_Changes.DotNet8_0.verified.txt ├── Tests.Core_Library_Has_No_API_Changes.DotNet9_0.verified.txt ├── Tests.Engine_Library_Has_No_API_Changes.DotNet2_0.verified.txt ├── Tests.Engine_Library_Has_No_API_Changes.DotNet8_0.verified.txt ├── Tests.Engine_Library_Has_No_API_Changes.DotNet9_0.verified.txt ├── Tests.Playwright_Library_Has_No_API_Changes.DotNet2_0.Net4_7.verified.txt ├── Tests.Playwright_Library_Has_No_API_Changes.DotNet2_0.verified.txt ├── Tests.Playwright_Library_Has_No_API_Changes.DotNet8_0.verified.txt ├── Tests.Playwright_Library_Has_No_API_Changes.DotNet9_0.verified.txt └── Tests.cs ├── TUnit.RpcTests ├── Clients │ ├── IProcessHandle.cs │ ├── LogsCollector.cs │ ├── ProcessHandle.cs │ ├── TelemetryCollector.cs │ └── TestingPlatformClient.cs ├── Models │ ├── AttachDebuggerInfo.cs │ ├── ClientCapabilities.cs │ ├── ClientInfo.cs │ ├── ClientTestingCapabilities.cs │ ├── ConsoleRpcListener.cs │ ├── DiscoveryRequest.cs │ ├── InitializeRequest.cs │ ├── InitializeResponse.cs │ ├── LogLevel.cs │ ├── RunRequest.cs │ ├── ServerCapabilities.cs │ ├── ServerInfo.cs │ ├── ServerTestingCapabilities.cs │ ├── TelemetryPayload.cs │ ├── TestNode.cs │ ├── TestNodeStateChangedEventArgs.cs │ └── TestNodeUpdate.cs ├── RpcJsonSerializerOptions.cs ├── TUnit.RpcTests.csproj └── Tests.cs ├── TUnit.Templates.Tests ├── AspNetTemplateTests.cs ├── AspireStarterTemplateTests.cs ├── AspireTemplateTests.cs ├── BasicTemplateTests.cs ├── GlobalUsings.cs ├── PlaywriteTemplateTests.cs ├── Snapshots │ ├── InstantiationTest.TUnit.AspNet._.verified │ │ └── TUnit.AspNet │ │ │ ├── TUnit.AspNet │ │ │ ├── GlobalSetup.cs │ │ │ ├── TUnit.AspNet.csproj │ │ │ ├── Tests.cs │ │ │ └── WebApplicationFactory.cs │ │ │ └── WebApp │ │ │ ├── Program.cs │ │ │ ├── Properties │ │ │ └── launchSettings.json │ │ │ ├── WebApp.csproj │ │ │ ├── WebApp.http │ │ │ ├── appsettings.Development.json │ │ │ └── appsettings.json │ ├── InstantiationTest.TUnit.Aspire.Starter._.verified │ │ └── TUnit.Aspire.Starter │ │ │ ├── TUnit.Aspire.Starter.ApiService │ │ │ ├── Program.cs │ │ │ ├── Properties │ │ │ │ └── launchSettings.json │ │ │ ├── TUnit.Aspire.Starter.ApiService.csproj │ │ │ ├── appsettings.Development.json │ │ │ └── appsettings.json │ │ │ ├── TUnit.Aspire.Starter.AppHost │ │ │ ├── Program.cs │ │ │ ├── Properties │ │ │ │ └── launchSettings.json │ │ │ ├── TUnit.Aspire.Starter.AppHost.csproj │ │ │ ├── appsettings.Development.json │ │ │ └── appsettings.json │ │ │ ├── TUnit.Aspire.Starter.ServiceDefaults │ │ │ ├── Extensions.cs │ │ │ └── TUnit.Aspire.Starter.ServiceDefaults.csproj │ │ │ ├── TUnit.Aspire.Starter.TestProject │ │ │ ├── Data │ │ │ │ └── HttpClientDataClass.cs │ │ │ ├── GlobalSetup.cs │ │ │ ├── Models │ │ │ │ └── WeatherForecast.cs │ │ │ ├── TUnit.Aspire.Starter.TestProject.csproj │ │ │ └── Tests │ │ │ │ └── ApiTests.cs │ │ │ └── TUnit.Aspire.Starter.WebApp │ │ │ ├── Components │ │ │ ├── App.razor │ │ │ ├── Layout │ │ │ │ ├── MainLayout.razor │ │ │ │ ├── MainLayout.razor.css │ │ │ │ ├── NavMenu.razor │ │ │ │ └── NavMenu.razor.css │ │ │ ├── Pages │ │ │ │ ├── Counter.razor │ │ │ │ ├── Error.razor │ │ │ │ ├── Home.razor │ │ │ │ └── Weather.razor │ │ │ ├── Routes.razor │ │ │ └── _Imports.razor │ │ │ ├── Program.cs │ │ │ ├── Properties │ │ │ └── launchSettings.json │ │ │ ├── TUnit.Aspire.Starter.WebApp.csproj │ │ │ ├── WeatherApiClient.cs │ │ │ ├── appsettings.Development.json │ │ │ ├── appsettings.json │ │ │ └── wwwroot │ │ │ ├── app.css │ │ │ ├── favicon.png │ │ │ └── lib │ │ │ └── bootstrap │ │ │ └── dist │ │ │ ├── css │ │ │ ├── bootstrap-grid.css │ │ │ ├── bootstrap-grid.css.map │ │ │ ├── bootstrap-grid.min.css │ │ │ ├── bootstrap-grid.min.css.map │ │ │ ├── bootstrap-grid.rtl.css │ │ │ ├── bootstrap-grid.rtl.css.map │ │ │ ├── bootstrap-grid.rtl.min.css │ │ │ ├── bootstrap-grid.rtl.min.css.map │ │ │ ├── bootstrap-reboot.css │ │ │ ├── bootstrap-reboot.css.map │ │ │ ├── bootstrap-reboot.min.css │ │ │ ├── bootstrap-reboot.min.css.map │ │ │ ├── bootstrap-reboot.rtl.css │ │ │ ├── bootstrap-reboot.rtl.css.map │ │ │ ├── bootstrap-reboot.rtl.min.css │ │ │ ├── bootstrap-reboot.rtl.min.css.map │ │ │ ├── bootstrap-utilities.css │ │ │ ├── bootstrap-utilities.css.map │ │ │ ├── bootstrap-utilities.min.css │ │ │ ├── bootstrap-utilities.min.css.map │ │ │ ├── bootstrap-utilities.rtl.css │ │ │ ├── bootstrap-utilities.rtl.css.map │ │ │ ├── bootstrap-utilities.rtl.min.css │ │ │ ├── bootstrap-utilities.rtl.min.css.map │ │ │ ├── bootstrap.css │ │ │ ├── bootstrap.css.map │ │ │ ├── bootstrap.min.css │ │ │ ├── bootstrap.min.css.map │ │ │ ├── bootstrap.rtl.css │ │ │ ├── bootstrap.rtl.css.map │ │ │ ├── bootstrap.rtl.min.css │ │ │ └── bootstrap.rtl.min.css.map │ │ │ └── js │ │ │ ├── bootstrap.bundle.js │ │ │ ├── bootstrap.bundle.js.map │ │ │ ├── bootstrap.bundle.min.js │ │ │ ├── bootstrap.bundle.min.js.map │ │ │ ├── bootstrap.esm.js │ │ │ ├── bootstrap.esm.js.map │ │ │ ├── bootstrap.esm.min.js │ │ │ ├── bootstrap.esm.min.js.map │ │ │ ├── bootstrap.js │ │ │ ├── bootstrap.js.map │ │ │ ├── bootstrap.min.js │ │ │ └── bootstrap.min.js.map │ ├── InstantiationTest.TUnit.Aspire.Test._.verified │ │ └── TUnit.Aspire.Test │ │ │ ├── Data │ │ │ └── HttpClientDataClass.cs │ │ │ ├── GlobalSetup.cs │ │ │ ├── IntegrationTest1.cs │ │ │ └── TUnit.Aspire.Test.csproj │ ├── InstantiationTest.TUnit.Playwright._.verified │ │ └── TUnit.Playwright │ │ │ ├── GlobalSetup.cs │ │ │ ├── Hooks.cs │ │ │ ├── TUnit.Playwright.csproj │ │ │ └── Tests.cs │ ├── InstantiationTest.TUnit._.verified │ │ └── TUnit │ │ │ ├── Data │ │ │ ├── DataClass.cs │ │ │ ├── DataGenerator.cs │ │ │ └── DependencyInjectionClassConstructor.cs │ │ │ ├── GlobalSetup.cs │ │ │ ├── TUnit.csproj │ │ │ ├── Tests.cs │ │ │ ├── Tests2.cs │ │ │ └── Tests3.cs │ ├── InstantiationTestWithFSharp.TUnit.AspNet.FSharp._.verified │ │ └── TUnit.AspNet.FSharp │ │ │ ├── TUnit.AspNet.FSharp │ │ │ ├── GlobalSetup.fs │ │ │ ├── TUnit.AspNet.FSharp.fsproj │ │ │ ├── Tests.fs │ │ │ └── WebApplicationFactory.fs │ │ │ └── WebApp │ │ │ ├── Controllers │ │ │ └── WeatherForecastController.fs │ │ │ ├── Program.fs │ │ │ ├── Properties │ │ │ └── launchSettings.json │ │ │ ├── WeatherForecast.fs │ │ │ ├── WebApp.fsproj │ │ │ ├── appsettings.Development.json │ │ │ └── appsettings.json │ ├── InstantiationTestWithFSharp.TUnit.FSharp._.verified │ │ └── TUnit.FSharp │ │ │ ├── Data │ │ │ ├── DataClass.fs │ │ │ ├── DataGenerator.fs │ │ │ └── DependencyInjectionClassConstructor.fs │ │ │ ├── GlobalSetup.fs │ │ │ ├── TUnit.FSharp.fsproj │ │ │ ├── Tests.fs │ │ │ ├── Tests2.fs │ │ │ └── Tests3.fs │ └── InstantiationTestWithVB.TUnit.VB._.verified │ │ └── TUnit.VB │ │ ├── Data │ │ ├── DataClass.vb │ │ ├── DataGenerator.vb │ │ └── DependencyInjectionClassConstructor.vb │ │ ├── GlobalSetup.vb │ │ ├── TUnit.VB.vbproj │ │ ├── Tests.vb │ │ ├── Tests2.vb │ │ └── Tests3.vb ├── TUnit.Templates.Tests.csproj └── TemplateTestBase.cs ├── TUnit.Templates ├── .idea │ └── .idea.TUnit.dir │ │ └── .idea │ │ ├── .gitignore │ │ ├── .name │ │ ├── encodings.xml │ │ └── indexLayout.xml ├── Directory.Build.props ├── Directory.Build.targets ├── Directory.Packages.props ├── README.md ├── TUnit.Templates.csproj └── content │ ├── Directory.Build.props │ ├── TUnit.AspNet.FSharp │ ├── .template.config │ │ └── template.json │ ├── TestProject │ │ ├── GlobalSetup.fs │ │ ├── TestProject.fsproj │ │ ├── Tests.fs │ │ └── WebApplicationFactory.fs │ └── WebApp │ │ ├── Controllers │ │ └── WeatherForecastController.fs │ │ ├── Program.fs │ │ ├── Properties │ │ └── launchSettings.json │ │ ├── WeatherForecast.fs │ │ ├── WebApp.fsproj │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ ├── TUnit.AspNet │ ├── .template.config │ │ └── template.json │ ├── TestProject │ │ ├── GlobalSetup.cs │ │ ├── TestProject.csproj │ │ ├── Tests.cs │ │ └── WebApplicationFactory.cs │ └── WebApp │ │ ├── Program.cs │ │ ├── Properties │ │ └── launchSettings.json │ │ ├── WebApp.csproj │ │ ├── WebApp.http │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ ├── TUnit.Aspire.Starter │ ├── .template.config │ │ └── template.json │ ├── ExampleNamespace.ApiService │ │ ├── ExampleNamespace.ApiService.csproj │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ ├── ExampleNamespace.AppHost │ │ ├── ExampleNamespace.AppHost.csproj │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ ├── ExampleNamespace.ServiceDefaults │ │ ├── ExampleNamespace.ServiceDefaults.csproj │ │ └── Extensions.cs │ ├── ExampleNamespace.TestProject │ │ ├── Data │ │ │ └── HttpClientDataClass.cs │ │ ├── ExampleNamespace.TestProject.csproj │ │ ├── GlobalSetup.cs │ │ ├── Models │ │ │ └── WeatherForecast.cs │ │ └── Tests │ │ │ └── ApiTests.cs │ └── ExampleNamespace.WebApp │ │ ├── Components │ │ ├── App.razor │ │ ├── Layout │ │ │ ├── MainLayout.razor │ │ │ ├── MainLayout.razor.css │ │ │ ├── NavMenu.razor │ │ │ └── NavMenu.razor.css │ │ ├── Pages │ │ │ ├── Counter.razor │ │ │ ├── Error.razor │ │ │ ├── Home.razor │ │ │ └── Weather.razor │ │ ├── Routes.razor │ │ └── _Imports.razor │ │ ├── ExampleNamespace.WebApp.csproj │ │ ├── Program.cs │ │ ├── Properties │ │ └── launchSettings.json │ │ ├── WeatherApiClient.cs │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ └── wwwroot │ │ ├── app.css │ │ ├── favicon.png │ │ └── lib │ │ └── bootstrap │ │ └── dist │ │ ├── css │ │ ├── bootstrap-grid.css │ │ ├── bootstrap-grid.css.map │ │ ├── bootstrap-grid.min.css │ │ ├── bootstrap-grid.min.css.map │ │ ├── bootstrap-grid.rtl.css │ │ ├── bootstrap-grid.rtl.css.map │ │ ├── bootstrap-grid.rtl.min.css │ │ ├── bootstrap-grid.rtl.min.css.map │ │ ├── bootstrap-reboot.css │ │ ├── bootstrap-reboot.css.map │ │ ├── bootstrap-reboot.min.css │ │ ├── bootstrap-reboot.min.css.map │ │ ├── bootstrap-reboot.rtl.css │ │ ├── bootstrap-reboot.rtl.css.map │ │ ├── bootstrap-reboot.rtl.min.css │ │ ├── bootstrap-reboot.rtl.min.css.map │ │ ├── bootstrap-utilities.css │ │ ├── bootstrap-utilities.css.map │ │ ├── bootstrap-utilities.min.css │ │ ├── bootstrap-utilities.min.css.map │ │ ├── bootstrap-utilities.rtl.css │ │ ├── bootstrap-utilities.rtl.css.map │ │ ├── bootstrap-utilities.rtl.min.css │ │ ├── bootstrap-utilities.rtl.min.css.map │ │ ├── bootstrap.css │ │ ├── bootstrap.css.map │ │ ├── bootstrap.min.css │ │ ├── bootstrap.min.css.map │ │ ├── bootstrap.rtl.css │ │ ├── bootstrap.rtl.css.map │ │ ├── bootstrap.rtl.min.css │ │ └── bootstrap.rtl.min.css.map │ │ └── js │ │ ├── bootstrap.bundle.js │ │ ├── bootstrap.bundle.js.map │ │ ├── bootstrap.bundle.min.js │ │ ├── bootstrap.bundle.min.js.map │ │ ├── bootstrap.esm.js │ │ ├── bootstrap.esm.js.map │ │ ├── bootstrap.esm.min.js │ │ ├── bootstrap.esm.min.js.map │ │ ├── bootstrap.js │ │ ├── bootstrap.js.map │ │ ├── bootstrap.min.js │ │ └── bootstrap.min.js.map │ ├── TUnit.Aspire.Test │ ├── .template.config │ │ └── template.json │ ├── Data │ │ └── HttpClientDataClass.cs │ ├── ExampleNamespace.csproj │ ├── GlobalSetup.cs │ └── IntegrationTest1.cs │ ├── TUnit.FSharp │ ├── .template.config │ │ └── template.json │ ├── Data │ │ ├── DataClass.fs │ │ ├── DataGenerator.fs │ │ └── DependencyInjectionClassConstructor.fs │ ├── GlobalSetup.fs │ ├── TestProject.fsproj │ ├── Tests.fs │ ├── Tests2.fs │ └── Tests3.fs │ ├── TUnit.Playwright │ ├── .template.config │ │ └── template.json │ ├── GlobalSetup.cs │ ├── Hooks.cs │ ├── TestProject.csproj │ └── Tests.cs │ ├── TUnit.VB │ ├── .template.config │ │ └── template.json │ ├── Data │ │ ├── DataClass.vb │ │ ├── DataGenerator.vb │ │ └── DependencyInjectionClassConstructor.vb │ ├── GlobalSetup.vb │ ├── TestProject.vbproj │ ├── Tests.vb │ ├── Tests2.vb │ └── Tests3.vb │ └── TUnit │ ├── .template.config │ └── template.json │ ├── Data │ ├── DataClass.cs │ ├── DataGenerator.cs │ └── DependencyInjectionClassConstructor.cs │ ├── GlobalSetup.cs │ ├── TestProject.csproj │ ├── Tests.cs │ ├── Tests2.cs │ └── Tests3.cs ├── TUnit.TestProject.FSharp ├── ClassConstructorTest.fs ├── ClassConstructorWithEnumerableTest.fs ├── ClassDataSourceDrivenTests.fs ├── DependencyInjectionClassConstructor.fs ├── DummyReferenceTypeClass.fs ├── TUnit.TestProject.FSharp.fsproj └── Tests.fs ├── TUnit.TestProject.Library ├── BaseTests.cs ├── Bugs │ ├── 1889 │ │ └── BaseTests.cs │ └── 1899 │ │ └── BaseClass.cs ├── Hooks.cs ├── Models │ ├── Dummy.cs │ ├── InitializableClass.cs │ ├── ParallelLimit3.cs │ └── SomeAsyncDisposableClass.cs ├── Polyfill │ └── ModuleInitializerAttribute.cs ├── ProjectReferenceEnum.cs └── TUnit.TestProject.Library.csproj ├── TUnit.TestProject.VB.NET ├── ClassConstructorTest.vb ├── ClassConstructorWithEnumerableTest.vb ├── ClassDataSourceDrivenTests.vb ├── DependencyInjectionClassConstructor.vb ├── DummyReferenceTypeClass.vb ├── Program.vb └── TUnit.TestProject.VB.NET.vbproj ├── TUnit.TestProject ├── AbstractTests │ ├── AbstractBaseClass.cs │ ├── ConcreteClass1.cs │ └── ConcreteClass2.cs ├── AfterTestAttributeTests.cs ├── AfterTests │ ├── AfterEveryTests.cs │ ├── AfterTests.cs │ ├── AssemblyAfterTests.cs │ ├── TestDiscoveryAfterTests.cs │ └── TestSessionAfterTests.cs ├── AmbiguousOverloadsTests.cs ├── ApplicableAttributeTests.cs ├── ArgsAsArrayTests.cs ├── ArgumentWithImplicitConverterTests.cs ├── AssemblyHooks.cs ├── AsyncDisposableFieldTests.cs ├── AsyncDisposablePropertyTests.cs ├── AsyncDisposableTests.cs ├── AsyncLocalTest.cs ├── AttributeTests.cs ├── Attributes │ ├── AutoDataAttribute.cs │ ├── ClassDisplayNameAttribute.cs │ ├── EnumGeneratorAttribute.cs │ ├── SkipMacOSAttribute.cs │ └── SkipNetFrameworkAttribute.cs ├── AutoDataTests.cs ├── BasicTests.cs ├── BasicTests_HooksFromLibrary.cs ├── BeforeTests │ ├── AssemblyBeforeTests.cs │ ├── BeforeEveryTests.cs │ ├── BeforeTests.cs │ ├── TestDiscoveryBeforeTests.cs │ └── TestSessionBeforeTests.cs ├── Bugs │ ├── 1187 │ │ └── Tests.cs │ ├── 1304 │ │ └── Tests.cs │ ├── 1410 │ │ ├── ReproTest.cs │ │ └── SharedFixture.cs │ ├── 1432 │ │ ├── ConstantInBaseClassTests.cs │ │ ├── ConstantsInInterpolatedStringsTests.cs │ │ └── EnumMemberNamesTests.cs │ ├── 1538 │ │ └── Tests.cs │ ├── 1539 │ │ └── Tests.cs │ ├── 1570 │ │ └── Tests.cs │ ├── 1577 │ │ └── Tests.cs │ ├── 1589 │ │ └── MyTests.cs │ ├── 1594 │ │ └── MyTests.cs │ ├── 1603 │ │ ├── MyTests.cs │ │ └── Tests.cs │ ├── 1692 │ │ └── Tests.cs │ ├── 1821 │ │ └── Tests.cs │ ├── 1836 │ │ └── Tests.cs │ ├── 1889 │ │ └── DerivedTest.cs │ ├── 1899 │ │ └── DerivedTest.cs │ ├── 1914 │ │ ├── AsyncHookTests.cs │ │ └── SyncHookTests.cs │ ├── 1924 │ │ ├── DataClass.cs │ │ ├── Keyed │ │ │ └── Tests.cs │ │ ├── None │ │ │ └── Tests.cs │ │ ├── PerAssembly │ │ │ └── Tests.cs │ │ ├── PerClass │ │ │ └── Tests.cs │ │ └── PerTestSession │ │ │ └── Tests.cs │ ├── 1939 │ │ ├── DataClass.cs │ │ └── Tests.cs │ ├── 2067 │ │ ├── DataClass.cs │ │ └── Tests.cs │ ├── 2075 │ │ └── Tests.cs │ ├── 2083 │ │ └── Tests.cs │ ├── 2085 │ │ └── Tests.cs │ ├── 2112 │ │ └── Tests.cs │ ├── 2136 │ │ └── Tests.cs │ ├── 2449 │ │ └── Tests.cs │ └── 2481 │ │ └── Tests.cs ├── ByteArgumentTests.cs ├── CaptureOutputTests.cs ├── CategoryTests.cs ├── ClassAndMethodArgumentsTests.cs ├── ClassArgumentsTests.cs ├── ClassConstructorTest.cs ├── ClassConstructorWithEnumerableTest.cs ├── ClassDataSourceDisposal │ └── Repro.cs ├── ClassDataSourceDrivenTests.cs ├── ClassDataSourceDrivenTests2.cs ├── ClassDataSourceDrivenTestsSharedForClass.cs ├── ClassDataSourceDrivenTestsSharedKeyed.cs ├── ClassDataSourceDrivenTestsSharedKeyed2.cs ├── ClassDataSourceDrivenTestsSharedKeyed3.cs ├── ClassDataSourceDrivenTestsSharedNone.cs ├── ClassHooks.cs ├── ClassHooksExecutionCountTests.cs ├── ClassTupleDataSourceDrivenTests.cs ├── CleanUpTests.cs ├── CommonTestData.cs ├── ComplexDependsOn │ ├── BaseClass.cs │ └── Tests.cs ├── ComplexDependsOn2 │ └── Tests.cs ├── ConfigurationTests.cs ├── ConflictingDependsOnTests.cs ├── ConflictingDependsOnTests2.cs ├── ConflictingDependsOnTests3.cs ├── ConsoleConcurrentTests.cs ├── ConsoleTests.cs ├── ConstantArgumentsTests.cs ├── CultureTests.cs ├── CustomAssertions │ ├── ProblemDetailsAssertion.cs │ └── ProblemDetailsSourceGenerationContext.cs ├── CustomClassDisplayNameTests.cs ├── CustomDisplayNameTests.cs ├── CustomFilteringTests.cs ├── CustomPropertyTests.cs ├── CustomRetryTests.cs ├── CustomSkipAttribute.cs ├── Data │ ├── Blah.txt │ └── Zip.zip ├── DataDrivenTests.cs ├── DataSourceClassCombinedWithDataSourceMethod.cs ├── DataSourceGeneratorTests.cs ├── DebugAssertFailureTests.cs ├── DeepNestedDependencyConflict.cs ├── DependencyCountTests.cs ├── DependencyInjectionClassConstructor.cs ├── DependsOnAndNotInParallelTests.cs ├── DependsOnTests.cs ├── DependsOnTests2.cs ├── DependsOnTests3.cs ├── DependsOnTestsWithClass.cs ├── DependsOnTestsWithClass2.cs ├── DependsOnTestsWithProceedOnFailure.cs ├── DependsOnTestsWithoutProceedOnFailure.cs ├── DependsOnWithBaseTests.cs ├── DisposableFieldTests.cs ├── DisposablePropertyTests.cs ├── DisposedRepro.cs ├── DummyReferenceTypeClass.cs ├── DynamicCodeOnlyAttribute.cs ├── DynamicTests │ ├── Basic.cs │ ├── Basic2.cs │ └── Runtime.cs ├── DynamicallyAddedTestsAtRuntimeTests.cs ├── DynamicallyRegisteredTests.cs ├── EnumTests.cs ├── EnumerableDataSourceDrivenTests.cs ├── EnumerableTupleDataSourceDrivenTests.cs ├── Enums │ └── PriorityLevel.cs ├── ExampleTestFixture.cs ├── ExperimentalTests.cs ├── ExplicitTests.cs ├── ExternalEnumArgumentTest.cs ├── FailedInitializationTests.cs ├── FailedInitializationTests2.cs ├── FilterByDynamicAddedPropertyTests.cs ├── GenericHooks.cs ├── GenericMethodTests.cs ├── GenericTests.cs ├── GlobalSetUpCleanUp.cs ├── GlobalTestHooks.cs ├── GlobalUsings.cs ├── HumanizerDisplayNameTests.cs ├── IDisposableTests.cs ├── InheritedPropertySetterTests.cs ├── InheritedTestsFromDifferentProjectTests.cs ├── Inject_NonSharedInstance.cs ├── Inject_SharedInstanceGlobally.cs ├── Inject_SharedInstancePerKey.cs ├── Inject_SharedInstancePerTestClass.cs ├── InjectedClassDataSourceWithAsyncInitializerTests.cs ├── InstanceData.cs ├── KeyedNotInParallelTests.cs ├── LongFailures.cs ├── MEDITest.cs ├── MatrixTests.cs ├── MethodDataSourceDrivenTests.cs ├── MethodDataSourceDrivenWithCancellationTokenTests.cs ├── MixedMatrixTests.cs ├── MultipleClassDataSourceDrivenTests.cs ├── MyTests.cs ├── NameOfArgumentTests.cs ├── NestedBaseTests.cs ├── NestedClassDataSourceDrivenTests.cs ├── NestedExceptionTests.cs ├── NotInParallelTests.cs ├── NotInParallelWithDependsOnTests.cs ├── NullableByteArgumentTests.cs ├── NumberArgumentTests.cs ├── OneTimeCleanUpWithBaseTests │ ├── Base1.cs │ ├── Base2.cs │ └── NonBase.cs ├── OneTimeSetUpWithBaseTests │ ├── Base1.cs │ ├── Base2.cs │ └── NonBase.cs ├── OptionalArgumentsTests.cs ├── OrderedByAttributeOrderParameterSetupTests │ ├── Base1.cs │ ├── Base2.cs │ ├── Base3.cs │ └── Tests.cs ├── OrderedSetupTests │ ├── Base1.cs │ ├── Base2.cs │ ├── Base3.cs │ └── Tests.cs ├── OrderedTests.cs ├── OverrideResultsTests.cs ├── ParallelLimiterTests.cs ├── ParallelTests.cs ├── ParametersTests.cs ├── PassFailTests.cs ├── PriorityFilteringTests.cs ├── PropertySetterTests.cs ├── RepeatTests.cs ├── RetryTests.cs ├── ReturnTypeTests.cs ├── STAThreadTests.cs ├── SkipTests.cs ├── SomethingElseAttribute.cs ├── StringArgumentTests.cs ├── TUnit.TestProject.csproj ├── TestArtifactTests.cs ├── TestData.cs ├── TestDataSources.cs ├── TestDiscoveryHookTests.cs ├── TestEnum.cs ├── TestEnum2.cs ├── Tests.cs ├── TimeoutCancellationTokenTests.cs ├── TupleDataSourceDrivenTests.cs ├── UniqueBuilderContextsOnEnumerableDataGeneratorTests.cs ├── UniqueObjectsOnEnumerableDataGeneratorTests.cs └── testconfig.json ├── TUnit.UnitTests ├── Extensions │ └── ReflectionExtensions.cs ├── GlobalUsings.cs ├── Services │ └── DependencyCollectorTests.cs ├── TUnit.UnitTests.csproj └── TestExtensionsTests.cs ├── TUnit.sln ├── TUnit ├── TUnit.csproj ├── TUnit.props └── TUnit.targets ├── TestLibrary.props ├── TestLibrary.targets ├── TestProject.props ├── TestProject.targets ├── assets ├── banner.png └── logo.jpg ├── clean.ps1 ├── docs ├── .gitignore ├── README.md ├── babel.config.js ├── docs │ ├── assertions │ │ ├── and-conditions.md │ │ ├── assertion-groups.md │ │ ├── awaiting.md │ │ ├── delegates.md │ │ ├── extensibility │ │ │ ├── custom-assertions.md │ │ │ ├── extensibility-chaining-and-converting.md │ │ │ └── extensibility-returning-items-from-await.md │ │ ├── fsharp.md │ │ ├── or-conditions.md │ │ ├── scopes.md │ │ └── type-checking.md │ ├── comparison │ │ ├── _category_.json │ │ ├── attributes.md │ │ └── framework-differences.md │ ├── customization-extensibility │ │ ├── argument-formatters.md │ │ ├── data-source-generators.md │ │ ├── display-names.md │ │ ├── libraries.md │ │ └── logging.md │ ├── examples │ │ ├── _category_.json │ │ ├── aspnet.md │ │ ├── fsharp-interactive.md │ │ ├── instrumenting-global-test-ids.md │ │ ├── intro.md │ │ ├── playwright.md │ │ └── tunit-ci-pipeline.md │ ├── execution │ │ ├── engine-modes.md │ │ ├── executors.md │ │ ├── repeating.md │ │ ├── retrying.md │ │ ├── test-filters.md │ │ └── timeouts.md │ ├── experimental │ │ ├── _category_.json │ │ └── dynamic-tests.md │ ├── extensions │ │ ├── _category_.json │ │ └── extensions.md │ ├── faq.md │ ├── getting-started │ │ ├── congratulations.md │ │ ├── installation.md │ │ ├── running-your-tests.md │ │ └── writing-your-first-test.md │ ├── intro.md │ ├── migration │ │ ├── _category_.json │ │ └── xunit.md │ ├── parallelism │ │ ├── not-in-parallel.md │ │ ├── parallel-groups.md │ │ └── parallel-limiter.md │ ├── reference │ │ ├── command-line-flags.md │ │ └── test-configuration.md │ ├── test-authoring │ │ ├── arguments.md │ │ ├── class-data-source.md │ │ ├── depends-on.md │ │ ├── explicit.md │ │ ├── matrix-tests.md │ │ ├── method-data-source.md │ │ ├── order.md │ │ ├── skip.md │ │ └── things-to-know.md │ └── test-lifecycle │ │ ├── class-constructors.md │ │ ├── cleanup.md │ │ ├── dependency-injection.md │ │ ├── event-subscribing.md │ │ ├── properties.md │ │ ├── property-injection.md │ │ ├── setup.md │ │ └── test-context.md ├── docusaurus.config.ts ├── package.json ├── sidebars.js ├── sidebars.ts ├── src │ ├── components │ │ └── HomepageFeatures │ │ │ ├── index.tsx │ │ │ └── styles.module.css │ ├── css │ │ └── custom.css │ └── pages │ │ ├── index.module.css │ │ ├── index.tsx │ │ └── markdown-page.md ├── static │ ├── .nojekyll │ ├── CNAME │ └── img │ │ ├── docusaurus-social-card.jpg │ │ ├── docusaurus.png │ │ ├── easy.svg │ │ ├── fast.svg │ │ ├── favicon.ico │ │ ├── flexible.svg │ │ ├── lab.svg │ │ ├── logo.svg │ │ ├── rider.png │ │ ├── undraw_docusaurus_mountain.svg │ │ ├── undraw_docusaurus_react.svg │ │ ├── undraw_docusaurus_tree.svg │ │ ├── visual-studio-code.png │ │ └── visual-studio.png ├── tsconfig.json └── yarn.lock ├── renovate.json ├── rider.png ├── strongname.snk └── tools ├── Directory.Build.props ├── Directory.Build.targets ├── speed-comparison ├── .idea │ └── .idea.TestProjects │ │ └── .idea │ │ ├── .gitignore │ │ ├── .name │ │ ├── encodings.xml │ │ ├── indexLayout.xml │ │ ├── material_theme_project_new.xml │ │ └── vcs.xml ├── MSTestTimer │ ├── .idea │ │ └── .idea.MSTestTimer │ │ │ └── .idea │ │ │ ├── .gitignore │ │ │ ├── encodings.xml │ │ │ └── material_theme_project_new.xml │ ├── MSTestTimer.sln │ └── MSTestTimer │ │ ├── BasicTest.cs │ │ ├── GlobalUsings.cs │ │ ├── MSTestTimer.csproj │ │ └── RepeatTests.cs ├── NUnitTimer │ ├── .idea │ │ └── .idea.NUnitTimer │ │ │ └── .idea │ │ │ ├── .gitignore │ │ │ ├── encodings.xml │ │ │ └── material_theme_project_new.xml │ ├── NUnitTimer.sln │ └── NUnitTimer │ │ ├── BasicTest.cs │ │ ├── GlobalUsings.cs │ │ ├── NUnitTimer.csproj │ │ └── RepeatTests.cs ├── TUnitTimer │ ├── .idea │ │ └── .idea.TUnitTimer │ │ │ └── .idea │ │ │ ├── .gitignore │ │ │ ├── encodings.xml │ │ │ └── material_theme_project_new.xml │ ├── TUnitTimer.sln │ └── TUnitTimer │ │ ├── BasicTest.cs │ │ ├── GlobalUsings.cs │ │ ├── RepeatTests.cs │ │ └── TUnitTimer.csproj ├── TestProjects.sln ├── Tests.Benchmark │ ├── BenchmarkBase.cs │ ├── BuildBenchmarks.cs │ ├── Program.cs │ ├── RuntimeBenchmarks.cs │ └── Tests.Benchmark.csproj └── xUnitTimer │ ├── .idea │ └── .idea.xUnitTimer │ │ └── .idea │ │ ├── .gitignore │ │ ├── encodings.xml │ │ └── material_theme_project_new.xml │ ├── xUnitTimer.sln │ └── xUnitTimer │ ├── BasicTest.cs │ ├── GlobalUsings.cs │ ├── RepeatTests.cs │ └── xUnitTimer.csproj └── tunit-nuget-tester └── TUnit.NugetTester ├── .idea └── .idea.TUnit.NugetTester │ └── .idea │ ├── .gitignore │ ├── encodings.xml │ ├── indexLayout.xml │ ├── material_theme_project_new.xml │ └── vcs.xml ├── TUnit.NugetTester.FSharp ├── Program.fs └── TUnit.NugetTester.FSharp.fsproj ├── TUnit.NugetTester.Library ├── TUnit.NugetTester.Library.csproj └── TestBase.cs ├── TUnit.NugetTester.VB ├── Program.vb └── TUnit.NugetTester.VB.vbproj ├── TUnit.NugetTester.sln └── TUnit.NugetTester ├── MyTests.cs └── TUnit.NugetTester.csproj /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*.{cs,vb}] 4 | dotnet_diagnostic.TUnitAssertions0003.severity=silent 5 | 6 | 7 | # Verify 8 | [*.{received,verified}.{txt}] 9 | charset = "utf-8-bom" 10 | end_of_line = lf 11 | indent_size = unset 12 | indent_style = unset 13 | insert_final_newline = false 14 | tab_width = unset 15 | trim_trailing_whitespace = false -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | # Verify 7 | *.verified.txt text eol=lf working-tree-encoding=UTF-8 -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: [thomhurst] -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ### Please check the following before creating a Pull Request 2 | 3 | - If this is a new feature or piece of functionality, have you started a discussion and gotten agreement on it? 4 | - If it fixes a bug or problem, is there an issue to track it? If not, create one first and link it please so there's clear visibility. 5 | - Did you write tests to ensure you code works properly? -------------------------------------------------------------------------------- /.github/release.yml: -------------------------------------------------------------------------------- 1 | changelog: 2 | exclude: 3 | labels: 4 | - ignore-for-release 5 | categories: 6 | - title: Breaking Changes 🛠 7 | labels: 8 | - Semver-Major 9 | - breaking-change 10 | - breaking 11 | - title: 🏕 Changes 12 | labels: 13 | - '*' 14 | exclude: 15 | labels: 16 | - dependencies 17 | - title: 👒 Dependencies 18 | labels: 19 | - dependencies -------------------------------------------------------------------------------- /.idea/.idea.TUnit/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Rider ignored files 5 | /projectSettingsUpdater.xml 6 | /modules.xml 7 | /contentModel.xml 8 | /.idea.TUnit.iml 9 | # Editor-based HTTP Client requests 10 | /httpRequests/ 11 | # Datasource local storage ignored files 12 | /dataSources/ 13 | /dataSources.local.xml 14 | -------------------------------------------------------------------------------- /.idea/.idea.TUnit/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /.idea/.idea.TUnit/.idea/indexLayout.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/.idea.TUnit/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Analyzer.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Directory.Build.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | $(DefineConstants);ROSLYN4_7_OR_GREATER 4 | 5 | 6 | -------------------------------------------------------------------------------- /GitVersion.yml: -------------------------------------------------------------------------------- 1 | mode: ContinuousDeployment 2 | strategies: 3 | - Mainline 4 | ignore: 5 | sha: 6 | - e39ef8a0ed0d5e12e396e3c87d185ba7b0c512b0 7 | - 9b0b1c0d80692dba7584905554cfb43c92e29782 8 | - 7e0f59874705082e81a0d614abea2709a9f6a98e 9 | - 0f32f64e21316fc908af0721864ab3dd1fcebb4b 10 | - cc09c9b221e35d842bea687c96a1594a574b1fac -------------------------------------------------------------------------------- /Polyfill.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | all 5 | runtime; build; native; contentfiles; analyzers; buildtransitive 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Roslyn.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | all 8 | runtime; build; native; contentfiles; analyzers; buildtransitive 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /SourceGenerator.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /TUnit.Analyzers.Roslyn414/TUnit.Analyzers.Roslyn414.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 4.14 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /TUnit.Analyzers.Roslyn44/TUnit.Analyzers.Roslyn44.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 4.4 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /TUnit.Analyzers.Roslyn47/TUnit.Analyzers.Roslyn47.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 4.7 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /TUnit.Analyzers.Tests/Extensions/StringExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Analyzers.Tests.Extensions; 2 | 3 | public static class StringExtensions 4 | { 5 | public static string NormalizeLineEndings(this string value) 6 | { 7 | return value.Replace("\r\n", "\n").Replace("\n", "\r\n"); 8 | } 9 | } -------------------------------------------------------------------------------- /TUnit.Analyzers/AnalyzerReleases.Unshipped.md: -------------------------------------------------------------------------------- 1 | ### New Rules 2 | 3 | Rule ID | Category | Severity | Notes 4 | --------|----------|----------|------- -------------------------------------------------------------------------------- /TUnit.Analyzers/FullyQualifiedTypeName.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Analyzers; 2 | 3 | public record FullyQualifiedTypeName 4 | { 5 | public FullyQualifiedTypeName(string fullyQualifiedType) 6 | { 7 | WithoutGlobalPrefix = fullyQualifiedType; 8 | WithGlobalPrefix = $"global::{WithoutGlobalPrefix}"; 9 | } 10 | 11 | public string WithoutGlobalPrefix { get; } 12 | 13 | public string WithGlobalPrefix { get; } 14 | } -------------------------------------------------------------------------------- /TUnit.Analyzers/HookLevel.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Analyzers; 2 | 3 | public enum HookLevel 4 | { 5 | Test, 6 | Class, 7 | Assembly, 8 | TestSession, 9 | TestDiscovery, 10 | } -------------------------------------------------------------------------------- /TUnit.Analyzers/HookType.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Analyzers; 2 | 3 | public enum HookType 4 | { 5 | Before, 6 | After 7 | } -------------------------------------------------------------------------------- /TUnit.Analyzers/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "profiles": { 4 | "DebugRoslynAnalyzers": { 5 | "commandName": "DebugRoslynComponent", 6 | "targetProject": "../TUnit.Analyzers.Sample/TUnit.Analyzers.Sample.csproj" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /TUnit.Assertions.Analyzers.CodeFixers.Tests/Extensions/StringExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Assertions.Analyzers.CodeFixers.Tests.Extensions; 2 | 3 | public static class StringExtensions 4 | { 5 | public static string NormalizeLineEndings(this string value) 6 | { 7 | return value.Replace("\r\n", "\n").Replace("\n", Environment.NewLine); 8 | } 9 | } -------------------------------------------------------------------------------- /TUnit.Assertions.Analyzers/AnalyzerReleases.Shipped.md: -------------------------------------------------------------------------------- 1 | ## Release 1.0 2 | 3 | ### New Rules 4 | 5 | Rule ID | Category | Severity | Notes 6 | --------|----------|----------|------------------------------------------------ 7 | TUnitAnalyzers0001 | Usage | Warning | Don't mix 'Or' & 'And' operators in assertions. 8 | TUnitAnalyzers0002 | Usage | Error | Assert statements must be awaited. 9 | TUnitAnalyzers0004 | Usage | Error | Don't populate compiler arguments. 10 | -------------------------------------------------------------------------------- /TUnit.Assertions.Analyzers/AnalyzerReleases.Unshipped.md: -------------------------------------------------------------------------------- 1 | ### New Rules 2 | 3 | Rule ID | Category | Severity | Notes 4 | --------|----------|----------|------- -------------------------------------------------------------------------------- /TUnit.Assertions.Analyzers/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | 3 | [assembly: InternalsVisibleTo("TUnit.Analyzers.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100698a70398fa0b2230c5a72e3bd9d56b48f809f6173e49a19fbb942d621be93ad48c5566b47b28faabc359b9ad3ff4e00bbdea88f5bdfa250f391fedd28182b2e37b55d429c0151a42a98ea7a5821818cd15a79fef9903e8607a88304cf3e0317bf86ec96e32e1381535a6582251e5a6eed40b5a3ed82bc444598b1269cce57a7")] 4 | -------------------------------------------------------------------------------- /TUnit.Assertions.Analyzers/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "profiles": { 4 | "DebugRoslynAnalyzers": { 5 | "commandName": "DebugRoslynComponent", 6 | "targetProject": "../TUnit.Analyzers.Sample/TUnit.Analyzers.Sample.csproj" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /TUnit.Assertions.FSharp/TUnit.Assertions.FSharp.fsproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /TUnit.Assertions.FSharp/TUnit.Assertions.FSharp.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | enable 4 | auto 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /TUnit.Assertions.Tests/Bugs/Tests1917.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Immutable; 2 | using TUnit.Assertions.Enums; 3 | 4 | namespace TUnit.Assertions.Tests.Bugs; 5 | 6 | public class Tests1917 7 | { 8 | [Test] 9 | public async Task Immutable_Array_Has_Enumerable_Methods() 10 | { 11 | var array = ImmutableArray.Empty; 12 | var list = ImmutableList.Empty; 13 | 14 | await Assert.That(array).IsEmpty(); 15 | await Assert.That(list).IsEmpty(); 16 | } 17 | } -------------------------------------------------------------------------------- /TUnit.Assertions.Tests/GlobalUsings.cs: -------------------------------------------------------------------------------- 1 | global using TUnit.Core; 2 | global using TUnit.Assertions.Exceptions; 3 | global using TUnit.Assertions.Extensions; -------------------------------------------------------------------------------- /TUnit.Assertions.Tests/Old/DynamicAssertionTests.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Assertions.Tests.Old; 2 | 3 | public class DynamicAssertionTests 4 | { 5 | [Test] 6 | public async Task Test1() 7 | { 8 | dynamic? foo = null; 9 | await TUnitAssert.That((object?)foo).IsNull(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /TUnit.Assertions.Tests/Old/GlobalUsings.cs: -------------------------------------------------------------------------------- 1 | global using TUnitAssert = TUnit.Assertions.Assert; 2 | global using TUnitAssertionException = TUnit.Assertions.Exceptions.AssertionException; -------------------------------------------------------------------------------- /TUnit.Assertions.Tests/Old/ObjectTests.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Assertions.Tests.Old; 2 | 3 | public class ObjectTests 4 | { 5 | [Test] 6 | public async Task Assertion_Message_Has_Correct_Expression() 7 | { 8 | var myModel = new MyModel("1", "2"); 9 | var myModel2 = new MyModel("1", "2"); 10 | 11 | await Assert.That(myModel).IsEqualTo(myModel2); 12 | } 13 | 14 | public record MyModel(string One, string Two); 15 | } -------------------------------------------------------------------------------- /TUnit.Assertions.Tests/Old/RefStructEqualToAssertionTests.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Assertions.Tests.Old; 2 | 3 | public class RefStructEqualToAssertionTests 4 | { 5 | [Test] 6 | public async Task EqualsTo_Success() 7 | { 8 | var value1 = new MyRefStruct(); 9 | var value2 = new MyRefStruct(); 10 | 11 | await TUnitAssert.That(value1.Value).IsEqualTo(value2.Value); 12 | } 13 | public ref struct MyRefStruct 14 | { 15 | public string Value { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /TUnit.Assertions.Tests/Old/TimeSpanAssertionTests.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Assertions.Tests.Old; 2 | 3 | public class TimeSpanAssertionTests 4 | { 5 | [Test] 6 | public async Task Less_Than() 7 | { 8 | var value1 = TimeSpan.FromSeconds(1); 9 | var value2 = TimeSpan.FromSeconds(2); 10 | 11 | await TUnitAssert.That(value1).IsLessThan(value2); 12 | } 13 | } -------------------------------------------------------------------------------- /TUnit.Assertions.Tests/TUnit.Assertions.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /TUnit.Assertions.Tests/TypeOfTests.cs: -------------------------------------------------------------------------------- 1 | using System.Text; 2 | 3 | namespace TUnit.Assertions.Tests; 4 | 5 | public class TypeOfTests 6 | { 7 | [Test] 8 | public async Task Returns_Casted_Object() 9 | { 10 | object? obj = new StringBuilder(); 11 | 12 | var result = await Assert.That(obj).IsTypeOf(); 13 | 14 | await Assert.That(result).IsNotNull(); 15 | } 16 | } -------------------------------------------------------------------------------- /TUnit.Assertions/AssertConditions/ChainType.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Assertions.AssertConditions; 2 | 3 | public enum ChainType 4 | { 5 | None, 6 | And, 7 | Or 8 | } -------------------------------------------------------------------------------- /TUnit.Assertions/AssertConditions/FailureLocation.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Assertions.AssertConditions; 2 | 3 | public record FailureLocation 4 | { 5 | public long Position { get; } 6 | public object? ExpectedValue { get; } 7 | public object? ActualValue { get; } 8 | } -------------------------------------------------------------------------------- /TUnit.Assertions/AssertConditions/Interfaces/IDelegateSource.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Assertions.AssertConditions.Interfaces; 2 | 3 | public interface IDelegateSource : ISource; -------------------------------------------------------------------------------- /TUnit.Assertions/AssertConditions/Interfaces/ISource.cs: -------------------------------------------------------------------------------- 1 | using System.Text; 2 | 3 | namespace TUnit.Assertions.AssertConditions.Interfaces; 4 | 5 | public interface ISource 6 | { 7 | string? ActualExpression { get; } 8 | internal Stack Assertions { get; } 9 | internal ValueTask AssertionDataTask { get; } 10 | internal StringBuilder ExpressionBuilder { get; } 11 | 12 | ISource AppendExpression(string expression); 13 | ISource WithAssertion(BaseAssertCondition assertCondition); 14 | } -------------------------------------------------------------------------------- /TUnit.Assertions/AssertConditions/Interfaces/IValueDelegateSource.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Assertions.AssertConditions.Interfaces; 2 | 3 | public interface IValueDelegateSource : IValueSource, IDelegateSource; -------------------------------------------------------------------------------- /TUnit.Assertions/AssertConditions/Interfaces/IValueSource.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Assertions.AssertConditions.Interfaces; 2 | 3 | public interface IValueSource : ISource; -------------------------------------------------------------------------------- /TUnit.Assertions/AssertConditions/Operators/AssertionType.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Assertions.AssertConditions.Operators; 2 | 3 | [Flags] 4 | public enum AssertionType 5 | { 6 | Value = 1, 7 | Delegate = 2 8 | } -------------------------------------------------------------------------------- /TUnit.Assertions/AssertionBuilders/AsyncDelegateAssertionBuilder.cs: -------------------------------------------------------------------------------- 1 | using TUnit.Assertions.AssertConditions.Interfaces; 2 | using TUnit.Assertions.Extensions; 3 | 4 | namespace TUnit.Assertions.AssertionBuilders; 5 | 6 | public class AsyncDelegateAssertionBuilder 7 | : AssertionBuilder, 8 | IDelegateSource 9 | { 10 | internal AsyncDelegateAssertionBuilder(Func function, string? expressionBuilder) : base(function.AsAssertionData(expressionBuilder), expressionBuilder) 11 | { 12 | } 13 | } -------------------------------------------------------------------------------- /TUnit.Assertions/AssertionBuilders/AsyncValueDelegateAssertionBuilder.cs: -------------------------------------------------------------------------------- 1 | using TUnit.Assertions.AssertConditions.Interfaces; 2 | using TUnit.Assertions.Extensions; 3 | 4 | namespace TUnit.Assertions.AssertionBuilders; 5 | 6 | public class AsyncValueDelegateAssertionBuilder 7 | : AssertionBuilder, IValueDelegateSource 8 | { 9 | internal AsyncValueDelegateAssertionBuilder(Func> function, string? expressionBuilder) : base(function.AsAssertionData(expressionBuilder), expressionBuilder) 10 | { 11 | } 12 | } -------------------------------------------------------------------------------- /TUnit.Assertions/AssertionBuilders/DelegateAssertionBuilder.cs: -------------------------------------------------------------------------------- 1 | using TUnit.Assertions.AssertConditions.Interfaces; 2 | using TUnit.Assertions.Extensions; 3 | 4 | namespace TUnit.Assertions.AssertionBuilders; 5 | 6 | public class DelegateAssertionBuilder 7 | : AssertionBuilder, 8 | IDelegateSource 9 | { 10 | internal DelegateAssertionBuilder(Action action, string? expressionBuilder) : base(action.AsAssertionData(expressionBuilder), expressionBuilder) 11 | { 12 | } 13 | } -------------------------------------------------------------------------------- /TUnit.Assertions/AssertionBuilders/IAndAssertionBuilder.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Assertions.AssertionBuilders; 2 | 3 | public interface IAndAssertionBuilder; -------------------------------------------------------------------------------- /TUnit.Assertions/AssertionBuilders/IInvokableAssertionBuilder.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | using TUnit.Assertions.AssertConditions.Interfaces; 3 | 4 | namespace TUnit.Assertions.AssertionBuilders; 5 | 6 | public interface IInvokableAssertionBuilder : ISource 7 | { 8 | TaskAwaiter GetAwaiter(); 9 | string? GetExpression(); 10 | } -------------------------------------------------------------------------------- /TUnit.Assertions/AssertionBuilders/IOrAssertionBuilder.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Assertions.AssertionBuilders; 2 | 3 | public interface IOrAssertionBuilder; -------------------------------------------------------------------------------- /TUnit.Assertions/AssertionBuilders/ValueDelegateAssertionBuilder.cs: -------------------------------------------------------------------------------- 1 | using TUnit.Assertions.AssertConditions.Interfaces; 2 | using TUnit.Assertions.Extensions; 3 | 4 | namespace TUnit.Assertions.AssertionBuilders; 5 | 6 | public class ValueDelegateAssertionBuilder 7 | : AssertionBuilder, IValueDelegateSource 8 | { 9 | internal ValueDelegateAssertionBuilder(Func function, string? expressionBuilder) : base(function.AsAssertionData(expressionBuilder), expressionBuilder) 10 | { 11 | } 12 | } -------------------------------------------------------------------------------- /TUnit.Assertions/AssertionBuilders/Wrappers/GenericEqualToAssertionBuilderWrapper.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Assertions.AssertionBuilders.Wrappers; 2 | 3 | public class GenericEqualToAssertionBuilderWrapper : InvokableValueAssertionBuilder 4 | { 5 | internal GenericEqualToAssertionBuilderWrapper(InvokableAssertionBuilder invokableAssertionBuilder) : base(invokableAssertionBuilder) 6 | { 7 | } 8 | } -------------------------------------------------------------------------------- /TUnit.Assertions/AssertionBuilders/Wrappers/GenericNotEqualToAssertionBuilderWrapper.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Assertions.AssertionBuilders.Wrappers; 2 | 3 | public class GenericNotEqualToAssertionBuilderWrapper : InvokableValueAssertionBuilder 4 | { 5 | internal GenericNotEqualToAssertionBuilderWrapper(InvokableAssertionBuilder invokableAssertionBuilder) : base(invokableAssertionBuilder) 6 | { 7 | } 8 | } -------------------------------------------------------------------------------- /TUnit.Assertions/AssertionData.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Assertions; 2 | 3 | public readonly record struct AssertionData(object? Result, Exception? Exception, string? ActualExpression, DateTimeOffset Start, DateTimeOffset End) 4 | { 5 | public static implicit operator AssertionData((object?, Exception?, string?, DateTimeOffset, DateTimeOffset) tuple) => 6 | new(tuple.Item1, tuple.Item2, tuple.Item3, tuple.Item4, tuple.Item5); 7 | } -------------------------------------------------------------------------------- /TUnit.Assertions/AssertionMetadata.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Assertions; 2 | 3 | public class AssertionMetadata 4 | { 5 | public required DateTimeOffset StartTime { get; init; } 6 | public required DateTimeOffset EndTime { get; init; } 7 | public TimeSpan Duration => EndTime - StartTime; 8 | } -------------------------------------------------------------------------------- /TUnit.Assertions/Assertions/Collections/Conditions/PropertyOrMethodAccessor.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Assertions.AssertConditions.Collections; 2 | 3 | public class PropertyOrMethodAccessor; -------------------------------------------------------------------------------- /TUnit.Assertions/Assertions/Collections/HasExtensions_String.cs: -------------------------------------------------------------------------------- 1 | #nullable disable 2 | 3 | using TUnit.Assertions.AssertConditions.Interfaces; 4 | 5 | namespace TUnit.Assertions.Extensions; 6 | 7 | public static partial class HasExtensions 8 | { 9 | public static StringLength HasLength(this IValueSource valueSource) 10 | { 11 | valueSource.AppendExpression("HasLength()"); 12 | return new StringLength(valueSource); 13 | } 14 | } -------------------------------------------------------------------------------- /TUnit.Assertions/CompareOptions.cs: -------------------------------------------------------------------------------- 1 | using TUnit.Assertions.Enums; 2 | 3 | namespace TUnit.Assertions; 4 | 5 | public record CompareOptions 6 | { 7 | public string[] MembersToIgnore { get; init; } = []; 8 | public EquivalencyKind EquivalencyKind { get; set; } = EquivalencyKind.Full; 9 | } -------------------------------------------------------------------------------- /TUnit.Assertions/ComparisonFailure.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Assertions; 2 | 3 | public record ComparisonFailure 4 | { 5 | public required MemberType Type { get; init; } 6 | public required string[] NestedMemberNames { get; init; } 7 | public required object? Actual { get; init; } 8 | public required object? Expected { get; init; } 9 | } -------------------------------------------------------------------------------- /TUnit.Assertions/Enums/CollectionOrdering.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Assertions.Enums; 2 | 3 | public enum CollectionOrdering 4 | { 5 | Matching, 6 | Any 7 | } -------------------------------------------------------------------------------- /TUnit.Assertions/Enums/EquivalencyKind.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Assertions.Enums; 2 | 3 | public enum EquivalencyKind 4 | { 5 | Full, 6 | Partial 7 | } -------------------------------------------------------------------------------- /TUnit.Assertions/Enums/Order.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Assertions.Enums; 2 | 3 | public enum Order 4 | { 5 | Ascending, 6 | Descending 7 | } -------------------------------------------------------------------------------- /TUnit.Assertions/Exceptions/AssertionException.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Assertions.Exceptions; 2 | 3 | public class AssertionException : BaseAssertionException 4 | { 5 | public AssertionException(string? message) : base(message) 6 | { 7 | } 8 | 9 | public AssertionException(string? message, Exception innerException) : base(message, innerException) 10 | { 11 | } 12 | } -------------------------------------------------------------------------------- /TUnit.Assertions/Exceptions/BaseAssertionException.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Assertions.Exceptions; 2 | 3 | public class BaseAssertionException : Exception 4 | { 5 | public BaseAssertionException() 6 | { 7 | } 8 | 9 | public BaseAssertionException(string? message) : base(message) 10 | { 11 | } 12 | 13 | public BaseAssertionException(string? message, Exception? innerException) : base(message, innerException) 14 | { 15 | } 16 | } -------------------------------------------------------------------------------- /TUnit.Assertions/Exceptions/CompleteWithinException.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Assertions.Exceptions; 2 | 3 | internal class CompleteWithinException : AssertionException 4 | { 5 | public CompleteWithinException(string? message) : base(message) 6 | { 7 | } 8 | 9 | public CompleteWithinException(string? message, Exception innerException) : base(message, innerException) 10 | { 11 | } 12 | } -------------------------------------------------------------------------------- /TUnit.Assertions/Exceptions/MaybeCaughtException.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Assertions.Exceptions; 2 | 3 | public class MaybeCaughtException(Exception exception) 4 | : Exception($"(This exception may or may not have been caught) {exception.GetType().Namespace}.{exception.GetType().Name}: {exception.Message}", exception); -------------------------------------------------------------------------------- /TUnit.Assertions/Exceptions/MixedAndOrAssertionsException.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Assertions.Exceptions; 2 | 3 | public class MixedAndOrAssertionsException() 4 | : AssertionException("Don't mix 'Or' & 'And' operators in assertions (Consider using Assertion Groups as an alternative)."); -------------------------------------------------------------------------------- /TUnit.Assertions/Extensions/NumberExtensions.cs: -------------------------------------------------------------------------------- 1 | #if NET 2 | 3 | using System.Numerics; 4 | 5 | namespace TUnit.Assertions.Extensions; 6 | 7 | internal static class NumberExtensions 8 | { 9 | public static bool IsBetween(this INumber number, INumber min, INumber max) 10 | where TActual : INumber 11 | { 12 | return number.CompareTo(min) >= 0 && number.CompareTo(max) <= 0; 13 | } 14 | } 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /TUnit.Assertions/MemberType.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Assertions; 2 | 3 | public enum MemberType 4 | { 5 | Property, 6 | Field, 7 | Value, 8 | EnumerableItem, 9 | DictionaryItem 10 | } -------------------------------------------------------------------------------- /TUnit.Assertions/TUnit.Assertions.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /TUnit.Core.SourceGenerator.Roslyn414/TUnit.Core.SourceGenerator.Roslyn414.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 4.14 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /TUnit.Core.SourceGenerator.Roslyn44/TUnit.Core.SourceGenerator.Roslyn44.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 4.4 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /TUnit.Core.SourceGenerator.Roslyn47/TUnit.Core.SourceGenerator.Roslyn47.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 4.7 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /TUnit.Core.SourceGenerator.Tests/AbstractTests.AbstractClass.verified.txt: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /TUnit.Core.SourceGenerator.Tests/ArgsAsArrayTests.cs: -------------------------------------------------------------------------------- 1 | using TUnit.Core.SourceGenerator.CodeGenerators; 2 | 3 | namespace TUnit.Core.SourceGenerator.Tests; 4 | 5 | internal class ArgsAsArrayTests : TestsBase 6 | { 7 | [Test] 8 | public Task Test() => RunTest(Path.Combine(Git.RootDirectory.FullName, 9 | "TUnit.TestProject", 10 | "ArgsAsArrayTests.cs"), 11 | async generatedFiles => 12 | { 13 | await Assert.That(generatedFiles.Length).IsEqualTo(5); 14 | }); 15 | } -------------------------------------------------------------------------------- /TUnit.Core.SourceGenerator.Tests/AttributeTests.cs: -------------------------------------------------------------------------------- 1 | using TUnit.Core.SourceGenerator.CodeGenerators; 2 | 3 | namespace TUnit.Core.SourceGenerator.Tests; 4 | 5 | internal class AttributeTests : TestsBase 6 | { 7 | [Test] 8 | public Task Test() => RunTest(Path.Combine(Git.RootDirectory.FullName, 9 | "TUnit.TestProject", 10 | "AttributeTests.cs"), 11 | async generatedFiles => 12 | { 13 | await Assert.That(generatedFiles.Length).IsEqualTo(1); 14 | }); 15 | } -------------------------------------------------------------------------------- /TUnit.Core.SourceGenerator.Tests/BasicTests.cs: -------------------------------------------------------------------------------- 1 | using TUnit.Core.SourceGenerator.CodeGenerators; 2 | 3 | namespace TUnit.Core.SourceGenerator.Tests; 4 | 5 | internal class BasicTests : TestsBase 6 | { 7 | [Test] 8 | public Task Test() => RunTest(Path.Combine(Git.RootDirectory.FullName, 9 | "TUnit.TestProject", 10 | "BasicTests.cs"), 11 | async generatedFiles => 12 | { 13 | await Assert.That(generatedFiles.Length).IsEqualTo(3); 14 | }); 15 | } -------------------------------------------------------------------------------- /TUnit.Core.SourceGenerator.Tests/ConstantArgumentsTests.cs: -------------------------------------------------------------------------------- 1 | using TUnit.Core.SourceGenerator.CodeGenerators; 2 | 3 | namespace TUnit.Core.SourceGenerator.Tests; 4 | 5 | internal class ConstantArgumentsTests : TestsBase 6 | { 7 | [Test] 8 | public Task Test() => RunTest(Path.Combine(Git.RootDirectory.FullName, 9 | "TUnit.TestProject", 10 | "ConstantArgumentsTests.cs"), 11 | async generatedFiles => 12 | { 13 | await Assert.That(generatedFiles.Length).IsEqualTo(7); 14 | }); 15 | } -------------------------------------------------------------------------------- /TUnit.Core.SourceGenerator.Tests/CustomDisplayNameTests.cs: -------------------------------------------------------------------------------- 1 | using TUnit.Core.SourceGenerator.CodeGenerators; 2 | 3 | namespace TUnit.Core.SourceGenerator.Tests; 4 | 5 | internal class CustomDisplayNameTests : TestsBase 6 | { 7 | [Test] 8 | public Task Test() => RunTest(Path.Combine(Git.RootDirectory.FullName, 9 | "TUnit.TestProject", 10 | "CustomDisplayNameTests.cs"), 11 | async generatedFiles => 12 | { 13 | await Assert.That(generatedFiles.Length).IsEqualTo(8); 14 | }); 15 | } -------------------------------------------------------------------------------- /TUnit.Core.SourceGenerator.Tests/DisableReflectionScannerTests.Test.DotNet8_0.verified.txt: -------------------------------------------------------------------------------- 1 | [ 2 | // 3 | #pragma warning disable 4 | file static class DisableReflectionScanner_Guid 5 | { 6 | [global::System.Runtime.CompilerServices.ModuleInitializer] 7 | public static void Initialize() 8 | { 9 | global::TUnit.Core.SourceRegistrar.IsEnabled = true; 10 | } 11 | } 12 | 13 | ] -------------------------------------------------------------------------------- /TUnit.Core.SourceGenerator.Tests/DisableReflectionScannerTests.Test.DotNet9_0.verified.txt: -------------------------------------------------------------------------------- 1 | [ 2 | // 3 | #pragma warning disable 4 | file static class DisableReflectionScanner_Guid 5 | { 6 | [global::System.Runtime.CompilerServices.ModuleInitializer] 7 | public static void Initialize() 8 | { 9 | global::TUnit.Core.SourceRegistrar.IsEnabled = true; 10 | } 11 | } 12 | 13 | ] -------------------------------------------------------------------------------- /TUnit.Core.SourceGenerator.Tests/DisableReflectionScannerTests.Test.Net4_7.verified.txt: -------------------------------------------------------------------------------- 1 | [ 2 | // 3 | #pragma warning disable 4 | file static class DisableReflectionScanner_Guid 5 | { 6 | [global::System.Runtime.CompilerServices.ModuleInitializer] 7 | public static void Initialize() 8 | { 9 | global::TUnit.Core.SourceRegistrar.IsEnabled = true; 10 | } 11 | } 12 | 13 | ] -------------------------------------------------------------------------------- /TUnit.Core.SourceGenerator.Tests/Extensions/StringExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Text.RegularExpressions; 2 | 3 | namespace TUnit.Core.SourceGenerator.Tests.Extensions; 4 | 5 | public static class StringExtensions 6 | { 7 | public static string IgnoreWhitespaceFormatting(this string value) 8 | { 9 | value = value.Replace("\t", " "); 10 | 11 | while (value.Contains(" ")) 12 | { 13 | value = value.Replace(" ", " "); 14 | } 15 | 16 | return Regex.Replace(value, "\\s+", " "); 17 | } 18 | } -------------------------------------------------------------------------------- /TUnit.Core.SourceGenerator.Tests/GenericMethodTests.cs: -------------------------------------------------------------------------------- 1 | using TUnit.Core.SourceGenerator.CodeGenerators; 2 | 3 | namespace TUnit.Core.SourceGenerator.Tests; 4 | 5 | internal class GenericMethodTests : TestsBase 6 | { 7 | [Test] 8 | public Task Test() => RunTest(Path.Combine(Git.RootDirectory.FullName, 9 | "TUnit.TestProject", 10 | "GenericMethodTests.cs"), 11 | async generatedFiles => 12 | { 13 | await Assert.That(generatedFiles.Length).IsEqualTo(1); 14 | }); 15 | } -------------------------------------------------------------------------------- /TUnit.Core.SourceGenerator.Tests/Git.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.SourceGenerator.Tests; 2 | 3 | internal class Git 4 | { 5 | public static DirectoryInfo RootDirectory => Sourcy.Git.RootDirectory; 6 | } -------------------------------------------------------------------------------- /TUnit.Core.SourceGenerator.Tests/GlobalUsings.cs: -------------------------------------------------------------------------------- 1 | global using TUnit.Assertions.Extensions; 2 | global using Assert = TUnit.Assertions.Assert; 3 | global using TestAttribute = TUnit.Core.TestAttribute; -------------------------------------------------------------------------------- /TUnit.Core.SourceGenerator.Tests/NameOfArgumentTests.cs: -------------------------------------------------------------------------------- 1 | using TUnit.Core.SourceGenerator.CodeGenerators; 2 | 3 | namespace TUnit.Core.SourceGenerator.Tests; 4 | 5 | internal class NameOfArgumentTests : TestsBase 6 | { 7 | [Test] 8 | public Task Test() => RunTest(Path.Combine(Git.RootDirectory.FullName, 9 | "TUnit.TestProject", 10 | "NameOfArgumentTests.cs"), 11 | async generatedFiles => 12 | { 13 | await Assert.That(generatedFiles.Length).IsEqualTo(1); 14 | }); 15 | } -------------------------------------------------------------------------------- /TUnit.Core.SourceGenerator.Tests/Options/RunTestOptions.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.CodeAnalysis.Testing; 2 | 3 | namespace TUnit.Core.SourceGenerator.Tests.Options; 4 | 5 | public record RunTestOptions 6 | { 7 | public string[] AdditionalFiles { get; set; } = []; 8 | public Dictionary? BuildProperties { get; set; } 9 | public Func? VerifyConfigurator { get; set; } 10 | public string[] AdditionalSyntaxes { get; set; } = []; 11 | public PackageIdentity[] AdditionalPackages { get; set; } = []; 12 | } -------------------------------------------------------------------------------- /TUnit.Core.SourceGenerator.Tests/PolyfillTests.Test_With_False_BuildProperty.verified.txt: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /TUnit.Core.SourceGenerator.Tests/RepeatTests.cs: -------------------------------------------------------------------------------- 1 | using TUnit.Core.SourceGenerator.CodeGenerators; 2 | 3 | namespace TUnit.Core.SourceGenerator.Tests; 4 | 5 | internal class RepeatTests : TestsBase 6 | { 7 | [Test] 8 | public Task Test() => RunTest(Path.Combine(Git.RootDirectory.FullName, 9 | "TUnit.TestProject", 10 | "RepeatTests.cs"), 11 | async generatedFiles => 12 | { 13 | await Assert.That(generatedFiles.Length).IsEqualTo(3); 14 | }); 15 | } -------------------------------------------------------------------------------- /TUnit.Core.SourceGenerator.Tests/STAThreadHooksTests.cs: -------------------------------------------------------------------------------- 1 | using TUnit.Core.SourceGenerator.CodeGenerators; 2 | 3 | namespace TUnit.Core.SourceGenerator.Tests; 4 | 5 | internal class STAThreadHooksTests : TestsBase 6 | { 7 | [Test] 8 | public Task Test() => RunTest(Path.Combine(Git.RootDirectory.FullName, 9 | "TUnit.TestProject", 10 | "STAThreadTests.cs"), 11 | async generatedFiles => 12 | { 13 | await Assert.That(generatedFiles.Length).IsEqualTo(2); 14 | }); 15 | } -------------------------------------------------------------------------------- /TUnit.Core.SourceGenerator.Tests/StringArgumentTests.cs: -------------------------------------------------------------------------------- 1 | using TUnit.Core.SourceGenerator.CodeGenerators; 2 | 3 | namespace TUnit.Core.SourceGenerator.Tests; 4 | 5 | internal class StringArgumentTests : TestsBase 6 | { 7 | [Test] 8 | public Task Test() => RunTest(Path.Combine(Git.RootDirectory.FullName, 9 | "TUnit.TestProject", 10 | "StringArgumentTests.cs"), 11 | async generatedFiles => 12 | { 13 | await Assert.That(generatedFiles.Length).IsEqualTo(2); 14 | }); 15 | } -------------------------------------------------------------------------------- /TUnit.Core.SourceGenerator.Tests/Tests1899.Test.verified.txt: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /TUnit.Core.SourceGenerator.Tests/Tests2075.Test.DotNet8_0.verified.txt: -------------------------------------------------------------------------------- 1 | Non -------------------------------------------------------------------------------- /TUnit.Core.SourceGenerator.Tests/Tests2075.Test.DotNet9_0.verified.txt: -------------------------------------------------------------------------------- 1 | rre -------------------------------------------------------------------------------- /TUnit.Core.SourceGenerator.Tests/Tests2075.Test.Net4_7.verified.txt: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /TUnit.Core.SourceGenerator.Tests/Tests2075.Test.verified.txt: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /TUnit.Core.SourceGenerator.Tests/VerifyChecksTests.cs: -------------------------------------------------------------------------------- 1 | using VerifyTUnit; 2 | 3 | namespace TUnit.Core.SourceGenerator.Tests; 4 | 5 | public class VerifyChecksTests 6 | { 7 | [Test] 8 | public Task Run() => 9 | VerifyChecks.Run(); 10 | } -------------------------------------------------------------------------------- /TUnit.Core.SourceGenerator/CodeGenerators/Helpers/HookExecutorHelper.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.SourceGenerator.CodeGenerators.Helpers; 2 | 3 | public static class HookExecutorHelper 4 | { 5 | public static string GetHookExecutor(string? hookExecutor) 6 | { 7 | if (string.IsNullOrEmpty(hookExecutor)) 8 | { 9 | return "DefaultExecutor.Instance"; 10 | } 11 | 12 | return $"new {hookExecutor}()"; 13 | } 14 | } -------------------------------------------------------------------------------- /TUnit.Core.SourceGenerator/Enums/ArgumentsType.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.SourceGenerator.Enums; 2 | 3 | public enum ArgumentsType 4 | { 5 | ClassConstructor, 6 | Method, 7 | Property, 8 | } -------------------------------------------------------------------------------- /TUnit.Core.SourceGenerator/Enums/HookLocationType.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.SourceGenerator.Enums; 2 | 3 | [Flags] 4 | public enum HookLocationType 5 | { 6 | Before, 7 | After 8 | } -------------------------------------------------------------------------------- /TUnit.Core.SourceGenerator/Models/Arguments/Argument.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.SourceGenerator.Models.Arguments; 2 | 3 | public record Argument 4 | { 5 | public Argument(string type, string? invocation) 6 | { 7 | Type = type; 8 | Invocation = invocation ?? "null"; 9 | } 10 | 11 | public string Type { get; } 12 | public string Invocation { get; } 13 | } -------------------------------------------------------------------------------- /TUnit.Core.SourceGenerator/Models/Arguments/DataSourceAttributeContainer.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.CodeAnalysis; 2 | using TUnit.Core.SourceGenerator.Enums; 3 | 4 | namespace TUnit.Core.SourceGenerator.Models.Arguments; 5 | 6 | public abstract record DataSourceAttributeContainer(ArgumentsType ArgumentsType) : BaseContainer 7 | { 8 | public override required AttributeData? Attribute { get; init; } 9 | public required int? AttributeIndex { get; init; } 10 | } -------------------------------------------------------------------------------- /TUnit.Core.SourceGenerator/Models/Arguments/Variable.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.SourceGenerator.Models.Arguments; 2 | 3 | public record Variable 4 | { 5 | public required string Name { get; init; } 6 | public required string Type { get; init; } 7 | public required string Value { get; init; } 8 | 9 | public override string ToString() 10 | { 11 | return $"{Type} {Name} = {Value};"; 12 | } 13 | } -------------------------------------------------------------------------------- /TUnit.Core.SourceGenerator/Models/StaticClassDataSourceInjectorModel.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.SourceGenerator.Models; 2 | 3 | public record StaticClassDataSourceInjectorModel 4 | { 5 | public required string FullyQualifiedTypeName { get; init; } 6 | public required string PropertyName { get; init; } 7 | public required string InjectableType { get; init; } 8 | public required string MinimalTypeName { get; set; } 9 | } -------------------------------------------------------------------------------- /TUnit.Core.SourceGenerator/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "profiles": { 4 | "DebugRoslynSourceGenerator": { 5 | "commandName": "DebugRoslynComponent", 6 | "targetProject": "../TUnit.Core.SourceGenerator.Sample/TUnit.Core.SourceGenerator.Sample.csproj" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /TUnit.Core/Attributes/DynamicTestBuilderAttribute.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | using System.Runtime.CompilerServices; 3 | 4 | namespace TUnit.Core; 5 | 6 | [Experimental("TUnitWIP0001")] 7 | public class DynamicTestBuilderAttribute([CallerFilePath] string file = "", [CallerLineNumber] int line = 0) : BaseTestAttribute(file, line); -------------------------------------------------------------------------------- /TUnit.Core/Attributes/Executors/HookExecutorAttribute.cs: -------------------------------------------------------------------------------- 1 | using TUnit.Core.Interfaces; 2 | 3 | namespace TUnit.Core.Executors; 4 | 5 | public class HookExecutorAttribute(Type type) : TUnitAttribute 6 | { 7 | public Type HookExecutorType { get; } = type; 8 | } 9 | 10 | [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method)] 11 | public sealed class HookExecutorAttribute() : HookExecutorAttribute(typeof(T)) where T : IHookExecutor, new(); -------------------------------------------------------------------------------- /TUnit.Core/Attributes/Executors/InvariantCultureAttribute.cs: -------------------------------------------------------------------------------- 1 | using System.Globalization; 2 | 3 | namespace TUnit.Core.Executors; 4 | 5 | [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method)] 6 | public class InvariantCultureAttribute() : CultureAttribute(CultureInfo.InvariantCulture); -------------------------------------------------------------------------------- /TUnit.Core/Attributes/RunOnDiscoveryAttribute.cs: -------------------------------------------------------------------------------- 1 | using TUnit.Core.Interfaces; 2 | 3 | namespace TUnit.Core; 4 | 5 | public class RunOnDiscoveryAttribute : TUnitAttribute, ITestDiscoveryEventReceiver 6 | { 7 | public int Order => 0; 8 | 9 | public void OnTestDiscovery(DiscoveredTestContext discoveredTestContext) 10 | { 11 | discoveredTestContext.RunOnTestDiscovery = true; 12 | } 13 | } -------------------------------------------------------------------------------- /TUnit.Core/Attributes/SingleTUnitAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core; 2 | 3 | /// 4 | /// Represents a single TUnit attribute. 5 | /// 6 | public class SingleTUnitAttribute : TUnitAttribute 7 | { 8 | /// 9 | /// Initializes a new instance of the class. 10 | /// 11 | internal SingleTUnitAttribute() 12 | { 13 | } 14 | } -------------------------------------------------------------------------------- /TUnit.Core/Attributes/TUnitAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core; 2 | 3 | /// 4 | /// Represents the base attribute for TUnit. 5 | /// 6 | public class TUnitAttribute : Attribute 7 | { 8 | /// 9 | /// Initializes a new instance of the class. 10 | /// 11 | internal TUnitAttribute() 12 | { 13 | } 14 | } -------------------------------------------------------------------------------- /TUnit.Core/Attributes/TestData/ArgumentDisplayFormatter.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core; 2 | 3 | public abstract class ArgumentDisplayFormatter 4 | { 5 | public abstract bool CanHandle(object? value); 6 | public abstract string FormatValue(object? value); 7 | } 8 | -------------------------------------------------------------------------------- /TUnit.Core/Attributes/TestData/IAccessesInstanceData.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core; 2 | 3 | public interface IAccessesInstanceData; -------------------------------------------------------------------------------- /TUnit.Core/Attributes/TestData/IDataAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core; 2 | 3 | public interface IDataAttribute; 4 | 5 | internal class NoOpDataAttribute : IDataAttribute 6 | { 7 | public static IDataAttribute[] Array { get; } = [ new NoOpDataAttribute() ]; 8 | } -------------------------------------------------------------------------------- /TUnit.Core/Attributes/TestData/IDataSourceGeneratorAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core; 2 | 3 | internal interface IDataSourceGeneratorAttribute : IDataAttribute; -------------------------------------------------------------------------------- /TUnit.Core/Attributes/TestData/INonTypedDataSourceGeneratorAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core; 2 | 3 | internal interface INonTypedDataSourceGeneratorAttribute : IDataAttribute; -------------------------------------------------------------------------------- /TUnit.Core/Attributes/TestData/MatrixExclusionAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core; 2 | 3 | [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, AllowMultiple = true)] 4 | public class MatrixExclusionAttribute(params object?[]? objects) : TUnitAttribute 5 | { 6 | public object?[] Objects { get; } = objects ?? [ null ]; 7 | } -------------------------------------------------------------------------------- /TUnit.Core/Attributes/TestData/MatrixInstanceMethodAttribute.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | 3 | namespace TUnit.Core; 4 | 5 | [AttributeUsage(AttributeTargets.Parameter)] 6 | public class MatrixInstanceMethodAttribute 7 | <[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)] TClass> 8 | (string methodName) : MatrixMethodAttribute(methodName), IAccessesInstanceData where TClass : class; -------------------------------------------------------------------------------- /TUnit.Core/Attributes/TestData/NonTypedDataSourceGeneratorAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core; 2 | 3 | [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Property, AllowMultiple = true)] 4 | public abstract class NonTypedDataSourceGeneratorAttribute : TestDataAttribute, INonTypedDataSourceGeneratorAttribute, IDataSourceGeneratorAttribute 5 | { 6 | public abstract IEnumerable> GenerateDataSources(DataGeneratorMetadata dataGeneratorMetadata); 7 | } -------------------------------------------------------------------------------- /TUnit.Core/Attributes/TestData/SharedType.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core; 2 | 3 | public enum SharedType 4 | { 5 | None, 6 | PerClass, 7 | PerAssembly, 8 | PerTestSession, 9 | Keyed, 10 | } -------------------------------------------------------------------------------- /TUnit.Core/Attributes/TestData/TestDataAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core; 2 | 3 | public class TestDataAttribute : TUnitAttribute, IDataAttribute 4 | { 5 | public bool AccessesInstanceData { get; init; } 6 | } -------------------------------------------------------------------------------- /TUnit.Core/Attributes/TestHooks/AfterAttribute.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | 3 | #pragma warning disable CS9113 4 | 5 | namespace TUnit.Core; 6 | 7 | [AttributeUsage(AttributeTargets.Method)] 8 | public sealed class AfterAttribute(HookType hookType, [CallerFilePath] string file = "", [CallerLineNumber] int line = 0) : HookAttribute(hookType, file, line); -------------------------------------------------------------------------------- /TUnit.Core/Attributes/TestHooks/AfterEveryAttribute.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | 3 | namespace TUnit.Core; 4 | 5 | #pragma warning disable CS9113 6 | [AttributeUsage(AttributeTargets.Method)] 7 | public sealed class AfterEveryAttribute(HookType hookType, [CallerFilePath] string file = "", [CallerLineNumber] int line = 0) : HookAttribute(hookType, file, line); -------------------------------------------------------------------------------- /TUnit.Core/Attributes/TestHooks/BeforeAttribute.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | 3 | #pragma warning disable CS9113 4 | 5 | namespace TUnit.Core; 6 | 7 | [AttributeUsage(AttributeTargets.Method)] 8 | public sealed class BeforeAttribute(HookType hookType, [CallerFilePath] string file = "", [CallerLineNumber] int line = 0) : HookAttribute(hookType, file, line); -------------------------------------------------------------------------------- /TUnit.Core/Attributes/TestHooks/BeforeEveryAttribute.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | 3 | namespace TUnit.Core; 4 | 5 | #pragma warning disable CS9113 6 | [AttributeUsage(AttributeTargets.Method)] 7 | public sealed class BeforeEveryAttribute(HookType hookType, [CallerFilePath] string file = "", [CallerLineNumber] int line = 0) : HookAttribute(hookType, file, line); -------------------------------------------------------------------------------- /TUnit.Core/Attributes/TestMetadata/ExplicitAttribute.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | 3 | namespace TUnit.Core; 4 | 5 | [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class)] 6 | public sealed class ExplicitAttribute( 7 | [CallerFilePath] string callerFile = "", 8 | [CallerMemberName] string callerMemberName = "") 9 | : TUnitAttribute 10 | { 11 | public string For { get; } = $"{callerFile} {callerMemberName}".Trim(); 12 | } -------------------------------------------------------------------------------- /TUnit.Core/Attributes/Tests/InheritsTestsAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core; 2 | 3 | [AttributeUsage(AttributeTargets.Class)] 4 | public sealed class InheritsTestsAttribute : TUnitAttribute; -------------------------------------------------------------------------------- /TUnit.Core/Attributes/Tests/TestAttribute.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | 3 | namespace TUnit.Core; 4 | 5 | [AttributeUsage(AttributeTargets.Method)] 6 | public sealed class TestAttribute( 7 | [CallerFilePath] string file = "", 8 | [CallerLineNumber] int line = 0) 9 | : BaseTestAttribute(file, line); -------------------------------------------------------------------------------- /TUnit.Core/Enums/DataGeneratorType.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Enums; 2 | 3 | public enum DataGeneratorType 4 | { 5 | ClassParameters, 6 | TestParameters, 7 | Property, 8 | } -------------------------------------------------------------------------------- /TUnit.Core/Enums/LogLevel.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Enums; 2 | 3 | public enum LogLevel 4 | { 5 | None = -1, 6 | Trace = 0, 7 | Debug = 1, 8 | Information = 2, 9 | Warning = 3, 10 | Error = 4, 11 | Critical = 5, 12 | } -------------------------------------------------------------------------------- /TUnit.Core/Enums/Status.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Enums; 2 | 3 | public enum Status 4 | { 5 | None, 6 | Passed, 7 | Failed, 8 | Skipped, 9 | Cancelled 10 | } -------------------------------------------------------------------------------- /TUnit.Core/Exceptions/AfterAssemblyException.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Exceptions; 2 | 3 | public class AfterAssemblyException(string message, Exception innerException) : TUnitException(message, innerException); -------------------------------------------------------------------------------- /TUnit.Core/Exceptions/AfterClassException.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Exceptions; 2 | 3 | public class AfterClassException(string message, Exception innerException) : TUnitException(message, innerException); -------------------------------------------------------------------------------- /TUnit.Core/Exceptions/AfterTestDiscoveryException.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Exceptions; 2 | 3 | public class AfterTestDiscoveryException(string message, Exception innerException) : TUnitException(message, innerException); -------------------------------------------------------------------------------- /TUnit.Core/Exceptions/AfterTestException.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Exceptions; 2 | 3 | public class AfterTestException(string message, Exception innerException) : TUnitException(message, innerException); -------------------------------------------------------------------------------- /TUnit.Core/Exceptions/AfterTestSessionException.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Exceptions; 2 | 3 | public class AfterTestSessionException(string message, Exception innerException) : TUnitException(message, innerException); -------------------------------------------------------------------------------- /TUnit.Core/Exceptions/BeforeAssemblyException.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Exceptions; 2 | 3 | public class BeforeAssemblyException(string message, Exception innerException) : TUnitException(message, innerException); -------------------------------------------------------------------------------- /TUnit.Core/Exceptions/BeforeClassException.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Exceptions; 2 | 3 | public class BeforeClassException(string message, Exception innerException) : TUnitException(message, innerException); -------------------------------------------------------------------------------- /TUnit.Core/Exceptions/BeforeTestDiscoveryException.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Exceptions; 2 | 3 | public class BeforeTestDiscoveryException(string message, Exception innerException) : TUnitException(message, innerException); -------------------------------------------------------------------------------- /TUnit.Core/Exceptions/BeforeTestException.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Exceptions; 2 | 3 | public class BeforeTestException(string message, Exception innerException) : TUnitException(message, innerException); -------------------------------------------------------------------------------- /TUnit.Core/Exceptions/BeforeTestSessionException.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Exceptions; 2 | 3 | public class BeforeTestSessionException(string message, Exception innerException) : TUnitException(message, innerException); -------------------------------------------------------------------------------- /TUnit.Core/Exceptions/DependencyConflictException.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Exceptions; 2 | 3 | public class DependencyConflictException : TUnitException 4 | { 5 | internal DependencyConflictException(IEnumerable testChain) : base(GetMessage(testChain.ToList())) 6 | { 7 | } 8 | 9 | private static string GetMessage(List testChain) 10 | { 11 | return $"DependsOn Conflict: {string.Join(" > ", testChain.Select(x => $"{x.TestMethod.Class.Name}.{x.TestName}"))}"; 12 | } 13 | } -------------------------------------------------------------------------------- /TUnit.Core/Exceptions/FailTestException.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Exceptions; 2 | 3 | public class FailTestException(string reason) : TUnitException 4 | { 5 | public string Reason { get; } = reason; 6 | } -------------------------------------------------------------------------------- /TUnit.Core/Exceptions/InconclusiveTestException.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Exceptions; 2 | 3 | public class InconclusiveTestException(string message, Exception exception) : TUnitException(message, exception); -------------------------------------------------------------------------------- /TUnit.Core/Exceptions/SkipTestException.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Exceptions; 2 | 3 | public class SkipTestException(string reason) : TUnitException(reason) 4 | { 5 | public string Reason => Message; 6 | } -------------------------------------------------------------------------------- /TUnit.Core/Exceptions/TUnitException.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Exceptions; 2 | 3 | public class TUnitException : Exception 4 | { 5 | public TUnitException() 6 | { 7 | } 8 | 9 | public TUnitException(string? message) : base(message) 10 | { 11 | } 12 | 13 | public TUnitException(string? message, Exception? innerException) : base(message, innerException) 14 | { 15 | } 16 | } -------------------------------------------------------------------------------- /TUnit.Core/Exceptions/TestFailedInitializationException.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Exceptions; 2 | 3 | public class TestFailedInitializationException(string? message, Exception? innerException) 4 | : Exception(message, innerException); -------------------------------------------------------------------------------- /TUnit.Core/Exceptions/TestNotExecutedException.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Exceptions; 2 | 3 | public class TestNotExecutedException : TUnitException 4 | { 5 | internal TestNotExecutedException(TestDetails testDetails) : base(GetMessage(testDetails)) 6 | { 7 | } 8 | 9 | private static string GetMessage(TestDetails testDetails) 10 | { 11 | return $"The test {testDetails.TestName} was not run."; 12 | } 13 | } -------------------------------------------------------------------------------- /TUnit.Core/Exceptions/TestRunCanceledException.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Exceptions; 2 | 3 | public class TestRunCanceledException : TUnitException; -------------------------------------------------------------------------------- /TUnit.Core/Exceptions/TimeoutException.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Exceptions; 2 | 3 | public class TimeoutException : TUnitException 4 | { 5 | internal TimeoutException(TimeSpan timeSpan) : base(GetMessage(timeSpan)) 6 | { 7 | } 8 | 9 | private static string GetMessage(TimeSpan timeSpan) 10 | { 11 | return $"The test timed out after {timeSpan.TotalMilliseconds} milliseconds"; 12 | } 13 | } -------------------------------------------------------------------------------- /TUnit.Core/Executors/CultureExecutor.cs: -------------------------------------------------------------------------------- 1 | using System.Globalization; 2 | 3 | namespace TUnit.Core; 4 | 5 | public class CultureExecutor(CultureInfo cultureInfo) : DedicatedThreadExecutor 6 | { 7 | protected override void ConfigureThread(Thread thread) 8 | { 9 | thread.CurrentCulture = cultureInfo; 10 | thread.CurrentUICulture = cultureInfo; 11 | } 12 | } -------------------------------------------------------------------------------- /TUnit.Core/Executors/DefaultExecutor.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core; 2 | 3 | public class DefaultExecutor : GenericAbstractExecutor 4 | { 5 | public static readonly DefaultExecutor Instance = new(); 6 | 7 | private DefaultExecutor() 8 | { 9 | } 10 | 11 | protected override ValueTask ExecuteAsync(Func action) 12 | { 13 | return action(); 14 | } 15 | } -------------------------------------------------------------------------------- /TUnit.Core/Executors/STAThreadExecutor.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Versioning; 2 | 3 | namespace TUnit.Core; 4 | 5 | [SupportedOSPlatform("windows")] 6 | public class STAThreadExecutor : DedicatedThreadExecutor 7 | { 8 | protected override void ConfigureThread(Thread thread) 9 | { 10 | thread.SetApartmentState(ApartmentState.STA); 11 | } 12 | } -------------------------------------------------------------------------------- /TUnit.Core/GlobalSharedDataKey.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core; 2 | 3 | public record GlobalSharedDataKey(Type Type) : SharedDataKey(RandomKey.ToString(), Type) 4 | { 5 | public static readonly Guid RandomKey = Guid.NewGuid(); 6 | } -------------------------------------------------------------------------------- /TUnit.Core/Helpers/DefaultParallelLimit.cs: -------------------------------------------------------------------------------- 1 | using TUnit.Core.Interfaces; 2 | 3 | namespace TUnit.Core.Helpers; 4 | 5 | public class DefaultParallelLimit : IParallelLimit 6 | { 7 | public int Limit { get; } = Environment.ProcessorCount; 8 | } -------------------------------------------------------------------------------- /TUnit.Core/Hooks/AfterAssemblyHookMethod.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Hooks; 2 | 3 | public record AfterAssemblyHookMethod : StaticHookMethod 4 | { 5 | public override ValueTask ExecuteAsync(AssemblyHookContext context, CancellationToken cancellationToken) 6 | { 7 | return HookExecutor.ExecuteAfterAssemblyHook(MethodInfo, context, 8 | () => Body!.Invoke(context, cancellationToken) 9 | ); 10 | } 11 | } -------------------------------------------------------------------------------- /TUnit.Core/Hooks/AfterClassHookMethod.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Hooks; 2 | 3 | public record AfterClassHookMethod : StaticHookMethod 4 | { 5 | public override ValueTask ExecuteAsync(ClassHookContext context, CancellationToken cancellationToken) 6 | { 7 | return HookExecutor.ExecuteAfterClassHook(MethodInfo, context, 8 | () => Body!.Invoke(context, cancellationToken) 9 | ); 10 | } 11 | } -------------------------------------------------------------------------------- /TUnit.Core/Hooks/AfterTestDiscoveryHookMethod.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Hooks; 2 | 3 | public record AfterTestDiscoveryHookMethod : StaticHookMethod 4 | { 5 | public override ValueTask ExecuteAsync(TestDiscoveryContext context, CancellationToken cancellationToken) 6 | { 7 | return HookExecutor.ExecuteAfterTestDiscoveryHook(MethodInfo, context, 8 | () => Body!.Invoke(context, cancellationToken) 9 | ); 10 | } 11 | } -------------------------------------------------------------------------------- /TUnit.Core/Hooks/AfterTestHookMethod.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Hooks; 2 | 3 | public record AfterTestHookMethod : StaticHookMethod 4 | { 5 | public override ValueTask ExecuteAsync(TestContext context, CancellationToken cancellationToken) 6 | { 7 | return HookExecutor.ExecuteAfterTestHook(MethodInfo, context, 8 | () => Body!.Invoke(context, cancellationToken) 9 | ); 10 | } 11 | } -------------------------------------------------------------------------------- /TUnit.Core/Hooks/AfterTestSessionHookMethod.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Hooks; 2 | 3 | public record AfterTestSessionHookMethod : StaticHookMethod 4 | { 5 | public override ValueTask ExecuteAsync(TestSessionContext context, CancellationToken cancellationToken) 6 | { 7 | return HookExecutor.ExecuteAfterTestSessionHook(MethodInfo, context, 8 | () => Body!.Invoke(context, cancellationToken) 9 | ); 10 | } 11 | } -------------------------------------------------------------------------------- /TUnit.Core/Hooks/BeforeAssemblyHookMethod.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Hooks; 2 | 3 | public record BeforeAssemblyHookMethod : StaticHookMethod 4 | { 5 | public override ValueTask ExecuteAsync(AssemblyHookContext context, CancellationToken cancellationToken) 6 | { 7 | return HookExecutor.ExecuteBeforeAssemblyHook(MethodInfo, context, 8 | () => Body!.Invoke(context, cancellationToken) 9 | ); 10 | } 11 | } -------------------------------------------------------------------------------- /TUnit.Core/Hooks/BeforeClassHookMethod.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Hooks; 2 | 3 | public record BeforeClassHookMethod : StaticHookMethod 4 | { 5 | public override ValueTask ExecuteAsync(ClassHookContext context, CancellationToken cancellationToken) 6 | { 7 | return HookExecutor.ExecuteBeforeClassHook(MethodInfo, context, 8 | () => Body!.Invoke(context, cancellationToken) 9 | ); 10 | } 11 | } -------------------------------------------------------------------------------- /TUnit.Core/Hooks/BeforeTestDiscoveryHookMethod.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Hooks; 2 | 3 | public record BeforeTestDiscoveryHookMethod : StaticHookMethod 4 | { 5 | public override ValueTask ExecuteAsync(BeforeTestDiscoveryContext context, CancellationToken cancellationToken) 6 | { 7 | return HookExecutor.ExecuteBeforeTestDiscoveryHook(MethodInfo, context, 8 | () => Body!.Invoke(context, cancellationToken) 9 | ); 10 | } 11 | } -------------------------------------------------------------------------------- /TUnit.Core/Hooks/BeforeTestHookMethod.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Hooks; 2 | 3 | public record BeforeTestHookMethod : StaticHookMethod 4 | { 5 | public override ValueTask ExecuteAsync(TestContext context, CancellationToken cancellationToken) 6 | { 7 | return HookExecutor.ExecuteBeforeTestHook(MethodInfo, context, 8 | () => Body!.Invoke(context, cancellationToken) 9 | ); 10 | } 11 | } -------------------------------------------------------------------------------- /TUnit.Core/Hooks/BeforeTestSessionHookMethod.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Hooks; 2 | 3 | public record BeforeTestSessionHookMethod : StaticHookMethod 4 | { 5 | public override ValueTask ExecuteAsync(TestSessionContext context, CancellationToken cancellationToken) 6 | { 7 | return HookExecutor.ExecuteBeforeTestSessionHook(MethodInfo, context, 8 | () => Body!.Invoke(context, cancellationToken) 9 | ); 10 | } 11 | } -------------------------------------------------------------------------------- /TUnit.Core/Hooks/IExecutableHook.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Hooks; 2 | 3 | public interface IExecutableHook 4 | { 5 | string Name { get; } 6 | SourceGeneratedMethodInformation MethodInfo { get; } 7 | int Order { get; } 8 | ValueTask ExecuteAsync(T context, CancellationToken cancellationToken); 9 | } -------------------------------------------------------------------------------- /TUnit.Core/Hooks/IHookMessagePublisher.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Hooks; 2 | 3 | public interface IHookMessagePublisher 4 | { 5 | Task Discover(string sessionId, string displayName, StaticHookMethod hookMethod); 6 | Task Push(string sessionId, string displayName, StaticHookMethod hookMethod, Func func); 7 | } -------------------------------------------------------------------------------- /TUnit.Core/IDynamicTestRegistrar.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | 3 | namespace TUnit.Core; 4 | 5 | public interface IDynamicTestRegistrar 6 | { 7 | Task Register< 8 | [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors 9 | | DynamicallyAccessedMemberTypes.PublicMethods 10 | | DynamicallyAccessedMemberTypes.PublicProperties)] 11 | TClass>(DynamicTest dynamicTest) where TClass : class; 12 | } -------------------------------------------------------------------------------- /TUnit.Core/Interfaces/IAsyncInitializer.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Interfaces; 2 | 3 | public interface IAsyncInitializer 4 | { 5 | Task InitializeAsync(); 6 | } -------------------------------------------------------------------------------- /TUnit.Core/Interfaces/IClassConstructor.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | 3 | namespace TUnit.Core.Interfaces; 4 | 5 | public interface IClassConstructor 6 | { 7 | object Create([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type type, ClassConstructorMetadata classConstructorMetadata); 8 | } -------------------------------------------------------------------------------- /TUnit.Core/Interfaces/IConfiguration.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Interfaces; 2 | 3 | public interface IConfiguration 4 | { 5 | string? Get(string key); 6 | } -------------------------------------------------------------------------------- /TUnit.Core/Interfaces/IContext.cs: -------------------------------------------------------------------------------- 1 | using TUnit.Core.Logging; 2 | 3 | namespace TUnit.Core.Interfaces; 4 | 5 | public interface IContext 6 | { 7 | TextWriter OutputWriter { get; } 8 | TextWriter ErrorOutputWriter { get; } 9 | DefaultLogger GetDefaultLogger(); 10 | } -------------------------------------------------------------------------------- /TUnit.Core/Interfaces/IFirstTestInAssemblyEventReceiver.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Interfaces; 2 | 3 | public interface IFirstTestInAssemblyEventReceiver : IEventReceiver 4 | { 5 | ValueTask OnFirstTestInAssembly(AssemblyHookContext context, TestContext testContext); 6 | } -------------------------------------------------------------------------------- /TUnit.Core/Interfaces/IFirstTestInClassEventReceiver.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Interfaces; 2 | 3 | public interface IFirstTestInClassEventReceiver : IEventReceiver 4 | { 5 | ValueTask OnFirstTestInClass(ClassHookContext context, TestContext testContext); 6 | } -------------------------------------------------------------------------------- /TUnit.Core/Interfaces/IFirstTestInTestSessionEventReceiver.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Interfaces; 2 | 3 | public interface IFirstTestInTestSessionEventReceiver : IEventReceiver 4 | { 5 | ValueTask OnFirstTestInTestSession(TestSessionContext current, TestContext testContext); 6 | } -------------------------------------------------------------------------------- /TUnit.Core/Interfaces/IHasLoggers.cs: -------------------------------------------------------------------------------- 1 | using TUnit.Core.Logging; 2 | 3 | namespace TUnit.Core.Interfaces; 4 | 5 | public interface IHasLoggers 6 | { 7 | public List Loggers { get; } 8 | } -------------------------------------------------------------------------------- /TUnit.Core/Interfaces/ILastTestInAssemblyEventReceiver.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Interfaces; 2 | 3 | public interface ILastTestInAssemblyEventReceiver : IEventReceiver 4 | { 5 | ValueTask OnLastTestInAssembly(AssemblyHookContext context, TestContext testContext); 6 | } -------------------------------------------------------------------------------- /TUnit.Core/Interfaces/ILastTestInClassEventReceiver.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Interfaces; 2 | 3 | public interface ILastTestInClassEventReceiver : IEventReceiver 4 | { 5 | ValueTask OnLastTestInClass(ClassHookContext context, TestContext testContext); 6 | } -------------------------------------------------------------------------------- /TUnit.Core/Interfaces/ILastTestInTestSessionEventReceiver.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Interfaces; 2 | 3 | public interface ILastTestInTestSessionEventReceiver : IEventReceiver 4 | { 5 | ValueTask OnLastTestInTestSession(TestSessionContext current, TestContext testContext); 6 | } -------------------------------------------------------------------------------- /TUnit.Core/Interfaces/IParallelConstraint.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Interfaces; 2 | 3 | public interface IParallelConstraint; -------------------------------------------------------------------------------- /TUnit.Core/Interfaces/IParallelLimit.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Interfaces; 2 | 3 | public interface IParallelLimit 4 | { 5 | int Limit { get; } 6 | } -------------------------------------------------------------------------------- /TUnit.Core/Interfaces/ITestEndEventReceiver.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Interfaces; 2 | 3 | public interface ITestEndEventReceiver : IEventReceiver 4 | { 5 | ValueTask OnTestEnd(AfterTestContext afterTestContext); 6 | } -------------------------------------------------------------------------------- /TUnit.Core/Interfaces/ITestExecutor.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Interfaces; 2 | 3 | public interface ITestExecutor 4 | { 5 | ValueTask ExecuteTest(TestContext context, Func action); 6 | } -------------------------------------------------------------------------------- /TUnit.Core/Interfaces/ITestFinder.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Interfaces; 2 | 3 | public interface ITestFinder 4 | { 5 | IEnumerable GetTests(Type classType); 6 | 7 | TestContext[] GetTestsByNameAndParameters(string testName, IEnumerable methodParameterTypes, 8 | Type classType, IEnumerable classParameterTypes, IEnumerable classArguments); 9 | } -------------------------------------------------------------------------------- /TUnit.Core/Interfaces/ITestRetryEventReceiver.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Interfaces; 2 | 3 | public interface ITestRetryEventReceiver : IEventReceiver 4 | { 5 | ValueTask OnTestRetry(TestContext testContext, int retryAttempt); 6 | } -------------------------------------------------------------------------------- /TUnit.Core/Interfaces/ITestSkippedEventReceiver.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Interfaces; 2 | 3 | public interface ITestSkippedEventReceiver : IEventReceiver 4 | { 5 | ValueTask OnTestSkipped(TestContext testContext); 6 | } -------------------------------------------------------------------------------- /TUnit.Core/Interfaces/ITestStartEventReceiver.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Interfaces; 2 | 3 | public interface ITestStartEventReceiver : IEventReceiver 4 | { 5 | ValueTask OnTestStart(BeforeTestContext beforeTestContext); 6 | } -------------------------------------------------------------------------------- /TUnit.Core/Interfaces/SourceGenerator/IDynamicTestSource.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Interfaces.SourceGenerator; 2 | 3 | public interface IDynamicTestSource 4 | { 5 | IReadOnlyList CollectDynamicTests(string sessionId); 6 | } -------------------------------------------------------------------------------- /TUnit.Core/Interfaces/SourceGenerator/ITestDiscoveryHookSource.cs: -------------------------------------------------------------------------------- 1 | using TUnit.Core.Hooks; 2 | 3 | namespace TUnit.Core.Interfaces.SourceGenerator; 4 | 5 | public interface ITestDiscoveryHookSource 6 | { 7 | IReadOnlyList> CollectBeforeTestDiscoveryHooks(string sessionId); 8 | IReadOnlyList> CollectAfterTestDiscoveryHooks(string sessionId); 9 | } -------------------------------------------------------------------------------- /TUnit.Core/Interfaces/SourceGenerator/ITestSessionHookSource.cs: -------------------------------------------------------------------------------- 1 | using TUnit.Core.Hooks; 2 | 3 | namespace TUnit.Core.Interfaces.SourceGenerator; 4 | 5 | public interface ITestSessionHookSource 6 | { 7 | IReadOnlyList> CollectBeforeTestSessionHooks(string sessionId); 8 | IReadOnlyList> CollectAfterTestSessionHooks(string sessionId); 9 | } -------------------------------------------------------------------------------- /TUnit.Core/Interfaces/SourceGenerator/ITestSource.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core.Interfaces.SourceGenerator; 2 | 3 | public interface ITestSource 4 | { 5 | IReadOnlyList CollectTests(string sessionId); 6 | } -------------------------------------------------------------------------------- /TUnit.Core/Models/Artifact.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core; 2 | 3 | public class Artifact 4 | { 5 | public required FileInfo File { get; init; } 6 | public required string DisplayName { get; init; } 7 | public string? Description { get; init; } 8 | } -------------------------------------------------------------------------------- /TUnit.Core/Models/ClassConstructorMetadata.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core; 2 | 3 | public record ClassConstructorMetadata 4 | { 5 | public required string TestSessionId { get; init; } 6 | public required TestBuilderContext TestBuilderContext { get; init; } 7 | } -------------------------------------------------------------------------------- /TUnit.Core/Models/Dependency.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core; 2 | 3 | internal record Dependency(DiscoveredTest Test, bool ProceedOnFailure) 4 | { 5 | public TestDetails TestDetails => Test.TestDetails; 6 | 7 | public virtual bool Equals(Dependency? other) 8 | { 9 | return other?.TestDetails.IsSameTest(TestDetails) is true; 10 | } 11 | 12 | public override int GetHashCode() 13 | { 14 | return TestDetails.TestName.GetHashCode(); 15 | } 16 | } -------------------------------------------------------------------------------- /TUnit.Core/Models/LazyHook.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core; 2 | 3 | internal class LazyHook(Func func) 4 | { 5 | private readonly Lock _lock = new(); 6 | 7 | private Task? _value; 8 | 9 | public Task Value(T1 arg1, T2 arg2) 10 | { 11 | lock (_lock) 12 | { 13 | return _value ??= func(arg1, arg2); 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /TUnit.Core/NotInParallelConstraint.cs: -------------------------------------------------------------------------------- 1 | using TUnit.Core.Interfaces; 2 | 3 | namespace TUnit.Core; 4 | 5 | public record NotInParallelConstraint(IReadOnlyList NotInParallelConstraintKeys) : IParallelConstraint 6 | { 7 | public int Order { get; set; } = int.MaxValue / 2; 8 | } -------------------------------------------------------------------------------- /TUnit.Core/SharedDataKey.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core; 2 | 3 | /// 4 | /// Represents a key for shared data. 5 | /// 6 | /// The key. 7 | /// The type of the data. 8 | public record SharedDataKey(string Key, Type Type); -------------------------------------------------------------------------------- /TUnit.Core/TUnit.Core.targets: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /TUnit.Core/Timing.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core; 2 | 3 | /// 4 | /// Represents the timing information for a test step. 5 | /// 6 | /// The name of the step. 7 | /// The start time of the step. 8 | /// The end time of the step. 9 | public record Timing(string StepName, DateTimeOffset Start, DateTimeOffset End) 10 | { 11 | /// 12 | /// Gets the duration of the step. 13 | /// 14 | public TimeSpan Duration => End - Start; 15 | } -------------------------------------------------------------------------------- /TUnit.Core/UntypedTestDetails.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Core; 2 | 3 | public record UntypedTestDetails(ResettableLazy ResettableLazy) : TestDetails 4 | { 5 | public override object ClassInstance => ResettableLazy.Value; 6 | } -------------------------------------------------------------------------------- /TUnit.Engine.Tests/Attributes/SetDisplayNameWithClassAttribute.cs: -------------------------------------------------------------------------------- 1 | using TUnit.Core.Extensions; 2 | using TUnit.Core.Interfaces; 3 | 4 | namespace TUnit.Engine.Tests.Attributes; 5 | 6 | public class SetDisplayNameWithClassAttribute : Attribute, ITestDiscoveryEventReceiver 7 | { 8 | public void OnTestDiscovery(DiscoveredTestContext discoveredTestContext) 9 | { 10 | discoveredTestContext.SetDisplayName( 11 | $"{discoveredTestContext.TestDetails.TestClass.Name}.{discoveredTestContext.TestContext.GetTestDisplayName()}"); 12 | } 13 | } -------------------------------------------------------------------------------- /TUnit.Engine.Tests/Attributes/SkipNetFrameworkAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Engine.Tests.Attributes; 2 | 3 | public class SkipNetFrameworkAttribute(string reason) : SkipAttribute(reason) 4 | { 5 | private static readonly string NetVersion = Environment.GetEnvironmentVariable("NET_VERSION") ?? "net9.0"; 6 | 7 | public override Task ShouldSkip(BeforeTestContext context) 8 | { 9 | var isNetFramework = NetVersion.StartsWith("net4"); 10 | 11 | return Task.FromResult(isNetFramework); 12 | } 13 | } -------------------------------------------------------------------------------- /TUnit.Engine.Tests/Enums/TestMode.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Engine.Tests.Enums; 2 | 3 | public enum TestMode 4 | { 5 | SourceGenerated, 6 | Reflection, 7 | AOT, 8 | SingleFileApplication, 9 | } -------------------------------------------------------------------------------- /TUnit.Engine.Tests/EnvironmentVariables.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Engine.Tests; 2 | 3 | public class EnvironmentVariables 4 | { 5 | public static readonly string? NetVersion = Environment.GetEnvironmentVariable("NET_VERSION"); 6 | 7 | public static readonly bool IsNetFramework = NetVersion?.StartsWith("net4") == true; 8 | } -------------------------------------------------------------------------------- /TUnit.Engine.Tests/Extensions/FileInfoExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Engine.Tests.Extensions; 2 | 3 | public static class FileInfoExtensions 4 | { 5 | public static FileInfo AssertExists(this FileInfo? fileInfo) 6 | { 7 | if (fileInfo is null || !fileInfo.Exists) 8 | { 9 | throw new FileNotFoundException($"The file {fileInfo?.FullName} does not exist."); 10 | } 11 | 12 | return fileInfo; 13 | } 14 | } -------------------------------------------------------------------------------- /TUnit.Engine.Tests/GlobalHooks.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Engine.Tests; 2 | 3 | public class GlobalHooks 4 | { 5 | [Before(TestSession)] 6 | public static async Task BuildTestProject() 7 | { 8 | await CliWrap.Cli.Wrap("dotnet") 9 | .WithArguments(["build", "-c", "Release"]) 10 | .WithWorkingDirectory(FileSystemHelpers.FindFile(x => x.Name == "TUnit.TestProject.csproj")!.DirectoryName!) 11 | .ExecuteAsync(); 12 | } 13 | } -------------------------------------------------------------------------------- /TUnit.Engine.Tests/GlobalSettings.cs: -------------------------------------------------------------------------------- 1 | using TUnit.Core.Helpers; 2 | using TUnit.Engine.Tests.Attributes; 3 | 4 | [assembly: ParallelLimiter] 5 | [assembly: SetDisplayNameWithClass] 6 | -------------------------------------------------------------------------------- /TUnit.Engine/Capabilities/TrxReportCapability.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Testing.Extensions.TrxReport.Abstractions; 2 | 3 | namespace TUnit.Engine.Capabilities; 4 | 5 | internal class TrxReportCapability : ITrxReportCapability 6 | { 7 | public void Enable() 8 | { 9 | } 10 | 11 | public bool IsSupported => true; 12 | } -------------------------------------------------------------------------------- /TUnit.Engine/Constants/TestAdapterConstants.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Engine.Constants; 2 | 3 | internal static class TestAdapterConstants 4 | { 5 | internal const string ExecutorUriString = "executor://tunit/TestRunner/net"; 6 | internal static readonly Uri ExecutorUri = new(ExecutorUriString); 7 | } -------------------------------------------------------------------------------- /TUnit.Engine/Enums/EngineMode.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Engine.Enums; 2 | 3 | public enum EngineMode 4 | { 5 | SourceGenerated, 6 | Reflection 7 | } -------------------------------------------------------------------------------- /TUnit.Engine/Exceptions/HookFailedException.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Engine.Exceptions; 2 | 3 | public class HookFailedException : TUnitFailedException 4 | { 5 | public HookFailedException(Exception exception) : base(exception) 6 | { 7 | } 8 | 9 | public HookFailedException(string? message, Exception? innerException) : base(message, innerException) 10 | { 11 | } 12 | } -------------------------------------------------------------------------------- /TUnit.Engine/Exceptions/TestFailedException.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Engine.Exceptions; 2 | 3 | public class TestFailedException : TUnitFailedException 4 | { 5 | public TestFailedException(Exception exception) : base(exception) 6 | { 7 | } 8 | 9 | public TestFailedException(string? message, Exception? innerException) : base(message, innerException) 10 | { 11 | } 12 | } -------------------------------------------------------------------------------- /TUnit.Engine/Exceptions/ThrowListener.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | using TUnit.Core.Exceptions; 3 | 4 | namespace TUnit.Engine.Exceptions; 5 | 6 | internal class ThrowListener : TextWriterTraceListener 7 | { 8 | public override void Fail(string? message) 9 | { 10 | throw new TUnitException(message); 11 | } 12 | 13 | public override void Fail(string? message, string? detailMessage) 14 | { 15 | throw new TUnitException($"{message}{Environment.NewLine}{detailMessage}"); 16 | } 17 | } -------------------------------------------------------------------------------- /TUnit.Engine/Extensions/EnumerableExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Engine.Extensions; 2 | 3 | internal static class EnumerableExtensions 4 | { 5 | public static Queue ToQueue(this IEnumerable enumerable) 6 | { 7 | return new Queue(enumerable); 8 | } 9 | } -------------------------------------------------------------------------------- /TUnit.Engine/Extensions/TypeExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Engine.Extensions; 2 | 3 | internal static class TypeExtensions 4 | { 5 | public static IEnumerable GetSelfAndBaseTypes(this Type type) 6 | { 7 | var nullableType = type; 8 | 9 | while (nullableType != null) 10 | { 11 | yield return nullableType; 12 | nullableType = nullableType.BaseType; 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /TUnit.Engine/Framework/ConfigurationAdapter.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Testing.Platform.Configurations; 2 | 3 | namespace TUnit.Engine.Framework; 4 | 5 | internal class ConfigurationAdapter(IConfiguration configuration) : Core.Interfaces.IConfiguration 6 | { 7 | public string? Get(string key) 8 | { 9 | return configuration[key]; 10 | } 11 | } -------------------------------------------------------------------------------- /TUnit.Engine/Framework/IFilterReceiver.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Engine.Framework; 2 | 3 | public interface IFilterReceiver 4 | { 5 | string? Filter { set; } 6 | } -------------------------------------------------------------------------------- /TUnit.Engine/Framework/TestingPlatformBuilderHook.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Testing.Platform.Builder; 2 | using TUnit.Engine.Extensions; 3 | 4 | namespace TUnit.Engine.Framework; 5 | 6 | public static class TestingPlatformBuilderHook 7 | { 8 | public static void AddExtensions( 9 | ITestApplicationBuilder testApplicationBuilder, 10 | string[] _) => 11 | testApplicationBuilder.AddTUnit(); 12 | } -------------------------------------------------------------------------------- /TUnit.Engine/Helpers/NoOpDisposable.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Engine.Helpers; 2 | 3 | internal class NoOpDisposable : IDisposable 4 | { 5 | public static readonly NoOpDisposable Instance = new(); 6 | 7 | private NoOpDisposable() 8 | { 9 | } 10 | 11 | public void Dispose() 12 | { 13 | } 14 | } -------------------------------------------------------------------------------- /TUnit.Engine/Json/ExceptionJson.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Engine.Json; 2 | 3 | public record ExceptionJson 4 | { 5 | public required string? Type { get; init; } 6 | public required string Message { get; init; } 7 | public required string? Stacktrace { get; init; } 8 | public required ExceptionJson? InnerException { get; init; } 9 | } -------------------------------------------------------------------------------- /TUnit.Engine/Json/JsonContext.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using TUnit.Core.Enums; 3 | 4 | namespace TUnit.Engine.Json; 5 | 6 | [JsonSourceGenerationOptions( 7 | WriteIndented = true, 8 | IgnoreReadOnlyProperties = true, 9 | IgnoreReadOnlyFields = true, 10 | Converters = [ typeof(JsonStringEnumConverter) ], 11 | GenerationMode = JsonSourceGenerationMode.Default)] 12 | [JsonSerializable(typeof(TestSessionJson))] 13 | [JsonSerializable(typeof(TestJson))] 14 | internal partial class JsonContext : JsonSerializerContext; -------------------------------------------------------------------------------- /TUnit.Engine/Json/TestAssemblyJson.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Engine.Json; 2 | 3 | public record TestAssemblyJson 4 | { 5 | public required string? AssemblyName { get; init; } 6 | public required TestClassJson[] Classes { get; init; } 7 | } -------------------------------------------------------------------------------- /TUnit.Engine/Json/TestClassJson.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Engine.Json; 2 | 3 | public record TestClassJson 4 | { 5 | public required string? Type { get; init; } 6 | public required TestJson[] Tests { get; init; } 7 | } -------------------------------------------------------------------------------- /TUnit.Engine/Json/TestResultJson.cs: -------------------------------------------------------------------------------- 1 | using TUnit.Core.Enums; 2 | 3 | namespace TUnit.Engine.Json; 4 | 5 | public record TestResultJson 6 | { 7 | public required Status Status { get; init; } 8 | public required DateTimeOffset? Start { get; init; } 9 | public required DateTimeOffset? End { get; init; } 10 | public required TimeSpan? Duration { get; init; } 11 | public required ExceptionJson? Exception { get; init; } 12 | public required string ComputerName { get; init; } 13 | public required string? Output { get; init; } 14 | } -------------------------------------------------------------------------------- /TUnit.Engine/Json/TestSessionJson.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Engine.Json; 2 | 3 | public record TestSessionJson 4 | { 5 | public required TestAssemblyJson[] Assemblies { get; init; } 6 | } -------------------------------------------------------------------------------- /TUnit.Engine/Models/DiscoveredTestExtensions.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Testing.Platform.Extensions.Messages; 2 | using TUnit.Core; 3 | using TUnit.Engine.Extensions; 4 | 5 | namespace TUnit.Engine.Models; 6 | 7 | internal static class DiscoveredTestExtensions 8 | { 9 | public static TestNode ToTestNode(this DiscoveredTest discoveredTest) => discoveredTest.TestContext.ToTestNode(); 10 | } -------------------------------------------------------------------------------- /TUnit.Engine/PolyfillExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Assertions.UnitTests; 2 | 3 | internal static class PolyfillExtensions 4 | { 5 | internal static string ReplaceLineEndings(this string value, string replacement) 6 | { 7 | return value.Replace("\r\n", replacement) 8 | .Replace("\n", replacement) 9 | .Replace("\r", replacement); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /TUnit.Engine/Services/TUnitRunner.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Testing.Platform.Builder; 2 | using TUnit.Engine.Framework; 3 | 4 | namespace TUnit.Engine.Services; 5 | 6 | public static class TUnitRunner 7 | { 8 | public static async Task RunTests(params string[] args) 9 | { 10 | var builder = await TestApplication.CreateBuilderAsync(args); 11 | TestingPlatformBuilderHook.AddExtensions(builder, []); 12 | var app = await builder.BuildAsync(); 13 | return await app.RunAsync(); 14 | } 15 | } -------------------------------------------------------------------------------- /TUnit.Engine/Verify.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | using System.Runtime.CompilerServices; 3 | 4 | namespace TUnit; 5 | 6 | static class Verify 7 | { 8 | internal static void ArgNotNull([NotNull] object? argument, [CallerArgumentExpression(nameof(argument))] string? paramName = null) 9 | { 10 | if (argument is null) 11 | { 12 | throw new ArgumentNullException(paramName); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /TUnit.Example.Asp.Net.TestProject/GlobalSetup.cs: -------------------------------------------------------------------------------- 1 | // Here you could define global logic that would affect all tests 2 | 3 | // You can use attributes at the assembly level to apply to all tests in the assembly 4 | 5 | [assembly: System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -------------------------------------------------------------------------------- /TUnit.Example.Asp.Net/Program.cs: -------------------------------------------------------------------------------- 1 | var builder = WebApplication.CreateBuilder(args); 2 | 3 | builder.Services.AddOpenApi(); 4 | 5 | var app = builder.Build(); 6 | 7 | if (app.Environment.IsDevelopment()) 8 | { 9 | app.MapOpenApi(); 10 | } 11 | 12 | app.UseHttpsRedirection(); 13 | 14 | app.MapGet("/ping", () => "Hello, World!"); 15 | 16 | app.Run(); 17 | 18 | public partial class Program; -------------------------------------------------------------------------------- /TUnit.Example.Asp.Net/TUnit.Example.Asp.Net.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | false 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /TUnit.Example.Asp.Net/TUnit.Example.Asp.Net.http: -------------------------------------------------------------------------------- 1 | @TUnit.Example.Asp.Net_HostAddress = http://localhost:5174 2 | 3 | GET {{TUnit.Example.Asp.Net_HostAddress}}/weatherforecast/ 4 | Accept: application/json 5 | 6 | ### 7 | -------------------------------------------------------------------------------- /TUnit.Example.Asp.Net/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /TUnit.Example.Asp.Net/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /TUnit.Pipeline/EnvironmentVariables.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Pipeline; 2 | 3 | public class EnvironmentVariables 4 | { 5 | public static readonly string? NetVersion = Environment.GetEnvironmentVariable("NET_VERSION"); 6 | 7 | public static readonly bool IsNetFramework = NetVersion?.StartsWith("net4") == true; 8 | } -------------------------------------------------------------------------------- /TUnit.Pipeline/Modules/ProcessorParallelLimit.cs: -------------------------------------------------------------------------------- 1 | using ModularPipelines.Interfaces; 2 | 3 | namespace TUnit.Pipeline.Modules; 4 | 5 | public class ProcessorParallelLimit : IParallelLimit 6 | { 7 | public int Limit { get; } = Environment.ProcessorCount * 4; 8 | } 9 | -------------------------------------------------------------------------------- /TUnit.Pipeline/NuGetOptions.cs: -------------------------------------------------------------------------------- 1 | using ModularPipelines.Attributes; 2 | 3 | namespace TUnit.Pipeline; 4 | 5 | public record NuGetOptions 6 | { 7 | [SecretValue] 8 | public string? ApiKey { get; set; } 9 | 10 | public bool ShouldPublish { get; set; } 11 | } -------------------------------------------------------------------------------- /TUnit.Pipeline/PackedProject.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Pipeline; 2 | 3 | public record PackedProject(string Name, string Version); -------------------------------------------------------------------------------- /TUnit.Playwright/IWorkerService.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Playwright; 2 | 3 | public interface IWorkerService 4 | { 5 | public Task ResetAsync(); 6 | public Task DisposeAsync(); 7 | } 8 | -------------------------------------------------------------------------------- /TUnit.Playwright/PageTest.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Playwright; 2 | using TUnit.Core; 3 | 4 | namespace TUnit.Playwright; 5 | 6 | public class PageTest : ContextTest 7 | { 8 | public IPage Page { get; private set; } = null!; 9 | 10 | [Before(HookType.Test, "", 0)] 11 | public async Task PageSetup() 12 | { 13 | Page = await Context.NewPageAsync().ConfigureAwait(false); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /TUnit.RpcTests/Clients/IProcessHandle.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.RpcTests.Clients; 2 | 3 | public interface IProcessHandle 4 | { 5 | int Id { get; } 6 | 7 | string ProcessName { get; } 8 | 9 | int ExitCode { get; } 10 | 11 | TextWriter StandardInput { get; } 12 | 13 | TextReader StandardOutput { get; } 14 | 15 | void Dispose(); 16 | 17 | void Kill(); 18 | 19 | Task StopAsync(); 20 | 21 | Task WaitForExitAsync(); 22 | 23 | Task WriteInputAsync(string input); 24 | } 25 | -------------------------------------------------------------------------------- /TUnit.RpcTests/Clients/LogsCollector.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Concurrent; 2 | 3 | namespace TUnit.RpcTests.Clients; 4 | 5 | public class LogsCollector : ConcurrentBag; 6 | -------------------------------------------------------------------------------- /TUnit.RpcTests/Clients/TelemetryCollector.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Concurrent; 2 | using TUnit.RpcTests.Models; 3 | 4 | namespace TUnit.RpcTests.Clients; 5 | 6 | public class TelemetryCollector : ConcurrentBag; 7 | -------------------------------------------------------------------------------- /TUnit.RpcTests/Models/AttachDebuggerInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace TUnit.RpcTests.Models; 4 | 5 | public sealed record AttachDebuggerInfo( 6 | [property:JsonPropertyName("processId")] 7 | int ProcessId); 8 | -------------------------------------------------------------------------------- /TUnit.RpcTests/Models/ClientCapabilities.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace TUnit.RpcTests.Models; 4 | 5 | public sealed record ClientCapabilities( 6 | [property: JsonPropertyName("testing")] 7 | ClientTestingCapabilities Testing); -------------------------------------------------------------------------------- /TUnit.RpcTests/Models/ClientInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace TUnit.RpcTests.Models; 4 | 5 | public sealed record ClientInfo( 6 | [property:JsonPropertyName("name")] 7 | string Name, 8 | 9 | [property:JsonPropertyName("version")] 10 | string Version = "1.0.0"); 11 | -------------------------------------------------------------------------------- /TUnit.RpcTests/Models/ClientTestingCapabilities.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace TUnit.RpcTests.Models; 4 | 5 | public sealed record ClientTestingCapabilities( 6 | [property: JsonPropertyName("debuggerProvider")] 7 | bool DebuggerProvider); -------------------------------------------------------------------------------- /TUnit.RpcTests/Models/ConsoleRpcListener.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | 3 | namespace TUnit.RpcTests.Models; 4 | 5 | internal sealed class ConsoleRpcListener : TraceListener 6 | { 7 | public override void Write(string? message) => Console.Write(message ?? string.Empty); 8 | 9 | public override void WriteLine(string? message) => Console.WriteLine(message ?? string.Empty); 10 | } 11 | -------------------------------------------------------------------------------- /TUnit.RpcTests/Models/DiscoveryRequest.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace TUnit.RpcTests.Models; 4 | 5 | public sealed record DiscoveryRequest( 6 | [property:JsonPropertyName("runId")] 7 | Guid RunId); 8 | -------------------------------------------------------------------------------- /TUnit.RpcTests/Models/InitializeRequest.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace TUnit.RpcTests.Models; 4 | 5 | public sealed record InitializeRequest( 6 | [property:JsonPropertyName("processId")] 7 | int ProcessId, 8 | 9 | [property:JsonPropertyName("clientInfo")] 10 | ClientInfo ClientInfo, 11 | 12 | [property:JsonPropertyName("capabilities")] 13 | ClientCapabilities Capabilities); 14 | -------------------------------------------------------------------------------- /TUnit.RpcTests/Models/InitializeResponse.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.RpcTests.Models; 2 | 3 | public sealed record InitializeResponse( 4 | ServerInfo ServerInfo, 5 | ServerCapabilities Capabilities); 6 | -------------------------------------------------------------------------------- /TUnit.RpcTests/Models/LogLevel.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.RpcTests.Models; 2 | 3 | public enum LogLevel 4 | { 5 | Trace = 0, 6 | Debug = 1, 7 | Information = 2, 8 | Warning = 3, 9 | Error = 4, 10 | Critical = 5, 11 | None = 6, 12 | } 13 | -------------------------------------------------------------------------------- /TUnit.RpcTests/Models/RunRequest.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace TUnit.RpcTests.Models; 4 | 5 | public sealed record RunRequest( 6 | [property:JsonPropertyName("runId")] 7 | Guid RunId); 8 | -------------------------------------------------------------------------------- /TUnit.RpcTests/Models/ServerCapabilities.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace TUnit.RpcTests.Models; 4 | 5 | public sealed record ServerCapabilities( 6 | [property: JsonPropertyName("testing")] 7 | ServerTestingCapabilities Testing); -------------------------------------------------------------------------------- /TUnit.RpcTests/Models/ServerInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace TUnit.RpcTests.Models; 4 | 5 | public sealed record ServerInfo( 6 | [property:JsonPropertyName("name")] 7 | string Name, 8 | 9 | [property:JsonPropertyName("version")] 10 | string Version = "1.0.0"); 11 | -------------------------------------------------------------------------------- /TUnit.RpcTests/Models/ServerTestingCapabilities.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace TUnit.RpcTests.Models; 4 | 5 | public sealed record ServerTestingCapabilities( 6 | [property: JsonPropertyName("supportsDiscovery")] 7 | bool SupportsDiscovery, 8 | [property: JsonPropertyName("experimental_multiRequestSupport")] 9 | bool MultiRequestSupport, 10 | [property: JsonPropertyName("vsTestProvider")] 11 | bool VSTestProvider); -------------------------------------------------------------------------------- /TUnit.RpcTests/Models/TelemetryPayload.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace TUnit.RpcTests.Models; 4 | 5 | public record TelemetryPayload 6 | ( 7 | [property: JsonPropertyName(nameof(TelemetryPayload.EventName))] 8 | string EventName, 9 | 10 | [property: JsonPropertyName("metrics")] 11 | IDictionary Metrics); 12 | -------------------------------------------------------------------------------- /TUnit.RpcTests/Models/TestNode.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace TUnit.RpcTests.Models; 4 | 5 | // TODO: complete the object model 6 | public sealed record TestNode 7 | ( 8 | [property: JsonPropertyName("uid")] 9 | string Uid, 10 | 11 | [property: JsonPropertyName("display-name")] 12 | string DisplayName, 13 | 14 | [property: JsonPropertyName("node-type")] 15 | string NodeType, 16 | 17 | [property: JsonPropertyName("execution-state")] 18 | string ExecutionState); 19 | -------------------------------------------------------------------------------- /TUnit.RpcTests/Models/TestNodeStateChangedEventArgs.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace TUnit.RpcTests.Models; 4 | 5 | public record TestNodeStateChangedEventArgs( 6 | [property:JsonPropertyName("runId")] Guid RunId, 7 | [property:JsonPropertyName("changes")] TestNodeUpdate[] Changes 8 | ); -------------------------------------------------------------------------------- /TUnit.RpcTests/Models/TestNodeUpdate.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace TUnit.RpcTests.Models; 4 | 5 | public sealed record TestNodeUpdate 6 | ( 7 | [property: JsonPropertyName("node")] 8 | TestNode Node, 9 | 10 | [property: JsonPropertyName("parent")] 11 | string ParentUid); -------------------------------------------------------------------------------- /TUnit.RpcTests/RpcJsonSerializerOptions.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json; 2 | 3 | namespace TUnit.RpcTests; 4 | 5 | public static class RpcJsonSerializerOptions 6 | { 7 | public static JsonSerializerOptions Default { get; } 8 | 9 | static RpcJsonSerializerOptions() 10 | { 11 | Default = new JsonSerializerOptions 12 | { 13 | PropertyNamingPolicy = JsonNamingPolicy.CamelCase, 14 | PropertyNameCaseInsensitive = true, 15 | }; 16 | } 17 | } -------------------------------------------------------------------------------- /TUnit.Templates.Tests/AspireStarterTemplateTests.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Templates.Tests 2 | { 3 | public class AspireStarterTemplateTests : TemplateTestBase 4 | { 5 | protected override string TemplateShortName { get; set; } = "TUnit.Aspire.Starter"; 6 | 7 | [Test] 8 | public async Task InstantiationTest() 9 | { 10 | await Engine.Execute(Options).ConfigureAwait(false); 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /TUnit.Templates.Tests/AspireTemplateTests.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Templates.Tests 2 | { 3 | public class AspireTemplateTests:TemplateTestBase 4 | { 5 | protected override string TemplateShortName { get; set; } = "TUnit.Aspire.Test"; 6 | 7 | [Test] 8 | public async Task InstantiationTest() 9 | { 10 | await Engine.Execute(Options).ConfigureAwait(false); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /TUnit.Templates.Tests/GlobalUsings.cs: -------------------------------------------------------------------------------- 1 | global using Microsoft.TemplateEngine.Authoring.TemplateVerifier; -------------------------------------------------------------------------------- /TUnit.Templates.Tests/PlaywriteTemplateTests.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Templates.Tests; 2 | 3 | public class PlaywriteTemplateTests : TemplateTestBase 4 | { 5 | protected override string TemplateShortName { get; set; } = "TUnit.Playwright"; 6 | 7 | [Test] 8 | public async Task InstantiationTest() 9 | { 10 | await Engine.Execute(Options).ConfigureAwait(false); 11 | } 12 | } -------------------------------------------------------------------------------- /TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.AspNet._.verified/TUnit.AspNet/TUnit.AspNet/GlobalSetup.cs: -------------------------------------------------------------------------------- 1 | // Here you could define global logic that would affect all tests 2 | 3 | // You can use attributes at the assembly level to apply to all tests in the assembly 4 | [assembly: System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -------------------------------------------------------------------------------- /TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.AspNet._.verified/TUnit.AspNet/TUnit.AspNet/WebApplicationFactory.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc.Testing; 2 | using TUnit.Core.Interfaces; 3 | 4 | namespace TUnit.AspNet; 5 | 6 | public class WebApplicationFactory : WebApplicationFactory, IAsyncInitializer 7 | { 8 | public Task InitializeAsync() 9 | { 10 | _ = Server; 11 | 12 | return Task.CompletedTask; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.AspNet._.verified/TUnit.AspNet/WebApp/Program.cs: -------------------------------------------------------------------------------- 1 | var builder = WebApplication.CreateBuilder(args); 2 | 3 | builder.Services.AddEndpointsApiExplorer(); 4 | 5 | var app = builder.Build(); 6 | 7 | app.UseHttpsRedirection(); 8 | 9 | app.MapGet("/ping", () => "Hello, World!"); 10 | 11 | app.Run(); 12 | 13 | public partial class Program; 14 | -------------------------------------------------------------------------------- /TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.AspNet._.verified/TUnit.AspNet/WebApp/WebApp.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.AspNet._.verified/TUnit.AspNet/WebApp/WebApp.http: -------------------------------------------------------------------------------- 1 | @WebApp_HostAddress = http://localhost:5298 2 | 3 | GET {{WebApp_HostAddress}}/weatherforecast/ 4 | Accept: application/json 5 | 6 | ### 7 | -------------------------------------------------------------------------------- /TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.AspNet._.verified/TUnit.AspNet/WebApp/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.AspNet._.verified/TUnit.AspNet/WebApp/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.ApiService/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.ApiService/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.AppHost/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.AppHost/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning", 6 | "Aspire.Hosting.Dcp": "Warning" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.TestProject/Models/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Aspire.Starter.TestProject.Models 2 | { 3 | record WeatherForecast(DateOnly Date, int TemperatureC, string? Summary) 4 | { 5 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.WebApp/Components/Pages/Home.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | 3 | Home 4 | 5 |

Hello, world!

6 | 7 | Welcome to your new app. 8 | -------------------------------------------------------------------------------- /TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.WebApp/Components/Routes.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.WebApp/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.WebApp/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.WebApp/wwwroot/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomhurst/TUnit/a9411849b3062e1629f841e7e44eeeb487e381b0/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Aspire.Starter._.verified/TUnit.Aspire.Starter/TUnit.Aspire.Starter.WebApp/wwwroot/favicon.png -------------------------------------------------------------------------------- /TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Playwright._.verified/TUnit.Playwright/GlobalSetup.cs: -------------------------------------------------------------------------------- 1 | // Here you could define global logic that would affect all tests 2 | 3 | // You can use attributes at the assembly level to apply to all tests in the assembly 4 | [assembly: System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -------------------------------------------------------------------------------- /TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Playwright._.verified/TUnit.Playwright/Hooks.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | 3 | namespace TUnit.Playwright; 4 | 5 | public class Hooks 6 | { 7 | [Before(TestSession)] 8 | public static void InstallPlaywright() 9 | { 10 | if (Debugger.IsAttached) 11 | { 12 | Environment.SetEnvironmentVariable("PWDEBUG", "1"); 13 | } 14 | 15 | Microsoft.Playwright.Program.Main(["install"]); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Playwright._.verified/TUnit.Playwright/TUnit.Playwright.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | enable 5 | enable 6 | Exe 7 | net8.0 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit._.verified/TUnit/Data/DataGenerator.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.Data; 2 | 3 | public class DataGenerator : DataSourceGeneratorAttribute 4 | { 5 | public override IEnumerable> GenerateDataSources(DataGeneratorMetadata dataGeneratorMetadata) 6 | { 7 | yield return () => (1, 1, 2); 8 | yield return () => (1, 2, 3); 9 | yield return () => (4, 5, 9); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit._.verified/TUnit/TUnit.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | enable 5 | enable 6 | Exe 7 | net8.0 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit._.verified/TUnit/Tests3.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit; 2 | 3 | [ClassDataSource] 4 | [ClassConstructor] 5 | public class AndEvenMoreTests(DataClass dataClass) 6 | { 7 | [Test] 8 | public void HaveFun() 9 | { 10 | Console.WriteLine(dataClass); 11 | Console.WriteLine("For more information, check out the documentation"); 12 | Console.WriteLine("https://tunit.dev/"); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /TUnit.Templates.Tests/Snapshots/InstantiationTestWithFSharp.TUnit.AspNet.FSharp._.verified/TUnit.AspNet.FSharp/TUnit.AspNet.FSharp/GlobalSetup.fs: -------------------------------------------------------------------------------- 1 | namespace TUnit.AspNet.FSharp 2 | 3 | // Here you could define global logic that would affect all tests 4 | 5 | // You can use attributes at the assembly level to apply to all tests in the assembly 6 | [] 7 | do () 8 | -------------------------------------------------------------------------------- /TUnit.Templates.Tests/Snapshots/InstantiationTestWithFSharp.TUnit.AspNet.FSharp._.verified/TUnit.AspNet.FSharp/WebApp/WeatherForecast.fs: -------------------------------------------------------------------------------- 1 | namespace WebApp 2 | 3 | open System 4 | 5 | type WeatherForecast = 6 | { Date: DateTime 7 | TemperatureC: int 8 | Summary: string } 9 | 10 | member this.TemperatureF = 11 | 32.0 + (float this.TemperatureC / 0.5556) 12 | -------------------------------------------------------------------------------- /TUnit.Templates.Tests/Snapshots/InstantiationTestWithFSharp.TUnit.AspNet.FSharp._.verified/TUnit.AspNet.FSharp/WebApp/WebApp.fsproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /TUnit.Templates.Tests/Snapshots/InstantiationTestWithFSharp.TUnit.AspNet.FSharp._.verified/TUnit.AspNet.FSharp/WebApp/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /TUnit.Templates.Tests/Snapshots/InstantiationTestWithFSharp.TUnit.AspNet.FSharp._.verified/TUnit.AspNet.FSharp/WebApp/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /TUnit.Templates.Tests/Snapshots/InstantiationTestWithVB.TUnit.VB._.verified/TUnit.VB/TUnit.VB.vbproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | latest 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /TUnit.Templates/.idea/.idea.TUnit.dir/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Rider ignored files 5 | /modules.xml 6 | /projectSettingsUpdater.xml 7 | /contentModel.xml 8 | /.idea.TUnit.iml 9 | # Editor-based HTTP Client requests 10 | /httpRequests/ 11 | # Datasource local storage ignored files 12 | /dataSources/ 13 | /dataSources.local.xml 14 | -------------------------------------------------------------------------------- /TUnit.Templates/.idea/.idea.TUnit.dir/.idea/.name: -------------------------------------------------------------------------------- 1 | TUnit -------------------------------------------------------------------------------- /TUnit.Templates/.idea/.idea.TUnit.dir/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /TUnit.Templates/.idea/.idea.TUnit.dir/.idea/indexLayout.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /TUnit.Templates/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /TUnit.Templates/Directory.Build.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /TUnit.Templates/Directory.Packages.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | false 4 | 5 | 6 | -------------------------------------------------------------------------------- /TUnit.Templates/README.md: -------------------------------------------------------------------------------- 1 | # TUnit.Templates 2 | 3 | Some templates to help you get started with TUnit! 4 | 5 | For more information, check out the repository at https://www.github.com/thomhurst/TUnit -------------------------------------------------------------------------------- /TUnit.Templates/content/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /TUnit.Templates/content/TUnit.AspNet.FSharp/TestProject/GlobalSetup.fs: -------------------------------------------------------------------------------- 1 | namespace TestProject 2 | 3 | // Here you could define global logic that would affect all tests 4 | 5 | // You can use attributes at the assembly level to apply to all tests in the assembly 6 | [] 7 | do () 8 | -------------------------------------------------------------------------------- /TUnit.Templates/content/TUnit.AspNet.FSharp/TestProject/WebApplicationFactory.fs: -------------------------------------------------------------------------------- 1 | namespace TestProject 2 | 3 | open System.Threading.Tasks 4 | open Microsoft.AspNetCore.Mvc.Testing 5 | open TUnit.Core.Interfaces 6 | 7 | type WebApplicationFactory() = 8 | inherit WebApplicationFactory() 9 | 10 | interface IAsyncInitializer with 11 | member this.InitializeAsync() : Task = 12 | let _ = this.Server 13 | Task.CompletedTask 14 | 15 | 16 | -------------------------------------------------------------------------------- /TUnit.Templates/content/TUnit.AspNet.FSharp/WebApp/WeatherForecast.fs: -------------------------------------------------------------------------------- 1 | namespace WebApp 2 | 3 | open System 4 | 5 | type WeatherForecast = 6 | { Date: DateTime 7 | TemperatureC: int 8 | Summary: string } 9 | 10 | member this.TemperatureF = 11 | 32.0 + (float this.TemperatureC / 0.5556) 12 | -------------------------------------------------------------------------------- /TUnit.Templates/content/TUnit.AspNet.FSharp/WebApp/WebApp.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net9.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /TUnit.Templates/content/TUnit.AspNet.FSharp/WebApp/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /TUnit.Templates/content/TUnit.AspNet.FSharp/WebApp/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /TUnit.Templates/content/TUnit.AspNet/TestProject/GlobalSetup.cs: -------------------------------------------------------------------------------- 1 | // Here you could define global logic that would affect all tests 2 | 3 | // You can use attributes at the assembly level to apply to all tests in the assembly 4 | [assembly: System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -------------------------------------------------------------------------------- /TUnit.Templates/content/TUnit.AspNet/TestProject/WebApplicationFactory.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc.Testing; 2 | using TUnit.Core.Interfaces; 3 | 4 | namespace TestProject; 5 | 6 | public class WebApplicationFactory : WebApplicationFactory, IAsyncInitializer 7 | { 8 | public Task InitializeAsync() 9 | { 10 | _ = Server; 11 | 12 | return Task.CompletedTask; 13 | } 14 | } -------------------------------------------------------------------------------- /TUnit.Templates/content/TUnit.AspNet/WebApp/Program.cs: -------------------------------------------------------------------------------- 1 | var builder = WebApplication.CreateBuilder(args); 2 | 3 | builder.Services.AddEndpointsApiExplorer(); 4 | 5 | var app = builder.Build(); 6 | 7 | app.UseHttpsRedirection(); 8 | 9 | app.MapGet("/ping", () => "Hello, World!"); 10 | 11 | app.Run(); 12 | 13 | public partial class Program; -------------------------------------------------------------------------------- /TUnit.Templates/content/TUnit.AspNet/WebApp/WebApp.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /TUnit.Templates/content/TUnit.AspNet/WebApp/WebApp.http: -------------------------------------------------------------------------------- 1 | @WebApp_HostAddress = http://localhost:5298 2 | 3 | GET {{WebApp_HostAddress}}/weatherforecast/ 4 | Accept: application/json 5 | 6 | ### 7 | -------------------------------------------------------------------------------- /TUnit.Templates/content/TUnit.AspNet/WebApp/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /TUnit.Templates/content/TUnit.AspNet/WebApp/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /TUnit.Templates/content/TUnit.Aspire.Starter/ExampleNamespace.ApiService/ExampleNamespace.ApiService.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /TUnit.Templates/content/TUnit.Aspire.Starter/ExampleNamespace.ApiService/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /TUnit.Templates/content/TUnit.Aspire.Starter/ExampleNamespace.ApiService/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /TUnit.Templates/content/TUnit.Aspire.Starter/ExampleNamespace.AppHost/Program.cs: -------------------------------------------------------------------------------- 1 | var builder = DistributedApplication.CreateBuilder(args); 2 | 3 | var cache = builder.AddRedis("cache"); 4 | 5 | var apiService = builder.AddProject("apiservice"); 6 | 7 | builder.AddProject("webfrontend") 8 | .WithExternalHttpEndpoints() 9 | .WithReference(cache) 10 | .WaitFor(cache) 11 | .WithReference(apiService) 12 | .WaitFor(apiService); 13 | 14 | builder.Build().Run(); 15 | -------------------------------------------------------------------------------- /TUnit.Templates/content/TUnit.Aspire.Starter/ExampleNamespace.AppHost/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /TUnit.Templates/content/TUnit.Aspire.Starter/ExampleNamespace.AppHost/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning", 6 | "Aspire.Hosting.Dcp": "Warning" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /TUnit.Templates/content/TUnit.Aspire.Starter/ExampleNamespace.TestProject/Models/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace ExampleNamespace.TestProject.Models 2 | { 3 | record WeatherForecast(DateOnly Date, int TemperatureC, string? Summary) 4 | { 5 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /TUnit.Templates/content/TUnit.Aspire.Starter/ExampleNamespace.WebApp/Components/Pages/Counter.razor: -------------------------------------------------------------------------------- 1 | @page "/counter" 2 | @rendermode InteractiveServer 3 | 4 | Counter 5 | 6 |

Counter

7 | 8 |

Current count: @currentCount

9 | 10 | 11 | 12 | @code { 13 | private int currentCount = 0; 14 | 15 | private void IncrementCount() 16 | { 17 | currentCount++; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /TUnit.Templates/content/TUnit.Aspire.Starter/ExampleNamespace.WebApp/Components/Pages/Home.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | 3 | Home 4 | 5 |

Hello, world!

6 | 7 | Welcome to your new app. 8 | -------------------------------------------------------------------------------- /TUnit.Templates/content/TUnit.Aspire.Starter/ExampleNamespace.WebApp/Components/Routes.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /TUnit.Templates/content/TUnit.Aspire.Starter/ExampleNamespace.WebApp/Components/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using System.Net.Http.Json 3 | @using Microsoft.AspNetCore.Components.Forms 4 | @using Microsoft.AspNetCore.Components.Routing 5 | @using Microsoft.AspNetCore.Components.Web 6 | @using static Microsoft.AspNetCore.Components.Web.RenderMode 7 | @using Microsoft.AspNetCore.Components.Web.Virtualization 8 | @using Microsoft.AspNetCore.OutputCaching 9 | @using Microsoft.JSInterop 10 | @using WebApp 11 | @using WebApp.Components 12 | -------------------------------------------------------------------------------- /TUnit.Templates/content/TUnit.Aspire.Starter/ExampleNamespace.WebApp/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /TUnit.Templates/content/TUnit.Aspire.Starter/ExampleNamespace.WebApp/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /TUnit.Templates/content/TUnit.Aspire.Starter/ExampleNamespace.WebApp/wwwroot/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomhurst/TUnit/a9411849b3062e1629f841e7e44eeeb487e381b0/TUnit.Templates/content/TUnit.Aspire.Starter/ExampleNamespace.WebApp/wwwroot/favicon.png -------------------------------------------------------------------------------- /TUnit.Templates/content/TUnit.FSharp/Tests3.fs: -------------------------------------------------------------------------------- 1 | namespace TestProject 2 | 3 | open System 4 | open TUnit.Core 5 | 6 | [)>] 7 | [)>] 8 | type AndEvenMoreTests(dataClass: DataClass) = 9 | 10 | [] 11 | member _.HaveFun() = 12 | Console.WriteLine(dataClass) 13 | Console.WriteLine("For more information, check out the documentation") 14 | Console.WriteLine("https://tunit.dev/") 15 | 16 | -------------------------------------------------------------------------------- /TUnit.Templates/content/TUnit.Playwright/GlobalSetup.cs: -------------------------------------------------------------------------------- 1 | // Here you could define global logic that would affect all tests 2 | 3 | // You can use attributes at the assembly level to apply to all tests in the assembly 4 | [assembly: System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] -------------------------------------------------------------------------------- /TUnit.Templates/content/TUnit.Playwright/Hooks.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | 3 | namespace TestProject; 4 | 5 | public class Hooks 6 | { 7 | [Before(TestSession)] 8 | public static void InstallPlaywright() 9 | { 10 | if (Debugger.IsAttached) 11 | { 12 | Environment.SetEnvironmentVariable("PWDEBUG", "1"); 13 | } 14 | 15 | Microsoft.Playwright.Program.Main(["install"]); 16 | } 17 | } -------------------------------------------------------------------------------- /TUnit.Templates/content/TUnit.Playwright/TestProject.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | enable 5 | enable 6 | Exe 7 | net8.0 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /TUnit.Templates/content/TUnit.VB/TestProject.vbproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | latest 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /TUnit.Templates/content/TUnit/Data/DataGenerator.cs: -------------------------------------------------------------------------------- 1 | namespace TestProject.Data; 2 | 3 | public class DataGenerator : DataSourceGeneratorAttribute 4 | { 5 | public override IEnumerable> GenerateDataSources(DataGeneratorMetadata dataGeneratorMetadata) 6 | { 7 | yield return () => (1, 1, 2); 8 | yield return () => (1, 2, 3); 9 | yield return () => (4, 5, 9); 10 | } 11 | } -------------------------------------------------------------------------------- /TUnit.Templates/content/TUnit/TestProject.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | enable 5 | enable 6 | Exe 7 | net8.0 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /TUnit.Templates/content/TUnit/Tests3.cs: -------------------------------------------------------------------------------- 1 | namespace TestProject; 2 | 3 | [ClassDataSource] 4 | [ClassConstructor] 5 | public class AndEvenMoreTests(DataClass dataClass) 6 | { 7 | [Test] 8 | public void HaveFun() 9 | { 10 | Console.WriteLine(dataClass); 11 | Console.WriteLine("For more information, check out the documentation"); 12 | Console.WriteLine("https://tunit.dev/"); 13 | } 14 | } -------------------------------------------------------------------------------- /TUnit.TestProject.FSharp/ClassConstructorTest.fs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject 2 | 3 | open TUnit.Core 4 | 5 | [)>] 6 | type ClassConstructorTest(dummyReferenceTypeClass: DummyReferenceTypeClass) = 7 | 8 | member _.DummyReferenceTypeClass = dummyReferenceTypeClass 9 | 10 | [] 11 | member _.Test() = () 12 | 13 | -------------------------------------------------------------------------------- /TUnit.TestProject.FSharp/DummyReferenceTypeClass.fs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject 2 | 3 | type DummyReferenceTypeClass() = class end 4 | 5 | -------------------------------------------------------------------------------- /TUnit.TestProject.FSharp/Tests.fs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject.FSharp 2 | 3 | open TUnit.Assertions 4 | open TUnit.Assertions.Extensions 5 | open TUnit.Assertions.FSharp.Operations 6 | open TUnit.Core 7 | 8 | type Tests() = 9 | [] 10 | member this.Test() = 11 | printfn "Test method executed" 12 | 13 | #if NETCOREAPP 14 | [] 15 | member this.TestAsync() = async { 16 | let result = 1 + 1 17 | do! check (Assert.That(result).IsPositive()) 18 | } 19 | #endif -------------------------------------------------------------------------------- /TUnit.TestProject.Library/BaseTests.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject.Library; 2 | 3 | public abstract class BaseTests 4 | { 5 | [Test] 6 | public void BaseTest() 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /TUnit.TestProject.Library/Bugs/1889/BaseTests.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject.Library.Bugs._1889; 2 | 3 | public abstract class BaseTest 4 | { 5 | [Test] 6 | public void Test1() 7 | { 8 | } 9 | 10 | [Test] 11 | [MatrixDataSource] 12 | public void Test2(bool condition) 13 | { 14 | } 15 | 16 | [Test] 17 | [Arguments(false)] 18 | [Arguments(true)] 19 | public void Test3(bool condition) 20 | { 21 | } 22 | } -------------------------------------------------------------------------------- /TUnit.TestProject.Library/Bugs/1899/BaseClass.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject.Library.Bugs._1899; 2 | 3 | public abstract class BaseClass 4 | { 5 | private int _value; 6 | 7 | [Before(HookType.Test)] 8 | public void Setup() 9 | { 10 | _value = 99; 11 | } 12 | 13 | [Test] 14 | public void Test1() 15 | { 16 | if (_value != 99) 17 | { 18 | throw new Exception("Setup method was not called"); 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /TUnit.TestProject.Library/Hooks.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject.Library; 2 | 3 | public class Hooks 4 | { 5 | [Before(Test)] 6 | public void BeforeTests(TestContext testContext) 7 | { 8 | testContext.ObjectBag.Add("BeforeHit", true); 9 | } 10 | 11 | [After(Test)] 12 | public void AfterTests(TestContext testContext) 13 | { 14 | testContext.ObjectBag.Add("AfterHit", true); 15 | } 16 | } -------------------------------------------------------------------------------- /TUnit.TestProject.Library/Models/Dummy.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject.Library.Models; 2 | 3 | public record Dummy; -------------------------------------------------------------------------------- /TUnit.TestProject.Library/Models/InitializableClass.cs: -------------------------------------------------------------------------------- 1 | using TUnit.Core.Interfaces; 2 | 3 | namespace TUnit.TestProject.Library.Models; 4 | 5 | public class InitializableClass : IAsyncInitializer 6 | { 7 | public Task InitializeAsync() 8 | { 9 | IsInitialized = true; 10 | return Task.CompletedTask; 11 | } 12 | 13 | public bool IsInitialized { get; private set; } 14 | } -------------------------------------------------------------------------------- /TUnit.TestProject.Library/Models/ParallelLimit3.cs: -------------------------------------------------------------------------------- 1 | using TUnit.Core.Interfaces; 2 | 3 | namespace TUnit.TestProject.Library.Models; 4 | 5 | public class ParallelLimit3 : IParallelLimit 6 | { 7 | public int Limit => 3; 8 | } -------------------------------------------------------------------------------- /TUnit.TestProject.Library/Models/SomeAsyncDisposableClass.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject.Library.Models; 2 | 3 | public class SomeAsyncDisposableClass : IAsyncDisposable 4 | { 5 | public bool IsDisposed { get; private set; } 6 | 7 | public int Value => 1; 8 | 9 | public ValueTask DisposeAsync() 10 | { 11 | IsDisposed = true; 12 | return default; 13 | } 14 | } -------------------------------------------------------------------------------- /TUnit.TestProject.Library/Polyfill/ModuleInitializerAttribute.cs: -------------------------------------------------------------------------------- 1 | // ReSharper disable once CheckNamespace 2 | namespace System.Runtime.CompilerServices; 3 | 4 | [AttributeUsage(AttributeTargets.Method, Inherited = false)] 5 | sealed class ModuleInitializerAttribute : Attribute; -------------------------------------------------------------------------------- /TUnit.TestProject.Library/ProjectReferenceEnum.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject.Library; 2 | 3 | public enum ProjectReferenceEnum 4 | { 5 | Value1, 6 | Value2 7 | } -------------------------------------------------------------------------------- /TUnit.TestProject.VB.NET/ClassConstructorTest.vb: -------------------------------------------------------------------------------- 1 | Imports TUnit.Core 2 | 3 | 4 | Public Class ClassConstructorTest 5 | 6 | Public Sub New(dummyReferenceTypeClass As DummyReferenceTypeClass) 7 | Me.DummyReferenceTypeClass = dummyReferenceTypeClass 8 | End Sub 9 | 10 | Public ReadOnly Property DummyReferenceTypeClass As DummyReferenceTypeClass 11 | 12 | 13 | Public Sub Test() 14 | ' Test logic here 15 | End Sub 16 | 17 | End Class -------------------------------------------------------------------------------- /TUnit.TestProject.VB.NET/DummyReferenceTypeClass.vb: -------------------------------------------------------------------------------- 1 | Public Class DummyReferenceTypeClass 2 | 3 | End Class 4 | -------------------------------------------------------------------------------- /TUnit.TestProject/AbstractTests/AbstractBaseClass.cs: -------------------------------------------------------------------------------- 1 | using TUnit.Assertions; 2 | using TUnit.Assertions.Extensions; 3 | 4 | namespace TUnit.TestProject.AbstractTests; 5 | 6 | public abstract class AbstractBaseClass 7 | { 8 | [Test] 9 | public async Task AssertClassName() 10 | { 11 | var name = GetName(); 12 | 13 | await Assert.That(name).IsEqualTo(GetType().Name, StringComparison.Ordinal); 14 | } 15 | 16 | protected abstract string GetName(); 17 | } -------------------------------------------------------------------------------- /TUnit.TestProject/AbstractTests/ConcreteClass1.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject.AbstractTests; 2 | 3 | [InheritsTests] 4 | public class ConcreteClass1 : AbstractBaseClass 5 | { 6 | protected override string GetName() 7 | { 8 | return "Concrete1"; 9 | } 10 | } -------------------------------------------------------------------------------- /TUnit.TestProject/AbstractTests/ConcreteClass2.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject.AbstractTests; 2 | 3 | [InheritsTests] 4 | public class ConcreteClass2 : ConcreteClass1 5 | { 6 | protected override string GetName() 7 | { 8 | return "ConcreteClass2"; 9 | } 10 | 11 | [Test] 12 | public void SecondTest() 13 | { 14 | // Dummy method 15 | } 16 | } -------------------------------------------------------------------------------- /TUnit.TestProject/ApplicableAttributeTests.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject; 2 | 3 | public class ApplicableAttributeTests 4 | { 5 | [Test, CustomSkip, SomethingElse] 6 | public async Task Test() 7 | { 8 | await Task.CompletedTask; 9 | } 10 | } -------------------------------------------------------------------------------- /TUnit.TestProject/AsyncDisposableTests.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject; 2 | 3 | public class AsyncDisposableTests : IAsyncDisposable 4 | { 5 | [Test] 6 | public void One() 7 | { 8 | 9 | } 10 | 11 | [Test] 12 | public Task Two() 13 | { 14 | return Task.CompletedTask; 15 | } 16 | 17 | [Test] 18 | public async Task Three() 19 | { 20 | await Task.CompletedTask; 21 | } 22 | 23 | public async ValueTask DisposeAsync() 24 | { 25 | await Task.CompletedTask; 26 | } 27 | } -------------------------------------------------------------------------------- /TUnit.TestProject/Attributes/SkipMacOSAttribute.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace TUnit.TestProject.Attributes; 4 | 5 | public class SkipMacOSAttribute(string reason) : SkipAttribute(reason) 6 | { 7 | public override Task ShouldSkip(BeforeTestContext context) 8 | { 9 | return Task.FromResult(RuntimeInformation.IsOSPlatform(OSPlatform.OSX)); 10 | } 11 | } -------------------------------------------------------------------------------- /TUnit.TestProject/Attributes/SkipNetFrameworkAttribute.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace TUnit.TestProject.Attributes; 4 | 5 | public class SkipNetFrameworkAttribute(string reason) : SkipAttribute(reason) 6 | { 7 | public override Task ShouldSkip(BeforeTestContext context) 8 | { 9 | return Task.FromResult(RuntimeInformation.FrameworkDescription.StartsWith(".NET Framework")); 10 | } 11 | } -------------------------------------------------------------------------------- /TUnit.TestProject/AutoDataTests.cs: -------------------------------------------------------------------------------- 1 | using TUnit.TestProject.Attributes; 2 | 3 | namespace TUnit.TestProject; 4 | 5 | public class AutoDataTests 6 | { 7 | [AutoData] 8 | [Test] 9 | public Task Test1(string value1, int value2, double value3, bool value4) 10 | { 11 | return Task.CompletedTask; 12 | } 13 | } -------------------------------------------------------------------------------- /TUnit.TestProject/BasicTests.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject; 2 | 3 | public class BasicTests 4 | { 5 | [Test] 6 | public void SynchronousTest() 7 | { 8 | // Dummy method 9 | } 10 | 11 | [Test] 12 | public async Task AsynchronousTest() 13 | { 14 | await Task.CompletedTask; 15 | } 16 | 17 | [Test] 18 | public async ValueTask ValueTaskAsynchronousTest() 19 | { 20 | await new ValueTask(); 21 | } 22 | } -------------------------------------------------------------------------------- /TUnit.TestProject/Bugs/1410/SharedFixture.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject.Bugs._1410; 2 | 3 | public class SharedFixture : IDisposable 4 | { 5 | public bool IsDisposed { get; private set; } 6 | 7 | public void Dispose() 8 | { 9 | IsDisposed = true; 10 | } 11 | } -------------------------------------------------------------------------------- /TUnit.TestProject/Bugs/1432/EnumMemberNamesTests.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject.Bugs._1432; 2 | 3 | public class EnumMemberNamesTests 4 | { 5 | [Test] 6 | [Arguments(nameof(SomeEnum.A))] 7 | [Arguments(nameof(SomeEnum.B))] 8 | [Arguments(nameof(SomeEnum.C))] 9 | public void SomeTest(string value) 10 | { 11 | } 12 | 13 | public enum SomeEnum 14 | { 15 | A, B, C 16 | } 17 | } -------------------------------------------------------------------------------- /TUnit.TestProject/Bugs/1692/Tests.cs: -------------------------------------------------------------------------------- 1 | using TUnit.Assertions; 2 | using TUnit.Assertions.Extensions; 3 | 4 | namespace TUnit.TestProject.Bugs._1692; 5 | 6 | public class Tests 7 | { 8 | private const string? NullContent = null; 9 | 10 | [Test] 11 | [Arguments(NullContent)] 12 | [Arguments(null)] 13 | public async Task NullTest(string? t) => await Assert.That(t).IsNull(); 14 | } -------------------------------------------------------------------------------- /TUnit.TestProject/Bugs/1889/DerivedTest.cs: -------------------------------------------------------------------------------- 1 | using TUnit.TestProject.Library.Bugs._1889; 2 | 3 | namespace TUnit.TestProject.Bugs._1889; 4 | 5 | [InheritsTests] 6 | public class DerivedTest : BaseTest; -------------------------------------------------------------------------------- /TUnit.TestProject/Bugs/1899/DerivedTest.cs: -------------------------------------------------------------------------------- 1 | using TUnit.TestProject.Library.Bugs._1899; 2 | 3 | namespace TUnit.TestProject.Bugs._1899; 4 | 5 | [InheritsTests] 6 | public class DerivedTest: BaseClass; -------------------------------------------------------------------------------- /TUnit.TestProject/Bugs/2083/Tests.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject.Bugs._2083; 2 | 3 | public class Tests 4 | { 5 | [Test] 6 | [Arguments(0)] 7 | [Arguments(byte.MaxValue)] 8 | [Arguments(short.MaxValue)] 9 | [Arguments(char.MaxValue)] 10 | [Arguments(int.MaxValue)] 11 | [Arguments(long.MaxValue)] 12 | public void MyTest(long value) 13 | { 14 | } 15 | } -------------------------------------------------------------------------------- /TUnit.TestProject/ByteArgumentTests.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject; 2 | 3 | public class ByteArgumentTests 4 | { 5 | [Test] 6 | [Arguments((byte)1)] 7 | public void Normal(byte b) 8 | { 9 | // Dummy method 10 | } 11 | 12 | [Test] 13 | [Arguments((byte)1)] 14 | [Arguments(null)] 15 | public void Nullable(byte? b) 16 | { 17 | // Dummy method 18 | } 19 | } -------------------------------------------------------------------------------- /TUnit.TestProject/ClassConstructorTest.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject; 2 | 3 | [ClassConstructor] 4 | public class ClassConstructorTest(DummyReferenceTypeClass dummyReferenceTypeClass) 5 | { 6 | public DummyReferenceTypeClass DummyReferenceTypeClass { get; } = dummyReferenceTypeClass; 7 | 8 | [Test] 9 | public void Test() 10 | { 11 | } 12 | } -------------------------------------------------------------------------------- /TUnit.TestProject/CommonTestData.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject; 2 | 3 | public static class CommonTestData 4 | { 5 | public static List EnumerableInteger() 6 | { 7 | return [1, 2, 3]; 8 | } 9 | 10 | public static int One() => 1; 11 | public static int Two() => 2; 12 | public static int Three() => 3; 13 | } -------------------------------------------------------------------------------- /TUnit.TestProject/ConsoleTests.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject; 2 | 3 | public class ConsoleTests 4 | { 5 | [Test] 6 | public void Write_Source_Gen_Information() 7 | { 8 | Console.WriteLine(TestContext.Current!.TestDetails.TestMethod); 9 | } 10 | } -------------------------------------------------------------------------------- /TUnit.TestProject/CustomAssertions/ProblemDetailsSourceGenerationContext.cs: -------------------------------------------------------------------------------- 1 | #if NET 2 | using System.Text.Json.Serialization; 3 | 4 | namespace TUnit.TestProject.CustomAssertions; 5 | 6 | [JsonSourceGenerationOptions(WriteIndented = true)] 7 | [JsonSerializable(typeof(ProblemDetails))] 8 | public partial class ProblemDetailsSourceGenerationContext : JsonSerializerContext; 9 | #endif -------------------------------------------------------------------------------- /TUnit.TestProject/CustomFilteringTests.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject; 2 | 3 | public class CustomFilteringTests 4 | { 5 | [Test, Property("one", "yes")] 6 | public async Task Custom_Filter_One() 7 | { 8 | await Task.CompletedTask; 9 | } 10 | 11 | [Test, Property("one", "no")] 12 | public async Task Custom_Filter_Two() 13 | { 14 | await Task.CompletedTask; 15 | } 16 | } -------------------------------------------------------------------------------- /TUnit.TestProject/CustomSkipAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject; 2 | 3 | public class CustomSkipAttribute() : SkipAttribute("Some reason"); -------------------------------------------------------------------------------- /TUnit.TestProject/Data/Blah.txt: -------------------------------------------------------------------------------- 1 | Blah! -------------------------------------------------------------------------------- /TUnit.TestProject/Data/Zip.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomhurst/TUnit/a9411849b3062e1629f841e7e44eeeb487e381b0/TUnit.TestProject/Data/Zip.zip -------------------------------------------------------------------------------- /TUnit.TestProject/DebugAssertFailureTests.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | 3 | namespace TUnit.TestProject; 4 | 5 | public class DebugAssertFailureTests 6 | { 7 | [Test] 8 | public void Test() 9 | { 10 | var @true = "true"; 11 | Trace.Assert(@true is "false", "Some message"); 12 | } 13 | } -------------------------------------------------------------------------------- /TUnit.TestProject/DependsOnAndNotInParallelTests.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject; 2 | 3 | public class DependsOnAndNotInParallelTests 4 | { 5 | [Test, NotInParallel] 6 | public async Task Test1() 7 | { 8 | await Task.Delay(TimeSpan.FromSeconds(5)); 9 | } 10 | 11 | [Test, DependsOn(nameof(Test1))] 12 | public async Task Test2() 13 | { 14 | await Task.CompletedTask; 15 | } 16 | } -------------------------------------------------------------------------------- /TUnit.TestProject/DependsOnTestsWithProceedOnFailure.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject; 2 | 3 | public class DependsOnTestsWithProceedOnFailure 4 | { 5 | [Test] 6 | public void Test1() 7 | { 8 | throw new Exception(); 9 | } 10 | 11 | [Test, DependsOn(nameof(Test1), ProceedOnFailure = true)] 12 | public void Test2() 13 | { 14 | } 15 | } -------------------------------------------------------------------------------- /TUnit.TestProject/DependsOnTestsWithoutProceedOnFailure.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject; 2 | 3 | public class DependsOnTestsWithoutProceedOnFailure 4 | { 5 | [Test] 6 | public void Test1() 7 | { 8 | throw new Exception(); 9 | } 10 | 11 | [Test, DependsOn(nameof(Test1))] 12 | public void Test2() 13 | { 14 | } 15 | } -------------------------------------------------------------------------------- /TUnit.TestProject/DisposableFieldTests.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject; 2 | 3 | public class DisposableFieldTests 4 | { 5 | private Stream? _stream; 6 | 7 | [Before(Test)] 8 | public void Setup() 9 | { 10 | _stream = new MemoryStream(); 11 | } 12 | 13 | [After(Test)] 14 | public void Blah() 15 | { 16 | _stream?.Dispose(); 17 | } 18 | 19 | [Test] 20 | public void Test1() 21 | { 22 | // Dummy method 23 | } 24 | } -------------------------------------------------------------------------------- /TUnit.TestProject/DummyReferenceTypeClass.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject; 2 | 3 | public class DummyReferenceTypeClass; -------------------------------------------------------------------------------- /TUnit.TestProject/DynamicCodeOnlyAttribute.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | 3 | namespace TUnit.TestProject; 4 | 5 | public class DynamicCodeOnlyAttribute() : SkipAttribute("This test is only supported when dynamic code is available") 6 | { 7 | public override Task ShouldSkip(BeforeTestContext context) 8 | { 9 | #if NET 10 | return Task.FromResult(!RuntimeFeature.IsDynamicCodeSupported); 11 | #else 12 | return Task.FromResult(false); 13 | #endif 14 | } 15 | } -------------------------------------------------------------------------------- /TUnit.TestProject/DynamicallyAddedTestsAtRuntimeTests.cs: -------------------------------------------------------------------------------- 1 | #pragma warning disable 2 | namespace TUnit.TestProject; 3 | 4 | public class DynamicallyAddedTestsAtRuntimeTests 5 | { 6 | private static int _testRepeatLimit = 0; 7 | 8 | [Test] 9 | [Arguments(1)] 10 | public void Failure(int i) 11 | { 12 | throw new Exception($"Random reason: {i}"); 13 | } 14 | 15 | [After(Test)] 16 | public void CreateRepeatTestIfFailure(TestContext context) 17 | { 18 | // TODO 19 | } 20 | } -------------------------------------------------------------------------------- /TUnit.TestProject/EnumTests.cs: -------------------------------------------------------------------------------- 1 | using TUnit.TestProject.Attributes; 2 | using TUnit.TestProject.Enums; 3 | 4 | namespace TUnit.TestProject; 5 | 6 | public class EnumTests 7 | { 8 | [EnumGenerator] 9 | [Test] 10 | public void Test(PriorityLevel priorityLevel) 11 | { 12 | } 13 | } -------------------------------------------------------------------------------- /TUnit.TestProject/Enums/PriorityLevel.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject.Enums; 2 | 3 | public enum PriorityLevel 4 | { 5 | Low, 6 | Medium, 7 | High 8 | } -------------------------------------------------------------------------------- /TUnit.TestProject/ExperimentalTests.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | 3 | namespace TUnit.TestProject; 4 | 5 | public class ExperimentalTests 6 | { 7 | [Experimental("Blah")] 8 | [Test] 9 | public void SynchronousTest() 10 | { 11 | // Dummy method 12 | } 13 | 14 | [Experimental("Blah")] 15 | [Test] 16 | public async Task AsynchronousTest() 17 | { 18 | await Task.CompletedTask; 19 | } 20 | } -------------------------------------------------------------------------------- /TUnit.TestProject/ExplicitTests.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject; 2 | 3 | [Explicit] 4 | public class ExplicitTests 5 | { 6 | [Test] 7 | public void MyExplicitTest() 8 | { 9 | 10 | } 11 | 12 | [Test] 13 | public void MyExplicitTest2() 14 | { 15 | 16 | } 17 | } -------------------------------------------------------------------------------- /TUnit.TestProject/ExternalEnumArgumentTest.cs: -------------------------------------------------------------------------------- 1 | using Polly.CircuitBreaker; 2 | 3 | namespace TUnit.TestProject; 4 | 5 | public class ExternalEnumArgumentTest 6 | { 7 | [Test] 8 | [Arguments(CircuitState.Closed)] 9 | public void MyTest(CircuitState value) 10 | { 11 | } 12 | } -------------------------------------------------------------------------------- /TUnit.TestProject/FailedInitializationTests.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject; 2 | 3 | public class FailedInitializationTests 4 | { 5 | [Test] 6 | [MethodDataSource(nameof(Data))] 7 | public void FailingDataSource(int value) 8 | { 9 | } 10 | 11 | public static int Data() => throw new Exception(); 12 | } -------------------------------------------------------------------------------- /TUnit.TestProject/FailedInitializationTests2.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | 3 | namespace TUnit.TestProject; 4 | 5 | [UnconditionalSuppressMessage("Usage", "TUnit0033:Conflicting DependsOn attributes")] 6 | public class FailedInitializationTests2 7 | { 8 | [Test] 9 | [DependsOn(nameof(Test2))] 10 | public void Test() 11 | { 12 | } 13 | 14 | [Test] 15 | [DependsOn(nameof(Test))] 16 | public void Test2() 17 | { 18 | } 19 | } -------------------------------------------------------------------------------- /TUnit.TestProject/GenericHooks.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject; 2 | 3 | [Arguments(1)] 4 | [Arguments("Hello")] 5 | public class GenericHooks(T arg) 6 | { 7 | [Before(HookType.Test)] 8 | public void Before() 9 | { 10 | Console.WriteLine(arg); 11 | } 12 | 13 | [After(HookType.Test)] 14 | public void After() 15 | { 16 | Console.WriteLine(arg); 17 | } 18 | 19 | [Test] 20 | public void Test() 21 | { 22 | Console.WriteLine(arg); 23 | } 24 | } -------------------------------------------------------------------------------- /TUnit.TestProject/GlobalSetUpCleanUp.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject; 2 | 3 | public static class GlobalSetUpCleanUp 4 | { 5 | [Before(Assembly)] 6 | public static void BlahSetUp() 7 | { 8 | // Dummy method 9 | } 10 | 11 | [Before(Assembly)] 12 | public static void BlahSetUp2() 13 | { 14 | // Dummy method 15 | } 16 | 17 | [After(Assembly)] 18 | public static Task BlahCleanUp() 19 | { 20 | return Task.CompletedTask; 21 | } 22 | } -------------------------------------------------------------------------------- /TUnit.TestProject/GlobalUsings.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomhurst/TUnit/a9411849b3062e1629f841e7e44eeeb487e381b0/TUnit.TestProject/GlobalUsings.cs -------------------------------------------------------------------------------- /TUnit.TestProject/IDisposableTests.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject; 2 | 3 | public class DisposableTests : IDisposable 4 | { 5 | [Test] 6 | public void One() 7 | { 8 | 9 | } 10 | 11 | [Test] 12 | public Task Two() 13 | { 14 | return Task.CompletedTask; 15 | } 16 | 17 | [Test] 18 | public async Task Three() 19 | { 20 | await Task.CompletedTask; 21 | } 22 | 23 | public void Dispose() 24 | { 25 | 26 | } 27 | } -------------------------------------------------------------------------------- /TUnit.TestProject/InheritedPropertySetterTests.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject; 2 | 3 | [InheritsTests] 4 | public class InheritedPropertySetterTests : PropertySetterTests; -------------------------------------------------------------------------------- /TUnit.TestProject/InstanceData.cs: -------------------------------------------------------------------------------- 1 | using TUnit.Assertions; 2 | using TUnit.Assertions.Extensions; 3 | 4 | namespace TUnit.TestProject; 5 | 6 | public class InstanceData 7 | { 8 | private int _value; 9 | 10 | [Test] 11 | public void Test() 12 | { 13 | #pragma warning disable TUnit0018 14 | _value = 99; 15 | #pragma warning restore TUnit0018 16 | } 17 | 18 | [Test] 19 | public async Task Test2() 20 | { 21 | await Assert.That(_value).IsEqualTo(99); 22 | } 23 | } -------------------------------------------------------------------------------- /TUnit.TestProject/LongFailures.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject; 2 | 3 | [Category("LongFailures")] 4 | public class LongFailures 5 | { 6 | private static int _counter; 7 | 8 | [Repeat(100)] 9 | [Test] 10 | public async Task LongFailure() 11 | { 12 | await Task.Delay(TimeSpan.FromSeconds(Interlocked.Increment(ref _counter))); 13 | throw new Exception(); 14 | } 15 | } -------------------------------------------------------------------------------- /TUnit.TestProject/MyTests.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject; 2 | 3 | public class MyTests; -------------------------------------------------------------------------------- /TUnit.TestProject/NameOfArgumentTests.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject; 2 | 3 | public class NameOfArgumentTests 4 | { 5 | [Test] 6 | [Arguments(nameof(TestName))] 7 | public void TestName(string name) 8 | { 9 | // Dummy method 10 | } 11 | } -------------------------------------------------------------------------------- /TUnit.TestProject/NullableByteArgumentTests.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject; 2 | 3 | public class NullableByteArgumentTests 4 | { 5 | [Test] 6 | [Arguments((byte)1)] 7 | [Arguments(null)] 8 | public void Test(byte? someByte) 9 | { 10 | } 11 | 12 | [Test] 13 | [Arguments((byte)1, (byte)1)] 14 | [Arguments((byte)1, null)] 15 | public void Test2(byte byte1, byte? byte2) 16 | { 17 | } 18 | } -------------------------------------------------------------------------------- /TUnit.TestProject/OneTimeCleanUpWithBaseTests/Base1.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject.OneTimeCleanUpWithBaseTests; 2 | 3 | public class Base1 : Base2 4 | { 5 | [After(Class)] 6 | public static Task Base1AfterAllTestsInClass() 7 | { 8 | return Task.CompletedTask; 9 | } 10 | 11 | [After(Test)] 12 | public Task Base1CleanUp() 13 | { 14 | return Task.CompletedTask; 15 | } 16 | } -------------------------------------------------------------------------------- /TUnit.TestProject/OneTimeCleanUpWithBaseTests/Base2.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject.OneTimeCleanUpWithBaseTests; 2 | 3 | public class Base2 4 | { 5 | [After(Class)] 6 | public static Task Base2AfterAllTestsInClass() 7 | { 8 | return Task.CompletedTask; 9 | } 10 | 11 | [After(Test)] 12 | public Task Base2CleanUp() 13 | { 14 | return Task.CompletedTask; 15 | } 16 | } -------------------------------------------------------------------------------- /TUnit.TestProject/OneTimeCleanUpWithBaseTests/NonBase.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject.OneTimeCleanUpWithBaseTests; 2 | 3 | public class NonBase : Base1 4 | { 5 | [After(Class)] 6 | public static Task NonBaseAfterAllTestsInClass() 7 | { 8 | return Task.CompletedTask; 9 | } 10 | 11 | [After(HookType.Test)] 12 | public Task NonBaseCleanUp() 13 | { 14 | return Task.CompletedTask; 15 | } 16 | 17 | [Test] 18 | public void Test() 19 | { 20 | // Dummy method 21 | } 22 | } -------------------------------------------------------------------------------- /TUnit.TestProject/OneTimeSetUpWithBaseTests/Base1.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject.OneTimeSetUpWithBaseTests; 2 | 3 | public class Base1 : Base2 4 | { 5 | [Before(Class)] 6 | public static Task Base1OneTimeSetup() 7 | { 8 | return Task.CompletedTask; 9 | } 10 | 11 | [Before(Test)] 12 | public Task Base1SetUp() 13 | { 14 | return Task.CompletedTask; 15 | } 16 | } -------------------------------------------------------------------------------- /TUnit.TestProject/OneTimeSetUpWithBaseTests/Base2.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject.OneTimeSetUpWithBaseTests; 2 | 3 | public class Base2 4 | { 5 | [Before(Class)] 6 | public static Task Base2OneTimeSetup() 7 | { 8 | return Task.CompletedTask; 9 | } 10 | 11 | [Before(Test)] 12 | public Task Base2SetUp() 13 | { 14 | return Task.CompletedTask; 15 | } 16 | } -------------------------------------------------------------------------------- /TUnit.TestProject/OneTimeSetUpWithBaseTests/NonBase.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject.OneTimeSetUpWithBaseTests; 2 | 3 | public class NonBase : Base1 4 | { 5 | [Before(Class)] 6 | public static Task NonBaseOneTimeSetup() 7 | { 8 | return Task.CompletedTask; 9 | } 10 | 11 | [Before(HookType.Test)] 12 | public Task NonBaseSetUp() 13 | { 14 | return Task.CompletedTask; 15 | } 16 | 17 | [Test] 18 | public void Test() 19 | { 20 | // Dummy method 21 | } 22 | } -------------------------------------------------------------------------------- /TUnit.TestProject/OptionalArgumentsTests.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject; 2 | 3 | public class OptionalArgumentsTests 4 | { 5 | [Test] 6 | [Arguments(1)] 7 | public void Test(int value, bool flag = true) 8 | { 9 | // Dummy Method 10 | } 11 | } -------------------------------------------------------------------------------- /TUnit.TestProject/RepeatTests.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject; 2 | 3 | [Repeat(3)] 4 | public class RepeatTests 5 | { 6 | [Test] 7 | [Repeat(1)] 8 | public void One() 9 | { 10 | // Dummy method 11 | } 12 | 13 | [Test] 14 | [Repeat(2)] 15 | public void Two() 16 | { 17 | // Dummy method 18 | } 19 | 20 | [Test] 21 | public void Three() 22 | { 23 | // Dummy method 24 | } 25 | } -------------------------------------------------------------------------------- /TUnit.TestProject/SkipTests.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject; 2 | 3 | public class SkipTests : SkipDummyHooks 4 | { 5 | [Test] 6 | [Skip("Just because.")] 7 | public void SkippedTest() 8 | { 9 | } 10 | } 11 | 12 | public class SkipDummyHooks 13 | { 14 | public string? _dummy; 15 | 16 | [Before(Test)] 17 | public void SetUp() 18 | { 19 | } 20 | 21 | [After(Test)] 22 | public void TearDown() 23 | { 24 | } 25 | } -------------------------------------------------------------------------------- /TUnit.TestProject/SomethingElseAttribute.cs: -------------------------------------------------------------------------------- 1 | using TUnit.Core.Interfaces; 2 | 3 | namespace TUnit.TestProject; 4 | 5 | public class SomethingElseAttribute : Attribute, ITestStartEventReceiver 6 | { 7 | public ValueTask OnTestStart(BeforeTestContext beforeTestContext) 8 | { 9 | return default; 10 | } 11 | 12 | public int Order => 0; 13 | } -------------------------------------------------------------------------------- /TUnit.TestProject/TestArtifactTests.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject; 2 | 3 | public class TestArtifactTests 4 | { 5 | [Test] 6 | public void Artifact_Test() 7 | { 8 | TestContext.Current!.AddArtifact(new Artifact 9 | { 10 | File = new FileInfo("Data/Zip.zip"), 11 | DisplayName = "Blah!" 12 | }); 13 | } 14 | } -------------------------------------------------------------------------------- /TUnit.TestProject/TestData.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject; 2 | 3 | public class TestData 4 | { 5 | public static string Foo() => "foo"; 6 | } -------------------------------------------------------------------------------- /TUnit.TestProject/TestDataSources.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject; 2 | 3 | public class TestDataSources 4 | { 5 | public static int One() => 1; 6 | public static int Two() => 2; 7 | 8 | public static int[] OneEnumerable() => [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; 9 | public static int[] OneFailingEnumerable() => [1, 2, 3, 4, 5, 6, 7, 8, 9]; 10 | 11 | } -------------------------------------------------------------------------------- /TUnit.TestProject/TestDiscoveryHookTests.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject; 2 | 3 | public class TestDiscoveryHookTests 4 | { 5 | [BeforeEvery(TestDiscovery, Order = 5)] 6 | public static void BeforeDiscovery() 7 | { 8 | } 9 | 10 | [AfterEvery(TestDiscovery)] 11 | public static void AfterDiscovery() 12 | { 13 | } 14 | } -------------------------------------------------------------------------------- /TUnit.TestProject/TestEnum.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject; 2 | 3 | public enum TestEnum 4 | { 5 | One, 6 | Two 7 | } -------------------------------------------------------------------------------- /TUnit.TestProject/TestEnum2.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject; 2 | 3 | public enum TestEnum2 4 | { 5 | One, 6 | Two 7 | } -------------------------------------------------------------------------------- /TUnit.TestProject/TupleDataSourceDrivenTests.cs: -------------------------------------------------------------------------------- 1 | namespace TUnit.TestProject; 2 | 3 | public class TupleDataSourceDrivenTests 4 | { 5 | [Test] 6 | [MethodDataSource(nameof(TupleMethod))] 7 | public void DataSource_TupleMethod(int value, string value2, bool value3) 8 | { 9 | // Dummy method 10 | } 11 | 12 | public static (int, string, bool) TupleMethod() => (1, "String", true); 13 | } -------------------------------------------------------------------------------- /TUnit.TestProject/testconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "MyKey1": "MyValue1", 3 | "Nested": { 4 | "MyKey2": "MyValue2" 5 | } 6 | } -------------------------------------------------------------------------------- /TUnit.UnitTests/Extensions/ReflectionExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | 3 | namespace TUnit.UnitTests.Extensions; 4 | 5 | public static class ReflectionExtensions 6 | { 7 | public static FieldInfo? GetBackingField(this PropertyInfo propertyInfo) 8 | { 9 | return propertyInfo.DeclaringType!.GetField($"<{propertyInfo.Name}>k__BackingField", BindingFlags.Instance | BindingFlags.NonPublic); 10 | } 11 | } -------------------------------------------------------------------------------- /TUnit.UnitTests/GlobalUsings.cs: -------------------------------------------------------------------------------- 1 | global using Assert = TUnit.Assertions.Assert; 2 | global using TestAttribute = TUnit.Core.TestAttribute; -------------------------------------------------------------------------------- /TUnit/TUnit.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /TUnit/TUnit.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | latest 6 | 7 | 8 | -------------------------------------------------------------------------------- /assets/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomhurst/TUnit/a9411849b3062e1629f841e7e44eeeb487e381b0/assets/banner.png -------------------------------------------------------------------------------- /assets/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomhurst/TUnit/a9411849b3062e1629f841e7e44eeeb487e381b0/assets/logo.jpg -------------------------------------------------------------------------------- /clean.ps1: -------------------------------------------------------------------------------- 1 | Get-ChildItem .\ -include bin,obj -Recurse | foreach ($_) { remove-item $_.fullname -Force -Recurse } 2 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | # Dependencies 2 | /node_modules 3 | 4 | # Production 5 | /build 6 | 7 | # Generated files 8 | .docusaurus 9 | .cache-loader 10 | 11 | # Misc 12 | .DS_Store 13 | .env.local 14 | .env.development.local 15 | .env.test.local 16 | .env.production.local 17 | 18 | npm-debug.log* 19 | yarn-debug.log* 20 | yarn-error.log* 21 | -------------------------------------------------------------------------------- /docs/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [require.resolve('@docusaurus/core/lib/babel/preset')], 3 | }; 4 | -------------------------------------------------------------------------------- /docs/docs/comparison/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Test Framework Comparisons", 3 | "position": 5, 4 | "link": { 5 | "type": "generated-index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /docs/docs/customization-extensibility/libraries.md: -------------------------------------------------------------------------------- 1 | # Libraries 2 | 3 | If you want a library package to define things like re-useable base classes with hooks etc, then you shouldn't use the main `TUnit` package - As this assumes your project is a test project and tries to build it as an executable etc. 4 | 5 | Instead, reference `TUnit.Core` instead - It has all of the models required for wiring up your tests, but without all the extra setting up of the test suite execition. 6 | -------------------------------------------------------------------------------- /docs/docs/examples/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Examples", 3 | "position": 6, 4 | "link": { 5 | "type": "generated-index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /docs/docs/examples/intro.md: -------------------------------------------------------------------------------- 1 | # Examples 2 | 3 | This can serve as a place to show how to use TUnit to test more complex systems, utilising advanced features like ClassData sources with IAsyncInitializers and IAsyncDisposables, or utilising test events to drive things. 4 | 5 | As tests come in all shapes and sizes, this is a good place for community contributions. If you have a good example for showing other users how to setup a specific testing scenario, then please submit a pull request with code examples. 6 | -------------------------------------------------------------------------------- /docs/docs/experimental/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Experimental", 3 | "position": 7, 4 | "link": { 5 | "type": "generated-index", 6 | "description": "Documentation for Experimental Features." 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /docs/docs/extensions/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Extensions", 3 | "position": 5, 4 | "link": { 5 | "type": "generated-index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /docs/docs/getting-started/congratulations.md: -------------------------------------------------------------------------------- 1 | # Congratulations! 2 | 3 | You have just learned the basics of writing a test in TUnit. 4 | 5 | Keep reading if you'd like to know more on assertions, or more advanced features such as test setups and cleanups. 6 | -------------------------------------------------------------------------------- /docs/docs/migration/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Migration", 3 | "position": 5, 4 | "link": { 5 | "type": "generated-index", 6 | "description": "How to migrate from xUnit." 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /docs/src/components/HomepageFeatures/styles.module.css: -------------------------------------------------------------------------------- 1 | .features { 2 | display: flex; 3 | align-items: center; 4 | padding: 2rem 0; 5 | width: 100%; 6 | } 7 | 8 | .featureSvg { 9 | height: 200px; 10 | width: 200px; 11 | fill: #333; 12 | } 13 | -------------------------------------------------------------------------------- /docs/src/pages/index.module.css: -------------------------------------------------------------------------------- 1 | /** 2 | * CSS files with the .module.css suffix will be treated as CSS modules 3 | * and scoped locally. 4 | */ 5 | 6 | .heroBanner { 7 | padding: 4rem 0; 8 | text-align: center; 9 | position: relative; 10 | overflow: hidden; 11 | } 12 | 13 | @media screen and (max-width: 996px) { 14 | .heroBanner { 15 | padding: 2rem; 16 | } 17 | } 18 | 19 | .buttons { 20 | display: flex; 21 | align-items: center; 22 | justify-content: center; 23 | } 24 | -------------------------------------------------------------------------------- /docs/src/pages/markdown-page.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Markdown page example 3 | --- 4 | 5 | # Markdown page example 6 | 7 | You don't need React to write simple standalone pages. 8 | 9 | -------------------------------------------------------------------------------- /docs/static/.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomhurst/TUnit/a9411849b3062e1629f841e7e44eeeb487e381b0/docs/static/.nojekyll -------------------------------------------------------------------------------- /docs/static/CNAME: -------------------------------------------------------------------------------- 1 | tunit.dev -------------------------------------------------------------------------------- /docs/static/img/docusaurus-social-card.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomhurst/TUnit/a9411849b3062e1629f841e7e44eeeb487e381b0/docs/static/img/docusaurus-social-card.jpg -------------------------------------------------------------------------------- /docs/static/img/docusaurus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomhurst/TUnit/a9411849b3062e1629f841e7e44eeeb487e381b0/docs/static/img/docusaurus.png -------------------------------------------------------------------------------- /docs/static/img/fast.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/static/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomhurst/TUnit/a9411849b3062e1629f841e7e44eeeb487e381b0/docs/static/img/favicon.ico -------------------------------------------------------------------------------- /docs/static/img/flexible.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/static/img/lab.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/static/img/rider.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomhurst/TUnit/a9411849b3062e1629f841e7e44eeeb487e381b0/docs/static/img/rider.png -------------------------------------------------------------------------------- /docs/static/img/visual-studio-code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomhurst/TUnit/a9411849b3062e1629f841e7e44eeeb487e381b0/docs/static/img/visual-studio-code.png -------------------------------------------------------------------------------- /docs/static/img/visual-studio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomhurst/TUnit/a9411849b3062e1629f841e7e44eeeb487e381b0/docs/static/img/visual-studio.png -------------------------------------------------------------------------------- /docs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | // This file is not used in compilation. It is here just for a nice editor experience. 3 | "extends": "@docusaurus/tsconfig", 4 | "compilerOptions": { 5 | "baseUrl": "." 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "ignorePaths": [ 4 | "**/node_modules/**", 5 | "**/bower_components/**", 6 | "**/Snapshots/**" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /rider.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomhurst/TUnit/a9411849b3062e1629f841e7e44eeeb487e381b0/rider.png -------------------------------------------------------------------------------- /strongname.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomhurst/TUnit/a9411849b3062e1629f841e7e44eeeb487e381b0/strongname.snk -------------------------------------------------------------------------------- /tools/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tools/Directory.Build.targets: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tools/speed-comparison/.idea/.idea.TestProjects/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Rider ignored files 5 | /projectSettingsUpdater.xml 6 | /.idea.TestProjects.iml 7 | /contentModel.xml 8 | /modules.xml 9 | # Editor-based HTTP Client requests 10 | /httpRequests/ 11 | # Datasource local storage ignored files 12 | /dataSources/ 13 | /dataSources.local.xml 14 | -------------------------------------------------------------------------------- /tools/speed-comparison/.idea/.idea.TestProjects/.idea/.name: -------------------------------------------------------------------------------- 1 | TestProjects -------------------------------------------------------------------------------- /tools/speed-comparison/.idea/.idea.TestProjects/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /tools/speed-comparison/.idea/.idea.TestProjects/.idea/indexLayout.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /tools/speed-comparison/.idea/.idea.TestProjects/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /tools/speed-comparison/MSTestTimer/.idea/.idea.MSTestTimer/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Rider ignored files 5 | /contentModel.xml 6 | /projectSettingsUpdater.xml 7 | /modules.xml 8 | /.idea.MSTestTimer.iml 9 | # Editor-based HTTP Client requests 10 | /httpRequests/ 11 | # Datasource local storage ignored files 12 | /dataSources/ 13 | /dataSources.local.xml 14 | -------------------------------------------------------------------------------- /tools/speed-comparison/MSTestTimer/.idea/.idea.MSTestTimer/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /tools/speed-comparison/MSTestTimer/MSTestTimer/BasicTest.cs: -------------------------------------------------------------------------------- 1 | namespace MSTestTimer; 2 | 3 | public class BasicTest 4 | { 5 | [TestMethod] 6 | public void Test() 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /tools/speed-comparison/MSTestTimer/MSTestTimer/GlobalUsings.cs: -------------------------------------------------------------------------------- 1 | global using Microsoft.VisualStudio.TestTools.UnitTesting; -------------------------------------------------------------------------------- /tools/speed-comparison/MSTestTimer/MSTestTimer/RepeatTests.cs: -------------------------------------------------------------------------------- 1 | namespace MSTestTimer; 2 | 3 | [TestClass] 4 | public class RepeatTests 5 | { 6 | [TestMethod] 7 | [DynamicData(nameof(Repeat), DynamicDataSourceType.Method)] 8 | public async Task TestMethod1(int _) 9 | { 10 | await Task.Delay(50); 11 | } 12 | 13 | public static IEnumerable Repeat() 14 | { 15 | return Enumerable.Range(0, 100).Select(i => (object[])[i]); 16 | } 17 | } -------------------------------------------------------------------------------- /tools/speed-comparison/NUnitTimer/.idea/.idea.NUnitTimer/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Rider ignored files 5 | /.idea.NUnitTimer.iml 6 | /modules.xml 7 | /contentModel.xml 8 | /projectSettingsUpdater.xml 9 | # Editor-based HTTP Client requests 10 | /httpRequests/ 11 | # Datasource local storage ignored files 12 | /dataSources/ 13 | /dataSources.local.xml 14 | -------------------------------------------------------------------------------- /tools/speed-comparison/NUnitTimer/.idea/.idea.NUnitTimer/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /tools/speed-comparison/NUnitTimer/NUnitTimer/BasicTest.cs: -------------------------------------------------------------------------------- 1 | namespace NUnitTimer; 2 | 3 | public class BasicTest 4 | { 5 | [Test] 6 | public void Test() 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /tools/speed-comparison/NUnitTimer/NUnitTimer/GlobalUsings.cs: -------------------------------------------------------------------------------- 1 | global using NUnit.Framework; -------------------------------------------------------------------------------- /tools/speed-comparison/NUnitTimer/NUnitTimer/RepeatTests.cs: -------------------------------------------------------------------------------- 1 | namespace NUnitTimer; 2 | 3 | [Parallelizable(ParallelScope.All)] 4 | public class RepeatTests 5 | { 6 | [Test, Repeat(100)] 7 | public async Task Test1() 8 | { 9 | await Task.Delay(50); 10 | } 11 | } -------------------------------------------------------------------------------- /tools/speed-comparison/TUnitTimer/.idea/.idea.TUnitTimer/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Rider ignored files 5 | /projectSettingsUpdater.xml 6 | /contentModel.xml 7 | /.idea.TUnitTimer.iml 8 | /modules.xml 9 | # Editor-based HTTP Client requests 10 | /httpRequests/ 11 | # Datasource local storage ignored files 12 | /dataSources/ 13 | /dataSources.local.xml 14 | -------------------------------------------------------------------------------- /tools/speed-comparison/TUnitTimer/.idea/.idea.TUnitTimer/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /tools/speed-comparison/TUnitTimer/TUnitTimer/BasicTest.cs: -------------------------------------------------------------------------------- 1 | namespace TUnitTimer; 2 | 3 | public class BasicTest 4 | { 5 | [Test] 6 | public void Test() 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /tools/speed-comparison/TUnitTimer/TUnitTimer/GlobalUsings.cs: -------------------------------------------------------------------------------- 1 | global using TUnit.Core; -------------------------------------------------------------------------------- /tools/speed-comparison/TUnitTimer/TUnitTimer/RepeatTests.cs: -------------------------------------------------------------------------------- 1 | namespace TUnitTimer; 2 | 3 | public class RepeatTests 4 | { 5 | [Test, Repeat(99)] 6 | public async Task Test1() 7 | { 8 | await Task.Delay(50); 9 | } 10 | } -------------------------------------------------------------------------------- /tools/speed-comparison/Tests.Benchmark/Tests.Benchmark.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0;net9.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /tools/speed-comparison/xUnitTimer/.idea/.idea.xUnitTimer/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Rider ignored files 5 | /contentModel.xml 6 | /projectSettingsUpdater.xml 7 | /.idea.xUnitTimer.iml 8 | /modules.xml 9 | # Editor-based HTTP Client requests 10 | /httpRequests/ 11 | # Datasource local storage ignored files 12 | /dataSources/ 13 | /dataSources.local.xml 14 | -------------------------------------------------------------------------------- /tools/speed-comparison/xUnitTimer/.idea/.idea.xUnitTimer/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /tools/speed-comparison/xUnitTimer/xUnitTimer/BasicTest.cs: -------------------------------------------------------------------------------- 1 | namespace xUnitTimer; 2 | 3 | public class BasicTest 4 | { 5 | [Fact] 6 | public void Test() 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /tools/speed-comparison/xUnitTimer/xUnitTimer/GlobalUsings.cs: -------------------------------------------------------------------------------- 1 | global using Xunit; -------------------------------------------------------------------------------- /tools/speed-comparison/xUnitTimer/xUnitTimer/RepeatTests.cs: -------------------------------------------------------------------------------- 1 | namespace xUnitTimer; 2 | 3 | public class RepeatTests 4 | { 5 | [Theory, MemberData(nameof(Repeat))] 6 | public async Task Test1(object _) 7 | { 8 | await Task.Delay(50); 9 | } 10 | 11 | public static IEnumerable Repeat() 12 | { 13 | return Enumerable.Range(0, 100).Select(i => (object[])[i]); 14 | } 15 | } -------------------------------------------------------------------------------- /tools/tunit-nuget-tester/TUnit.NugetTester/.idea/.idea.TUnit.NugetTester/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Rider ignored files 5 | /projectSettingsUpdater.xml 6 | /modules.xml 7 | /contentModel.xml 8 | /.idea.TUnit.NugetTester.iml 9 | # Editor-based HTTP Client requests 10 | /httpRequests/ 11 | # Datasource local storage ignored files 12 | /dataSources/ 13 | /dataSources.local.xml 14 | -------------------------------------------------------------------------------- /tools/tunit-nuget-tester/TUnit.NugetTester/.idea/.idea.TUnit.NugetTester/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /tools/tunit-nuget-tester/TUnit.NugetTester/.idea/.idea.TUnit.NugetTester/.idea/indexLayout.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /tools/tunit-nuget-tester/TUnit.NugetTester/.idea/.idea.TUnit.NugetTester/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /tools/tunit-nuget-tester/TUnit.NugetTester/TUnit.NugetTester.FSharp/Program.fs: -------------------------------------------------------------------------------- 1 | namespace TUnit.NugetTester.FSharp 2 | 3 | open TUnit.Core 4 | 5 | type Tests() = 6 | [] 7 | member this.Test() = 8 | printfn "Test method executed" -------------------------------------------------------------------------------- /tools/tunit-nuget-tester/TUnit.NugetTester/TUnit.NugetTester.VB/Program.vb: -------------------------------------------------------------------------------- 1 | Imports TUnit.Core 2 | 3 | Public Class Tests 4 | 5 | Public Sub Test() 6 | TestContext.Current.OutputWriter.WriteLine("Test method executed") 7 | End Sub 8 | End Class -------------------------------------------------------------------------------- /tools/tunit-nuget-tester/TUnit.NugetTester/TUnit.NugetTester/MyTests.cs: -------------------------------------------------------------------------------- 1 | using TUnit.NugetTester.Library; 2 | using TUnit.Core.Logging; 3 | 4 | namespace TUnit.NugetTester; 5 | 6 | public class MyTests : TestBase 7 | { 8 | [Test] 9 | public void Test() 10 | { 11 | TestContext.Current!.GetDefaultLogger().LogInformation("Blah"); 12 | } 13 | } --------------------------------------------------------------------------------