Esempio 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);
        }
Esempio 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);
        }
Esempio 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);
        }