public IHttpActionResult GetUserStatus() { try { var model = _bankingAccount.GetUserData(User.Identity.Name); return(Ok(model)); } catch (Exception e) { return(InternalServerError(e)); } }
public void Get_User_Data_Autofac() { //Arrange _mockContextFactory.Setup(x => x.Create()).Returns(_mockContext.Object); //Act var result = _bankingAccount.GetUserData("*****@*****.**"); //Assert Assert.IsNotNull(result); Assert.AreEqual(result.AvailableAmount, 200); Assert.AreEqual(result.History.Count, 3); }