Exemplo n.º 1
0
        public void BypassFileExtension_WithNullOrEmptyInput_ShouldThrow(string extension, Type expectedException)
        {
            MiddlewareOptionsBuilder builder = new MiddlewareOptionsBuilder(_dirMapperSvc);
            Action testAction = () =>
            {
                builder.BypassFileExtension(extension);
            };


            testAction.ShouldThrow(expectedException);
        }
Exemplo n.º 2
0
        public void BypassFileExtension_WithValidExtension_ValueShouldEqualInput(string extension)
        {
            MiddlewareOptionsBuilder builder = new MiddlewareOptionsBuilder(_dirMapperSvc);

            builder.BypassFileExtension(extension);


            builder.GetOptions()
            .GetSingleOrDefault <BypassFileExtensionOption>()
            .ShouldNotBeNull()
            // the method BypassFileExtension removes the dots of the extensions
            .Value.ShouldBe(extension.StartsWith('.')
                    ? extension.Substring(1)
                    : extension);
        }