Example #1
0
        public static void LogDifference(
            string server,
            string database,
            string schema,
            string objectName,
            string parent,
            string objectType,
            Difference diff)
        {
            if (objectTypeFriendlyNameMappings.ContainsKey(objectType))
            {
                objectType = objectTypeFriendlyNameMappings[objectType];
            }

            if (!File.Exists("./differences.csv"))
            {
                using (var differences = File.CreateText("./differences.csv"))
                {
                    differences.WriteLine("server,database,type,schema,parent,name,difference");
                }
            }

            using (var differences = File.AppendText("./differences.csv"))
            {
                differences.WriteLine(
                    "{0},{1},{2},{3},{4},{5},{6}",
                    server,
                    database,
                    objectType,
                    schema,
                    parent,
                    objectName,
                    diff.ToString());
            }
        }
Example #2
0
        [Test] public void ToStringContainsId()
        {
            string commentDifference = minorDifference.ToString();
            string idValue           = "type: " + (int)DifferenceType.ATTR_SEQUENCE_ID;

            Assert.IsTrue(commentDifference.IndexOfAny(idValue.ToCharArray()) > 0,
                          "contains " + idValue);
        }
Example #3
0
 [Test] public void NotEqualOrIdenticalAfterMajorDifferenceFound()
 {
     _result.DifferenceFound(_diff, _majorDifference);
     Assert.AreEqual(false, _result.Identical);
     Assert.AreEqual(false, _result.Equal);
     Assert.AreEqual(_diff.OptionalDescription
                     + Environment.NewLine
                     + _majorDifference.ToString(), _result.StringValue);
 }
Example #4
0
        [Test] public void ToStringContainsId()
        {
            string commentDifference = minorDifference.ToString();
            string idValue           = "type: " + (int)DifferenceType.AttributeSequence;

            Assert.AreEqual(
                true,
                commentDifference.IndexOfAny(idValue.ToCharArray()) > 0,
                "contains " + idValue);
        }
        public void DifferenceToString()
        {
            var difference = new Difference("Property1", "12345", "12346");

            var toString = difference.ToString();

            Assert.IsTrue(toString.Contains("Property1"));
            Assert.IsTrue(toString.Contains("12345"));
            Assert.IsTrue(toString.Contains("12346"));
        }
Example #6
0
 /// <inheritdoc/>
 public override string ToString()
 {
     return(string.Format(Strings.SchemaComparisonResultFormat,
                          SchemaComparisonStatus,
                          HasUnsafeActions.ToString().ToLower(),
                          HasColumnTypeChanges.ToString().ToLower(),
                          IsCompatibleInLegacyMode.HasValue ? IsCompatibleInLegacyMode.Value.ToString() : Strings.Unknown,
                          UnsafeActions.Any() ? UnsafeActions.ToDelimitedString("\r\n").Indent(2) : string.Empty,
                          Hints != null ? Hints.ToString().Indent(2) : string.Empty,
                          Difference != null ? Difference.ToString().Indent(2) : string.Empty));
 }
        public bool Include(Difference difference)
        {
            // Is the entire rule ignored?
            if (_ignoreDifferences.Contains(difference.Id))
                return false;

            // Is the specific violation of the rule ignored?
            if (_ignoreDifferences.Contains(difference.ToString()))
                return false;

            return _filter.Include(difference);
        }
        public bool Include(Difference difference)
        {
            // Is the entire rule ignored?
            if (_ignoreDifferences.Contains(difference.Id))
            {
                return(false);
            }

            // Is the specific violation of the rule ignored?
            if (_ignoreDifferences.Contains(difference.ToString()))
            {
                return(false);
            }

            return(_filter.Include(difference));
        }
        public OperationTypeConflictResolverForm(
                    ConflictContext context,
                    Difference differenceTypeInSourceBranch, 
                    Difference differenceTypeInDestinationBranch)
        {
            InitializeComponent();
            FormPosition.LoadFromRegistry(this);

            m_result = null;

            m_conflictcontextcontrol.Data = context;
            m_radioKeepSource.Tag = differenceTypeInSourceBranch;
            m_textboxChangeDescriptionFromSourceBranch.Text = differenceTypeInSourceBranch.ToString();
            m_radioKeepDestination.Tag = differenceTypeInDestinationBranch;
            m_textboxChangeDescriptionFromDestinationBranch.Text = differenceTypeInDestinationBranch.ToString();
            m_buttonAccept.Enabled = false;
        }
        public OperationTypeConflictResolverForm(
            ConflictContext context,
            Difference differenceTypeInSourceBranch,
            Difference differenceTypeInDestinationBranch)
        {
            InitializeComponent();
            FormPosition.LoadFromRegistry(this);

            m_result = null;

            m_conflictcontextcontrol.Data = context;
            m_radioKeepSource.Tag         = differenceTypeInSourceBranch;
            m_textboxChangeDescriptionFromSourceBranch.Text = differenceTypeInSourceBranch.ToString();
            m_radioKeepDestination.Tag = differenceTypeInDestinationBranch;
            m_textboxChangeDescriptionFromDestinationBranch.Text = differenceTypeInDestinationBranch.ToString();
            m_buttonAccept.Enabled = false;
        }
Example #11
0
        public bool Include(Difference difference)
        {
            // Is the entire rule ignored?
            if (_ignoreDifferences.ContainsKey(difference.Id))
            {
                _ignoreDifferences[difference.Id] = true;
                return(false);
            }

            // Is the specific violation of the rule ignored?
            var diff = difference.ToString();

            if (_ignoreDifferences.ContainsKey(diff))
            {
                _ignoreDifferences[diff] = true;
                return(false);
            }

            return(_filter.Include(difference));
        }
Example #12
0
 public override string ToString()
 {
     return(Difference.ToString());
 }
Example #13
0
 public override string ToString()
 {
     return(Difference.ToString().Substring(0, 1) + " " + Definition.UniqueId());
 }
Example #14
0
 public FlowControlException(Difference cause) : base(cause.ToString())
 {
 }