コード例 #1
0
 public void Constructor_NullAsAccessor_ThrowsArgumentNull()
 {
     Assert.Throws <ArgumentNullException>(() => CreateInstance(IPhysicalProjectTreeFactory.Create(),
                                                                SVsServiceProviderFactory.Create(), ConfiguredProjectFactory.Create(), null));
 }
コード例 #2
0
 public void Constructor_NullAsProjectTree_ThrowsArgumentNull()
 {
     Assert.Throws <ArgumentNullException>(() => CreateInstance(null, SVsServiceProviderFactory.Create(),
                                                                ConfiguredProjectFactory.Create(), IProjectAccessorFactory.Create()));
 }
コード例 #3
0
        public async Tasks.Task VerifyProjectRemoved_AddedWithChange()
        {
            var projectGuid = Guid.NewGuid();

            var mockIVsStartupProjectsListService = IVsStartupProjectsListServiceFactory.CreateMockInstance(projectGuid);
            var iVsStartupProjectsListService     = mockIVsStartupProjectsListService.Object;

            var serviceProvider = SVsServiceProviderFactory.Create(iVsStartupProjectsListService);

            var debuggerLaunchProvider = CreateDebuggerLaunchProviderInstance();

            debuggerLaunchProvider.Debuggers.Add(GetLazyDebugLaunchProvider(debugs: false));
            var activeConfiguredProjectWithLaunchProviders = IActiveConfiguredProjectFactory.ImplementValue(() => debuggerLaunchProvider);

            var startupProjectRegistrar = CreateInstance(
                serviceProvider,
                activeConfiguredProjectWithLaunchProviders);

            var testWrapperMethod = new DataFlowExtensionMethodCaller(new DataFlowExtensionMethodWrapperMock());

            startupProjectRegistrar.WrapperMethodCaller = testWrapperMethod;

            await startupProjectRegistrar.Load();


            var projectSubscriptionUpdate = IProjectSubscriptionUpdateFactory.FromJson(@"{
    ""ProjectChanges"": {
        ""ConfigurationGeneral"": {
            ""Difference"": {
                ""ChangedProperties"": [ ""ProjectGuid"" ]
            },
            ""After"": {
                ""Properties"": {
                   ""ProjectGuid"": """ + projectGuid + @"""
                }
            }
        }
    }
}");
            await startupProjectRegistrar.ConfigurationGeneralRuleBlock_ChangedAsync(
                IProjectVersionedValueFactory <IProjectSubscriptionUpdate> .Create(projectSubscriptionUpdate));

            mockIVsStartupProjectsListService.Verify(s => s.AddProject(ref projectGuid), Times.Never);
            mockIVsStartupProjectsListService.Verify(s => s.RemoveProject(ref projectGuid), Times.Once);

            debuggerLaunchProvider.Debuggers.Clear();
            debuggerLaunchProvider.Debuggers.Add(GetLazyDebugLaunchProvider(debugs: true));

            projectSubscriptionUpdate = IProjectSubscriptionUpdateFactory.FromJson(@"{
    ""ProjectChanges"": {
        ""ConfigurationGeneral"": {
            ""Difference"": {
                ""ChangedProperties"": [ ""OutputType"" ]
            }
        }
    }
}");

            await startupProjectRegistrar.ConfigurationGeneralRuleBlock_ChangedAsync(
                IProjectVersionedValueFactory <IProjectSubscriptionUpdate> .Create(projectSubscriptionUpdate));

            mockIVsStartupProjectsListService.Verify(s => s.AddProject(ref projectGuid), Times.Once);
        }
コード例 #4
0
 public void Constructor_NullAsProjectVsService_ThrowsArgumentNull()
 {
     Assert.Throws <ArgumentNullException>(() => CreateInstance(IPhysicalProjectTreeFactory.Create(), null,
                                                                SVsServiceProviderFactory.Create()));
 }
 public void Constructor_NullAsGeneratePackageOnBuildPropertyProvider_ThrowsArgumentNull()
 {
     Assert.Throws <ArgumentNullException>(() => CreateInstanceCore(UnconfiguredProjectFactory.Create(), IProjectThreadingServiceFactory.Create(), SVsServiceProviderFactory.Create(null), null));
 }