コード例 #1
0
 public Description GenerateDescription(SubmittedProperty submittedProperty, List<Detail> content)
 {
     return new Description
     {
         ShortDescription = submittedProperty.BuildShortDescription(),
         PropertyDescription = submittedProperty.BuildPropertyDescription(),
     };
 }
        public void Bedroom_But_No_Bathroom_Feature_Generates_Short_Description_Including_No_Of_Bedrooms()
        {
            //Arrange
            var property = new SubmittedProperty
            {
                PropertyType = PropertyType.Flat,
                Features =
                    new List<Feature> {new Feature {FeatureType = FeatureType.NumberOfBedrooms, FeatureValue = "2"}}

            };

            //Act
            var description = property.BuildShortDescription();

            //Assert
            description.Should().NotBeNullOrEmpty();
            description.Should().EndWith("2 Bedroom Flat.");
        }
        public void Multiple_Occupancy_And_Bedroom_And_Bathroom_Feature_Generates_Short_Decsription_Including_Beds_And_Baths()
        {
            //Arrange
            var property = new SubmittedProperty
            {
                PropertyType = PropertyType.Flat,
                Features =
                    new List<Feature>
                    {
                        new Feature { FeatureType = FeatureType.NumberOfBedrooms, FeatureValue = "2" },
                        new Feature { FeatureType = FeatureType.NumberOfBathrooms, FeatureValue = "2" },
                        new Feature { FeatureType = FeatureType.MultipleOccupancy, FeatureValue = "Yes" }
                    }
            };

            //Act
            var description = property.BuildShortDescription();

            //Assert
            description.Should().NotBeNullOrEmpty();
            description.Should().EndWith("Room in a 2 Bedroom, 2 Bathroom Flat.");
        }
        public void No_Bedroom_Or_Bathroom_Feature_Generates_Short_Description()
        {
            //Arrange
            var property = new SubmittedProperty
            {
                PropertyType = PropertyType.Flat
            };

            //Act
            var description = property.BuildShortDescription();

            //Assert
            description.Should().NotBeNullOrEmpty();
            description.Should().EndWith("Flat.");
        }