PageRenderTime 22ms CodeModel.GetById 18ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/V4/PrismLibrary/Desktop/Prism.MefExtensions.Tests/MefNullContainerBootstrapperFixture.cs

#
C# | 54 lines | 33 code | 5 blank | 16 comment | 0 complexity | 09473544dd6d4602ce8954148c508ed5 MD5 | raw file
 1//===================================================================================
 2// Microsoft patterns & practices
 3// Composite Application Guidance for Windows Presentation Foundation and Silverlight
 4//===================================================================================
 5// Copyright (c) Microsoft Corporation.  All rights reserved.
 6// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
 7// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
 8// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 9// FITNESS FOR A PARTICULAR PURPOSE.
10//===================================================================================
11// The example companies, organizations, products, domain names,
12// e-mail addresses, logos, people, places, and events depicted
13// herein are fictitious.  No association with any real company,
14// organization, product, domain name, email address, logo, person,
15// places, or events is intended or should be inferred.
16//===================================================================================
17using System;
18using System.ComponentModel.Composition.Hosting;
19using System.Windows;
20using Microsoft.Practices.Prism.MefExtensions;
21using Microsoft.VisualStudio.TestTools.UnitTesting;
22
23namespace Microsoft.Practices.Prism.MefExtensions.Tests
24{
25    [TestClass]
26    public class MefNullContainerBootstrapperFixture : BootstrapperFixtureBase
27    {
28        [TestMethod]
29        public void RunThrowsWhenNullContainerCreated()
30        {
31            var bootstrapper = new NullContainerBootstrapper();
32
33            AssertExceptionThrownOnRun(bootstrapper, typeof(InvalidOperationException), "CompositionContainer");
34        }
35
36        internal class NullContainerBootstrapper : MefBootstrapper
37        {
38            protected override CompositionContainer CreateContainer()
39            {
40                return null;
41            }
42
43            protected override DependencyObject CreateShell()
44            {
45                throw new NotImplementedException();
46            }
47
48            protected override void InitializeShell()
49            {
50                throw new NotImplementedException();
51            }
52        }        
53    }
54}