1using Microsoft.VisualStudio.TestTools.UnitTesting;
2using System.Threading.Tasks;
9 private static async Task<FindSetOrLoadInvocationsWalker> GetWalker(
string code)
11 var document = TestHelpers.Create(code);
12 var root = await document.GetSyntaxRootAsync();
13 var model = await document.GetSemanticModelAsync();
15 return new FindSetOrLoadInvocationsWalker(root, model);
22 var code =
"public class A { }";
23 var walker = await GetWalker(code);
24 Assert.IsNull(walker.Invocation);
33public class A : BusinessBase<A>
35 public void Go() => this.GetHashCode();
37 var walker = await GetWalker(code);
38 Assert.IsNull(walker.Invocation);
47public class A : BusinessBase<A>
49 public void Go() => this.SetProperty(null, null);
51 var walker = await GetWalker(code);
52 Assert.IsNotNull(walker.Invocation);
61public class A : BusinessBase<A>
63 public void Go() => this.SetPropertyConvert<int, int>(null, 0);
65 var walker = await GetWalker(code);
66 Assert.IsNotNull(walker.Invocation);
75public class A : BusinessBase<A>
77 public void Go() => this.LoadProperty(null, null);
79 var walker = await GetWalker(code);
80 Assert.IsNotNull(walker.Invocation);
89public class A : BusinessBase<A>
91 public void Go() => this.LoadPropertyAsync<int>(null, null);
93 var walker = await GetWalker(code);
94 Assert.IsNotNull(walker.Invocation);
103public class A : BusinessBase<A>
105 public void Go() => this.LoadPropertyConvert<int, int>(null, 0);
107 var walker = await GetWalker(code);
108 Assert.IsNotNull(walker.Invocation);
117public class A : BusinessBase<A>
119 public void Go() => this.LoadPropertyMarkDirty(null, null);
121 var walker = await GetWalker(code);
122 Assert.IsNotNull(walker.Invocation);
async Task WalkWhenContainingTypeIsBusinessBaseAndInvocationIsSetPropertyConvert()
async Task WalkWhenContainingTypeIsBusinessBaseAndInvocationIsNotCslaMethod()
async Task WalkWhenContainingTypeIsBusinessBaseAndInvocationIsSetProperty()
async Task WalkWhenContainingTypeIsNotBusinessBase()
async Task WalkWhenContainingTypeIsBusinessBaseAndInvocationIsLoadPropertyAsync()
async Task WalkWhenContainingTypeIsBusinessBaseAndInvocationIsLoadPropertyConvert()
async Task WalkWhenContainingTypeIsBusinessBaseAndInvocationIsLoadProperty()
async Task WalkWhenContainingTypeIsBusinessBaseAndInvocationIsLoadPropertyMarkDirty()