Esempio n. 1
0
        public void AllocationIntegration_Delete_ShouldBeOk()
        {
            Allocation allocation = ObjectMother.GetAllocation(ObjectMother.GetEmployee(), ObjectMother.GetRoom());

            allocation.Id = 2;

            _service.Delete(allocation);

            Allocation allocationdel = _service.Get(2);

            allocationdel.Should().BeNull();

            List <Allocation> allocations = _service.GetAll() as List <Allocation>;

            allocations.Count().Should().Be(1);
        }
Esempio n. 2
0
        public void AllocationService_Delete_ShouldBeOk()
        {
            Allocation modelo = ObjectMother.GetAllocation(ObjectMother.GetEmployee(), ObjectMother.GetRoom());

            modelo.Id = 1;

            _mockRepository.Setup(m => m.Delete(modelo));


            AllocationService service = new AllocationService(_mockRepository.Object);

            service.Delete(modelo);

            _mockRepository.Verify(repository => repository.Delete(modelo));
        }