Ejemplo n.º 1
0
        public void it_can_build()
        {
            var action = _builder
                         .WithName("name")
                         .WithClass("class 1")
                         .WithClass("class 2")
                         .WithMethod("method")
                         .WithHref("href")
                         .WithTitle("title")
                         .WithType("type")
                         .WithField(new FieldBuilder().WithName("name 1"))
                         .WithField(new FieldBuilder().WithName("name 2"))
                         .Build();

            Assert.That(action.Name, Is.EqualTo("name"));
            Assert.That(action.Class.Select(x => x), Is.EqualTo(new[] { "class 1", "class 2" }));
            Assert.That(action.Method, Is.EqualTo("method"));
            Assert.That(action.Href, Is.EqualTo("href"));
            Assert.That(action.Title, Is.EqualTo("title"));
            Assert.That(action.Type, Is.EqualTo("type"));
            Assert.That(action.Fields.Select(x => x.Name), Is.EqualTo(new[] { "name 1", "name 2" }));
        }