Exemplo n.º 1
0
 public ApplicationService(IMemoryService memory, ISourceFileModel <ILineOfCode> srcModel, OperationHelpers operationHelpers, BitOperations bitOperations, ByteOperations byteOperations, LiteralControlOperations literalControlOperations)
 {
     this._memory              = memory;
     this._srcModel            = srcModel;
     _bitOperations            = bitOperations;
     _byteOperations           = byteOperations;
     _literalControlOperations = literalControlOperations;
     _operationHelpers         = operationHelpers;
 }
        public void Setup()
        {
            _mem = new Mock <IMemoryService>().SetupAllProperties();
            _ram = new Mock <IRAMModel>().SetupAllProperties();
            _mem.Setup(m => m.RAM).Returns(_ram.Object);
            Stack <short> _pcStack = new Stack <short>();

            _mem.Setup(m => m.PCStack).Returns(_pcStack);
            _opService = new LiteralControlOperations(_mem.Object);
        }
Exemplo n.º 3
0
 public void Create()
 {
     //TODO: set this to timer port when it is implemented
     PortA                    = new Port();
     PortB                    = new Port();
     RAM                      = new RAMModel(PortA, PortB);
     PCStack                  = new ObservableStack <short>(new Stack <short>(MemoryConstants.PC_STACK_CAPACITY));
     Memory                   = new MemoryService(RAM, PCStack);
     SourceFile               = new SourceFileModel();
     FileService              = new FileService();
     DialogService            = new DialogService();
     OperationHelpers         = new OperationHelpers(Memory);
     BitOperations            = new BitOperations(Memory);
     ByteOperations           = new ByteOperations(Memory);
     LiteralControlOperations = new LiteralControlOperations(Memory);
     ApplicationService       = new ApplicationService(Memory, SourceFile, OperationHelpers, BitOperations, ByteOperations, LiteralControlOperations);
 }