示例#1
0
 public void CountOfKey()
 {
     map.Add(Key1, Value1);
     Assert.That(map.Count(Key1), Is.EqualTo(1));
     map.Add(Key1, Value2);
     Assert.That(map.Count(Key1), Is.EqualTo(2));
 }
        public Holding Add(string classification, int branchId)
        {
            var material = ClassificationService.Retrieve(classification);

            if (material == null)
            {
                throw new LibraryException("Invalid classification");
            }
            var copyNumber = Holdings.Count(classification) + 1;
            var holding    = new Holding(classification, copyNumber, branchId)
            {
                CheckoutPolicy = material.CheckoutPolicy
            };

            Holdings.Add(classification, holding);
            return(holding);
        }
示例#3
0
 public void IncrementsCountWhenKeyAdded()
 {
     map.Add(Key1, Value1);
     Assert.That(map.Count(Key1), Is.EqualTo(1));
 }