Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
        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);
        }