コード例 #1
0
    public void JosephusI5O3()
    {
        Josephus joe = GameObject.FindObjectOfType <Josephus>();

        joe.JosephusAlgorithm("5");
        Assert.AreEqual(joe.output.text, "3", "value was: " + joe.output.text);
    }
コード例 #2
0
    public void JosephusI2O1()
    {
        Josephus joe = GameObject.FindObjectOfType <Josephus>();

        joe.JosephusAlgorithm("2");
        Assert.AreEqual(joe.output.text, "1");
    }
コード例 #3
0
    public void JosephusOnlyAcceptsPositiveInput()
    {
        Josephus joe = GameObject.FindObjectOfType <Josephus>();

        joe.JosephusAlgorithm("-1");
        Assert.That(joe.output.text.Equals(""));
    }
コード例 #4
0
    public void JosephusI1O1()
    {
        Josephus joe = GameObject.FindObjectOfType <Josephus>();

        joe.JosephusAlgorithm("1");
        Assert.That(joe.output.text.Equals("1"));
    }
コード例 #5
0
    public void JosephusOnlyAcceptsNumericInput()
    {
        Josephus joe = GameObject.FindObjectOfType <Josephus>();

        joe.output.text = "hi";
        joe.JosephusAlgorithm("a");
        Assert.That(joe.output.text.Equals(""));
    }