public void GetAccountTypes() { #region Assign AccountTypeRepo testRepo = new AccountTypeRepo(); AccountTypesApiController testController = new AccountTypesApiController(testRepo, testLogger); #endregion #region Act var taskReturn = testController.GetAccountTypes(); var taskResults = taskReturn.Result.Value.ToList(); #endregion #region Assert foreach (AccountType element in taskResults) { Assert.AreEqual(test_accountTypes[taskResults.IndexOf(element)].Id, element.Id); Assert.AreEqual(test_accountTypes[taskResults.IndexOf(element)].Name, element.Name); Assert.AreEqual(test_accountTypes[taskResults.IndexOf(element)].InterestRate, element.InterestRate); } #endregion }
public void GetAccountTypeByName() { #region Assign AccountTypeRepo testRepo = new AccountTypeRepo(); AccountTypesApiController testController = new AccountTypesApiController(testRepo, testLogger); #endregion foreach (AccountType element in test_accountTypes) { #region Act var taskReturn = testController.GetAccountTypeByName(element.Name); var taskResult = taskReturn.Result.Value; #endregion #region Assert Assert.AreEqual(element.Id, taskResult.Id); Assert.AreEqual(element.Name, taskResult.Name); Assert.AreEqual(element.InterestRate, taskResult.InterestRate); #endregion } }
public void AddAccountType() { #region Assign AccountTypeRepo testRepo = new AccountTypeRepo(); AccountTypesApiController testController = new AccountTypesApiController(testRepo, testLogger); #endregion #region Act var task = testRepo.AddAccountType(new AccountType { Id = 5, Name = "DankMemes", InterestRate = 69M }); task.Wait(); AccountType newAccount = testRepo.GetAccountTypeById(5).Result; #endregion #region Assert Assert.AreEqual(5, newAccount.Id); Assert.AreEqual("DankMemes", newAccount.Name); Assert.AreEqual(69M, newAccount.InterestRate); #endregion }