public void Setup()
 {
     sectorsContext        = SectorData.CreateSectors();
     bookingsSectorContext = BookingSectorData.CreateBookingSectorsList();
     bookingSectorDTO      = BookingSectorData.CreateBookingSectorDTO();
     unitOfWorkMock.Setup(u => u.SaveAsync()).ReturnsAsync(true);
     unitOfWorkMock.Setup(u => u.BookingSectorRepository).Returns(bookingSectorRepositoryMock.Object);
     unitOfWorkMock.Setup(u => u.SectorRepository).Returns(sectorRepositoryMock.Object);
     bookingSectorRepositoryMock.Setup(b => b.GetAllEntitiesAsync()).ReturnsAsync(bookingsSectorContext);
     bookingSectorRepositoryMock.Setup(b => b.GetEntityByIdAsync(It.IsAny <int>()))
     .ReturnsAsync((int id) => bookingsSectorContext
                   .Find(b => b.Id == id));
 }
示例#2
0
 public void Setup()
 {
     bookingSectorContext = BookingSectorData.CreateBookingSectorDTOs();
     bookingSectorDTO     = BookingSectorData.CreateBookingSectorDTO();
 }