Пример #1
0
        public void ValdrTypeAttributeDescriptorTest()
        {
            // Arrange and Act
            var type = new ValdrTypeAttributeDescriptor(typeof(ValdrTypeAttribute), nameof(ValdrTypeAttribute.Name));

            // Assert
            Assert.That(type.TypeName, Is.EqualTo(typeof(ValdrTypeAttribute).Name), "TypeName not as expected.");
            Assert.That(type.ValdrTypePropertyName, Is.EqualTo(nameof(ValdrTypeAttribute.Name)), "ValdrTypePropertyName not as expected.");
        }
Пример #2
0
        public void ValdrTypeAttributeDescriptorWithoutParameterTest()
        {
            // Arrange
            ValdrTypeAttributeDescriptor type = null;

            // Act
            var ex = Assert.Throws <ArgumentNullException>(() => type = new ValdrTypeAttributeDescriptor(null, null));

            // Assert
            Assert.That(ex.Message.Substring(0, 21), Is.EqualTo("Value cannot be null."));
            Assert.That(type, Is.Null);
        }