public async Task TryHandleCommandAsync_AppDesignerFolderAsNodes_CallsShowProjectDesignerAsync() { int callCount = 0; var designerService = IProjectDesignerServiceFactory.ImplementShowProjectDesignerAsync(() => { callCount++; }); var command = CreateInstance(designerService); var tree = ProjectTreeParser.Parse(@" Root (flags: {ProjectRoot}) Properties (flags: {Folder AppDesignerFolder}) "); var nodes = ImmutableHashSet.Create(tree.Children[0]); await command.TryHandleCommandAsync(nodes, GetCommandId(), true, 0, IntPtr.Zero, IntPtr.Zero); Assert.Equal(1, callCount); }
public async Task TryHandleCommandAsync_AppDesignerFolderAsNodes_CallsShowProjectDesignerAsync() { int callCount = 0; var designerService = IProjectDesignerServiceFactory.ImplementShowProjectDesignerAsync(() => { callCount++; }); var command = CreateInstance(designerService); var tree = ProjectTreeParser.Parse(@" Root (flags: {ProjectRoot}) Properties (flags: {Folder AppDesignerFolder}) "); var nodes = ImmutableHashSet.Create(tree.Children[0]); #pragma warning disable RS0003 // Do not directly await a Task (see https://github.com/dotnet/roslyn/issues/6770) await command.TryHandleCommandAsync(nodes, GetCommandId(), true, 0, IntPtr.Zero, IntPtr.Zero); #pragma warning restore RS0003 // Do not directly await a Task Assert.Equal(1, callCount); }