public void Should_Append_Options(DeclareParameter declareParameter, string expected)
            {
                //Given --> When
                var actual = declareParameter.ToCommandLineArgument();

                //Then
                Assert.Equal(expected, declareParameter.ToCommandLineArgument());
            }
Ejemplo n.º 2
0
            public void Should_Throw_If_Context_Is_Null()
            {
                // Given
                var declareParameter = new DeclareParameter();

                // When
                var result = Record.Exception(() => declareParameter.AppendCommandLineArgument(null));

                // Then
                Assert.IsArgumentNullException(result, "sb");
            }
            public void Should_Throw_If_Name_Is_Null_or_Empty()
            {
                // Given
                var declareParameter = new DeclareParameter();

                // When...Then
                var result = Record.Exception(() => declareParameter.AppendCommandLineArgument(new StringBuilder()));

                // Then
                Assert.IsExceptionWithMessage <NullReferenceException>(result, "Name is required when using the DeclareParameter option.");
            }