コード例 #1
0
        public List <TenureType> GenerateDropDownList()
        {
            List <TenureType> TenureTypeList = ReturnAllTenureTypes();
            TenureType        placeHolder    = new TenureType
            {
                Id             = Guid.Empty,
                TenureTypeName = "** Please Select A Tenure Type **"
            };

            TenureTypeList.Add(placeHolder);
            return(TenureTypeList
                   .OrderBy(x => x.TenureTypeName)
                   .ToList());
        }
コード例 #2
0
        public IActionResult Manage(PropertyAttributeViewModel model)
        {
            EPCRating    EPC          = EPCRatingService.ReturnSingleEPCRating(model.PropertyAttribute.EPCRating.Id);
            TenureType   TenureType   = TenureTypeService.ReturnSingleTenureType(model.PropertyAttribute.TenureType.Id);
            PropertyType PropertyType = PropertyTypeService.ReturnSinglePropertyType(model.PropertyAttribute.PropertyType.Id);

            model.PropertyAttribute.EPCRating    = EPC;
            model.PropertyAttribute.TenureType   = TenureType;
            model.PropertyAttribute.PropertyType = PropertyType;

            PropertyAttributeService.UpdatePropertyAttribute(model.PropertyAttribute);
            PropertyAttributeService.SaveChanges();

            return(RedirectToAction("PropertyDetails", "Property", new { PropertyId = model.PropertyId }));
        }
コード例 #3
0
        [TestCase("NOT", false)] // code not in raisableTenureCodes list
        public void TenureResponseObject_ToDomain_CorrectlyMapsCanRaiseRepair(string code, bool canRaiseRepair)
        {
            // Arrange
            var tenureType = new TenureType
            {
                Description = "Random Description",
                Code        = code
            };

            var model = _fixture.Build <TenureResponseObject>()
                        .With(x => x.TenureType, tenureType)
                        .Create();

            // Act
            var result = model.ToDomain();

            // Assert
            result.CanRaiseRepair.Should().Be(canRaiseRepair);
        }
コード例 #4
0
        private TenureResponseObject GenerateTenure(bool canRaiseRepair, string legacyReferenceValue)
        {
            var tenureType = new TenureType
            {
                Description = "Random Description",
                Code        = canRaiseRepair ? "ASY" : "NOT" // ASY in list of raisable tenures
            };

            var legacyReferences = new List <LegacyReference>()
            {
                new LegacyReference
                {
                    Name  = "uh_tag_ref",
                    Value = legacyReferenceValue
                }
            };
            var tenureResponse = _fixture.Build <TenureResponseObject>()
                                 .With(x => x.TenureType, tenureType)
                                 .With(x => x.LegacyReferences, legacyReferences)
                                 .Create();

            return(tenureResponse);
        }