예제 #1
0
        public void InterfaceDummy()
        {
            var dummy = TestDummyGenerator.Create <IDomainObj>();

            Assert.That(dummy, Is.Not.Null);
            Assert.Throws <TestDummyException>(() => dummy.DoSomething());
        }
예제 #2
0
        public override IWindowsRegistry GetWindowsRegistry()
        {
            if (_windowsRegistry == null)
            {
                _windowsRegistry = TestDummyGenerator.Create <IWindowsRegistry>();
            }

            return(_windowsRegistry);
        }
예제 #3
0
        IVSFake CreateVsFake(IGameletClientFactory gameletClientFactory)
        {
            var serviceManager = new MediumTestServiceManager(_taskContext, CreateVsiOptions());

            _compRoot = new MediumTestDebugEngineFactoryCompRoot(
                serviceManager, _taskContext, gameletClientFactory,
                TestDummyGenerator.Create <IWindowsRegistry>());

            IDebugEngine2 CreateDebugEngine() =>
            _compRoot.CreateDebugEngineFactory().Create(null);

            InitVsFakeCompRoot(serviceManager, gameletClientFactory);
            return(_vsFakeCompRoot.Create(CreateDebugEngine));
        }
예제 #4
0
        public void TestDebugEngineConstructor()
        {
            var lldbShell             = TestDummyGenerator.Create <SLLDBShell>();
            var vsiService            = new YetiVSIService(OptionPageGrid.CreateForTesting());
            var metrics               = TestDummyGenerator.Create <IMetrics>();
            var vsOutputWindow        = new OutputWindowStub();
            var symbolSettingsManager = Substitute.For <IVsDebuggerSymbolSettingsManager120A>();
            var serviceManager        = new ServiceManagerStub(metrics, lldbShell, vsiService,
                                                               vsOutputWindow, symbolSettingsManager);
            var compRoot = new MediumTestDebugEngineFactoryCompRoot(
                serviceManager, new JoinableTaskContext(), new GameletClientStub.Factory(),
                TestDummyGenerator.Create <IWindowsRegistry>());

            var factory = compRoot.CreateDebugEngineFactory();

            factory.Create(null);
        }
        DebugEngineFactoryCompRootStub CreateEngineFactoryCompRoot(
            IDebugSessionLauncherFactory debugSessionLauncherFactory, IRemoteDeploy remoteDeploy)
        {
            var compRoot = new DebugEngineFactoryCompRootStub(
                debugSessionLauncherFactory, remoteDeploy, Substitute.For <IGameLauncher>());

            _metrics = Substitute.For <IMetrics>();
            _metrics.NewDebugSessionId().Returns(_debugSessionId);
            ISessionNotifier sessionNotifier = Substitute.For <ISessionNotifier>();
            SLLDBShell       lldbShell       = TestDummyGenerator.Create <SLLDBShell>();
            var vsiService            = new YetiVSIService(OptionPageGrid.CreateForTesting());
            var vsOutputWindow        = new OutputWindowStub();
            var symbolSettingsManager = Substitute.For <IVsDebuggerSymbolSettingsManager120A>();

            compRoot.ServiceManager =
                new ServiceManagerStub(_metrics, lldbShell, vsiService, vsOutputWindow,
                                       symbolSettingsManager, sessionNotifier);
            return(compRoot);
        }
        public void SetUp()
        {
            _optionPageGrid = OptionPageGrid.CreateForTesting();
            _optionPageGrid.NatvisLoggingLevel = NatvisLoggingLevelFeatureFlag.VERBOSE;

            var taskContext    = new JoinableTaskContext();
            var serviceManager = new FakeServiceManager(taskContext);

            serviceManager.AddService(typeof(YetiVSIService), new YetiVSIService(_optionPageGrid));
            _compRoot = new MediumTestDebugEngineFactoryCompRoot(
                serviceManager, taskContext, new GameletClientStub.Factory(),
                TestDummyGenerator.Create <IWindowsRegistry>());

            _varInfoFactory = _compRoot.GetLldbVariableInformationFactory();

            _nLogSpy = _compRoot.GetNatvisDiagnosticLogSpy();
            _nLogSpy.Attach();

            _evaluator = _compRoot.GetNatvisExpressionEvaluator();
        }
예제 #7
0
 public override IWindowsRegistry GetWindowsRegistry() => _windowsRegistry
 ?? (_windowsRegistry = TestDummyGenerator.Create <IWindowsRegistry>());
예제 #8
0
 public void ClassWithNonVirtualFunction()
 {
     Assert.Throws <ArgumentException>(
         () => TestDummyGenerator.Create <DomainObjWithNonVirtualMethod>());
 }