update MEF to preview 9
[mcs.git] / class / System.ComponentModel.Composition / Tests / ComponentModelUnitTest / System / ComponentModel / Composition / ComposablePartTests.cs
blobbab987db6f386adaf54fc783f8e880a676d64842
1 // -----------------------------------------------------------------------
2 // Copyright (c) Microsoft Corporation. All rights reserved.
3 // -----------------------------------------------------------------------
4 using System;
5 using System.Collections.Generic;
6 using System.ComponentModel.Composition.Factories;
7 using System.Linq;
8 using System.UnitTesting;
9 using Microsoft.VisualStudio.TestTools.UnitTesting;
11 namespace System.ComponentModel.Composition
13 [TestClass]
14 public class ComposablePartTests
16 [TestMethod]
17 public void Constructor1_ShouldSetMetadataPropertyToEmptyDictionary()
19 var part = PartFactory.Create();
21 EnumerableAssert.IsEmpty(part.Metadata);
24 [TestMethod]
25 public void Constructor1_ShouldSetMetadataPropertyToReadOnlyDictionary()
27 var part = PartFactory.Create();
29 ExceptionAssert.Throws<NotSupportedException>(() =>
31 part.Metadata["Value"] = "Value";
32 });
35 [TestMethod]
36 public void OnComposed_DoesNotThrow()
38 var part = PartFactory.Create();
39 part.Activate();