public void GetRootItems_ReturnsExpectedRootValues()
        {
            var predicate = new SerializationPresetPredicate(CreateTestConfiguration(), null, null);

            var roots = predicate.GetRootPaths();

            roots.Length.Should().Be(11);
            roots[0].DatabaseName.Should().Be("master");
            roots[0].Path.Should().Be("/sitecore/layout/Simulators");
            roots[7].DatabaseName.Should().Be("core");
            roots[7].Path.Should().Be("/sitecore/coredb");
        }
        public void GetRootItems_ReturnsExpectedRootValues()
        {
            var sourceItem1 = new Mock<ISerializableItem>();
            var sourceItem2 = new Mock<ISerializableItem>();

            var sourceDataProvider = new Mock<IDataStore>();
            sourceDataProvider.Setup(x => x.GetByPath("master", "/sitecore/layout/Simulators")).Returns(new[] { sourceItem1.Object });
            sourceDataProvider.Setup(x => x.GetByPath("core", "/sitecore/content")).Returns(new[] { sourceItem2.Object });

            var predicate = new SerializationPresetPredicate(CreateTestConfiguration());

            var roots = predicate.GetRootPaths();

            Assert.IsTrue(roots.Length == 2, "Expected two root paths from test config");
            Assert.AreEqual(roots[0].Database, "master", "Expected first root to be in master db");
            Assert.AreEqual(roots[0].Path, "/sitecore/layout/Simulators", "Expected first root to be /sitecore/layout/Simulators");
            Assert.AreEqual(roots[1].Database, "core", "Expected second root to be in core db");
            Assert.AreEqual(roots[1].Path, "/sitecore/content", "Expected second root to be /sitecore/content");
        }
        public void GetRootItems_ReturnsExpectedRootValues()
        {
            var sourceItem1 = new FakeItem();
            var sourceItem2 = new FakeItem();

            var sourceDataProvider = Substitute.For<IDataStore>();
            sourceDataProvider.GetByPath("master", "/sitecore/layout/Simulators").Returns(new[] { sourceItem1 });
            sourceDataProvider.GetByPath("core", "/sitecore/content").Returns(new[] { sourceItem2 });

            var predicate = new SerializationPresetPredicate(CreateTestConfiguration());

            var roots = predicate.GetRootPaths();

            Assert.True(roots.Length == 3, "Expected three root paths from test config");
            Assert.Equal(roots[0].DatabaseName, "master");
            Assert.Equal(roots[0].Path, "/sitecore/layout/Simulators");
            Assert.Equal(roots[1].DatabaseName, "core");
            Assert.Equal(roots[1].Path, "/sitecore/content");
        }