Exemplo n.º 1
0
        public void TestMethod3()
        {
            var santa = new Santa();
            var elf   = new GreenWoodenToyMakingElf(santa);
            var toy   = elf.MakePresent("Susan");

            Assert.That(toy.Type, Is.EqualTo("Green wooden toy"));
        }
Exemplo n.º 2
0
        public void TestMethod1()
        {
            var santa = new Santa();
            var elf   = new ToyMakingElf(santa);
            var toy   = elf.MakePresent("Sarah");

            Assert.That(toy.Type, Is.EqualTo("Train"));
        }
Exemplo n.º 3
0
        public void TestMethod2()
        {
            var santa = new Santa();
            var elf   = new WoodenToyMakingElf(santa);
            var toy   = elf.MakePresent("John");

            Assert.That(toy.Type, Is.EqualTo("Wooden toy"));
        }
Exemplo n.º 4
0
        public void TestMethod4()
        {
            var santa = new Santa();
            var elf   = new GreenWoodenToyMakingElf(santa);
            var toy   = elf.MakePresent("Bad Tom");

            Assert.That(toy.Type, Is.EqualTo("Coal"));
            Assert.That(toy.Reason, Is.EqualTo("Bad Tom was on the naughty list"));
        }
Exemplo n.º 5
0
        public static void Main()
        {
            var santa    = new Santa();
            var presents = santa.GetPresents();

            foreach (var present in presents)
            {
                Console.WriteLine("Santa's got " + present.Key + " a " + present.Value.Type);
            }
            Console.ReadLine();
        }
Exemplo n.º 6
0
        public void AllSantasPresents()
        {
            var santa       = new Santa();
            var allPresents = santa.GetPresents();

            Assert.That(allPresents["Susan"].Type, Is.EqualTo("Green wooden toy"));
            Assert.That(allPresents["John"].Type, Is.EqualTo("Wooden toy"));
            Assert.That(allPresents["Good Tom"].Type, Is.EqualTo("Red wooden toy"));
            Assert.That(allPresents["Bad Tom"].Type, Is.EqualTo("Coal"));
            Assert.That(allPresents["Bad Tom"].Reason, Is.EqualTo("Bad Tom was on the naughty list"));
            Assert.That(allPresents["Sarah"].Type, Is.EqualTo("Train"));
        }
 public RedWoodenToyMakingElf(Santa santa) : base(santa)
 {
     _colour = "Red";
 }
 public GreenWoodenToyMakingElf(Santa santa) : base(santa)
 {
     _colour = "green";
 }