Esempio n. 1
0
        public void Key_WhenMapKeys_ShouldBeInKeys()
        {
            var sut = new IntEntityClassMapper();

            sut.Key(x => x.Id);

            var result = sut.GetKeyMapByName(nameof(IntEntity.Id));

            Assert.NotNull(result);
        }
Esempio n. 2
0
        public void Key_WhenKeyIsAutoGenerated_ShouldBeIgnoredAndReadOnly()
        {
            var sut = new IntEntityClassMapper();

            sut.Key(x => x.Id).GeneratedBy.AutoGenerated();

            var result = sut.GetKeyMapByName(nameof(IntEntity.Id));

            Assert.NotNull(result);
            result.AssertPropertyMap(nameof(IntEntity.Id), true, true);
        }
Esempio n. 3
0
        public void Key_WhenKColumnNameIsChanged_ShouldHaveNewColumnName()
        {
            const string columnName = "new_name";

            var sut = new IntEntityClassMapper();

            sut.Key(x => x.Id).Column(columnName);

            var result = sut.GetKeyMapByName(nameof(IntEntity.Id));

            Assert.NotNull(result);
            result.AssertPropertyMap(columnName, true, true);
        }