public void Conversion_Handlers_Can_Run_Global()
        {
            var content = new PublishedContentMock
            {
                Properties = new[]
                {
                    new PublishedContentPropertyMock
                    {
                        Alias = "prop1",
                        Value = "Test1"
                    },
                    new PublishedContentPropertyMock
                    {
                        Alias = "prop2",
                        Value = "Test2"
                    }
                }
            };

            Ditto.RegisterConversionHandler <CalculatedModel2, CalculatedModel2ConversionHandler>();

            var model = content.As <CalculatedModel2>();

            Assert.That(model.AltText2, Is.EqualTo("Test1 Test2"));
        }
        public void Multiple_Conversion_Handlers_Registered_Same_Type()
        {
            Ditto.RegisterConversionHandler <MyModel, MyModelConversionHandler>();
            Ditto.RegisterConversionHandler <MyModel, MyModelConversionHandler2>();

            var content = new PublishedContentMock();

            var model = content.As <MyModel>();

            Assert.That(model, Is.Not.Null);
            Assert.That(model.Name, Is.EqualTo("foo bar"));
        }