Ejemplo n.º 1
0
        public void Ctors_Passes_For_Valid_Params()
        {
            IHeap <int> instance = new ConcurrentMinHeap <int>(1);

            Assert.True(instance.IsEmpty);
            Assert.False(instance.IsFull);
            instance = new ConcurrentMaxHeap <int>(1);
            Assert.True(instance.IsEmpty);
            Assert.False(instance.IsFull);
        }
Ejemplo n.º 2
0
        public void ConcurrentMinHeap_Ctor_Throws_Error_For_Invalid_Capacity(int capacity)
        {
            var ex = Assert.Throws <DdnDfException>(() =>
            {
                var _ = new ConcurrentMinHeap <int>(capacity);
            });

            Assert.NotNull(ex);
            Assert.IsTrue(ex.ErrorCode.Equals(DdnDfErrorCode.ValueLessThanThreshold));
        }