2using Microsoft.VisualStudio.TestTools.UnitTesting;
4using System.Threading.Tasks;
15 var diagnostics = analyzer.SupportedDiagnostics;
16 Assert.AreEqual(1, diagnostics.Length);
18 var diagnostic = diagnostics[0];
19 Assert.AreEqual(Constants.AnalyzerIdentifiers.FindOperationsWithNonSerializableArguments, diagnostic.Id,
20 nameof(DiagnosticDescriptor.Id));
21 Assert.AreEqual(FindOperationsWithNonSerializableArgumentsConstants.Title, diagnostic.Title.ToString(),
22 nameof(DiagnosticDescriptor.Title));
23 Assert.AreEqual(FindOperationsWithNonSerializableArgumentsConstants.Message, diagnostic.MessageFormat.ToString(),
24 nameof(DiagnosticDescriptor.MessageFormat));
25 Assert.AreEqual(Constants.Categories.Design, diagnostic.Category,
26 nameof(DiagnosticDescriptor.Category));
27 Assert.AreEqual(DiagnosticSeverity.Warning, diagnostic.DefaultSeverity,
28 nameof(DiagnosticDescriptor.DefaultSeverity));
30 diagnostic.HelpLinkUri,
31 nameof(DiagnosticDescriptor.HelpLinkUri));
37 var code =
"public class A { }";
39 code, Array.Empty<
string>());
48public class A : BusinessBase<A>
53 code, Array.Empty<
string>());
62public class A : BusinessBase<A>
65 private void Fetch() { }
68 code, Array.Empty<
string>());
77public class A : BusinessBase<A>
80 private void Fetch(int x) { }
83 code, Array.Empty<
string>());
94public class B : BusinessBase<B>
97 private void Fetch(A x) { }
100 code,
new[] { Constants.AnalyzerIdentifiers.FindOperationsWithNonSerializableArguments });
109public class A : BusinessBase<A> { }
111public class B : BusinessBase<B>
114 private void Fetch(A x) { }
117 code, Array.Empty<
string>());
128public class B : BusinessBase<B>
131 private void Fetch([Inject] A x) { }
134 code, Array.Empty<
string>());
147public class B : BusinessBase<B>
150 private void Fetch(A x) { }
154 code, Array.Empty<
string>());
163public class A : BusinessBase<A>
166 private void FetchChild() { }
169 code, Array.Empty<
string>());
178public class A : BusinessBase<A>
181 private void FetchChild(int x) { }
184 code, Array.Empty<
string>());
195public class B : BusinessBase<B>
198 private void FetchChild(A x) { }
201 code, Array.Empty<
string>());
async Task AnalyzeWithMobileObjectAndMethodIsChildOperationWithNoArguments()
async Task AnalyzeWithMobileObjectAndMethodIsChildOperationWithSerializableArgument()
async Task AnalyzeWithNotMobileObject()
async Task AnalyzeWithMobileObjectAndMethodIsRootOperationWithMobileObjectArgument()
async Task AnalyzeWithMobileObjectAndMethodIsNotOperation()
async Task AnalyzeWithMobileObjectAndMethodIsRootOperationWithNoArguments()
async Task AnalyzeWithMobileObjectAndMethodIsRootOperationWithSerializableArgumentCustomType()
async Task AnalyzeWithMobileObjectAndMethodIsRootOperationWithSerializableArgument()
async Task AnalyzeWithMobileObjectAndMethodIsChildOperationWithNonSerializableArgument()
async Task AnalyzeWithMobileObjectAndMethodIsRootOperationWithNonSerializableArgumentThatIsInjectable()
void VerifySupportedDiagnostics()
async Task AnalyzeWithMobileObjectAndMethodIsRootOperationWithNonSerializableArgument()