예제 #1
0
        public void ShouldDeleteMonsterTest()
        {
            Monster m = MonsterDB.GetMonsters().ElementAt(1);

            MonsterDB.DeleteMonster(m);
            Assert.That(MonsterDB.GetMonsters(), Has.None.EqualTo(m));
        }
예제 #2
0
        public void ShouldCreateMonster()
        {
            Monster m = new Monster
            {
                MonsterId = MonsterDB.GetNextMonsterId(),
                Alive     = true,
                Attack    = 1,
                HP        = 1,
                Name      = "BenMonster"
            };

            int amountInDb = MonsterDB.GetMonsters().Count;

            MonsterDB.InsertMonster(m);

            int amountInDbAfterInsert = MonsterDB.GetMonsters().Count;

            Assert.That(amountInDb + 1, Is.EqualTo(amountInDbAfterInsert));
        }
        public MonsterWindow()
        {
            InitializeComponent();
            monsterList = MonsterDB.GetMonsters();

            foreach (Monster m in monsterList)
            {
                monsterCollection.Add(m);
            }

            monsterDataGrid.DataContext           = monsterCollection;
            monsterDataGrid.ColumnWidth           = 70;
            monsterDataGrid.CanUserResizeColumns  = true;
            monsterDataGrid.CanUserAddRows        = false;
            monsterDataGrid.CanUserSortColumns    = false;
            monsterDataGrid.CanUserDeleteRows     = false;
            monsterDataGrid.CanUserReorderColumns = false;
            monsterDataGrid.IsReadOnly            = true;
        }