Esempio n. 1
0
            public void Should_Set_Return_Argument_If_Argument_Is_Not_Null()
            {
                // Arrange
                var baseClass = new BaseClass();

                // Act
                var value = MaybeUtils.CheckArgumentNotNull(baseClass, nameof(baseClass));

                //Assert
                value.ShouldBe(baseClass);
            }
Esempio n. 2
0
            public void Should_Throw_ArgumentNullException_If_Argument_Is_Null()
            {
                // Arrange
                var argumentName = "argumentName";

                // Act
                var exception = Record.Exception(() => MaybeUtils.CheckArgumentNotNull <BaseClass>(null, argumentName));

                // Assert
                exception.ShouldBeOfType <ArgumentNullException>();
                exception.Message.ShouldContain(argumentName);
            }