Пример #1
0
        public void AddNothingTest()
        {
            var editor = new InterfaceEditor
            {
                TypeNameWriter = new TypeNameWriter(false),
                EntityType     = MockUtilities.CreateEntityMock().Object,
                AllElements    = new List <IWritableElement>
                {
                    new PropertyAttributeElement()
                }
            };

            var edited = editor.EditEntity(@"using System;

public partial class Entity
{
}");

            var expected = @"using System;

public partial class Entity
{
}";

            Assert.Equal(expected, edited);
        }
Пример #2
0
        public void AddMultipleInterfaceNotFullyQualifiedTest()
        {
            var editor = new InterfaceEditor
            {
                TypeNameWriter = new TypeNameWriter(false),
                EntityType     = MockUtilities.CreateEntityMock().Object,
                AllElements    = new List <IWritableElement>
                {
                    new InterfaceElement(typeof(IAttributeTaggedEntityConventionDateTimeProperty)),
                    new InterfaceElement(typeof(IAttributeTaggedEntityConventionNullableIntProperty))
                }
            };

            var edited = editor.EditEntity(@"using System;

public partial class Entity
{
}");

            var expected = @"using System;

public partial class Entity : IAttributeTaggedEntityConventionDateTimeProperty, IAttributeTaggedEntityConventionNullableIntProperty
{
}";

            Assert.Equal(expected, edited);
        }