private void AssertParseValue <T>(string stringValue, T expected)
        {
            var field  = CreateField(stringValue);
            var actual = Materializer.ParseValue(field, typeof(T));

            Assert.That(actual, Is.TypeOf <T>());
            Assert.That(actual, Is.EqualTo(expected));
        }
        public void ParseValue_Always_UsesTypeFactoryToMapTypes()
        {
            // Arrange
            var typeFactoryMock = new Mock <ITypeFactory>();
            var materializer    = new SimpleMaterializer(new EntityActivator(), typeFactoryMock.Object);

            typeFactoryMock.Setup(x => x.GetFor(typeof(int))).Returns(new Int64Type()).Verifiable();

            // Act
            var value = materializer.ParseValue(CreateField("15"), typeof(int));

            // Assert
            typeFactoryMock.Verify();
            Assert.That(value, Is.TypeOf <long>());
        }