예제 #1
0
                public void AssignsNonNullValueCorrectly()
                {
                    const string input = null;
                    var          x     = CanBeNull.Create(input);

                    Assert.That(x.Value, Is.Null);
                }
예제 #2
0
                public void DelegatesToEncapsulatedValue()
                {
                    var input = new EqualsCapture();
                    var x     = CanBeNull.Create(input).Equals(input);

                    Assert.That(input.EqualsCallCount, Is.EqualTo(1));
                }
예제 #3
0
                public void ConvertsToCanBeNull()
                {
                    string             input     = "hello";
                    CanBeNull <string> canBeNull = input;

                    Assert.That(canBeNull.Value, Is.SameAs(input));
                }
예제 #4
0
                public void AssignsNullValueCorrectly()
                {
                    const string input = "hello";
                    var          x     = new CanBeNull <string>(input);

                    Assert.That(x.Value, Is.SameAs(input));
                }
예제 #5
0
                public void ReturnsZeroWhenValueIsNull()
                {
                    string input = null;
                    var    x     = CanBeNull.Create(input).GetHashCode();

                    Assert.That(x, Is.EqualTo(0));
                }
예제 #6
0
                public void ReturnsEmptyStringWhenNull()
                {
                    string input = null;
                    var    x     = CanBeNull.Create(input).ToString();

                    Assert.That(x, Is.EqualTo(""));
                }
예제 #7
0
                public void ConvertsFromCanBeNull()
                {
                    string             input     = "hello";
                    CanBeNull <string> canBeNull = CanBeNull.Create(input);

                    string output = canBeNull;

                    Assert.That(output, Is.SameAs(input));
                }
예제 #8
0
 public void WorksWithReferenceTypes()
 {
     var x = new CanBeNull <string>("hello");
 }
예제 #9
0
 public void StillWorksWithNulls()
 {
     string input = "";
     var    x     = CanBeNull.Create(input).Equals("some other string");
 }