public void Setup() { _listenerMock = new ClientListenerMock(); _receiverMock = new TimerMock(); _senderMock = new TimerMock(); _loggerMock = new LoggerMock(); _connector = new Connector(_listenerMock, _receiverMock, _senderMock, _loggerMock) }
public void TestInitialize() { _result = new List <string>(); _timer = new TimerMock(CurrentTime, Interval); _queue = new QueueByTime <string>( Timeout, Interval, () => _timer.CurrentTime, _timer); _queue.PulledData += Dictionary_SendData; }
public void Setup() { staticStates = new Dictionary <BrickState, Image>(); dynamicStates = new Dictionary <BrickState, Animation>(); timer1 = new TimerMock(); timer2 = new TimerMock(); var burnMock = new AnimationMock(Const.BrickTexture, Const.BlockSize, timer1); var growMock = new AnimationMock(Const.BrickTexture, Const.BlockSize, timer2); component = new DynamicComponent <BrickState>(0, 0); component.AddDynamicState(BrickState.Burn, burnMock); component.AddDynamicState(BrickState.Grow, growMock); component.State = BrickState.Visible; }
public void TestMethod1() { var tm = new TimerMock(); var br = new Brick(0, 0); var prop = br.GetType().GetField("burn", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); prop.SetValue(br, new Animation(Const.BrickBurnAnimation, Const.BlockSize, new TimerMock())); br.Burn(); tm.NextTick(); tm.NextTick(); tm.NextTick(); tm.NextTick(); }
public void SetupTestBrick() { brickTimer = new TimerMock(); burnTimer = new TimerMock(); growTimer = new TimerMock(); brick = new Brick(0, 0, brickTimer); grow = new Animation(animationPath, frameWidth, growTimer); grow.AnimationComplete += brick.OnGrowAnimationFinished; burn = new Animation(animationPath, frameWidth, burnTimer); burn.AnimationComplete += brick.OnBurnAnimationFinished; brick.AddDynamicState(BrickState.Burn, burn); brick.AddDynamicState(BrickState.Grow, grow); brick.AddStaticState(BrickState.Visible, Textures.Brick); brick.AddStaticState(BrickState.NotVisible, new Bitmap(1, 1)); }
public void Initialize() { timer = new TimerMock(); animation = new Animation(path, frameLength, timer); }
public void Setup() { _vsSolutionTestCoverageMock = Substitute.For<IVsSolutionTestCoverage>(); _timerMock = new TimerMock(); _documentProviderMock = Substitute.For<IDocumentProvider>(); var textSnapshotMock = Substitute.For<ITextSnapshot>(); _textBufferMock = Substitute.For<ITextBuffer>(); _textBufferMock.CurrentSnapshot.Returns(textSnapshotMock); _sut = new TaskCoverageManager(_timerMock, _documentProviderMock, _vsSolutionTestCoverageMock); var taskSchedulerMock = Substitute.For<ITaskSchedulerManager>(); SynchronizationContext.SetSynchronizationContext(new TestSyncContext()); var synchronizationTaskScheduler = TaskScheduler.FromCurrentSynchronizationContext(); taskSchedulerMock.FromSynchronizationContext().Returns(synchronizationTaskScheduler); TaskSchedulerManager.Current = taskSchedulerMock; }