public void CanReadSingleAndMultiDropDownListPropertiesWithConfigurations()
        {
            IPropertyReaderService<NewsArticleDTO> propertyReaderService = new PropertyReaderService<NewsArticleDTO>();
            propertyReaderService.ReadViewModelProperties();

            Assert.AreEqual(typeof(NewsArticleDTO).GetProperties().Length, propertyReaderService.FormFields.Count);
            Assert.AreEqual("Name", propertyReaderService.FormFields[0].Label);

            foreach (var field in propertyReaderService.FormFields)
            {
                switch (field.Id)
                {
                    case "Id":
                        AssertFormFieldData("Id", FieldType.Hidden, field);
                        break;
                    case "Headline":
                        AssertFormFieldData("Headline", FieldType.SingleLineTextField, field);
                        break;
                    case "Story":
                        AssertFormFieldData("Story", FieldType.MultiLineTextField, field);
                        break;
                    case "Date":
                        AssertFormFieldData("Date", FieldType.Date, field);
                        break;
                    case "Type":
                        AssertFormFieldData("Type", FieldType.SingleSelectDropDownList, field);
                        Assert.AreEqual("Id", field.OptionValue);
                        Assert.AreEqual("Name", field.OptionText);
                        break;
                    case "Tags":
                        AssertFormFieldData("Tags", FieldType.MultiSelectDropDownList, field);
                        Assert.AreEqual("Id", field.OptionValue);
                        Assert.AreEqual("Tag", field.OptionText);
                        break;
                }
            }
        }
        public void CanReadSimpleConfigurationDTOProperties()
        {
            IPropertyReaderService<TestSimpleConfigurationDTO> propertyReaderService = new PropertyReaderService<TestSimpleConfigurationDTO>();
            propertyReaderService.ReadViewModelProperties();

            // Remember the 1 ignore field
            Assert.AreEqual(typeof(TestSimpleConfigurationDTO).GetProperties().Length - 1, propertyReaderService.FormFields.Count);
            Assert.AreEqual("Name", propertyReaderService.FormFields[0].Label);

            foreach (var field in propertyReaderService.FormFields)
            {
                switch (field.Id)
                {
                    case "Id":
                        AssertFormFieldData("Id", FieldType.Hidden, field);
                        break;
                    case "Title":
                        AssertFormFieldData("Title", FieldType.SingleLineTextField, field);
                        break;
                    case "ShortDescription":
                        AssertFormFieldData("Short Description", FieldType.MultiLineTextField, field);
                        break;
                    case "FullDescription":
                        AssertFormFieldData("Full Description", FieldType.TextEditor, field);
                        break;
                    case "NewsImage":
                        AssertFormFieldData("News Image", FieldType.Asset, field);
                        break;
                }
            }
        }
        public void CanReadSimpleConventionBasedDTOProperties()
        {
            IPropertyReaderService<TestSimpleConventionDto> propertyReaderService = new PropertyReaderService<TestSimpleConventionDto>();
            propertyReaderService.ReadViewModelProperties();

            Assert.AreEqual(typeof(TestSimpleConventionDto).GetProperties().Length, propertyReaderService.FormFields.Count);
            Assert.AreEqual("Name", propertyReaderService.FormFields[0].Label);

            foreach (var field in propertyReaderService.FormFields)
            {
                switch (field.Id)
                {
                    case "Id":
                        AssertFormFieldData("Id", FieldType.Hidden, field);
                        break;
                    case "ProductName":
                        AssertFormFieldData("Product Name", FieldType.SingleLineTextField, field);
                        break;
                    case "Price":
                        AssertFormFieldData("Price", FieldType.SingleLineTextField, field);
                        break;
                    case "ExpiresOn":
                        AssertFormFieldData("Expires On", FieldType.Date, field);
                        break;
                    case "ShowOnHomePage":
                        AssertFormFieldData("Show On Home Page", FieldType.CheckBox, field);
                        break;
                    case "OrderPosition":
                        AssertFormFieldData("Order Position", FieldType.Hidden, field);
                        break;
                }
            }
        }
        public void CanReadHasAndBelongsToManyDTOPropertiesWithConventions()
        {
            IPropertyReaderService<AccessoryDTO> propertyReaderService = new PropertyReaderService<AccessoryDTO>();
            propertyReaderService.ReadViewModelProperties();

            Assert.AreEqual(typeof(AccessoryDTO).GetProperties().Length, propertyReaderService.FormFields.Count);
            Assert.AreEqual("Name", propertyReaderService.FormFields[0].Label);

            foreach (var field in propertyReaderService.FormFields)
            {
                switch (field.Id)
                {
                    case "Id":
                        AssertFormFieldData("Id", FieldType.Hidden, field);
                        break;
                    case "Name":
                        AssertFormFieldData("Name", FieldType.SingleLineTextField, field);
                        break;
                    case "Price":
                        AssertFormFieldData("Price", FieldType.SingleLineTextField, field);
                        break;
                    case "Product":
                        AssertFormFieldData("Product", FieldType.MultiSelectDropDownList, field);
                        Assert.AreEqual("Id", field.OptionValue);
                        Assert.AreEqual("Name", field.OptionText);
                        break;
                }
            }
        }