Exemple #1
0
 public void Add(TValue item)
 {
     if ((validOperations & Operations.Add) == Operations.Add)
     {
         ManagedCollection.Add(item);
         OnModified();
     }
     else
     {
         throw new NotSupportedException($"A process attempted to add an element to a {NameOf<Conservator<TValue>>()} " +
                                         $"whose list of supported operations does not include " +
                                         $"{nameof(Operations)}.{Operations.CopyTo}. ");
     }
 }
        public void Add()
        {
            var result = itemCollection.Add(obj);

            result.Should().NotBeNull();
        }