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

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

            // Assert
            Assert.Throws <NullReferenceException>(action);
        }
Exemple #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);
        }