public void SayHelloWorld()
        {
            INameSource nameSource = (INameSource)mocks.StrictMock(typeof(INameSource));

            Expect.Call(nameSource.CreateName(null, null)).IgnoreArguments().
            Do(new NameSourceDelegate(Formal));
            mocks.ReplayAll();
            string expected = "Hi, my name is Ayende Rahien";
            string actual   = new Speaker("Ayende", "Rahien", nameSource).Introduce();

            Assert.Equal(expected, actual);
        }
Exemple #2
0
            public string Introduce()
            {
                string name = nameSource.CreateName(firstName, surname);

                return(string.Format("Hi, my name is {0}", name));
            }