Ejemplo n.º 1
0
        public void TestIntString2()
        {
            var x = new IntString(33, "foobar");

            Assert.AreEqual(x.I, 33);
            Assert.AreEqual(x.S, "foobar");
        }
Ejemplo n.º 2
0
        public void TestIntString1()
        {
            var x = new IntString(42);

            Assert.AreEqual(x.I, 42);
            Assert.IsNull(x.S);
        }
Ejemplo n.º 3
0
        public void TestIntString2()
        {
            var x = new IntString(33, "foobar");

            Assert.AreEqual(33, x.I);
            Assert.AreEqual("foobar", x.S);
        }
Ejemplo n.º 4
0
        private void Init()
        {
            //TODO: Replace this with one activated from the core and figure out the min value.
            if (!IntString.Inited || IntString.MinValue > m_minFps || IntString.MaxValue < m_maxFps)
            {
                IntString.Init
                (
                    minNegativeValue: m_minFps,
                    maxPositiveValue: m_maxFps
                );
            }

            m_graphyManager = transform.root.GetComponentInChildren <GraphyManager>();

            m_fpsMonitor = GetComponent <FpsMonitor>();

            UpdateParameters();
        }
Ejemplo n.º 5
0
    public void TestForSortedGroups2()
    {
        IntString[] items = new IntString[] {
            new IntString {
                x = 0
            },
            new IntString {
                x = 0
            },
            new IntString {
                x = 1
            },
            new IntString {
                x = 2
            },
            new IntString {
                x = 3
            },
            new IntString {
                x = 3
            },
            new IntString {
                x = 3
            },
        };

        int expectedGroup = 0;
        int numItems      = 0;

        Util.ForSortedGroups(items, x => x.x, (num, group) =>
        {
            Assert.AreEqual(expectedGroup, num);
            foreach (IntString item in group)
            {
                Assert.AreEqual(expectedGroup, item.x);
                numItems++;
            }
            expectedGroup++;
        });

        Assert.AreEqual(4, expectedGroup);
        Assert.AreEqual(items.Length, numItems);
    }
Ejemplo n.º 6
0
 private int getWordIndex(string word)
 {
     if (!suggestions.InvokeRequired)
         return suggestions.FindStringExact(word);
     var d = new IntString(getWordIndex);
     return (int) MainControl.mainWin.Invoke(d, new object[] {word});
 }
Ejemplo n.º 7
0
 public void IntString_ToString_OutputIsAlmostIdentical(string input)
 {
     m_IntString = new IntString(input, Allocator.Temp);
     Debug.Log($"input - {input}, output - {m_IntString}");
     Assert.AreEqual(input, m_IntString.ToString());
 }