public void GivenAFile_TheCorrectContentTypeIsReturned() { var model = new NewMediaViewModel(); var file = new TestableHttpPostedFileBase(); model.File = file; model.ContentType.Should().Be("test/foo"); }
public void WhenTheModelIsValid_ThenNoMessageIsOutput() { var model = new NewMediaViewModel(); var file = new TestableHttpPostedFileBase(); model.File = file; var context = new ValidationContext(new object()); var results = model.Validate(context); results.Count().Should().Be(0); }