public override void Given()
        {
            var stream    = new MemoryStream(Encoding.UTF8.GetBytes("This is a test file"));
            var file      = new FormFile(stream, 0, 0, "Data", "File_With_Longer_Name.xml");
            var validFile = new FormFile(stream, 0, 0, "Data", "reg.csv");

            model = new FileValidationModel {
                File = file, ValidFile = validFile
            };
            validationContext = new ValidationContext(model);
        }
Beispiel #2
0
        public override void Given()
        {
            var moreDataStream  = new MemoryStream(Encoding.UTF8.GetBytes("Header \nrec1, \nrec2, \nrec3, \nrec4"));
            var validDataStream = new MemoryStream(Encoding.UTF8.GetBytes("Header \nrec1, \nrec2, \nrec3"));

            var file      = new FormFile(moreDataStream, 0, 256, "Data", "Registrations.csv");
            var validFile = new FormFile(validDataStream, 0, 256, "Data", "reg.csv");

            model = new FileValidationModel {
                File = file, ValidFile = validFile
            };
            validationContext = new ValidationContext(model);
        }
Beispiel #3
0
        public override void Given()
        {
            var stream     = new MemoryStream(Encoding.UTF8.GetBytes("This is a test file"));
            var filelength = 2 * 1024 * 1024; // 2mb

            var file      = new FormFile(stream, 0, filelength, "Data", "Registrations.xml");
            var validFile = new FormFile(stream, 0, 0, "Data", "reg.txt");

            model = new FileValidationModel {
                File = file, ValidFile = validFile
            };
            validationContext = new ValidationContext(model);
        }
        public override void Given()
        {
            var stream = new MemoryStream(Encoding.UTF8.GetBytes("This is a test file"));

            var file       = new FormFile(stream, 0, 0, "Data", "Registrations.xml");
            var validFile1 = new FormFile(stream, 0, 0, "Data", "reg.txt");
            var validFile2 = new FormFile(stream, 0, 0, "Data", "reg.pdf");
            var validFile3 = new FormFile(stream, 0, 0, "Data", "reg.pdf");

            model = new FileValidationModel {
                File = file, ValidFile1 = validFile1, ValidFile2 = validFile2, ValidFile3 = validFile3
            };
            validationContext = new ValidationContext(model);
        }