public void The_toString_should_call_the_render_method() { //arrange var spec = new InputPropertySpecification(); var property = new PropertyViewModel(); spec.Model = property; spec.Render = (a, b) => { Assert.AreEqual(property, b); return "foo"; }; //act var result = spec.ToString(); //assert Assert.AreEqual("foo",result); }
public void The_toString_should_call_the_render_method() { //arrange var spec = new InputPropertySpecification(); var property = new PropertyViewModel(); spec.Model = property; spec.Render = (a, b) => { Assert.AreEqual(property, b); return("foo"); }; //act var result = spec.ToString(); //assert Assert.AreEqual("foo", result); }
public void methods_should_modify_the_underlying_model() { //arrange var inputSpecification = new InputPropertySpecification(); inputSpecification.Model = new PropertyViewModel(); //act inputSpecification .MaxLength(5) .Example("new example") .Required() .Partial("partial") .Label("label"); //assert Assert.AreEqual(5, inputSpecification.Model.AdditionalValues["maxlength"]); Assert.AreEqual("partial", inputSpecification.Model.PartialName); Assert.AreEqual("new example", inputSpecification.Model.Example); Assert.AreEqual("label", inputSpecification.Model.Label); Assert.IsTrue(inputSpecification.Model.PropertyIsRequired); }