LoadCommand() public method

public LoadCommand ( Project, project, System reader, string line, int &lineNumber ) : void
project Project,
reader System
line string
lineNumber int
return void
Exemplo n.º 1
0
        public void TestLoadCommand()
        {
            Mockery            mockery    = new Mockery();
            IProjectSerializer serializer = mockery.NewMock <IProjectSerializer>();
            RuleCommand        rc         = new RuleCommand();

            Expect.Once.On(serializer).GetProperty("LineNumber").Will(Return.Value(1));
            Expect.Once.On(serializer).Method("ReadTextToken").Will(Return.Value(new Token(TokenType.Text, "a", 0, 1)));
            Expect.Once.On(serializer).Method("ReadTextToken").Will(Return.Value(null));

            rc.LoadCommand(serializer);

            Assert.AreEqual("a", rc.Rule);

            mockery.VerifyAllExpectationsHaveBeenMet();
        }
Exemplo n.º 2
0
        public void TestLoadCommand()
        {
            Mockery mockery = new Mockery();
            IProjectSerializer serializer = mockery.NewMock<IProjectSerializer>();
            RuleCommand rc = new RuleCommand();

            Expect.Once.On(serializer).GetProperty("LineNumber").Will(Return.Value(1));
            Expect.Once.On(serializer).Method("ReadTextToken").Will(Return.Value(new Token(TokenType.Text, "a", 0, 1)));
            Expect.Once.On(serializer).Method("ReadTextToken").Will(Return.Value(null));

            rc.LoadCommand(serializer);

            Assert.AreEqual("a", rc.Rule);

            mockery.VerifyAllExpectationsHaveBeenMet();
        }