Exemplo n.º 1
0
        public void test_transfer_when_target_level_will_exceed_capacity()
        {
            Bucket b1 = new Bucket(7);
            Bucket b2 = new Bucket(13);

            b1.Level = 5;
            b2.Level = 12;
            b1.Transfer(b2);

            Assert.AreEqual(4, b1.Level);
            Assert.AreEqual(b2.Capacity, b2.Level);
        }
Exemplo n.º 2
0
        public void test_transfer_when_source_can_be_transferred_completely()
        {
            Bucket b1 = new Bucket(7);
            Bucket b2 = new Bucket(13);

            b1.Level = 5;

            b1.Transfer(b2);

            Assert.AreEqual(0, b1.Level);
            Assert.AreEqual(5, b2.Level);
        }