public void ShouldValidateArtifactDuringBuild_returns_true_if_designer_info_option_does_not_contain_ValidateOnBuild_value()
        {
            var modelManager             = new Mock <ModelManager>(null, null).Object;
            var modelProvider            = new Mock <XmlModelProvider>().Object;
            var entityDesignArtifactMock =
                new Mock <EntityDesignArtifact>(modelManager, new Uri("urn:dummy"), modelProvider);

            using (var designerInfoRoot = new EFDesignerInfoRoot(entityDesignArtifactMock.Object, new XElement("_")))
            {
                using (var designerProperty = new DesignerProperty(null, new XElement("_")))
                {
                    var optionsDesignerInfoMock = new Mock <OptionsDesignerInfo>(designerInfoRoot, new XElement("_"));
                    optionsDesignerInfoMock
                    .Setup(o => o.ValidateOnBuild)
                    .Returns(designerProperty);

                    designerInfoRoot
                    .AddDesignerInfo(
                        "Options",
                        optionsDesignerInfoMock.Object);

                    entityDesignArtifactMock
                    .Setup(a => a.DesignerInfo)
                    .Returns(designerInfoRoot);

                    Assert.True(
                        EdmUpdateSolutionEvents.ShouldValidateArtifactDuringBuild(entityDesignArtifactMock.Object));
                }
            }
        }
        public void ShouldValidateArtifactDuringBuild_returns_true_if_no_designer_info()
        {
            var modelManager         = new Mock <ModelManager>(null, null).Object;
            var modelProvider        = new Mock <XmlModelProvider>().Object;
            var entityDesignArtifact =
                new Mock <EntityDesignArtifact>(modelManager, new Uri("urn:dummy"), modelProvider).Object;

            Assert.True(EdmUpdateSolutionEvents.ShouldValidateArtifactDuringBuild(entityDesignArtifact));
        }
        public void ShouldValidateArtifactDuringBuild_returns_true_if_designer_info_does_not_contain_options()
        {
            var modelManager             = new Mock <ModelManager>(null, null).Object;
            var modelProvider            = new Mock <XmlModelProvider>().Object;
            var entityDesignArtifactMock =
                new Mock <EntityDesignArtifact>(modelManager, new Uri("urn:dummy"), modelProvider);

            using (var designerInfoRoot = new EFDesignerInfoRoot(entityDesignArtifactMock.Object, new XElement("root")))
            {
                entityDesignArtifactMock
                .Setup(a => a.DesignerInfo)
                .Returns(designerInfoRoot);

                Assert.True(EdmUpdateSolutionEvents.ShouldValidateArtifactDuringBuild(entityDesignArtifactMock.Object));
            }
        }