Пример #1
0
        public void AddComputeNodeShouldAddSlot()
        {
            int            slotCount = RandomNumber.Between(8, 16);
            RepositoryRing ring      = new RepositoryRing(slotCount);

            ring.AddArc(new RepositoryService());
            Expect.AreEqual(slotCount + 1, ring.Arcs.Length);

            PrintSlots(ring);
        }
Пример #2
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();
        }