public void CreateImagesController_WhenParamsAreValid()
        {
            // Arrange
            var mockedImageService = new Mock <IUploadedImageService>();
            var mockedUserService  = new Mock <IUserService>();
            var mockedUserProvider = new Mock <IUserProvider>();

            var imagesController = new WebClient.Areas.Admin.Controllers.ImagesController(mockedImageService.Object,
                                                                                          mockedUserService.Object, mockedUserProvider.Object);

            //Act & Assert
            Assert.That(imagesController, Is.InstanceOf <WebClient.Areas.Admin.Controllers.ImagesController>());
        }
Beispiel #2
0
        public void ReturnDefaultView()
        {
            // Arrange
            var mockedImageService = new Mock <IUploadedImageService>();
            var mockedUserService  = new Mock <IUserService>();
            var mockedUserProvider = new Mock <IUserProvider>();

            var imagesController = new WebClient.Areas.Admin.Controllers.ImagesController(mockedImageService.Object,
                                                                                          mockedUserService.Object, mockedUserProvider.Object);

            // Act & Assert
            imagesController
            .WithCallTo(c => c.Index())
            .ShouldRenderDefaultView();
        }
Beispiel #3
0
        public void InvokeServiceMethod()
        {
            // Arrange
            var mockedImageService = new Mock <IUploadedImageService>();
            var mockedUserService  = new Mock <IUserService>();
            var mockedUserProvider = new Mock <IUserProvider>();

            var imagesController = new WebClient.Areas.Admin.Controllers.ImagesController(mockedImageService.Object,
                                                                                          mockedUserService.Object, mockedUserProvider.Object);

            //Act
            imagesController.Index();

            //Assert
            mockedImageService.Verify(x => x.GetAllImagesForAdmin(), Times.Once());
        }