mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-16 17:10:20 -10:00
45 lines
1.3 KiB
C#
45 lines
1.3 KiB
C#
// -----------------------------------------------------------------------
|
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
// -----------------------------------------------------------------------
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.Composition;
|
|
using System.Linq;
|
|
using System.Reflection;
|
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
using System.UnitTesting;
|
|
using System.ComponentModel.Composition.Factories;
|
|
|
|
namespace System.ComponentModel.Composition
|
|
{
|
|
[TestClass]
|
|
public class ComposablePartDefinitionTests
|
|
{
|
|
[TestMethod]
|
|
public void Constructor1_ShouldNotThrow()
|
|
{
|
|
PartDefinitionFactory.Create();
|
|
}
|
|
|
|
[TestMethod]
|
|
public void Constructor1_ShouldSetMetadataPropertyToEmptyDictionary()
|
|
{
|
|
var definition = PartDefinitionFactory.Create();
|
|
|
|
EnumerableAssert.IsEmpty(definition.Metadata);
|
|
}
|
|
|
|
[TestMethod]
|
|
public void Constructor1_ShouldSetMetadataPropertyToReadOnlyDictionary()
|
|
{
|
|
var definition = PartDefinitionFactory.Create();
|
|
|
|
ExceptionAssert.Throws<NotSupportedException>(() =>
|
|
{
|
|
definition.Metadata["Value"] = "Value";
|
|
});
|
|
}
|
|
}
|
|
}
|
|
|