Beispiel #1
0
        public void SimpleEmployeeBuilder()
        {
            const string expectedText = "Test name";

            var builder = new EmployeeBuilder();

            var actual = builder.With(x => x.Name = expectedText)
                         .Build();

            actual.Name.ShouldBe(expectedText);
        }
Beispiel #2
0
        public void SimpleEmployeeBuilderSetMoreThanOneValue()
        {
            var builder = new EmployeeBuilder();

            var actual = builder.With(x =>
            {
                x.Name     = "First";
                x.LastName = "Last";
            })
                         .Build();

            actual.Name.ShouldBe("First");
            actual.LastName.ShouldBe("Last");
        }