Exemplo n.º 1
0
        public void ExecCommand_VerifyCorrectFrameworkSet(int cmdIndex, bool expected)
        {
            var frameworks = new List <string>()
            {
                "net461", "netcoreapp1.0"
            };
            var activeDebugFrameworkSvcs = new IActiveDebugFrameworkServicesMock()
                                           .ImplementGetActiveDebuggingFrameworkPropertyAsync(null)
                                           .ImplementGetProjectFrameworksAsync(frameworks);

            if (expected)
            {
                activeDebugFrameworkSvcs.ImplementSetActiveDebuggingFrameworkPropertyAsync(frameworks[cmdIndex]);
            }
            var startupHelper = new Mock <IStartupProjectHelper>();

            startupHelper.Setup(x => x.GetExportFromSingleDotNetStartupProject <IActiveDebugFrameworkServices>(ProjectCapability.LaunchProfiles))
            .Returns(activeDebugFrameworkSvcs.Object);

            var command = new TestDebugFrameworksDynamicMenuCommand(startupHelper.Object);

            Assert.Equal(expected, command.ExecCommand(cmdIndex, EventArgs.Empty));

            startupHelper.Verify();
            activeDebugFrameworkSvcs.Verify();
        }
Exemplo n.º 2
0
        public void ExecCommand_HandleNullProject()
        {
            var startupHelper = new Mock <IStartupProjectHelper>();

            startupHelper.Setup(x => x.GetExportFromSingleDotNetStartupProject <IActiveDebugFrameworkServices>(ProjectCapability.LaunchProfiles))
            .Returns((IActiveDebugFrameworkServices)null);

            var command = new TestDebugFrameworksDynamicMenuCommand(startupHelper.Object);

            Assert.False(command.ExecCommand(0, EventArgs.Empty));
            startupHelper.Verify();
        }