public void InsertSale_IfYouInsertASaleWithNullIdAndNoExistingSales_IdStartsAtOne() { var mockDatabase = new MockDatabase(); var sale = new Sale(); mockDatabase.InsertSale(sale); Assert.AreEqual(1, sale.SaleId); }
public void InsertEmployee_IfYouInsertAnEmpoyeeWithNullIdAndNoExistingEmployees_IdStartsAtOne() { var mockDatabase = new MockDatabase(); var employee = new Employee(); mockDatabase.InsertEmployee(employee); Assert.AreEqual(1, employee.EmployeeId); }
public void InsertEmployee_IfYouInsertAnEmployeeWithNonNullId_ExistingIdIsNotOverwritten() { var mockDatabase = new MockDatabase(); var employee = new Employee { EmployeeId = 7 }; mockDatabase.InsertEmployee(employee); Assert.AreEqual(7, employee.EmployeeId); }
public void InsertSale_IfYouInsertANonNullId_TheExistingIdIsNotOverwritten() { var mockDatabase = new MockDatabase(); var sale = new Sale { SaleId = 7 }; mockDatabase.InsertSale(sale); Assert.AreEqual(7, sale.SaleId); }
public void GetSaleById_IfYouInsertASale_YouCanGetItBack() { var mockDatabase = new MockDatabase(); var sale = new Sale { SaleId = 20202 }; mockDatabase.InsertSale(sale); var actual = mockDatabase.GetSaleById(20202); Assert.IsNotNull(actual); Assert.AreEqual(20202, actual.SaleId); }
public void GetEmployeeById_IfYouInsertAnEmployee_YouCanGetItBack() { var mockDatabase = new MockDatabase(); var employee = new Employee { EmployeeId = 20202 }; mockDatabase.InsertEmployee(employee); var actual = mockDatabase.GetEmployeeById(20202); Assert.IsNotNull(actual); Assert.AreEqual(20202, actual.EmployeeId); }
public void InsertSale_IfYouInsertInsertASaleWithNullIdAndAPreviousSaleExists_IdIsMaxPlusOne() { var mockDatabase = new MockDatabase(); var initialSale = new Sale { SaleId = 7 }; mockDatabase.InsertSale(initialSale); var secondSale = new Sale(); mockDatabase.InsertSale(secondSale); Assert.AreEqual(8, secondSale.SaleId); }
public void InsertEmployee_IfYouInsertAnEmployeeWithNullIdAndAnEmployeeExists_IdIsMaxPlusOne() { var mockDatabase = new MockDatabase(); var initialEmployee = new Employee { EmployeeId = 7 }; mockDatabase.InsertEmployee(initialEmployee); var secondEmployee = new Employee(); mockDatabase.InsertEmployee(secondEmployee); Assert.AreEqual(8, secondEmployee.EmployeeId); }