Ejemplo n.º 1
0
        public async Task OnRestoreInfoChangedAsync_UnchangedValueAsValue_DoesNotPushToRestoreService()
        {
            int callCount = 0;
            var solutionRestoreService = IVsSolutionRestoreServiceFactory.ImplementNominateProjectAsync((projectFile, info, cancellationToken) => { callCount++; });

            var instance = await CreateInitializedInstance(solutionRestoreService : solutionRestoreService);

            var restoreInfo = IVsProjectRestoreInfoFactory.Create();
            var value       = IProjectVersionedValueFactory.Create <IVsProjectRestoreInfo>(restoreInfo);

            await instance.OnRestoreInfoChangedAsync(value);

            Assert.Equal(1, callCount); // Should have only been called once
        }
Ejemplo n.º 2
0
        public async Task OnRestoreInfoChangedAsync_PushesRestoreInfoToRestoreService()
        {
            IVsProjectRestoreInfo result = null;
            var solutionRestoreService   = IVsSolutionRestoreServiceFactory.ImplementNominateProjectAsync((projectFile, info, cancellationToken) => { result = info; });

            var instance = await CreateInitializedInstance(solutionRestoreService : solutionRestoreService);

            var restoreInfo = IVsProjectRestoreInfoFactory.Create();
            var value       = IProjectVersionedValueFactory.Create(restoreInfo);

            await instance.OnRestoreInfoChangedAsync(value);

            Assert.Same(restoreInfo, result);
        }