예제 #1
0
        public void PassingNullThrowsNullReferenceException()
        {
            // Arrange
            var thrower = new Thrower();

            // Act
            Action action = () => thrower.GetStringLengthOrThrowIfNull(null);

            // Assert
            Assert.Throws <NullReferenceException>(action);
        }
예제 #2
0
        public void ReturnsFourWhichIsTheStringLength()
        {
            // Arrange
            const string value   = "four";
            var          thrower = new Thrower();

            // Act
            var result = thrower.GetStringLengthOrThrowIfNull(value);

            // Assert
            Assert.Equal(4, result);
        }