Skip to content

Commit

Permalink
Commented out tests get errror that I don't understand analyzer was t…
Browse files Browse the repository at this point in the history
…ested manually and seems to work.
  • Loading branch information
StevenTCramer committed Aug 13, 2024
1 parent 5963b78 commit f778172
Showing 1 changed file with 121 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
// // ReSharper disable InconsistentNaming
// namespace StateReadOnlyPublicPropertiesAnalyzer_;
//
// public class Should_Trigger_StateReadOnlyPublicPropertiesRule
// {
// public static async Task Given_PublicPropertyWithPublicSetter()
// {
// const string TestCode =
// """
// using System.Threading.Tasks;
// using TimeWarp.State;
//
// public class SampleState : State<SampleState>
// {
// public int PublicProperty { get; set; }
//
// public override void Initialize() { }
// }
// """;
//
// var expectedDiagnostic = new DiagnosticResult("StateReadOnlyPublicPropertiesRule", DiagnosticSeverity.Warning)
// .WithSpan(6, 16, 6, 30)
// .WithArguments("PublicProperty");
//
// var analyzerTest = new CSharpAnalyzerTest<StateReadOnlyPublicPropertiesAnalyzer, FixieVerifier>
// {
// TestCode = TestCode
// };
//
// analyzerTest.ExpectedDiagnostics.Add(expectedDiagnostic);
//
// const string TimeWarpStateAssemblyPath = @"TimeWarp.State.dll";
// analyzerTest.TestState.AdditionalReferences.Add(MetadataReference.CreateFromFile(TimeWarpStateAssemblyPath));
//
// await analyzerTest.RunAsync();
// }
//
// public static async Task Given_PublicPropertyWithProtectedSetter()
// {
// const string TestCode =
// """
// using System.Threading.Tasks;
// using TimeWarp.State;
//
// public class SampleState : State<SampleState>
// {
// public int PublicProperty { get; protected set; }
//
// public override void Initialize() { }
// }
// """;
//
// var expectedDiagnostic = new DiagnosticResult("StateReadOnlyPublicPropertiesRule", DiagnosticSeverity.Warning)
// .WithSpan(6, 16, 6, 30)
// .WithArguments("PublicProperty");
//
// var analyzerTest = new CSharpAnalyzerTest<StateReadOnlyPublicPropertiesAnalyzer, FixieVerifier>
// {
// TestCode = TestCode
// };
//
// analyzerTest.ExpectedDiagnostics.Add(expectedDiagnostic);
//
// const string TimeWarpStateAssemblyPath = @"TimeWarp.State.dll";
// analyzerTest.TestState.AdditionalReferences.Add(MetadataReference.CreateFromFile(TimeWarpStateAssemblyPath));
//
// await analyzerTest.RunAsync();
// }
//
// public static async Task Given_PublicPropertyWithPrivateSetter()
// {
// const string TestCode =
// """
// using System.Threading.Tasks;
// using TimeWarp.State;
//
// public class SampleState : State<SampleState>
// {
// public int PublicProperty { get; private set; }
//
// public override void Initialize() { }
// }
// """;
//
// var analyzerTest = new CSharpAnalyzerTest<StateReadOnlyPublicPropertiesAnalyzer, FixieVerifier>
// {
// TestCode = TestCode
// };
//
// const string TimeWarpStateAssemblyPath = @"TimeWarp.State.dll";
// analyzerTest.TestState.AdditionalReferences.Add(MetadataReference.CreateFromFile(TimeWarpStateAssemblyPath));
//
// await analyzerTest.RunAsync();
// }
//
// public static async Task Given_PublicReadOnlyProperty()
// {
// const string TestCode =
// """
// using System.Threading.Tasks;
// using TimeWarp.State;
//
// public class SampleState : State<SampleState>
// {
// public int PublicProperty { get; }
//
// public override void Initialize() { }
// }
// """;
//
// var analyzerTest = new CSharpAnalyzerTest<StateReadOnlyPublicPropertiesAnalyzer, FixieVerifier>
// {
// TestCode = TestCode
// };
//
// const string TimeWarpStateAssemblyPath = @"TimeWarp.State.dll";
// analyzerTest.TestState.AdditionalReferences.Add(MetadataReference.CreateFromFile(TimeWarpStateAssemblyPath));
//
// await analyzerTest.RunAsync();
// }
// }

0 comments on commit f778172

Please sign in to comment.