public void AsTimeOfDay_ThrowsArgumentNull()
        {
            // Arrange
            PrimitivePropertyConfiguration property = null;

            // Act & Assert
            ExceptionAssert.ThrowsArgumentNull(() => property.AsTimeOfDay(), "property");
        }
        public void AsTimeOfDay_ThrowsArgument(Type propertyType)
        {
            // Arrange
            MockType     type     = new MockType().Property(propertyType, "CreatedTime");
            PropertyInfo property = type.GetProperty("CreatedTime");

            _structuralType.Setup(t => t.ClrType).Returns(type);

            // Act
            PrimitivePropertyConfiguration propertyConfig = new PrimitivePropertyConfiguration(property, _structuralType.Object);

            // Assert
            ExceptionAssert.ThrowsArgument(() => propertyConfig.AsTimeOfDay(), "property",
                                           "The property 'CreatedTime' on type 'NS.Customer' must be a System.TimeSpan property");
        }
        public void AsTimeOfDay_Works()
        {
            // Arrange
            MockType     type     = new MockType().Property(typeof(TimeSpan), "CreatedTime");
            PropertyInfo property = type.GetProperty("CreatedTime");

            _structuralType.Setup(t => t.ClrType).Returns(type);

            // Act
            PrimitivePropertyConfiguration propertyConfig = new PrimitivePropertyConfiguration(property, _structuralType.Object);
            EdmPrimitiveTypeKind?          typeKind       = propertyConfig.AsTimeOfDay().TargetEdmTypeKind;

            // Assert
            Assert.NotNull(typeKind);
            Assert.Equal(EdmPrimitiveTypeKind.TimeOfDay, typeKind);
        }