Prerequisites
Description
Debugging the new Upload() from #36 the call to ComputeFileTypes() sets the fileName to an empty string.
Steps to Reproduce
Pre-condition: only one FileType must exist for the extension, i.e. "step"
var fileName = "MyFile";
var extensions = new[] { "step" };
var fileTypes = this.ComputeFileTypes(extensions, this.GetAllowedFileType(iteration), ref fileName);
// Here fileName was updated as an empty string
// Expected: fileName = "Myfile.step"
Observation
The method contains the following line:
fileName = string.Join(".", extensions.Take(i));
which uses Take(i), being i=0 when only one extension is provided.
Also, only the extensions are part of the string.Join() which will not create a fileName content as the parameter refers to. It should preserve the initial value (the name).
System Configuration
Prerequisites
Description
Debugging the new Upload() from #36 the call to ComputeFileTypes() sets the
fileNameto an empty string.Steps to Reproduce
Pre-condition: only one
FileTypemust exist for the extension, i.e. "step"Observation
The method contains the following line:
which uses
Take(i), beingi=0when only one extension is provided.Also, only the extensions are part of the
string.Join()which will not create afileNamecontent as the parameter refers to. It should preserve the initial value (the name).System Configuration