public void Setup()
        {
            this.mockFactory = new CommonMockFactory();
            var platform = mockFactory.CreateMockPlatform();

            platform.Setup(p => p.CreateCParser(It.IsAny <TextReader>(), It.IsAny <ParserState>()))
            .Returns(new Func <TextReader, ParserState, CParser>((r, s) =>
            {
                var lex = new CLexer(r, CLexer.MsvcKeywords);
                return(new CParser(s ?? new ParserState(), lex));
            }));
            this.program = new Program
            {
                Platform     = platform.Object,
                Architecture = platform.Object.Architecture,
            };
        }
Esempio n. 2
0
 public void Setup()
 {
     this.mockFactory = new CommonMockFactory();
     this.platform    = mockFactory.CreateMockPlatform().Object;
     this.program     = mockFactory.CreateProgram();
 }