Exemplo n.º 1
0
        public void Adding_an_item_to_a_readonly_thing_is_ignored()
        {
            var x = new ThePlayers(true);

            x.Add(42, "");
            Assert.AreEqual(0, x.count());
        }
Exemplo n.º 2
0
        public void Removing_an_item_reduces_count_but_not_size()
        {
            //arrange
            var x = new ThePlayers(false);

            x.Add(42, "a");
            x.Add(43, "b");
            x.Add(44, "c");
            Assert.AreEqual(3, x.count());
            Assert.AreEqual(5, x.size());
            //act
            x.Remove(43);
            //assert
            Assert.AreEqual(2, x.count());
            Assert.AreEqual(5, x.size());
        }
Exemplo n.º 3
0
        public void Cant_get_an_item_with_the_wrong_key()
        {
            var x = new ThePlayers(false);

            x.Add(42, "");
            x.get(69);
        }
Exemplo n.º 4
0
        public void Can_get_an_item_after_adding_an_item()
        {
            var x = new ThePlayers(false);

            x.Add(42, "Bob");
            Assert.AreEqual("Bob", x.get(42));
        }
Exemplo n.º 5
0
        public void Adding_an_item_increases_size_by_five()
        {
            var x       = new ThePlayers(false);
            var oldSize = x.size();

            x.Add(42, "");
            Assert.AreEqual(oldSize + 5, x.size());
        }
Exemplo n.º 6
0
        public void Adding_an_item_increases_count_by_one()
        {
            var x        = new ThePlayers(false);
            var oldCount = x.count();

            x.Add(42, "");
            Assert.AreEqual(oldCount + 1, x.count());
        }
Exemplo n.º 7
0
 private void addAndAssertSize(ThePlayers it, int key, string value, int expectedSize)
 {
     it.Add(key, value);
     Assert.AreEqual(expectedSize, it.size());
 }