public void SetUp()
 {
     _transactionMock = new Mock<ITransmissionContext>();
     _transactionFactoryMock = new Mock<ITransmissionContextFactory>();
     _lowerLayerMock = new Mock<ILayer>();
     _observer = new Mock<IMessageObserver>();
     _messageLayer = new MessageLayer(_lowerLayerMock.Object, _transactionFactoryMock.Object);
     _messageLayer.RegisterObserver(_observer.Object);
     _transactionFactoryMock.Setup(f => f.Create(_messageLayer, It.IsAny<Message>())).Returns(_transactionMock.Object);
 }
Exemple #2
0
 public Client()
 {
     _messageLayer = new MessageLayer();
     _messageLayer.RegisterObserver(new ConsoleHandler());
 }
Exemple #3
0
 public Server()
 {
     _messageLayer = new MessageLayer();
     _messageLayer.RegisterObserver(new ConsoleHandler());
     _messageLayer.RegisterObserver(new ResourceHandler(_messageLayer, new TemperatureResource()));
 }