public void AssignsNonNullValueCorrectly() { const string input = null; var x = CanBeNull.Create(input); Assert.That(x.Value, Is.Null); }
public void DelegatesToEncapsulatedValue() { var input = new EqualsCapture(); var x = CanBeNull.Create(input).Equals(input); Assert.That(input.EqualsCallCount, Is.EqualTo(1)); }
public void ConvertsToCanBeNull() { string input = "hello"; CanBeNull <string> canBeNull = input; Assert.That(canBeNull.Value, Is.SameAs(input)); }
public void AssignsNullValueCorrectly() { const string input = "hello"; var x = new CanBeNull <string>(input); Assert.That(x.Value, Is.SameAs(input)); }
public void ReturnsZeroWhenValueIsNull() { string input = null; var x = CanBeNull.Create(input).GetHashCode(); Assert.That(x, Is.EqualTo(0)); }
public void ReturnsEmptyStringWhenNull() { string input = null; var x = CanBeNull.Create(input).ToString(); Assert.That(x, Is.EqualTo("")); }
public void ConvertsFromCanBeNull() { string input = "hello"; CanBeNull <string> canBeNull = CanBeNull.Create(input); string output = canBeNull; Assert.That(output, Is.SameAs(input)); }
public void WorksWithReferenceTypes() { var x = new CanBeNull <string>("hello"); }
public void StillWorksWithNulls() { string input = ""; var x = CanBeNull.Create(input).Equals("some other string"); }