public void TestDontSendCommandTwice() { var lockstep = NSubstitute.Substitute.For <LockstepUpdate> (); var realCommandSender = new CommandSenderProcessorMock(); var aCommand = new CommandBase(); CommandQueue sender = new CommandQueueBase(lockstep, realCommandSender); sender.EnqueueCommand(aCommand); sender.SendCommands(); Assert.That(realCommandSender.commands.Contains(aCommand), Is.True); realCommandSender.Reset(); sender.SendCommands(); Assert.That(realCommandSender.commands.Contains(aCommand), Is.False); }
public void TestSendEmptyCommandIfLockstepAndNoCommands() { var lockstep = NSubstitute.Substitute.For <LockstepUpdate> (); var realCommandSender = new CommandSenderProcessorMock(); lockstep.GetNextLockstepFrame().Returns(5); CommandQueue sender = new CommandQueueBase(lockstep, realCommandSender); sender.SendCommands(); Assert.That(realCommandSender.emptyCalled, Is.True); }