public void BindModelReturnsCorrectResult(DateViewModelBinder sut, ControllerContext controllerContext, ModelBindingContext bindingContext, DateTime dateTime, CultureInfo culture) { var rawValue = dateTime.ToString(DateViewModelBinder.DateFormat); Mock.Get(bindingContext.ValueProvider) .Setup(vp => vp.GetValue("id")) .Returns(new ValueProviderResult(rawValue, rawValue, culture)); var actual = sut.BindModel(controllerContext, bindingContext); var model = Assert.IsAssignableFrom<DateViewModel>(actual); dateTime.AsSource().OfLikeness<DateViewModel>().ShouldEqual(model); }
public void SutIsModelBinder(DateViewModelBinder sut) { Assert.IsAssignableFrom<IModelBinder>(sut); }