Пример #1
0
        public async Task CanPrepareHeaderLinksModel()
        {
            var model = await _commonModelFactory.PrepareHeaderLinksModelAsync();

            model.RegistrationType.Should().Be(_customerSettings.UserRegistrationType);
            model.IsAuthenticated.Should().BeTrue();
            model.CustomerName.Should().Be("John");
            model.ShoppingCartEnabled.Should().BeTrue();
            model.WishlistEnabled.Should().BeTrue();
            model.AllowPrivateMessages.Should().Be(_forumSettings.AllowPrivateMessages);
            model.UnreadPrivateMessages.Should().BeEmpty();
            model.AlertMessage.Should().BeEmpty();
            model.ShoppingCartItems.Should().Be(0);
            model.WishlistItems.Should().Be(0);
        }
Пример #2
0
        public async Task <IViewComponentResult> InvokeAsync()
        {
            var model = await _commonModelFactory.PrepareHeaderLinksModelAsync();

            return(View(model));
        }