public void TestRemainNomenclatureDbFindById_WithRemainNomenclatureId_ShouldFindTheRemainNomenclatureInDbById() { var repository = new RemainNomenclatureRegisterRepository(_db); var remainNomenclature = new RemainNomenclature(); repository.Create(remainNomenclature); var remainNomenclatureById = repository.GetById(remainNomenclature.Id); Assert.Equal(remainNomenclature.Id, remainNomenclatureById.Id); }
public void TestRemainNomenclatureDbAdd_WithNewRemainNomenclature_ShouldAddTheRemainNomenclatureToDb() { var repository = new RemainNomenclatureRegisterRepository(_db); var remainNomenclature = new RemainNomenclature(); var remainNomenclatureById = repository.GetById(remainNomenclature.Id); Assert.Null(remainNomenclatureById); repository.Create(remainNomenclature); remainNomenclatureById = repository.GetById(remainNomenclature.Id); Assert.NotNull(remainNomenclatureById); }
public void TestRemainNomenclatureDbDelete_WithRemainNomenclature_ShouldDeleteTheRemainNomenclatureFromDb() { var repository = new RemainNomenclatureRegisterRepository(_db); var remainNomenclature = new RemainNomenclature(); repository.Create(remainNomenclature); var remainNomenclatureById = repository.GetById(remainNomenclature.Id); Assert.NotNull(remainNomenclatureById); repository.Delete(remainNomenclature); remainNomenclatureById = repository.GetById(remainNomenclature.Id); Assert.Null(remainNomenclatureById); }
public void TestRemainNomenclatureDbUbdate_WithNewRemainNomenclature_ShouldUpdateTheRemainNomenclatureToDb() { var repository = new RemainNomenclatureRegisterRepository(_db); var remainNomenclature = new RemainNomenclature(); repository.Create(remainNomenclature); var remainNomenclatureById = repository.GetById(remainNomenclature.Id); Assert.Null(remainNomenclatureById.Warehouse); var warehouse = new Warehouse("warehouse name"); remainNomenclature.Warehouse = warehouse; repository.Update(remainNomenclature); Assert.Equal("warehouse name", remainNomenclatureById.Warehouse.Description); }