public void GivenSizeFallsShortOfMin_WhenIsValid_ThenFalseReturned() { HttpPostedFileBase test = MockRepository.GenerateMock<HttpPostedFileBase>(); test.Expect(t => t.ContentLength).Return(50); var target = new FileSizeAttribute(100, 200); Assert.IsFalse(target.IsValid(test)); }
public void GivenValidSize_WhenIsValid_ThenTrueReturned() { HttpPostedFileBase test = MockRepository.GenerateMock <HttpPostedFileBase>(); test.Expect(t => t.ContentLength).Return(50); var target = new FileSizeAttribute(0, 100); Assert.IsTrue(target.IsValid(test)); }
public void GivenSizeFallsShortOfMin_WhenIsValid_ThenFalseReturned() { HttpPostedFileBase test = MockRepository.GenerateMock <HttpPostedFileBase>(); test.Expect(t => t.ContentLength).Return(50); var target = new FileSizeAttribute(100, 200); Assert.IsFalse(target.IsValid(test)); }
public void GivenValidSize_WhenIsValid_ThenTrueReturned() { HttpPostedFileBase test = MockRepository.GenerateMock<HttpPostedFileBase>(); test.Expect(t => t.ContentLength).Return(50); var target = new FileSizeAttribute(0, 100); Assert.IsTrue(target.IsValid(test)); }