Exemplo n.º 1
0
        public void GetBannersData()
        {
            GivenServiceLocator();
            GivenBannerController();

            WhenAddTemplate();
            WhenAddBanner("Template1", "Mother Day", "SaltedChicken");
            WhenAddBanner("Template1", "Father Day", "Squid");
            WhenAddResx();

            _bannerController.ApplyBanner(new ApplyBannerReq()
            {
                BannerName = "Mother Day",
            });

            var banners = _bannerController.GetBannersData(new GetBannersDataReq()
            {
                BannerName  = "Mother Day",
                IsoLangCode = "en-US",
            });

            new[]
            {
                new
                {
                    BannerName      = "Mother Day",
                    TemplateName    = "Template1",
                    TemplateContent = "Hello Banner",
                    Variables       = new[]
                    {
                        new
                        {
                            VarName  = "image",
                            ResxName = "SaltedChickenPizzaImage",
                            Content  = "English Salted Chicken Pizza Url",
                        },
                        new
                        {
                            VarName  = "title",
                            ResxName = "SaltedChickenPizzaTitle",
                            Content  = "Salted Chicken Pizza",
                        }
                    }
                },
            }
            .Should()
            .BeEquivalentTo(banners, ExcludeProperties);
        }