public void Initialize() { ArticleService = new ArticleServiceFake(); FieldService = new FieldServiceFake(); ProductService = new ProductServiceFake(); Logger = new LoggerFake(); TransactionFactory = () => new TransactionFake(); Action = new ActionBaseFake(ArticleService, FieldService, ProductService, TransactionFactory); Context = new ActionContext { ContentItemIds = new[] { ContentItemId } }; }
public async Task Index_ShouldReturnView_WithCorrectArticles() { // Arrange var articleServiceFake = new ArticleServiceFake(); var homeController = new HomeController(articleServiceFake.Instance); // Act var result = await homeController.Index(); // Assert articleServiceFake.PageSize.ShouldBe(HomeIndexArticlePageSize); result .ShouldBeAssignableTo <ViewResult>() .Model .ShouldBeAssignableTo <IEnumerable <ArticleListingServiceModel> >(); }
public void Initialize() { ArticleService = new ArticleServiceFake(); NotificationService = new QPNotificationServiceFake(); FieldService = new FieldServiceFake(); FreezeService = new FreezeServiceFake(); ValidationService = new ValidationServiceFake(); ProductService = new ProductServiceFake { Content = new Content() { ContentId = ContentId } }; Transaction = null; Logger = new LoggerFake(); Context = new ActionContext(); InitializeAction(); }