Exemplo n.º 1
0
        public void GetLayoutReplacement_GivenExistingElement_ReturnsCorrectLayoutReplacement()
        {
            var replacement = FeatureToggles.GetLayoutReplacement(new Guid("{9E316C3C-9494-4C99-8AF6-653560D20F76}"),
                                                                  Guid.NewGuid());

            Assert.IsNotNull(replacement);
            Assert.AreEqual(new Guid("{0C993911-CCAB-4303-8D6F-9811E0BB0847}"), replacement.LayoutId);
            var sublayouts = replacement.Sublayouts.ToArray();

            Assert.AreEqual(3, replacement.Sublayouts.Count);
            Assert.AreEqual("topnav", sublayouts[0].Placeholder);
            Assert.AreEqual("main", sublayouts[1].Placeholder);
            Assert.AreEqual(new Guid("{BBDBC750-D502-4B1B-A5B4-77A4AB947DE8}"), sublayouts[0].SublayoutId);
            Assert.AreEqual(new Guid("{039BF107-3806-464E-B137-CF46A139D1F8}"), sublayouts[1].SublayoutId);
        }
Exemplo n.º 2
0
 public void GetLayoutReplacement_GivenNonExistingElement_ThrowsException()
 {
     Assert.Throws <ArgumentException>(() => FeatureToggles.GetLayoutReplacement(Guid.NewGuid(), Guid.NewGuid()));
 }