Example #1
0
        public void GetStorageClass_WithoutAttribute_ReturnsNull()
        {
            var propertyInformationStub = MockRepository.GenerateStub <IPropertyInformation>();

            propertyInformationStub
            .Stub(_ => _.GetCustomAttribute <StorageClassAttribute> (false))
            .Return(null);

            var reflector = new PropertyMetadataReflector();
            var result    = reflector.GetStorageClass(propertyInformationStub);

            Assert.That(result, Is.Null);
        }
Example #2
0
        public void GetStorageClass_WithDerivedAttribute_ReturnsStorageClass()
        {
            var propertyInformationStub = MockRepository.GenerateStub <IPropertyInformation>();

            propertyInformationStub
            .Stub(_ => _.GetCustomAttribute <StorageClassAttribute> (false))
            .Return(new StorageClassNoneAttribute());

            var reflector = new PropertyMetadataReflector();
            var result    = reflector.GetStorageClass(propertyInformationStub);

            Assert.That(result, Is.EqualTo(StorageClass.None));
        }