diff options
author | Marek Safar <marek.safar@gmail.com> | 2014-12-04 17:16:31 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2014-12-04 17:16:31 +0300 |
commit | a1aced8ab22c1dabd25542fe808459f332039ee9 (patch) | |
tree | edc815c58e3da7337a937cc454546af09b9530d7 /mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionContainerExtensibilityTests.cs | |
parent | 336755ca9edfbb0dd5c395f59a398c76449f7fdc (diff) |
Remove 4.0 profile
Diffstat (limited to 'mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionContainerExtensibilityTests.cs')
-rw-r--r-- | mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionContainerExtensibilityTests.cs | 81 |
1 files changed, 0 insertions, 81 deletions
diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionContainerExtensibilityTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionContainerExtensibilityTests.cs deleted file mode 100644 index f088200809b..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionContainerExtensibilityTests.cs +++ /dev/null @@ -1,81 +0,0 @@ -// -----------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// -----------------------------------------------------------------------
-using System;
-using System.ComponentModel.Composition.Factories;
-using System.ComponentModel.Composition.Hosting;
-using System.Linq;
-using System.UnitTesting;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
-
-namespace System.ComponentModel.Composition
-{
- [TestClass]
- public class CompositionContainerExtensibilityTests
- {
- [TestMethod]
- public void Dispose_DoesNotThrow()
- {
- var container = CreateCustomCompositionContainer();
- container.Dispose();
- }
-
- [TestMethod]
- public void DerivedCompositionContainer_CanExportItself()
- {
- var container = CreateCustomCompositionContainer();
- container.AddAndComposeExportedValue<CustomCompositionContainer>(container);
-
- Assert.AreSame(container, container.GetExportedValue<CustomCompositionContainer>());
- }
-
- [TestMethod]
- public void ICompositionService_CanBeExported()
- {
- var container = CreateCustomCompositionContainer();
- container.AddAndComposeExportedValue<ICompositionService>(container);
-
- Assert.AreSame(container, container.GetExportedValue<ICompositionService>());
- }
-
- [TestMethod]
- public void CompositionContainer_CanBeExported()
- {
- var container = CreateCustomCompositionContainer();
- container.AddAndComposeExportedValue<CompositionContainer>(container);
-
- Assert.AreSame(container, container.GetExportedValue<CompositionContainer>());
- }
-
- [TestMethod]
- public void CanBeCollectedAfterDispose()
- {
- AggregateExportProvider exportProvider = new AggregateExportProvider();
- var catalog = new AggregateCatalog(CatalogFactory.CreateDefaultAttributed());
- var container = new CompositionContainer(catalog, exportProvider);
-
- WeakReference weakContainer = new WeakReference(container);
- container.Dispose();
- container = null;
-
- GC.Collect();
- GC.WaitForPendingFinalizers();
-
- Assert.IsFalse(weakContainer.IsAlive);
-
- GC.KeepAlive(exportProvider);
- GC.KeepAlive(catalog);
- }
-
- private CustomCompositionContainer CreateCustomCompositionContainer()
- {
- return new CustomCompositionContainer();
- }
-
- // Type needs to be public otherwise container.GetExportedValue<CustomCompositionContainer>
- // fails on Silverlight because it cannot construct a Lazy<T,M> factory.
- public class CustomCompositionContainer : CompositionContainer
- {
- }
- }
-}
|