public virtual void TestZeroAlloaction()
        {
            ReservationId reservationID = ReservationId.NewInstance(rand.NextLong(), rand.NextLong
                                                                        ());

            int[] alloc = new int[] {  };
            long  start = 0;
            ReservationDefinition rDef = CreateSimpleReservationDefinition(start, start + alloc
                                                                           .Length + 1, alloc.Length);
            IDictionary <ReservationInterval, ReservationRequest> allocations = new Dictionary
                                                                                <ReservationInterval, ReservationRequest>();
            ReservationAllocation rAllocation = new InMemoryReservationAllocation(reservationID
                                                                                  , rDef, user, planName, start, start + alloc.Length + 1, allocations, resCalc, minAlloc
                                                                                  );

            DoAssertions(rAllocation, reservationID, rDef, allocations, (int)start, alloc);
            NUnit.Framework.Assert.IsFalse(rAllocation.ContainsGangs());
        }
        public virtual void TestBlocks()
        {
            ReservationId reservationID = ReservationId.NewInstance(rand.NextLong(), rand.NextLong
                                                                        ());

            int[] alloc = new int[] { 10, 10, 10, 10, 10, 10 };
            int   start = 100;
            ReservationDefinition rDef = CreateSimpleReservationDefinition(start, start + alloc
                                                                           .Length + 1, alloc.Length);
            IDictionary <ReservationInterval, ReservationRequest> allocations = GenerateAllocation
                                                                                    (start, alloc, false, false);
            ReservationAllocation rAllocation = new InMemoryReservationAllocation(reservationID
                                                                                  , rDef, user, planName, start, start + alloc.Length + 1, allocations, resCalc, minAlloc
                                                                                  );

            DoAssertions(rAllocation, reservationID, rDef, allocations, start, alloc);
            NUnit.Framework.Assert.IsFalse(rAllocation.ContainsGangs());
            for (int i = 0; i < alloc.Length; i++)
            {
                NUnit.Framework.Assert.AreEqual(Org.Apache.Hadoop.Yarn.Api.Records.Resource.NewInstance
                                                    (1024 * (alloc[i]), (alloc[i])), rAllocation.GetResourcesAtTime(start + i));
            }
        }