public void When_NodeHasNoChildren_Then_ReturnOnlyRootNode()
        {
            // Arrange
            var node   = CreateNode("/home.html");
            var target = new TextOutputGenerator();

            // Act
            var actual = target.Generate(node);

            //Assert
            var expected = "https://buildit.wiprodigital.com/home.html" + _n;

            Assert.AreEqual(expected, actual);
        }
Exemple #2
0
        public void IsAllInRow()
        {
            List <List <bool> > grid = new List <List <bool> >();

            grid.Add(CA.ToList <bool>(true, true, true));
            grid.Add(CA.ToList <bool>(false, false, false));
            grid.Add(CA.ToList <bool>(true, false, true));
            grid.Add(CA.ToList <bool>(false, true, true));

            ValuesTableGrid <bool> valuesTableGrid = new ValuesTableGrid <bool>(grid);

            List <string> atLeastOne = new List <string>();
            List <string> noOne      = new List <string>();

            Assert.Equal(false, valuesTableGrid.IsAllInRow(0, false));
            Assert.Equal(true, valuesTableGrid.IsAllInRow(1, false));
            Assert.Equal(false, valuesTableGrid.IsAllInRow(2, false));
            Assert.Equal(false, valuesTableGrid.IsAllInRow(3, false));

            for (int i = 0; i < grid.Count; i++)
            {
                string file = i.ToString();
                //all true(return false), all false(return true), false,true,false(if skipped, return false), true/false(return false) - everything is going fine
                if (valuesTableGrid.IsAllInRow(i, false))
                {
                    noOne.Add(file);
                }
                else
                {
                    atLeastOne.Add(file);
                }
            }

            TextOutputGenerator generator = new TextOutputGenerator();

            generator.List(noOne, "No one", new TextOutputGeneratorArgs(true, true));
            generator.List(atLeastOne, "At least one", new TextOutputGeneratorArgs(true, true));

#if DEBUG
            //DebugLogger.Instance.WriteLine(generator.ToString());
#endif
        }
        public void When_NodeHasSeveralNestedChildren_Then_ReturnSeveralNestedChildren()
        {
            // Arrange
            var node = CreateNode("/");

            node.Nodes = new List <Node>()
            {
                CreateNode("/home.html"), CreateNode("/about.html"), CreateNode("/contact.html")
            };
            node.Nodes[0].Nodes = new List <Node>()
            {
                CreateNode("/about.html"), CreateNode("/contact.html")
            };
            node.Nodes[1].Nodes = new List <Node>()
            {
                CreateNode("/home.html"), CreateNode("/contact.html")
            };
            node.Nodes[2].Nodes = new List <Node>()
            {
                CreateNode("/home.html"), CreateNode("/about.html")
            };
            var target = new TextOutputGenerator();

            // Act
            var actual = target.Generate(node);

            //Assert
            var expected =
                "https://buildit.wiprodigital.com/" + _n +
                "    https://buildit.wiprodigital.com/home.html" + _n +
                "        https://buildit.wiprodigital.com/about.html" + _n +
                "        https://buildit.wiprodigital.com/contact.html" + _n +
                "    https://buildit.wiprodigital.com/about.html" + _n +
                "        https://buildit.wiprodigital.com/home.html" + _n +
                "        https://buildit.wiprodigital.com/contact.html" + _n +
                "    https://buildit.wiprodigital.com/contact.html" + _n +
                "        https://buildit.wiprodigital.com/home.html" + _n +
                "        https://buildit.wiprodigital.com/about.html" + _n;

            Assert.AreEqual(expected, actual);
        }
Exemple #4
0
    /// <summary>
    ///
    /// </summary>
    public static void IsCSharpCodeTest()
    {
        // Unfortunately is c# code
        var input1 = "abc";
        var input2 = @"using System;

using System.Collections.Generic;
";

        // Everything here is c#
        var input3  = @"Nebyly nalezeny žádné sloupce
foreach (DataRow item in dt.Rows)
[i] = o[
Uloženo do souboru
Base
Tables.
if (o != null)
= MSTableRowParse.
protected void ParseRow(object[] o)
Base
V prvním sloupci není řádek ID nebo ID*
public void SelectInTable()
Tabulka nemůže mít jen 1 sloupec.
void InsertToTable3(
public static string Get
return MSStoredProceduresI.ci.SelectNameOfID(Tables.
public static string Get
return MSStoredProceduresI.ci.SelectNameOfID(Tables.
Snažíte se převést na int strukturovaný(složitý) datový typ
Snažíte se převést datový typ, pro který není implementována větev
Datový typ DateTimeOffset a Timestamp není podporován.
Not supported convert binary data to string
Strukturované datové typy nejsou podporovány.
Univerzální datové typy nejsou podporovány.
Variantní datové typy nejsou podporovány.
Xml datový typ není podporován
public void DisplayInfo()
private void SetP(string p, HtmlGenericControl lblName, HtmlGenericControl pName)
string t = p.Trim();
        if (t !=
protected void SetPDateTime(DateTime dt, string p, HtmlGenericControl lblName, HtmlGenericControl pName)
private void SetVisible(bool b)";
        var input3L = SH.GetLines(input3);

        //Assert.False(RoslynParser.IsCSharpCode(input1));
        Assert.True(RoslynParser.IsCSharpCode(input2));

        StringBuilder isCs    = new StringBuilder();
        StringBuilder isNotCs = new StringBuilder();

        foreach (var item in input3L)
        {
            if (RoslynParser.IsCSharpCode(item))
            {
                isCs.AppendLine(item);
            }
            else
            {
                isNotCs.AppendLine(item);
            }
        }

        TextOutputGenerator t = new TextOutputGenerator();

        t.Header("Is c#");
        t.AppendLine(isCs);
        t.Header("Is not c#");
        t.AppendLine(isNotCs);

        var s = t.ToString();

        // Cant be use because Presentation is not on nuget and UT projets does nto have Assemblies tab
        //Clipboard.SetText(s);

        //DebugLogger.Instance.WriteLine(s);
    }