Ejemplo n.º 1
0
    public void TextWaffleNoHeading()
    {
        var random = new Random(0);
        var text   = WaffleEngine.Text(random, 1, false);

        Approvals.Verify(text);
    }
    public Task TextWaffleMultiple()
    {
        var random = new Random(0);
        var text   = WaffleEngine.Text(random, 11, true);

        return(Verifier.Verify(text));
    }
Ejemplo n.º 3
0
        void CreateAuthor(string name, string imagePath)
        {
            if (_dbContext.Authors.Count() > 0)
            {
                return;
            }

            var email = ApplicationConstants.UserEmail;

            if (_dbContext.Authors.Count(a => a.UserName.Equals(email)) > 0)
            {
                return;
            }

            _dbContext.Authors.Add(new Author
            {
                UserName    = email,
                Email       = email,
                DisplayName = name,
                Avatar      = imagePath,
                Bio         = WaffleEngine.Text(1, false),
            });

            _dbContext.SaveChanges();
        }
    public Task HtmlWaffleSingleWithHeadAndBody()
    {
        var random = new Random(0);
        var html   = WaffleEngine.Html(random, 1, true, true);

        return(Verifier.Verify(html));
    }
    public Task HtmlWaffleSingle()
    {
        var random = new Random(0);
        var html   = WaffleEngine.Html(random, 1, true, false);

        return(Verifier.Verify(html));
    }
    public Task Title()
    {
        var random = new Random(0);
        var title  = WaffleEngine.Title(random);

        return(Verifier.Verify(title));
    }
Ejemplo n.º 7
0
    public void HtmlWaffleNoHeading()
    {
        var random = new Random(0);
        var html   = WaffleEngine.Html(random, 1, true, false);

        Approvals.Verify(html);
    }
Ejemplo n.º 8
0
    public void TextWaffleMultiple()
    {
        var random = new Random(0);
        var text   = WaffleEngine.Text(random, 11, true);

        Approvals.Verify(text);
    }
    public Task HtmlWaffleNoHeadingWithHeadAndBody()
    {
        Random random = new(0);
        var    html   = WaffleEngine.Html(random, 1, true, true);

        return(Verify(html));
    }
Ejemplo n.º 10
0
    public Task TextWaffleNoHeading()
    {
        Random random = new(0);
        var    text   = WaffleEngine.Text(random, 1, false);

        return(Verify(text));
    }
Ejemplo n.º 11
0
    public Task HtmlWaffleNoHeading()
    {
        Random random = new(0);
        var    html   = WaffleEngine.Html(random, 1, true, false);

        return(Verify(html));
    }
Ejemplo n.º 12
0
    public void MultiHtmlShouldNotDuplicate()
    {
        var text1 = WaffleEngine.Html(1, true, true);
        var text2 = WaffleEngine.Html(1, true, true);

        Assert.AreNotEqual(text1, text2);
    }
Ejemplo n.º 13
0
    public Task MarkdownWaffleMultiple()
    {
        Random random = new(0);
        var    text   = WaffleEngine.Markdown(random, 11, true);

        return(Verify(text).UseExtension("md"));
    }
Ejemplo n.º 14
0
    public Task HtmlWaffleMultiple()
    {
        Random random = new(0);
        var    html   = WaffleEngine.Html(random, 11, true, false);

        return(Verify(html));
    }
Ejemplo n.º 15
0
    public void MultiMarkdownShouldNotDuplicate()
    {
        var text1 = WaffleEngine.Markdown(1, true);
        var text2 = WaffleEngine.Markdown(1, true);

        Assert.AreNotEqual(text1, text2);
    }
Ejemplo n.º 16
0
    public Task Title()
    {
        Random random = new(0);
        var    title  = WaffleEngine.Title(random);

        return(Verify(title));
    }
Ejemplo n.º 17
0
    public void HtmlWaffleMultipleWithHeadAndBody()
    {
        var random = new Random(0);
        var html   = WaffleEngine.Html(random, 11, true, true);

        Approvals.Verify(html);
    }
Ejemplo n.º 18
0
    public void HtmlWaffleMultiple()
    {
        var random = new Random(0);
        var html   = WaffleEngine.Html(random, 11, true, false);

        Approvals.Verify(html);
    }
Ejemplo n.º 19
0
    public Task TextWaffleSingle()
    {
        Random random = new(0);
        var    text   = WaffleEngine.Text(random, 1, true);

        return(Verify(text));
    }
Ejemplo n.º 20
0
    public void Title()
    {
        var random = new Random(0);
        var title  = WaffleEngine.Title(random);

        Approvals.Verify(title);
    }
Ejemplo n.º 21
0
    public Task MarkdownWaffleNoHeading()
    {
        Random random = new(0);
        var    text   = WaffleEngine.Markdown(random, 1, false);

        return(Verify(text)
               .UseExtension("md"));
    }
Ejemplo n.º 22
0
    public void TextWaffleSample()
    {
        var text = WaffleEngine.Text(
            paragraphs: 1,
            includeHeading: true);

        Debug.WriteLine(text);
    }
Ejemplo n.º 23
0
        protected Post GetPost(int i, Guid authorId)
        {
            var title = WaffleEngine.Title();

            if (title.Length > 160)
            {
                title = title.Substring(0, 160);
            }

            var post = new Post
            {
                AuthorId    = authorId,
                Title       = title,
                Slug        = title.ToPostSlug(),
                Description = WaffleEngine.Text(1, false),
                Published   = DateTime.UtcNow.AddDays(-i * 10)
            };

            if (post.Description.Length > 450)
            {
                post.Description = post.Description.Substring(0, 450);
            }

            var content = new StringBuilder();

            content.Append($"## {WaffleEngine.Text(1, true)}");
            content.Append($"{WaffleEngine.Text(1, false)}");

            if (i % 2 == 0)
            {
                content.Append("``` csharp\npublic class {{\n  var myVar = \"Some value\";\n}}\n```\n");
            }
            else
            {
                content.Append("``` yaml\nYAML: YAML Ain't Markup Language\n```\n");
            }

            content.Append($"## {WaffleEngine.Text(1, true)}");
            content.Append($"{WaffleEngine.Text(2, false)}");
            content.Append($"> {WaffleEngine.Text(1, false)}\n");
            content.Append($"{WaffleEngine.Text(1, false)}");

            post.Content = content.ToString();

            if (i % 2 == 0)
            {
                post.CoverUrl     = "/images/woods.gif";
                post.CoverCaption = "Battle background for the Misty Woods in the game Shadows of Adam by Tim Wendorf";
                post.CoverLink    = "http://pixeljoint.com/pixelart/94359.htm";
                post.Categories   = "csharp,waffle,random";
            }
            else
            {
                post.Categories = "yaml,waffle,random";
            }

            return(post);
        }
    public Task MarkdownWaffleSingle()
    {
        var random   = new Random(0);
        var text     = WaffleEngine.Markdown(random, 1, true);
        var settings = new VerifySettings();

        settings.UseExtension("md");
        return(Verifier.Verify(text, settings));
    }
Ejemplo n.º 25
0
    public void HtmlWaffleSample()
    {
        var text = WaffleEngine.Html(
            paragraphs: 2,
            includeHeading: true,
            includeHeadAndBody: true);

        Debug.WriteLine(text);
    }
Ejemplo n.º 26
0
 public IActionResult Waffler(int id)
 {
     for (int i = 0; i < id; i++)
     {
         var waffle = WaffleEngine.Html(2, true, false);
         waffles.Add(new HtmlString(waffle));
     }
     return(View(waffles));
 }
Ejemplo n.º 27
0
    public static IDocument GeneratePage(int paragraphs = 1)
    {
        var context = BrowsingContext.New(Configuration.Default.WithDefaultLoader());

        return(context.OpenAsync(request => request.Content(
                                     WaffleEngine.Html(
                                         paragraphs: paragraphs,
                                         includeHeading: true,
                                         includeHeadAndBody: true))).RunSynchronously <IDocument>());
    }
Ejemplo n.º 28
0
    public void MarkdownWaffleSample()
    {
        #region markdownUsage

        var markdown = WaffleEngine.Markdown(
            paragraphs: 1,
            includeHeading: true);
        Debug.WriteLine(markdown);

        #endregion
    }
Ejemplo n.º 29
0
    public static IEnumerable <string> GenerateTitle(int times, Func <string, string> modifier = null)
    {
        Func <string, string> _nullModifier = @string => @string;
        var _modifier = modifier ?? _nullModifier;

        for (var i = 0; i < times; i++)
        {
            var title = WaffleEngine.Title();
            yield return(_modifier(title));
        }
    }
Ejemplo n.º 30
0
    public void TextWaffleSample()
    {
        #region textUsage

        var text = WaffleEngine.Text(
            paragraphs: 1,
            includeHeading: true);
        Debug.WriteLine(text);

        #endregion
    }