Ejemplo n.º 1
0
        public void DeafaultAndParams()
        {
            var thingy = new Thingy();

            Assert.Equal(2, thingy.Add(2, 0));
            Assert.Equal(12, thingy.Add(2));
            Assert.Equal(15, thingy.Add());
        }
Ejemplo n.º 2
0
        public void OverloadingMethods()
        {
            var thingy   = new Thingy();
            var fullName = thingy.FormatName("Han", "Solo");

            Assert.Equal("Solo, Han", fullName);

            fullName = thingy.FormatName("Han", "Solo", "D");
            Assert.Equal("Solo, Han D.", fullName);
        }