Пример #1
0
        private void ShouldReturnNullWhenEmpty(
            DataTypeAttributeExtractor sut)
        {
            var dataTypeAttribute = sut.GetDataTypeAttribute(new object[] { });

            Assert.Null(dataTypeAttribute);
        }
Пример #2
0
        private void ShouldReturnNullWhenNotFound(
            object[] customAttributes,
            DataTypeAttributeExtractor sut)
        {
            var dataTypeAttribute = sut.GetDataTypeAttribute(customAttributes);

            Assert.Null(dataTypeAttribute);
        }
Пример #3
0
        private void ShouldReturnMetaData(
            IEnumerable <object> customAttributes,
            DataTypeAttributeExtractor sut,
            DataTypeAttribute expectedAttribute)
        {
            customAttributes = customAttributes.Append(expectedAttribute);

            var dataTypeAttribute = sut.GetDataTypeAttribute(customAttributes.ToArray());

            Assert.Same(expectedAttribute, dataTypeAttribute);
        }
Пример #4
0
 private void ShouldReturnThrowInvalidOperationException(
     IEnumerable <DataTypeAttribute> customAttributes,
     DataTypeAttributeExtractor sut)
 {
     Assert.Throws <InvalidOperationException>(() => sut.GetDataTypeAttribute(customAttributes.ToArray <object>()));
 }
Пример #5
0
 private void ShouldThrowArgumentNullException(DataTypeAttributeExtractor sut)
 {
     Assert.Throws <ArgumentNullException>(() => sut.GetDataTypeAttribute(null));
 }