コード例 #1
0
        public void ContactSettingsRepository_NoPresets_ShouldReturnEmptyCollection(Db db, [Greedy] ContactSettingsRepository repo)
        {
            var siteContext = new FakeSiteContext("siteName");

            using (new FakeSiteContextSwitcher(siteContext))
            {
                CreateItem(db, $"/sitecore/client/Applications/ExperienceGenerator/Common/Contacts/{siteContext.Name}");
                repo.GetPresets().Count.Should().Be(0);
            }
        }
コード例 #2
0
        public void Save_OnePresent_ShouldReturnSingleSetting(Db db, [Greedy] ContactSettingsRepository repo)
        {
            var siteContext = new FakeSiteContext("siteName");

            using (new FakeSiteContextSwitcher(siteContext))
            {
                CreateItem(db, $"/sitecore/client/Applications/ExperienceGenerator/Common/Contacts/{siteContext.Name}");
                repo.Save("name", EmptySpecification);
                repo.GetPresets().Count.Should().Be(1);
            }
        }