Exemplo n.º 1
0
        public void The_PictureService_can_return_a_random_picture_from_the_PictureRepository()
        {
            //Arrange
            var picService = new PictureService(_pictureRepositoryMock.Object);

            //Act
            var randomPicture = picService.GetNextRandomPicture(_referencePictureIDs);

            //Assert
            _pictureRepositoryMock.Verify(repo => repo.GetNextRandomPicture(_referencePictureIDs), Times.Once());
            Assert.AreEqual(_randomPicture, randomPicture);
        }
Exemplo n.º 2
0
        public void PictureService_can_receive_list_from_repository()
        {
            //Arrange
            var picService = new PictureService(_picRepoMock.Object);

            //Action
            var picList = picService.GetFirstPictures(HomePageViewModel.TOP_SLIDE_PIC_COUNT);

            //Assertions
            _picRepoMock.Verify(prm => prm.GetAllInOrder(0, HomePageViewModel.TOP_SLIDE_PIC_COUNT), Times.Once());
            Assert.That(picList.Count == 1);
            Assert.AreEqual(picList[0], _testPic);
        }