public static object HandlePostCodeSearch(string address, string postcode)
 {
     return(MockPropertyApiResponses
            .Where(prop => (!string.IsNullOrEmpty(postcode) && prop.PostCode.Equals(postcode)) ||
                   (!string.IsNullOrEmpty(address) && prop.Address1.Contains(address)))
            .ToList());
 }
        internal static PropertyApiResponse NewProperty()
        {
            var newProperty = StubPropertyApiResponse().Generate();

            MockPropertyApiResponses.Add(newProperty);

            return(newProperty);
        }
        internal static void AddProperties(int count, string postcode = null, string address = null)
        {
            var newProperties = StubPropertyApiResponse().Generate(count);

            if (postcode != null)
            {
                newProperties.ForEach(property => property.PostCode = postcode);
            }

            if (address != null)
            {
                newProperties.ForEach(property => property.Address1 = address);
            }

            MockPropertyApiResponses.AddRange(newProperties);
        }
 public static object HandleAddressSearch(string value)
 {
     return(MockPropertyApiResponses.Where(prop => prop.Address1.Contains(value)).ToList());
 }