예제 #1
0
        public void IfCharacterDoesNotHaveFavoriteColorsJustUseBlack()
        {
            var bob = CharacterTestTemplates.AverageBob();

            SelectCharacterFavoriteColors.CreateAndRegister();
            var handleBarsTemplate = Handlebars.Compile("{{choose-favorite-color}}");
            var result             = handleBarsTemplate(new CharacterContext(bob).CreateObject());

            Assert.Equal("black", result);
        }
예제 #2
0
        public void PrintsOutColorNameFromOneOfCharactersFavoriteColors()
        {
            var bob   = CharacterTestTemplates.AverageBob();
            var likes = bob.Get <Likes>();
            var color = new Color("Red", 255, 0, 0);

            likes.SetFavoriteColors(new Color[] { color });

            SelectCharacterFavoriteColors.CreateAndRegister();
            var handleBarsTemplate = Handlebars.Compile("{{choose-favorite-color}}");
            var result             = handleBarsTemplate(new CharacterContext(bob).CreateObject());

            Assert.Equal("Red", result);
        }