public void Data_Read_Other_User_Category() { var repository = new CategoryRepository(_dataConnectionString, 1); var data = repository.Get(9); Assert.IsTrue(data == null); }
public void Data_Delete_Category() { var repository = new CategoryRepository(_dataConnectionString, 1); var result = repository.Delete(1); var category = repository.Get(1); Assert.IsTrue(category == null); Assert.IsTrue(result.Deleted == true); Assert.IsTrue(result.DeletedBy == 1); Assert.IsTrue(result.DeletedDate.Value.Date == DateTime.Now.Date); }
public void Data_Read_Category() { var repository = new CategoryRepository(_dataConnectionString, 1); var data = repository.Get(1); Assert.IsTrue(data.CategoryID == 1); Assert.IsTrue(data.Name == "Salary"); Assert.IsTrue(data.Account_AccountID == 1); Assert.IsTrue(data.AccountName == "Current"); }
public void Data_Update_Category() { var repository = new CategoryRepository(_dataConnectionString, 1); var category = repository.Get(1); category.Account_AccountID = 2; category.Name = "UPDATED"; category.Type = CategoryType.Income; var result = repository.Update(category); Assert.IsTrue(result.Account_AccountID == 2); Assert.IsTrue(result.AccountName == "Savings"); Assert.IsTrue(result.Name == "UPDATED"); Assert.IsTrue(result.Type == CategoryType.Income); Assert.IsTrue(result.LastModifiedBy == 1); Assert.IsTrue(result.LastModifiedDate.Date == DateTime.Now.Date); }