public void AllInitiativesSetIfAllNpcs()
        {
            participants = new[] { npc };
            var dice = DiceFactory.Create(new Random());

            setInitiativesViewModel = new SetInitiativesViewModel(participants, dice);

            Assert.That(setInitiativesViewModel.AllInitiativesSet, Is.True);
        }
        public void DiceSetNpcInitiatives()
        {
            var mockDice = new Mock<IDice>();
            mockDice.Setup(d => d.d10(It.IsAny<Int32>(), It.IsAny<Int32>())).Returns(5);

            setInitiativesViewModel = new SetInitiativesViewModel(participants, mockDice.Object);

            mockDice.Verify(d => d.d10(1, 0), Times.Once());
            Assert.That(npc.Initiative, Is.EqualTo(5));
        }
        public void Setup()
        {
            var participant = new ActionParticipant("name", isNpc: false);
            var participants = new[] { participant };
            var dice = DiceFactory.Create(new Random());

            setInitiativesViewModel = new SetInitiativesViewModel(participants, dice);
            participant.Initiative = 9;

            incrementInitiativeCommand = new IncrementInitiativeCommand(setInitiativesViewModel);
        }
 public IncrementInitiativeCommand(SetInitiativesViewModel setParticipantInitiativesViewModel)
 {
     this.setParticipantInitiativesViewModel = setParticipantInitiativesViewModel;
 }
 public SetInitiativesWindow(IEnumerable<ActionParticipant> participants, IDice dice)
 {
     InitializeComponent();
     setParticipantInitiativesViewModel = new SetInitiativesViewModel(participants, dice);
     DataContext = setParticipantInitiativesViewModel;
 }
        public void Setup()
        {
            npc = new ActionParticipant("3", isNpc: true);

            participants = new[]
            {
                new ActionParticipant("1", isNpc: false),
                new ActionParticipant("2", isNpc: false),
                npc
            };

            var participant = participants.First();
            participant.Initiative = 9;

            var dice = DiceFactory.Create(new Random());

            setInitiativesViewModel = new SetInitiativesViewModel(participants, dice);
        }
 public GetNextInitiativeCommand(SetInitiativesViewModel setParticipantInitiativesViewModel)
 {
     this.setParticipantInitiativesViewModel = setParticipantInitiativesViewModel;
 }