Exemplo n.º 1
0
        public void TestPrimaryResolverWithTableAttributeAndWithPrimaryProperty()
        {
            // Setup
            var resolver = new PrimaryResolver();

            // Act
            var result   = resolver.Resolve(typeof(EntityModelWithTableAttributeAndPrimaryProperty))?.GetMappedName();
            var expected = "TableId";

            // Assert
            Assert.AreEqual(expected, result);
        }
Exemplo n.º 2
0
        public void TestPrimaryResolverWithKeyAttribute()
        {
            // Setup
            var resolver = new PrimaryResolver();

            // Act
            var result   = resolver.Resolve(typeof(EntityModelWithKeyAttribute))?.GetMappedName();
            var expected = "PrimaryId";

            // Assert
            Assert.AreEqual(expected, result);
        }
Exemplo n.º 3
0
        public void TestPrimaryResolverWithKeyAttributeAndMappings()
        {
            // Setup
            var resolver = new PrimaryResolver();

            FluentMapper
            .Entity <EntityModelWithKeyAttribute>()
            .Primary(e => e.SecondaryId);

            // Act
            var result   = resolver.Resolve(typeof(EntityModelWithKeyAttribute))?.GetMappedName();
            var expected = "PrimaryId";

            // Assert
            Assert.AreEqual(expected, result);
        }