Exemplo n.º 1
0
        public void ManageUsers_WhenValidParametersArePased_ShouldReturnCorerectViewResultName()
        {
            // Arrange
            var autoMapperConfig = new AutoMapperConfig();

            autoMapperConfig.Execute(typeof(OffersController).Assembly);

            var carOffer        = new CarOffer();
            var userServiceMock = new Mock <IUserService>();

            var carOffersServiceMock = new Mock <ICarOffersService>();

            carOffersServiceMock.Setup(x => x.GetAll())
            .Returns(() => new List <CarOffer> {
                carOffer
            }.AsQueryable());

            OffersController offersController = new OffersController(carOffersServiceMock.Object, userServiceMock.Object);

            // Act
            ViewResult result = offersController.ManageUsers() as ViewResult;

            // Assert
            Assert.AreEqual(string.Empty, result.ViewName);
        }