Exemplo n.º 1
0
        protected override void Establish_context()
        {
            _clipboard = CreateStub<IClipboard>();
            _specParser = CreateStub<ISpecParser>();
            _cSharpCodeWriter = CreateStub<ICodeWriter>();
            _application = new Application(_clipboard, _specParser, _cSharpCodeWriter);

            var parsedSpec = new ParsedSpec();

            _clipboard.Stub(c => c.GetData()).Return("spec");
            _specParser.Stub(p => p.Parse("spec")).Return(parsedSpec);
            _cSharpCodeWriter.Stub(w => w.WriteCode(parsedSpec)).Return("code");
        }
Exemplo n.º 2
0
 public Application(IClipboard clipboard, ISpecParser specParser, ICodeWriter cSharpCodeWriter)
 {
     _clipboard = clipboard;
     _specParser = specParser;
     _codeWriter = cSharpCodeWriter;
 }