예제 #1
0
        public CharacterFactoryTests()
        {
            // Provide a seed to the DiceRollService to get deterministic results for testing.
            var diceRollService = new DiceRollService(1);
            var hitDiceService  = new HitDiceService(diceRollService);

            _instance = new CharacterFactory(hitDiceService);
        }
예제 #2
0
        public ApplicationServiceTests()
        {
            // Create mocks of the dependencies
            _characterRepository = new Mock <ICharacterRepository>();
            _eventBus            = new Mock <IEventBus>();

            // Create the character factory - Provide a seed to the DiceRollService to get deterministic results for testing.
            var diceRollService  = new DiceRollService(1);
            var hitDiceService   = new HitDiceService(diceRollService);
            var characterFactory = new CharacterFactory(hitDiceService);

            _instance = new ApplicationService(_characterRepository.Object, _eventBus.Object, characterFactory);
        }
예제 #3
0
        public EventCallback <MouseEventArgs> SetStatus(BehaviourChartColumn behaviourChartColumn)
        {
            DiceRoll = DiceRollService.GetRoll();

            Enemy.Status = behaviourChartColumn.GetStatus(DiceRoll);

            string action = "";

            ActionsService.Actions.TryGetValue(Enemy.Status, out action);
            Enemy.Action = action;

            return(new EventCallback <MouseEventArgs>());
        }