1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
namespace System.Data.Entity.ModelConfiguration.Edm.Common.UnitTests
{
using System.Collections.Generic;
using System.Data.Entity.Core.Metadata.Edm;
using Xunit;
public sealed class DataModelAnnotationExtensionsTests
{
[Fact]
public void Can_get_and_set_configuration_facet()
{
var annotations = new List<DataModelAnnotation>();
annotations.SetConfiguration(42);
Assert.Equal(42, annotations.GetConfiguration());
}
[Fact]
public void Can_get_and_set_clr_type_annotation()
{
var annotations = new List<DataModelAnnotation>();
annotations.SetClrType(typeof(int));
Assert.Equal(typeof(int), annotations.GetClrType());
}
[Fact]
public void Can_get_and_set_custom_annotation()
{
var annotations = new List<DataModelAnnotation>();
Assert.Null(annotations.GetAnnotation("Foo"));
annotations.SetAnnotation("Foo", "Bar");
Assert.Equal("Bar", annotations.GetAnnotation("Foo"));
annotations.SetAnnotation("Foo", "Baz");
Assert.Equal("Baz", annotations.GetAnnotation("Foo"));
Assert.Equal(1, annotations.Count);
}
}
}
|