Ejemplo n.º 1
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();
        }
Ejemplo n.º 2
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"));
        }