Esempio n. 1
0
        public void WillTellYouWhatYouCanDoIfItCantCreate()
        {
            var alpha2Code = "NotAAlpha2Code";
            var capable    = SpeakerFactory.CanCreateFromAlphaCode2(alpha2Code);

            if (capable is IsNotCapable notCapable)
            {
                foreach (var reason in notCapable.ReasonsWhy)
                {
                    output.WriteLine("Couldn't create a speaker, here is why:");
                    output.WriteLine(reason);
                }

                return;
            }

            var speaker = SpeakerFactory.CreateFromAlphaCode2(alpha2Code);


            output.WriteLine(speaker.SayHello());
        }
Esempio n. 2
0
        public void WillSayHeyWhenAlpha2CoDeIsDK()
        {
            var alpha2Code = "DK";
            var capable    = SpeakerFactory.CanCreateFromAlphaCode2(alpha2Code);

            if (capable is IsNotCapable notCapable)
            {
                foreach (var reason in notCapable.ReasonsWhy)
                {
                    output.WriteLine("Coulden't create a speaker, here is why:");
                    output.WriteLine(reason);
                }

                return;
            }

            var speaker = SpeakerFactory.CreateFromAlphaCode2(alpha2Code);


            output.WriteLine(speaker.SayHello());
        }