Exemplo n.º 1
0
        public void GetEntryByBadId_ShouldReturn_DtoEmpty()
        {
            // Arrange
            var newId = Guid.NewGuid().ToString();

            _departureRepository.Setup(r => r.GetById(newId));

            var entryService = new DepartureService(_departureRepository.Object, _entryRepository.Object, _rateService.Object, _cellService.Object);

            // Act
            DtoDeparture result = entryService.GetEntryById(id: newId);

            // Assert
            Assert.IsNull(result.Id);
        }
Exemplo n.º 2
0
        public void GetEntryById_ShouldReturn_DtoDepartureEntity()
        {
            // Arrange
            DepartureEntity departureEntity = new DepartureEntityBuilder()
                                              .WithId(Guid.NewGuid().ToString())
                                              .Build();

            _departureRepository.Setup(r => r.GetById(departureEntity.Id)).Returns(departureEntity);

            var entryService = new DepartureService(_departureRepository.Object, _entryRepository.Object, _rateService.Object, _cellService.Object);

            // Act
            DtoDeparture result = entryService.GetEntryById(id: departureEntity.Id);

            // Assert
            Assert.IsNotNull(result);
        }