Ejemplo n.º 1
0
        public void Erase_ShouldDoNothing_When_KeyDoesNotExist()
        {
            var sidePacket = new SidePacket();

            sidePacket.Erase("value");

            Assert.AreEqual(sidePacket.size, 0);
        }
Ejemplo n.º 2
0
        public void Erase_ShouldEraseKey_When_KeyExists()
        {
            var sidePacket = new SidePacket();

            sidePacket.Emplace("value", new BoolPacket(true));
            Assert.AreEqual(sidePacket.size, 1);

            sidePacket.Erase("value");
            Assert.AreEqual(sidePacket.size, 0);
        }
Ejemplo n.º 3
0
        public void Erase_ShouldDoNothing_When_KeyDoesNotExist()
        {
            using (var sidePacket = new SidePacket())
            {
                var count = sidePacket.Erase("value");

                Assert.AreEqual(0, sidePacket.size);
                Assert.AreEqual(0, count);
            }
        }
Ejemplo n.º 4
0
        public void Erase_ShouldEraseKey_When_KeyExists()
        {
            using (var sidePacket = new SidePacket())
            {
                sidePacket.Emplace("value", new BoolPacket(true));
                Assert.AreEqual(1, sidePacket.size);

                var count = sidePacket.Erase("value");
                Assert.AreEqual(0, sidePacket.size);
                Assert.AreEqual(1, count);
            }
        }