Пример #1
0
        public void Should_return_at_least_one_available_slip_for_the_dock()
        {
            ISlipsRepository repository = CreateSUT( );
            IDock            dock       = new Dock(1, string.Empty, null, null);

            IRichList <ISlip> slipsFound = ListFactory.From(repository.AllAvailableSlipsFor(dock));

            Assert.IsTrue(slipsFound.Count > 0);
        }
Пример #2
0
        public void Should_leverage_repository_to_find_dock()
        {
            long  dockId = 1;
            IDock dock   = _mockery.DynamicMock <IDock>( );
            ISlip slip   = _mockery.DynamicMock <ISlip>( );

            IList <ISlip> availableSlipsForDock = new List <ISlip>( );

            availableSlipsForDock.Add(slip);

            SlipDisplayDTO dto = ObjectMother.SlipDisplayDTO( );

            using (_mockery.Record( )) {
                Expect.Call(_dockRepository.FindBy(dockId)).Return(dock);
                Expect.Call(_slipRepository.AllAvailableSlipsFor(dock)).Return(availableSlipsForDock);
                Expect.Call(_slipMapper.MapFrom(slip)).Return(dto);
            }

            using (_mockery.Playback( )) {
                IRichList <SlipDisplayDTO> slipsFound = ListFactory.From(CreateSUT( ).GetAvailableSlipsForDockBy(dockId));
                Assert.IsTrue(slipsFound.Contains(dto));
            }
        }