public void AllocationIntegration_Add_ShouldBeOk() { Allocation allocation = _service.Save(ObjectMother.GetAllocation(ObjectMother.GetEmployee(), ObjectMother.GetRoom())); allocation.Id.Should().BeGreaterThan(0); var last = _service.Get(allocation.Id); last.Should().NotBeNull(); var allocations = _service.GetAll(); allocations.Count().Should().BeGreaterThan(0); }
public void AllocationService_Get_ShouldBeOk() { Employee employee = ObjectMother.GetEmployee(); Room room = ObjectMother.GetRoom(); employee.Id = 1; room.Id = 1; Allocation allocation = ObjectMother.GetAllocation(employee, room); allocation.Id = 3; _mockRepository.Setup(m => m.Get(3)).Returns(allocation); AllocationService service = new AllocationService(_mockRepository.Object); Allocation result = service.Get(3); result.Should().NotBeNull(); _mockRepository.Verify(repository => repository.Get(3)); }