public void GetAvailableProduct_Should_Not_Return_Available_Products_if_ltv_equals_90() { IProduct products = new InMemoryProduct(); IUser users = new InMemoryUser(); User newUser = new User() { Id = 0, FirstName = "Sanjay", LastName = "xxx", DOB = DateTime.Parse("1990-05-05"), Email = "*****@*****.**" }; users.AddUser(newUser); ProductServiceProvider service = new ProductServiceProvider(products, users); ProductSearchTerms terms = new ProductSearchTerms() { UserID = 1, PropertyValue = 100000, DepositeAmount = 10000 }; var result = service.GetAvailableProduct(terms); Assert.AreEqual(null, result); }
public void GetAvailableProduct_Should_Return_Available_Products_LTV60_And90() { IProduct products = new InMemoryProduct(); IUser users = new InMemoryUser(); User newUser = new User() { Id = 0, FirstName = "Sanjay", LastName = "xxx", DOB = DateTime.Parse("1990-05-05"), Email = "*****@*****.**" }; users.AddUser(newUser); ProductServiceProvider service = new ProductServiceProvider(products, users); ProductSearchTerms terms = new ProductSearchTerms() { UserID = 1, PropertyValue = 100000, DepositeAmount = 40001 }; var expect = products.GetAllProducts(); var result = service.GetAvailableProduct(terms); Assert.AreEqual(expect.Count() == 3, result.Count() == 3); Assert.AreEqual(expect.ElementAt(0).LoanToValuePercentage, result.ElementAt(0).LoanToValuePercentage); }