Exemple #1
0
        public void The_toString_should_call_the_render_method()
        {
            //arrange
            var spec = new InputPropertySpecification();
            var property = new InputModelProperty();
            spec.Model = property;
            spec.Render = (a, b) =>
            {
                Assert.AreEqual(property, b);
                return "foo";
            };
            //act
            var result = spec.ToString();

            //assert
            Assert.AreEqual("foo",result);
        }
Exemple #2
0
        public void testname()
        {
            //arrange
            var inputSpecification = new InputPropertySpecification();
            inputSpecification.Model= new InputModelProperty();

            //act
            inputSpecification
                .Partial("partial")
                .Example("new example")
                .Label("label")
                .Required();

            //assert
            Assert.AreEqual("partial", inputSpecification.Model.PartialName);
            Assert.AreEqual("new example", inputSpecification.Model.Example);
            Assert.AreEqual("label", inputSpecification.Model.Label);
            Assert.IsTrue(inputSpecification.Model.PropertyIsRequired);
        }