Пример #1
0
        public void FindsIdNamedId()
        {
            // Arrange
            var mm = new ModelManager(new PluralizationService());
            mm.RegisterResourceType(typeof(Author));

            // Act
            PropertyInfo idprop = mm.GetIdProperty(typeof(Author));

            // Assert
            Assert.AreSame(typeof(Author).GetProperty("Id"), idprop);
        }
Пример #2
0
        public void FindsIdFromAttribute()
        {
            // Arrange
            var mm = new ModelManager(new PluralizationService());
            mm.RegisterResourceType(typeof(CustomIdModel));
            
            // Act
            PropertyInfo idprop = mm.GetIdProperty(typeof(CustomIdModel));

            // Assert
            Assert.AreSame(typeof(CustomIdModel).GetProperty("Uuid"), idprop);
        }