public HttpResponseMessage Transactions(int customerId = 0, string email = "") { if (customerId != 0 || !string.IsNullOrEmpty(email)) { var customer = CustomerUtilities.GetCustomerByIdOrEmail(customerId, email); if (customer != null) { var model = CustomerUtilities.Model(customer); return(Request.CreateResponse(HttpStatusCode.OK, model)); } return(Request.CreateResponse(HttpStatusCode.NotFound)); } return(Request.CreateResponse(HttpStatusCode.BadRequest)); }
private void TestCustomerTransactions_ShouldReturnCustomer() { var customer = CustomerUtilities.GetCustomerByIdOrEmail(email: "*****@*****.**"); Assert.AreEqual(true, customer.Transactions.Count() > 0); }
private void TestCustomerEmail_ShouldReturnCustomer() { var customer = CustomerUtilities.GetCustomerByIdOrEmail(email: "*****@*****.**"); Assert.AreEqual(true, customer != null); }
private void TestCustomerId_ShouldReturnCustomer() { var customer = CustomerUtilities.GetCustomerByIdOrEmail(435622); Assert.AreEqual(true, customer != null); }