public void GetProjectGuidAsync_WhenProjectAlreadyUnloaded_ReturnsCancelledTask() { var tasksService = IUnconfiguredProjectTasksServiceFactory.CreateWithUnloadedProject <string>(); var accessor = CreateInstance(tasksService); var result = accessor.GetProjectGuidAsync(); Assert.True(result.IsCanceled); }
public async Task WhenProjectUnloading_DoesNotLoadConfiguredProject() { var tasksService = IUnconfiguredProjectTasksServiceFactory.CreateWithUnloadedProject <ConfiguredProject>(); var configuredProject = ConfiguredProjectFactory.Create(); int callCount = 0; UnconfiguredProject project = UnconfiguredProjectFactory.ImplementLoadConfiguredProjectAsync(configuration => { callCount++; return(Task.FromResult(configuredProject)); }); var loader = CreateInstance(project, tasksService, out ProjectValueDataSource <IConfigurationGroup <ProjectConfiguration> > source); await loader.InitializeAsync(); var configurationGroups = IConfigurationGroupFactory.CreateFromConfigurationNames("Debug|AnyCPU"); // Change the active configurations await source.SendAndCompleteAsync(configurationGroups, loader.TargetBlock); // Should not be listening Assert.Equal(0, callCount); }