public void GivenOtherObjectIsNotHeaderName_AreNotEqual() { var first = new HeaderName("abc123"); var second = new object(); first.Equals(second).Should().BeFalse(); }
public void ConvertsNameToLowercase() { var value = "TheValue-Again"; var actual = new HeaderName(value).ToString(); actual.Should().Be("thevalue-again"); }
public void ReturnsValue() { var value = Guid.NewGuid().ToString(); var actual = new HeaderName(value).ToString(); actual.Should().Be(value); }
public void IsImplicitlyConvertibleToString() { var value = Guid.NewGuid().ToString(); var obj = new HeaderName(value); string actual = obj; actual.Should().Be(value); }
public void WhenValuesAreDifferent_AreNotEqual() { var first = new HeaderName("abc123"); var second = new HeaderName("xyz123"); first.Equals(second).Should().BeFalse(); (first == second).Should().BeFalse(); (first != second).Should().BeTrue(); }
public void IsExplicitlyConvertibleFromString() { var value = Guid.NewGuid().ToString(); var str = value; var actual = (HeaderName)str; var expected = new HeaderName(value); actual.Should().Be(expected); }
public void WhenValueIsEmpty_IsEqualToEmpty() { var first = new HeaderName(""); var second = HeaderName.Empty; first.Equals(second).Should().BeTrue(); (first == second).Should().BeTrue(); (first != second).Should().BeFalse(); first.GetHashCode().Should().Be(second.GetHashCode()); }
public void WhenValuesAreEmpty_AreEqual() { var first = new HeaderName(""); var second = new HeaderName(""); first.Equals(second).Should().BeTrue(); (first == second).Should().BeTrue(); (first != second).Should().BeFalse(); first.GetHashCode().Should().Be(second.GetHashCode()); }
public void WhenValuesAreDifferentlyCased_AreEqual() { var first = new HeaderName("abc123"); var second = new HeaderName("aBc123"); first.Equals(second).Should().BeTrue(); (first == second).Should().BeTrue(); (first != second).Should().BeFalse(); first.GetHashCode().Should().Be(second.GetHashCode()); }
public void DefaultConstructor_CreatesEmptyHeaderName() { var actual = new HeaderName(); actual.Should().Be(HeaderName.Empty); }
public void NullValue_ReturnsEmptyHeaderName() { var actual = new HeaderName(null); actual.Should().Be(HeaderName.Empty); }
public void Constructor_CreatesHeaderNameWithValue() { var actual = new HeaderName("theValue"); actual.Value.Should().Be("theValue"); }