예제 #1
0
        public void GetHashCode_ReturnsDifferentHashCodeWhenColumnAndLineAreSquares()
        {
            var linePosition1 = new LinePosition(4, 14);
            var linePosition2 = new LinePosition(6, 16);

            linePosition1.GetHashCode().ShouldNotBe(linePosition2.GetHashCode());
        }
예제 #2
0
        public void GetHashCode_ReturnsSameHashCodeWhenLineAndColumnAreSame()
        {
            var linePosition1 = new LinePosition(4, 14);
            var linePosition2 = new LinePosition(4, 14);

            linePosition1.GetHashCode().ShouldBe(linePosition2.GetHashCode());
        }
예제 #3
0
        public void GetHashCode_ReturnsDifferentHashCodeWhenColumnAndLineAreCrossed()
        {
            var linePosition1 = new LinePosition(2, 27);
            var linePosition2 = new LinePosition(27, 2);

            linePosition1.GetHashCode().ShouldNotBe(linePosition2.GetHashCode());
        }
예제 #4
0
        public void GetHashCode_ReturnsDifferentHashCodeWhenColumnsAreSame()
        {
            var linePosition1 = new LinePosition(2, 27);
            var linePosition2 = new LinePosition(3, 27);

            linePosition1.GetHashCode().ShouldNotBe(linePosition2.GetHashCode());
        }
예제 #5
0
        public void GetHashCode_ReturnsDifferentHashCodeWhenLinePositionsAreDifferent()
        {
            var linePosition1 = new LinePosition(13, 4);
            var linePosition2 = new LinePosition(1, 27);

            linePosition1.GetHashCode().ShouldNotBe(linePosition2.GetHashCode());
        }
예제 #6
0
 public override int GetHashCode()
 {
     // Overflow is fine, just wrap
     unchecked
     {
         int hash = 17;
         hash = hash * 23 + (File == null ? 0 : File.GetHashCode());
         hash = hash * 23 + LineNumber.GetHashCode();
         hash = hash * 23 + LinePosition.GetHashCode();
         hash = hash * 23 + (ErrorMessage == null ? 0 : ErrorMessage.GetHashCode());
         return(hash);
     }
 }
예제 #7
0
        /// <summary>
        /// 속성들을 Xml Attribute로 생성합니다.
        /// </summary>
        /// <param name="writer">Attribute를 쓸 Writer</param>
        public override void GenerateXmlAttributes(System.Xml.XmlWriter writer)
        {
            base.GenerateXmlAttributes(writer);

            if (LinePosition.HasValue)
            {
                writer.WriteAttributeString("LinePosition", LinePosition.GetHashCode().ToString());
            }

            if (_lineAttr != null)
            {
                _lineAttr.GenerateXmlAttributes(writer);
            }
        }