예제 #1
0
 public void InvalidMask()
 {
     Assert.Throws <InvalidImageMaskException>(
         () => ImageMaskUtil.ZipImageIdMask("0123abc", new List <IFormFile>()));
     Assert.Throws <InvalidImageMaskException>(
         () => ImageMaskUtil.ZipImageIdMask("0129", new List <IFormFile>()));
     Assert.Throws <InvalidImageMaskException>(
         () => ImageMaskUtil.ZipImageIdMask("0121", new List <IFormFile> {
         null, null, null, null
     }));
 }
예제 #2
0
        public void ValidMask()
        {
            var formFiles = new IFormFile[]
            {
                new MockFormFile(), new MockFormFile(), new MockFormFile()
            };
            var result = ImageMaskUtil.ZipImageIdMask("351", formFiles);

            Assert.Equal(3, result.Count);
            Assert.Same(result[1], formFiles[2]);
            Assert.Same(result[3], formFiles[0]);
            Assert.Same(result[5], formFiles[1]);
        }
예제 #3
0
 public void EmptyMask()
 {
     Assert.Empty(ImageMaskUtil.ZipImageIdMask(string.Empty, new List <IFormFile>()));
 }
예제 #4
0
 public void InconsistentNumberOfImages()
 {
     Assert.Throws <InvalidImageMaskException>(
         () => ImageMaskUtil.ZipImageIdMask("01", new IFormFile[1]));
 }
예제 #5
0
 public void NullMaskOrFiles()
 {
     Assert.Throws <ArgumentNullException>(() => ImageMaskUtil.ZipImageIdMask(null, null));
     Assert.Throws <ArgumentNullException>(() => ImageMaskUtil.ZipImageIdMask(null, new List <IFormFile>()));
     Assert.Throws <ArgumentNullException>(() => ImageMaskUtil.ZipImageIdMask(string.Empty, null));
 }