protected override void Arrange()
        {
            base.Arrange();

            var section = new ElementForValidation();

            sectionModel = SectionViewModel.CreateSection(Container, "mock section", section);
        }
        protected override void Arrange()
        {
            base.Arrange();

            var section = new ElementForValidation();
            sectionModel = SectionViewModel.CreateSection(Container, "mock section", section);
            validationResult = new ElementValidationResult(sectionModel, "TestMessage", true);
            listener = new PropertyChangedListener(validationResult);
        }
        protected override void Arrange()
        {
            base.Arrange();
            base.Arrange();

            var section = new ElementForValidation();

            var sectionModel = SectionViewModel.CreateSection(Container, "mock section", section);
            collectionElement =
                sectionModel.DescendentConfigurationsOfType<NamedElementCollection<TestNamedElement>>()
                        .Where(x => x.Name == "ValidatedCollection").OfType<ElementCollectionViewModel>().First();

            collectionElement.AddNewCollectionElement(typeof (TestNamedElement));
        }
        protected override void Arrange()
        {
            base.Arrange();

            var locator = new Mock<ConfigurationSectionLocator>();
            locator.Setup(x => x.ConfigurationSectionNames).Returns(new[] { "testSection" });
            Container.RegisterInstance(locator.Object);

            var section = new ElementForValidation();
            section.DefaultTestElement = "IsAnInvalidReference";

            var source = new DesignDictionaryConfigurationSource();
            source.Add("testSection", section);

            var sourceModel = Container.Resolve<ConfigurationSourceModel>();
            sourceModel.Load(source);

            Section = sourceModel.Sections.Where(s => s.SectionName == "testSection").Single();
        }
        protected override void Arrange()
        {
            base.Arrange();
            var locator = new Mock<ConfigurationSectionLocator>();
            locator.Setup(x => x.ConfigurationSectionNames).Returns(new[] { "testSection" });
            Container.RegisterInstance(locator.Object);

            var section = new ElementForValidation();

            var source = new DesignDictionaryConfigurationSource();
            source.Add("testSection", section);

            var sourceModel = Container.Resolve<ConfigurationSourceModel>();
            sourceModel.Load(source);


            Assert.IsTrue(sourceModel.Sections
                              .SelectMany(s => s.DescendentElements()
                                                   .SelectMany(e => e.Properties)
                                                   .SelectMany(p => p.ValidationResults)
                                                   .Union(s.Properties.SelectMany(p => p.ValidationResults))
                                                   ).Where(e => e.IsError).Any());
        }