Beispiel #1
0
        public void SetSlotCountShouldSetSlotLength()
        {
            RepositoryRing ring = new RepositoryRing();

            ring.SetArcCount(2);
            Expect.AreEqual(2, ring.Arcs.Length);
        }
Beispiel #2
0
        public void SlotShouldMakeFullCircleAfterInit13()
        {
            RepositoryRing ring      = new RepositoryRing();
            int            slotCount = 13; //RandomNumber.Between(8, 16);

            ring.SetArcCount(slotCount);
            PrintSlots(ring);

            Expect.AreEqual(slotCount, ring.Arcs.Length);
            double fullCircle = 360;
            double endAngle   = ring.Arcs[ring.Arcs.Length - 1].EndAngle;

            Expect.AreEqual(fullCircle, endAngle);
        }
Beispiel #3
0
        public void SetSlotCountShouldKeepExistingSlots()
        {
            Before();
            RepositoryRing ring = new RepositoryRing();

            RepositoryService node = new RepositoryService();

            ring.AddArc(node);
            Expect.AreEqual(1, ring.Arcs.Length);

            RepositoryService check = (RepositoryService)ring.Arcs[0].GetServiceProvider();

            Expect.IsNotNull(check);

            ring.SetArcCount(3);

            Expect.AreEqual(3, ring.Arcs.Length);
            check = (RepositoryService)ring.Arcs[0].GetServiceProvider();

            PrintSlots(ring);
            After();
        }