1 // -----------------------------------------------------------------------
2 // Copyright (c) Microsoft Corporation. All rights reserved.
3 // -----------------------------------------------------------------------
5 using System
.Collections
.Generic
;
6 using System
.ComponentModel
.Composition
.Factories
;
8 using System
.UnitTesting
;
9 using Microsoft
.VisualStudio
.TestTools
.UnitTesting
;
11 namespace System
.ComponentModel
.Composition
14 public class ComposablePartTests
17 public void Constructor1_ShouldSetMetadataPropertyToEmptyDictionary()
19 var part
= PartFactory
.Create();
21 EnumerableAssert
.IsEmpty(part
.Metadata
);
25 public void Constructor1_ShouldSetMetadataPropertyToReadOnlyDictionary()
27 var part
= PartFactory
.Create();
29 ExceptionAssert
.Throws
<NotSupportedException
>(() =>
31 part
.Metadata
["Value"] = "Value";
36 public void OnComposed_DoesNotThrow()
38 var part
= PartFactory
.Create();