コード例 #1
0
ファイル: KernelTest.cs プロジェクト: pvandervelde/Apollo
        public void InstallServiceThatDependsOnItself()
        {
            var systemDiagnostics = new SystemDiagnostics((p, s) => { }, null);
            var testMock = new AdaptableKernelService(
                new[] { typeof(AdaptableKernelService) },
                systemDiagnostics);

            var kernel = new Kernel(
                () => { },
                systemDiagnostics);
            Assert.Throws<ServiceCannotDependOnItselfException>(() => kernel.Install(testMock));
        }
コード例 #2
0
        public void InstallServiceThatDependsOnKernelService()
        {
            var systemDiagnostics = new SystemDiagnostics((p, s) => { }, null);
            var testMock          = new AdaptableKernelService(
                new[] { typeof(KernelService) },
                systemDiagnostics);

            var kernel = new Kernel(
                () => { },
                systemDiagnostics);

            Assert.Throws <ServiceCannotDependOnGenericKernelServiceException>(() => kernel.Install(testMock));
        }