Ejemplo n.º 1
0
        public void GetFileParam_ShouldThrowIfBodyIsNull()
        {
            // Given
            Stream bodyStream = null;

            // When
            var exception = Record.Exception(() => RestUtilities.GetFileParam(ValidFilename, bodyStream, ValidContentType));

            // Then
            exception.Should().BeOfType <ArgumentNullException>().Subject.ParamName.Should().Be("bodyStream");
        }
Ejemplo n.º 2
0
        public void GetFileParam_ShouldThrowIfContentTypeNull()
        {
            using (var stream = new MemoryStream())
            {
                // Given
                string contentType = null;

                // When
                var exception = Record.Exception(() => RestUtilities.GetFileParam(ValidFilename, stream, contentType));

                // Then
                exception.Should().BeOfType <ArgumentNullException>().Subject.ParamName.Should().Be("contentType");
            }
        }