Beispiel #1
0
        public void ApplyBanners()
        {
            GivenServiceLocator();
            GivenBannerController();

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

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

            var bannerShelf =
                (from tb1 in _db.BannerShelf.AsNoTracking() select tb1)
                .ToList();

            var variableShelf =
                (from tb1 in _db.VariableShelf.AsNoTracking() select tb1)
                .ToList();

            new[]
            {
                new VariableShelfEntity()
                {
                    VarName     = "image",
                    Content     = "English Salted Chicken Pizza Url",
                    ResxName    = "SaltedChickenPizzaImage",
                    IsoLangCode = "en-US",
                },
                new VariableShelfEntity()
                {
                    VarName     = "image",
                    Content     = "鹹酥雞披薩圖片連結",
                    ResxName    = "SaltedChickenPizzaImage",
                    IsoLangCode = "zh-TW",
                },
                new VariableShelfEntity()
                {
                    VarName     = "title",
                    Content     = "Salted Chicken Pizza",
                    ResxName    = "SaltedChickenPizzaTitle",
                    IsoLangCode = "en-US",
                }
            }.Should()
            .BeEquivalentTo(variableShelf, ExcludeProperties);
        }