Ejemplo n.º 1
0
    public void CreateCanvasCommand()
    {
        var reader = new StringReader("create 0 0");
        var source = new ConsoleCommandSource(reader);

        Assert.AreEqual(true, source.MoveNext());
        Assert.AreEqual(new CreateCanvas(0, 0), source.Current);
    }
Ejemplo n.º 2
0
    public void DrawPointCommand()
    {
        var reader = new StringReader("create 1 1\npoint 0 0\n");
        var source = new ConsoleCommandSource(reader);
        var _      = source.Current; // ignore create

        Assert.AreEqual(true, source.MoveNext());
        Assert.AreEqual(new DrawPoint(0, 0), source.Current);
    }
Ejemplo n.º 3
0
    public void QuitCommand()
    {
        var reader = new StringReader("create 1 1\nquit\n");
        var source = new ConsoleCommandSource(reader);
        var _      = source.Current; // ignore create

        Assert.AreEqual(true, source.MoveNext());
        Assert.AreEqual(new QuitCommand(), source.Current);
    }
Ejemplo n.º 4
0
    public void PrintCanvasCommand()
    {
        var reader = new StringReader("create 0 0\nprint\n");
        var source = new ConsoleCommandSource(reader);
        var _      = source.Current; // ignore create

        Assert.AreEqual(true, source.MoveNext());
        Assert.AreEqual(new PrintCanvas(), source.Current);
    }