Exemplo n.º 1
0
            public void Should_Not_Throw_If_ParamName_Is_The_Same(string actualParamName, string expectedParamName)
            {
                // Given
                var exception = new ArgumentNullException(actualParamName);

                // When
                exception.IsArgumentNullException(expectedParamName);

                // Then
            }
Exemplo n.º 2
0
            public void Should_Not_Throw_If_Exception_Type_Is_ArgumentNullException()
            {
                // Given
                var exception = new ArgumentNullException("Foo");

                // When
                exception.IsArgumentNullException("Foo");

                // Then
            }
Exemplo n.º 3
0
            public void Should_Throw_If_ParamName_Is_Different(string actualParamName, string expectedParamName)
            {
                // Given
                var exception = new ArgumentNullException(actualParamName);

                // When
                var result = Record.Exception(() => exception.IsArgumentNullException(expectedParamName));

                // Then
                result.ShouldBeOfType <Exception>();
                result.Message.ShouldBe($"Expected parameter name to be '{expectedParamName}' but was '{actualParamName}'.");
            }