public void SetContextShouldWorkWithoutException()
        {
            //Arrange
            var context = new FighterContext();

            //Act
            var exception = Record.Exception(() => context.SetStrategy(new Ryu()));

            //Assert
            exception.ShouldBeNull();
        }
        public void KenShouldDoCombo_WhenKLetterIsPressed(char comboKey)
        {
            //Arrange
            var fighterContext = new FighterContext();

            fighterContext.SetStrategy(new Ken());

            //Act
            var sut = fighterContext.DoCombo(comboKey);

            //Assert
            sut.ShouldContain("Hadoken");
        }
        public void RyuShouldDoCombo_WhenRLetterIsPressed(char comboKey)
        {
            //Arrange
            var fighterContext = new FighterContext();

            fighterContext.SetStrategy(new Ryu());

            //Act
            var sut = fighterContext.DoCombo(comboKey);

            //Assert
            sut.ShouldContain("Shoryuken");
        }
        public void DhalsimShouldDoCombo_WhenDLetterIsPressed(char comboKey)
        {
            //Arrange
            var fighterContext = new FighterContext();

            fighterContext.SetStrategy(new Dhalsim());

            //Act
            var sut = fighterContext.DoCombo(comboKey);

            //Assert
            sut.ShouldContain("Yoga Flame");
        }
Пример #5
0
        public FightersController(FighterContext fighterContext)
        {
            this.fighterContext = fighterContext;

            if (this.fighterContext.Fighters.Count() == 0)
            {
                this.fighterContext.Fighters.AddRange(
                    new Fighter("Marcelo", "Garcia"),
                    new Fighter("Roger", "Gracie"),
                    new Fighter("Oli", "Geddes")
                    );
                this.fighterContext.SaveChanges();
            }
        }
Пример #6
0
 public FighterController(FighterContext context)
 {
     this.context = context;
 }