public async Task AddReferenceForTypeAsync() { // Given var project = new InMemoryProject(); // When project.AddReferenceFor <InMemoryProject>(); var compilation = await project.CompileAsync(); // Then Assert.NotNull(compilation); Assert.Contains(compilation.ReferencedAssemblyNames, a => a.Name == typeof(InMemoryProject).Assembly.GetName().Name); }
public async Task AddOrUpdateClassAsync() { // Given var project = new InMemoryProject(); // When project.AddOrUpdate("Foo.cs", "public class Foo { }"); var compilation = await project.CompileAsync(); // Then Assert.NotNull(compilation); Assert.True(compilation.ContainsSymbolsWithName("Foo")); }