├── .gitattributes
├── .github
├── FUNDING.yml
└── workflows
│ └── testRunner.yml
├── .gitignore
├── AdventOfCSharp.AdditionalProblemSolutionTests
├── AdventOfCSharp.AdditionalProblemSolutionTests.csproj
├── DependingRunnerTests.cs
└── Problems
│ └── Year2021
│ └── Day2.cs
├── AdventOfCSharp.AnalysisTestsBase
├── AdventOfCSharp.AnalysisTestsBase.csproj
├── Helpers
│ ├── AoCSMetadataReferences.cs
│ ├── AoCSUsingsProvider.cs
│ └── RuntimeReferences.cs
├── Resources
│ ├── ExampleAttribute.cs
│ ├── NotProblem.cs
│ └── TestSecretsContainerBase.cs
└── Verifiers
│ ├── CSharpAnalyzerVerifier`1+Test.cs
│ ├── CSharpAnalyzerVerifier`1.cs
│ ├── CSharpCodeFixVerifier`2+Test.cs
│ ├── CSharpCodeFixVerifier`2.cs
│ ├── CSharpCodeRefactoringVerifier`1+Test.cs
│ ├── CSharpCodeRefactoringVerifier`1.cs
│ └── CSharpVerifierHelper.cs
├── AdventOfCSharp.Analyzers.Tests
├── AdventOfCSharp.Analyzers.Tests.csproj
├── AnswerStringConverters
│ ├── AnswerStringConverterAnalyzerTests.cs
│ ├── AoCS0016_Tests.cs
│ ├── AoCS0017_Tests.cs
│ └── AoCS0018_Tests.cs
├── BaseAoCSDiagnosticTests.cs
├── FinalDaySolutions
│ ├── AoCS0011_Tests.cs
│ ├── AoCS0012_Tests.cs
│ └── FinalDayAnalyzerTests.cs
├── GuRoslynAssertsSetup.cs
├── PartSolutions
│ ├── AoCS0001_Tests.cs
│ ├── AoCS0002_Tests.cs
│ └── PartSolutionAnalyzerTests.cs
├── PartSolverAttributes
│ ├── AoCS0013_Tests.cs
│ ├── AoCS0014_Tests.cs
│ ├── AoCS0015_Tests.cs
│ └── PartSolverAttributeAnalyzerTests.cs
├── ProblemClassNamings
│ ├── AoCS0004_Tests.cs
│ ├── AoCS0005_Tests.cs
│ ├── AoCS0006_Tests.cs
│ ├── AoCS0007_Tests.cs
│ └── ProblemInheritanceAnalyzerTests.cs
├── ProblemSolutionClassInheritance
│ ├── AoCS0003_Tests.cs
│ └── ProblemInheritanceAnalyzerTests.cs
├── SecretContainers
│ ├── AoCS0008_Tests.cs
│ └── SecretsContainerAnalyzerTests.cs
└── SecretStringProperties
│ ├── AoCS0080_Tests.cs
│ ├── AoCS0081_Tests.cs
│ ├── AoCS0082_Tests.cs
│ ├── AoCS0083_Tests.cs
│ ├── AoCS0084_Tests.cs
│ ├── CookiesTests.cs
│ └── SecretStringPropertyAnalyzerTests.cs
├── AdventOfCSharp.Analyzers
├── AdventOfCSharp.Analyzers.csproj
├── AnalyzerReleases.Shipped.md
├── AnalyzerReleases.Unshipped.md
├── AnswerStringConverterAnalyzer.cs
├── AoCSAnalyzer.cs
├── AoCSDiagnosticDescriptorStorage.cs
├── AssemblyAttributes.cs
├── DiagnosticStringResources.Designer.cs
├── DiagnosticStringResources.resx
├── Diagnostics.cs
├── FinalDayAnalyzer.cs
├── PartSolutionAnalyzer.cs
├── PartSolverAttributeAnalyzer.cs
├── ProblemAoCSAnalyzer.cs
├── ProblemClassNamingAnalyzer.cs
├── ProblemInheritanceAnalyzer.cs
├── SecretStringPropertyAnalyzer.cs
├── SecretsContainerAnalyzer.cs
├── SymbolExtensions.cs
└── Utilities
│ └── AccessorListSyntaxExtensions.cs
├── AdventOfCSharp.Benchmarking.Common
├── AdventOfCSharp.Benchmarking.Common.csproj
├── BenchmarkDescriberAttribute.cs
└── BenchmarkingParts.cs
├── AdventOfCSharp.Benchmarking
├── AdventOfCSharp.Benchmarking.csproj
├── BenchmarkDescriber.cs
├── BenchmarkDescriberExecution.cs
├── BenchmarkDescriberHelpers.cs
├── ProblemBenchmark.cs
└── ProblemBenchmarkRunner.cs
├── AdventOfCSharp.CodeAnalysis.Core
├── AdventOfCSharp.CodeAnalysis.Core.csproj
├── AoCSAnalysisHelpers.cs
├── Extensions
│ ├── BaseTypeDeclarationSyntaxExtensions.cs
│ ├── CompilationExtensions.cs
│ ├── IAssemblyOrModuleSymbolExtensions.cs
│ ├── ISymbolExtensions.cs
│ └── SyntaxTreeExtensions.cs
└── KnownSymbolNames.cs
├── AdventOfCSharp.CodeFixes.Tests
├── AdventOfCSharp.CodeFixes.Tests.csproj
├── BaseCodeFixTests.cs
├── FinalDayUsage
│ ├── AoCS0011_CodeFixTests.cs
│ └── FinalDayUserCodeFixTests.cs
└── ProblemClassSimplification
│ ├── AoCS0003_CodeFixTests.cs
│ └── ProblemClassSimplifierCodeFixTests.cs
├── AdventOfCSharp.CodeFixes
├── AdventOfCSharp.CodeFixes.csproj
├── AoCSCodeFixProvider.cs
├── CodeFixStringResources.Designer.cs
├── CodeFixStringResources.resx
├── FinalDayUser.cs
└── ProblemClassSimplifier.cs
├── AdventOfCSharp.Common
├── AdventOfCSharp.Common.csproj
├── ISecretsContainer.cs
├── PartSolutionAttribute.cs
├── PartSolutionStatus.cs
├── PartSolverAttribute.cs
├── PrintsToConsoleAttribute.cs
├── ProblemDate.cs
├── SecretStringPropertyAttribute.cs
└── Utilities
│ └── LookupTable.cs
├── AdventOfCSharp.Package
├── AdventOfCSharp.Analyzers.Package.csproj
└── tools
│ ├── install.ps1
│ └── uninstall.ps1
├── AdventOfCSharp.ProblemSolutionResources
├── AdventOfCSharp.ProblemSolutionResources.csproj
├── Inputs
│ └── 2021
│ │ ├── 1.txt
│ │ └── 1T1.txt
├── Outputs
│ └── 2021
│ │ ├── 1.txt
│ │ └── 1T1.txt
├── Problems
│ └── Year2021
│ │ └── Day1.cs
└── ResourceFileManagement.cs
├── AdventOfCSharp.ProblemSolutionTests
└── AdventOfCSharp.ProblemSolutionTests.csproj
├── AdventOfCSharp.SourceGenerators.Tests
├── AdventOfCSharp.SourceGenerators.Tests.csproj
├── BaseSourceGeneratorTestContainer.cs
├── BenchmarkDescriberSourceGeneratorTests.cs
├── Helpers
│ ├── BenchmarkSpecificMetadataReferences.cs
│ ├── RuntimeReferences.cs
│ └── TestingSpecificMetadataReferences.cs
├── ProblemValidationTestSourceGeneratorTests.cs
├── SourceFileListExtensions.cs
└── Verifiers
│ └── CSharpSourceGeneratorVerifier.cs
├── AdventOfCSharp.SourceGenerators
├── AdventOfCSharp.SourceGenerators.csproj
├── BenchmarkDescriberSourceGenerator.cs
├── ProblemValidationTestSourceGenerator.cs
└── Utilities
│ ├── GeneratedSourceMappings.cs
│ ├── GeneratorExecutionConductor.cs
│ └── ProblemClassIdentifier.cs
├── AdventOfCSharp.Testing.Common
├── AdventOfCSharp.Testing.Common.csproj
├── AoCSTestAssemblyAttribute.cs
└── TestingFrameworkIdentifiers.cs
├── AdventOfCSharp.Testing.MSTest
├── AdventOfCSharp.Testing.MSTest.csproj
└── MSTestProblemValidationTests.cs
├── AdventOfCSharp.Testing.NUnit
├── AdventOfCSharp.Testing.NUnit.csproj
└── NUnitProblemValidationTests.cs
├── AdventOfCSharp.Testing.Tests.Common
├── AdventOfCSharp.Testing.Tests.Common.csproj
└── AoCSTestAssemblyInfo.cs
├── AdventOfCSharp.Testing.Tests.MSTest
├── AdventOfCSharp.Testing.Tests.MSTest.csproj
└── TestDeclaration.cs
├── AdventOfCSharp.Testing.Tests.NUnit
├── AdventOfCSharp.Testing.Tests.NUnit.csproj
└── TestDeclaration.cs
├── AdventOfCSharp.Testing.Tests.XUnit
├── AdventOfCSharp.Testing.Tests.XUnit.csproj
└── TestDeclaration.cs
├── AdventOfCSharp.Testing.xUnit
├── AdventOfCSharp.Testing.XUnit.csproj
└── XUnitProblemValidationTests.cs
├── AdventOfCSharp.Testing
├── AdventOfCSharp.Testing.csproj
└── FrameworkUnboundProblemValidationTests.cs
├── AdventOfCSharp.Tests
├── AdventOfCSharp.Tests.csproj
├── InputGeneratorTests.cs
├── ProblemRunnerTests.cs
└── Utilities
│ └── LookupTableTests.cs
├── AdventOfCSharp.sln
├── AdventOfCSharp
├── AdventOfCSharp.csproj
├── AnswerStringConversion.cs
├── AnswerStringConverter.cs
├── BaseProgram.cs
├── BufferHeightHandlingMode.cs
├── ConsoleBufferHandling.cs
├── Cookies.cs
├── ExecutionTimePrinting.cs
├── Extensions
│ ├── ArrayExtensions.cs
│ ├── ConsoleColorExtensions.cs
│ ├── IEnumerableExtensions.cs
│ ├── ISetExtensions.cs
│ ├── ResourceSetExtensions.cs
│ ├── StringExtensions.cs
│ └── TypeExtensions.cs
├── FancyPrinting.cs
├── FileHelpers.cs
├── FinalDay.cs
├── Generation
│ ├── InputGenerator.cs
│ └── SolutionTemplateGeneration.cs
├── GlobalUsings.cs
├── GlyphGridAnswerStringConverter.cs
├── IGlyphGrid.cs
├── Month.cs
├── Parser.cs
├── Problem.cs
├── ProblemFiles.cs
├── ProblemOutput.cs
├── ProblemRunner.cs
├── ProblemSolverMethodProvider.cs
├── ProblemValidator.cs
├── ProblemsIndex.cs
├── ResourceFileHelpers.cs
├── Resources
│ ├── GlyphResources.Designer.cs
│ ├── GlyphResources.resx
│ ├── GridFont.cs
│ ├── GridFontStore.cs
│ ├── GridGlyph.cs
│ ├── Infrauth.txt
│ └── Stargazer.txt
├── SecretsStorage.cs
├── ServerClock.cs
├── Utilities
│ ├── AppDomainHelpers.cs
│ ├── ConsoleAvailability.cs
│ ├── ConsolePrinting.cs
│ └── NextValueCounterDictionary.cs
└── WebsiteScraping.cs
├── LICENSE
├── README.md
└── docs
├── analyzers
└── rules
│ ├── AoCS0001.md
│ ├── AoCS0002.md
│ ├── AoCS0003.md
│ ├── AoCS0004.md
│ ├── AoCS0005.md
│ ├── AoCS0006.md
│ ├── AoCS0007.md
│ ├── AoCS0008.md
│ ├── AoCS0011.md
│ ├── AoCS0012.md
│ ├── AoCS0013.md
│ ├── AoCS0014.md
│ ├── AoCS0015.md
│ ├── AoCS0016.md
│ ├── AoCS0017.md
│ ├── AoCS0018.md
│ ├── AoCS0080.md
│ ├── AoCS0081.md
│ ├── AoCS0082.md
│ ├── AoCS0083.md
│ ├── AoCS0084.md
│ └── index.md
├── benchmarks.md
├── cookie_retrieval.png
├── index.md
├── input-generation.md
├── setup-secrets.md
└── unit-tests.md
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | patreon: Rekkon
4 | custom: buymeacoffee.com/Rekkon
5 |
--------------------------------------------------------------------------------
/.github/workflows/testRunner.yml:
--------------------------------------------------------------------------------
1 | name: Run Tests
2 |
3 | on: [push]
4 |
5 | jobs:
6 | run-tests:
7 | runs-on: windows-latest
8 |
9 | strategy:
10 | matrix:
11 | project:
12 | - name: Tests
13 | - name: AdditionalProblemSolutionTests
14 | - name: Analyzers.Tests
15 | - name: CodeFixes.Tests
16 | - name: SourceGenerators.Tests
17 |
18 | - name: Testing.Tests.MSTest
19 | - name: Testing.Tests.NUnit
20 | - name: Testing.Tests.XUnit
21 |
22 | steps:
23 | - name: Setup .NET 6.0
24 | uses: actions/setup-dotnet@v1
25 | with:
26 | dotnet-version: 6.0.x
27 |
28 | - name: Checkout Code
29 | uses: actions/checkout@v1
30 |
31 | - name: Run Tests in Project
32 | run: dotnet test ${{ matrix.project.directory }}AdventOfCSharp.${{ matrix.project.name }}/AdventOfCSharp.${{ matrix.project.name }}.csproj
33 |
--------------------------------------------------------------------------------
/AdventOfCSharp.AdditionalProblemSolutionTests/AdventOfCSharp.AdditionalProblemSolutionTests.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net6.0
5 | enable
6 |
7 | false
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | all
16 | runtime; build; native; contentfiles; analyzers; buildtransitive
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/AdventOfCSharp.AdditionalProblemSolutionTests/DependingRunnerTests.cs:
--------------------------------------------------------------------------------
1 | using NUnit.Framework;
2 |
3 | namespace AdventOfCSharp.AdditionalProblemSolutionTests;
4 |
5 | public class DependingRunnerTests
6 | {
7 | [Test]
8 | public void ValidateProblem()
9 | {
10 | // Transitively inherited problem type from dependency
11 | AssertExistence(2021, 1);
12 | // Implemented in this project
13 | AssertExistence(2021, 2);
14 | }
15 | private static void AssertExistence(int year, int day)
16 | {
17 | Assert.NotNull(ProblemsIndex.Instance[year, day].ProblemType.ProblemClass);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/AdventOfCSharp.AdditionalProblemSolutionTests/Problems/Year2021/Day2.cs:
--------------------------------------------------------------------------------
1 | namespace AdventOfCSharp.AdditionalProblemSolutionTests.Problems.Year2021;
2 |
3 | public class Day2 : Problem
4 | {
5 | public const int Part1Result = 142;
6 | public const int Part2Result = 234;
7 |
8 | public override int SolvePart1()
9 | {
10 | return Part1Result;
11 | }
12 | public override int SolvePart2()
13 | {
14 | return Part2Result;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/AdventOfCSharp.AnalysisTestsBase/AdventOfCSharp.AnalysisTestsBase.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net6.0
5 | 10.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/AdventOfCSharp.AnalysisTestsBase/Helpers/AoCSMetadataReferences.cs:
--------------------------------------------------------------------------------
1 | using AdventOfCSharp.AnalysisTestsBase.Resources;
2 | using Microsoft.CodeAnalysis;
3 | using RoseLynn;
4 | using System.Collections.Immutable;
5 |
6 | namespace AdventOfCSharp.AnalysisTestsBase.Helpers;
7 |
8 | public static class AoCSMetadataReferences
9 | {
10 | public static readonly ImmutableArray BaseReferences = ImmutableArray.Create(new MetadataReference[]
11 | {
12 | // AdventOfCSharp
13 | MetadataReferenceFactory.CreateFromType(),
14 |
15 | // AdventOfCSharp.Common
16 | MetadataReferenceFactory.CreateFromType(),
17 |
18 | // AdventOfCSharp.AnalysisTestsBase.Resources
19 | MetadataReferenceFactory.CreateFromType(),
20 | });
21 | }
22 |
--------------------------------------------------------------------------------
/AdventOfCSharp.AnalysisTestsBase/Helpers/AoCSUsingsProvider.cs:
--------------------------------------------------------------------------------
1 | using RoseLynn.Testing;
2 |
3 | namespace AdventOfCSharp.AnalysisTestsBase;
4 |
5 | public sealed class AoCSUsingsProvider : UsingsProviderBase
6 | {
7 | public static readonly AoCSUsingsProvider Instance = new();
8 |
9 | public const string DefaultUsings =
10 | @"
11 | using AdventOfCSharp;
12 | using AdventOfCSharp.AnalysisTestsBase.Resources;
13 | using System;
14 | using System.Collections;
15 | using System.Collections.Generic;
16 | ";
17 |
18 | public override string DefaultNecessaryUsings => DefaultUsings;
19 |
20 | private AoCSUsingsProvider() { }
21 | }
22 |
--------------------------------------------------------------------------------
/AdventOfCSharp.AnalysisTestsBase/Helpers/RuntimeReferences.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.CodeAnalysis;
2 | using Microsoft.CodeAnalysis.Testing;
3 | using RoseLynn;
4 | using System.IO;
5 |
6 | namespace AdventOfCSharp.AnalysisTestsBase.Helpers;
7 |
8 | public static class RuntimeReferences
9 | {
10 | public static readonly ReferenceAssemblies NET6_0Reference = new(
11 | "net6.0",
12 | new PackageIdentity(
13 | "Microsoft.NETCore.App.Ref", "6.0.0"),
14 | Path.Combine("ref", "net6.0"));
15 |
16 | public static readonly MetadataReference NETStandard2_0MetadataReference = MetadataReferenceFactory.CreateFromType