public void TestThatDefaultTextColorsAreEqual() { var tc1 = new TextColor(); var tc2 = new TextColor(); tc1.Equals(tc2).Should().BeTrue(); tc1.Equals((object)tc2).Should().BeTrue(); (tc1 == tc2).Should().BeTrue(); (tc1 != tc2).Should().BeFalse(); }
public void TestThatATextColorEqualsItself() { var tc = new TextColor { Foreground = Any.Enum <ConsoleColor>(), Background = Any.Enum <ConsoleColor>() }; tc.Equals(tc).Should().BeTrue(); tc.Equals((object)tc).Should().BeTrue(); #pragma warning disable CS1718 // Comparison made to same variable (tc == tc).Should().BeTrue(); (tc != tc).Should().BeFalse(); #pragma warning restore CS1718 // Comparison made to same variable }
public void TestThatTextColorsWithDifferentBackgroundColorsAreNotEqual() { var fgColor = Any.Enum <ConsoleColor>(); var tc1 = new TextColor { Foreground = fgColor, Background = ConsoleColor.Green }; var tc2 = new TextColor { Foreground = fgColor, Background = ConsoleColor.Blue }; tc1.Equals(tc2).Should().BeFalse(); tc1.Equals((object)tc2).Should().BeFalse(); (tc1 == tc2).Should().BeFalse(); (tc1 != tc2).Should().BeTrue(); }
public bool Equals(SharedSpan other) { if (other == null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(TextSize.Equals(other.TextSize) && TextStyle.Equals(other.TextStyle) && TextColor.Equals(other.TextColor) && BackgroundColor.Equals(other.BackgroundColor) && IsClickable == other.IsClickable && Equals(ClickValue, other.ClickValue)); }
/// <summary> /// Returns true if PdfAlignedTextParameters instances are equal /// </summary> /// <param name="input">Instance of PdfAlignedTextParameters to be compared</param> /// <returns>Boolean</returns> public bool Equals(PdfAlignedTextParameters input) { if (input == null) { return(false); } return (( TextVerticalAlignment == input.TextVerticalAlignment || TextVerticalAlignment.Equals(input.TextVerticalAlignment) ) && ( TextHorizontalAlignment == input.TextHorizontalAlignment || TextHorizontalAlignment.Equals(input.TextHorizontalAlignment) ) && ( Text == input.Text || (Text != null && Text.Equals(input.Text)) ) && ( TextColor == input.TextColor || (TextColor != null && TextColor.Equals(input.TextColor)) ) && ( FontName == input.FontName || (FontName != null && FontName.Equals(input.FontName)) ) && ( StandardFontName == input.StandardFontName || StandardFontName.Equals(input.StandardFontName) ) && ( FontStyle == input.FontStyle || FontStyle.Equals(input.FontStyle) ) && ( FontSize == input.FontSize || FontSize.Equals(input.FontSize) )); }