Beispiel #1
0
        public void PropertyValueAccessorGetInt64EnumTest()
        {
            // Arrange
            PropertyInfo      propertyInfo  = typeof(EntityWithProperties).GetProperty("Int64Enum");
            var               valueAccessor = new PropertyValueAccessor <EntityWithProperties>(propertyInfo);
            const MyInt64Enum value         = MyInt64Enum.A;
            var               user          = new EntityWithProperties {
                Int64Enum = value
            };

            // Act
            EntityProperty entityProperty = valueAccessor.GetValue(user);

            // Assert
            Assert.Equal((Int64)value, entityProperty.Int64Value);
        }
Beispiel #2
0
        public void PropertyValueAccessorSetInt64EnumTest()
        {
            // Arrange
            PropertyInfo propertyInfo  = typeof(EntityWithProperties).GetProperty("Int64Enum");
            var          valueAccessor = new PropertyValueAccessor <EntityWithProperties>(propertyInfo);
            var          entity        = new EntityWithProperties {
                Int64Enum = MyInt64Enum.A
            };
            const MyInt64Enum newValue = MyInt64Enum.B;

            // Act
            valueAccessor.SetValue(entity, new EntityProperty((Int64)newValue));

            // Assert
            Assert.Equal(newValue, entity.Int64Enum);
        }