PageRenderTime 20ms CodeModel.GetById 12ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/V4/PrismLibrary/Desktop/Prism.UnityExtensions.Tests/UnityBootstrapperNullContainerFixture.cs

#
C# | 53 lines | 33 code | 4 blank | 16 comment | 0 complexity | 36b682fd16c11f6048a70ae906f8b020 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.Windows;
19using Microsoft.Practices.Prism.UnityExtensions;
20using Microsoft.Practices.Unity;
21using Microsoft.VisualStudio.TestTools.UnitTesting;
22
23namespace Microsoft.Practices.Prism.UnityExtensions.Tests
24{
25    [TestClass]
26    public class UnityBootstrapperNullContainerFixture : BootstrapperFixtureBase
27    {
28        [TestMethod]
29        public void RunThrowsWhenNullContainerCreated()
30        {
31            var bootstrapper = new NullContainerBootstrapper();
32
33            AssertExceptionThrownOnRun(bootstrapper, typeof(InvalidOperationException), "IUnityContainer");
34        }
35
36        private class NullContainerBootstrapper : UnityBootstrapper
37        {
38            protected override IUnityContainer CreateContainer()
39            {
40                return null;
41            }
42            protected override DependencyObject CreateShell()
43            {
44                throw new NotImplementedException();
45            }
46
47            protected override void InitializeShell()
48            {
49                throw new NotImplementedException();
50            }
51        }    
52    }
53}