public void GetCustomAttributes_NonGeneric_InsertDefaultSchema_ForeignKeyAttribute_Test()
        {
            // Arrange

            const string defaultSchema = "defaultSchema123";

            var attributeDecorator = new StandardAttributeDecorator(x => null, null, defaultSchema);

            // Act

            IEnumerable<Attribute> resultSet =
                attributeDecorator.GetCustomAttributes(typeof (ForeignClass).GetProperty("ForeignKey"));

            Attribute result = resultSet.First();

            // Assert

            Assert.AreEqual(defaultSchema, ((ForeignKeyAttribute)result).Schema);
        }
 public void TestInitialize()
 {
     this.tableTypeCacheMock = new Mock<TableTypeCache>((Func<TableTypeCache, ITableTypeCacheService>)(x => null));
     this.attributeDecorator = new StandardAttributeDecorator(x => this.tableTypeCacheMock.Object, this.GetType().Assembly, null);
     this.populator = new Populator(this.attributeDecorator);
 }
        public void GetCustomAttributes_Generic_InsertDefaultSchema_ExplicitSchema_Test()
        {
            // Arrange

            const string defaultSchema = "defaultSchema123";

            var attributeDecorator = new StandardAttributeDecorator(x => null, null, defaultSchema);

            // Act

            IEnumerable<ForeignKeyAttribute> resultSet =
                attributeDecorator.GetCustomAttributes<ForeignKeyAttribute>(
                    typeof (ClassWithSchemaInForeignKey).GetProperty("ForeignKey"));

            ForeignKeyAttribute result = resultSet.First();

            // Assert

            Assert.AreEqual(ClassWithSchemaInForeignKey.Schema, result.Schema);
        }