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 NullMask() { Assert.Throws <ArgumentNullException>(() => ImageMaskUtil.ExtractImageIdFromMask(null)); }
public void ValidMask() { Assert.Equal(new [] { 0, 8, 1, 5 }, ImageMaskUtil.ExtractImageIdFromMask("0815")); }
public void EmptyMask() { Assert.Empty(ImageMaskUtil.ExtractImageIdFromMask(string.Empty)); }
public void InvalidMask() { Assert.Throws <InvalidImageMaskException>(() => ImageMaskUtil.ExtractImageIdFromMask("0123abc")); Assert.Throws <InvalidImageMaskException>(() => ImageMaskUtil.ExtractImageIdFromMask("01239")); Assert.Throws <InvalidImageMaskException>(() => ImageMaskUtil.ExtractImageIdFromMask("01421")); }
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)); }