public void GivenValidType_WhenIValidate_ThenTrueIsReturned()
        {
            var file = MockRepository.GenerateStub<HttpPostedFileBase>();
            file.Expect(f => f.FileName).Return("myfile.test");

            var target = new FileTypesAttribute("test,testing");

            Assert.IsTrue(target.IsValid(file));
        }
예제 #2
0
        public void GivenInvalidType_WhenIValidate_ThenFalseIsReturned()
        {
            var file = MockRepository.GenerateStub <HttpPostedFileBase>();

            file.Expect(f => f.FileName).Return("myfile.blah");

            var target = new FileTypesAttribute("test,testing");

            Assert.IsFalse(target.IsValid(file));
        }
        public void GivenNull_WhenIValidate_ThenTrueIsReturned()
        {
            var target = new FileTypesAttribute("test,testing");

            Assert.IsTrue(target.IsValid(null));
        }
예제 #4
0
        public void GivenNull_WhenIValidate_ThenTrueIsReturned()
        {
            var target = new FileTypesAttribute("test,testing");

            Assert.IsTrue(target.IsValid(null));
        }