private List <Product> Map(List <EntityModels.ProductDB> products) { var filteredProduct = products.Select(p => p).Where(pp => !string.IsNullOrEmpty(pp.Id)).Where(n => !string.IsNullOrEmpty(n.Name)).Where(pr => !string.IsNullOrEmpty(pr.Price)); var productItems = filteredProduct?.Select(p => new Product { Id = _iformatUtils.TryParseInt(p.Id), Name = p.Name, Price = (int)_iformatUtils.TryParseFloat(p.Price) }) ?? new List <Product>(); return(productItems.ToList()); }
public void FormatUtils_TryParseInt_Int() { var i = _sut.TryParseInt("2"); Assert.IsInstanceOfType(i, typeof(Int32)); }