public void Larger_Than_A_Megabite() { var postedFile = new Mock<HttpPostedFileBase>(); postedFile.SetupGet(f => f.ContentLength).Returns(1024*1024 + 2); var imageFileAttribute = new ImageFileAttribute(); Assert.IsFalse(imageFileAttribute.IsValid(postedFile.Object)); }
public void Larger_Than_A_Megabite() { var postedFile = new Mock <HttpPostedFileBase>(); postedFile.SetupGet(f => f.ContentLength).Returns(1024 * 1024 + 2); var imageFileAttribute = new ImageFileAttribute(); Assert.IsFalse(imageFileAttribute.IsValid(postedFile.Object)); }
public void Null_Value() { var imageFileAttribute = new ImageFileAttribute(); Assert.IsTrue(imageFileAttribute.IsValid(null)); }
public void Not_A_HttpPostedFileBase() { var imageFileAttribute = new ImageFileAttribute(); Assert.IsFalse(imageFileAttribute.IsValid("foo")); }