public void GetAccountTest() { var accountServiceMock = new Mock<IAccountService>(); accountServiceMock.Setup(ser => ser.GetAccount(1)) .Returns(new AccountEntity { Account_Id = 1, Account_Number = "1234-12345", Account_Type = "Deposit", Account_Balance = 1000, Customer_Id = 2, Deleted = false }); var controller = new AccountController(accountServiceMock.Object) { Request = new HttpRequestMessage(), Configuration = new HttpConfiguration() }; var accountDetail = controller.GetAccount(1); Assert.AreEqual(accountDetail.Account_Id, 1); Assert.AreEqual(accountDetail.Account_Number, "1234-12345"); Assert.AreEqual(accountDetail.Account_Type, "Deposit"); Assert.AreEqual(accountDetail.Account_Balance, 1000); Assert.AreEqual(accountDetail.Customer_Id, 2); Assert.AreEqual(accountDetail.Deleted, false); }