mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-01-09 12:19:12 +00:00
Add 3 more test cases
This commit is contained in:
parent
fc7f80f1c0
commit
8e2b479a70
1 changed files with 73 additions and 0 deletions
|
@ -141,6 +141,79 @@ public class MyClass
|
|||
}
|
||||
}
|
||||
}
|
||||
";
|
||||
|
||||
await Verifier.VerifyAnalyzerAsync(text).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task LogWithIdentifierAndMethodCall_NoDiagnostic()
|
||||
{
|
||||
string text = _loggerText + @"
|
||||
public class MyClass
|
||||
{
|
||||
public void MyMethod6()
|
||||
{
|
||||
try
|
||||
{
|
||||
Console.WriteLine(""test"");
|
||||
}
|
||||
catch (InvalidOperationException abc)
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Info?.Print(Ryujinx.Common.Logging.LogClass.Application, $""test: {abc.ToString()}"");
|
||||
Console.WriteLine(""Test"");
|
||||
}
|
||||
}
|
||||
}
|
||||
";
|
||||
|
||||
await Verifier.VerifyAnalyzerAsync(text).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task LogWithMethodCallOnIdentifier_NoDiagnostic()
|
||||
{
|
||||
string text = _loggerText + @"
|
||||
public class MyClass
|
||||
{
|
||||
public void MyMethod7()
|
||||
{
|
||||
try
|
||||
{
|
||||
Console.WriteLine(""test"");
|
||||
}
|
||||
catch (IndexOutOfRangeException mistake1)
|
||||
{
|
||||
string test = ""another test"";
|
||||
Ryujinx.Common.Logging.Logger.Info?.Print(Ryujinx.Common.Logging.LogClass.Application, $""test: {string.Concat(mistake1, test)}"");
|
||||
Console.WriteLine(""Test"");
|
||||
}
|
||||
}
|
||||
}
|
||||
";
|
||||
|
||||
await Verifier.VerifyAnalyzerAsync(text).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task LogWithPropertyOfException_NoDiagnostic()
|
||||
{
|
||||
string text = _loggerText + @"
|
||||
public class MyClass
|
||||
{
|
||||
public void MyMethod8()
|
||||
{
|
||||
try
|
||||
{
|
||||
Console.WriteLine(""test"");
|
||||
}
|
||||
catch (ArgumentOutOfRangeException oob)
|
||||
{
|
||||
Ryujinx.Common.Logging.Logger.Info?.Print(Ryujinx.Common.Logging.LogClass.Application, $""test: {oob.Message}"");
|
||||
Console.WriteLine(""Test"");
|
||||
}
|
||||
}
|
||||
}
|
||||
";
|
||||
|
||||
await Verifier.VerifyAnalyzerAsync(text).ConfigureAwait(false);
|
||||
|
|
Loading…
Reference in a new issue