public void WhenSingleFileIsTestedAndItHasIncorrectContentType_ValidationReturnsError()
        {
            var file = CreateFileWithContentType("image/png");

            var testedAttribute  = new ContentTypeAttribute("image/jpeg");
            var validationResult = testedAttribute.GetValidationResult(file, new ValidationContext(file));

            Assert.That(validationResult, Is.Not.Null);
        }
        public void WhenMultipleFilesAreTestedAndSomeFilesHasIncorrectContentType_ValidationReturnsError()
        {
            var files = new HttpPostedFileBase[]
            {
                CreateFileWithContentType("image/jpeg"),
                CreateFileWithContentType("image/png"),
                CreateFileWithContentType("image/jpeg"),
            };

            var testedAttribute  = new ContentTypeAttribute("image/jpeg");
            var validationResult = testedAttribute.GetValidationResult(files, new ValidationContext(files));

            Assert.That(validationResult, Is.Not.Null);
        }
        public void WhenMultipleFilesAreTestedAndEveryFileHasCorrectContentType_ValidationIsSuccessful()
        {
            var files = new HttpPostedFileBase[]
            {
                CreateFileWithContentType("image/jpeg"),
                CreateFileWithContentType("image/jpeg"),
                CreateFileWithContentType("image/jpeg"),
            };

            var testedAttribute  = new ContentTypeAttribute("image/jpeg");
            var validationResult = testedAttribute.GetValidationResult(files, new ValidationContext(files));

            Assert.That(validationResult, Is.Null);
        }