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 })); }
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]); }
public void EmptyMask() { Assert.Empty(ImageMaskUtil.ZipImageIdMask(string.Empty, new List <IFormFile>())); }
public void InconsistentNumberOfImages() { Assert.Throws <InvalidImageMaskException>( () => ImageMaskUtil.ZipImageIdMask("01", new IFormFile[1])); }
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)); }