Exemplo n.º 1
0
        public void CountChangedTest()
        {
            NewCollection <Place> places = new NewCollection <Place>("Тестовая коллекция");
            Journal j = new Journal("Тестовый журнал");

            places.CollectionCountChanged += new CollectionHandler(j.CollectionCountChanged);

            //Act
            places.Add(new Place());
            places.Remove(new Place());

            //Assert
            Assert.AreEqual(2, j.Count);
        }
Exemplo n.º 2
0
        public void deveRemoverChavePassada()
        {
            NewCollection collection = new NewCollection();

            collection.Add("ano", "1979");
            collection.Add("mes", "Agosto");
            collection.Add("dia", "02");
            collection.Remove("ano");
            IList <string> retorno = new List <string>();

            retorno = collection.Get("ano", 0, 2);

            IList <string> result = new List <string>();

            Assert.AreEqual(result.ToString(), retorno.ToString());
        }
Exemplo n.º 3
0
        static void chapter1()
        {
            NewCollection names = new NewCollection();

            names.Add("David");
            names.Add("Bernica");
            names.Add("Raymond");
            names.Add("Clayton");
            foreach (Object name in names)
            {
                Console.WriteLine(name);
            }
            String numOfNames = "Number of names: {0}";

            Console.WriteLine(numOfNames, names.Count());
            names.Remove("Raymond");
            Console.WriteLine(numOfNames, names.Count());
            names.Clear();
            Console.WriteLine(numOfNames, names.Count());
        }