예제 #1
0
        public void GetPropertyMap__TypeNotNull_IncludeAndExcludeAttributesAreSetted__RegistersAttributesWithPropertyNames()
        {
            // Arrange:
            var type = typeof(TestType);

            // Action:
            var propertyMap = TypeRepository.GetPropertyMap(type, typeof(HeaderAttribute), typeof(HiddenAttribute));

            // Assert:
            Assert.That(propertyMap.Keys, Is.EquivalentTo(TestType.PropertyAttributesCollection));
        }
예제 #2
0
        public void TryGetPropertyMap_TypeValid_ReturnsPropertyMap()
        {
            var type        = typeof(TestType);
            var propertyMap = TypeRepository.GetPropertyMap(type);
            var sheet       = MockedSheetFactory.GetMockedSheet(TestType.TableData);
            var sheetTable  = new SheetTable(sheet);

            var res = TypeRepository.TryGetPropertyMap(sheetTable, type, out var map);

            Assert.That(res);
            Assert.That(propertyMap.Keys.All(k => !String.IsNullOrWhiteSpace(k[0])));
        }