Example #1
0
        public void RepositoryFileTest()
        {
            var target   = new FileRepository();
            var policia1 = Factoria <Policia> .Get();

            policia1.Id = 4;
            target.Create(policia1);
        }
Example #2
0
        public void TestMethod1()
        {
            var targetPersona = Factoria <Persona> .Get();

            var targetPolicia = Factoria <Policia> .Get();

            Assert.IsInstanceOfType(targetPersona, typeof(Persona));
            Assert.IsInstanceOfType(targetPolicia, typeof(Policia));
        }
Example #3
0
        public void TestDelete()
        {
            var target  = new MemoryRepository();
            var persona = Factoria <Persona> .Get();

            persona.Id = 1;
            target.Create(persona);
            var policia = Factoria <Policia> .Get();

            policia.Id = 2;

            target.Create(policia);
            target.Delete(c => c.Id == 2);
        }
Example #4
0
        public void TestUpdate()
        {
            var target  = new MemoryRepository();
            var persona = Factoria <Persona> .Get();

            persona.Id = 1;
            target.Create(persona);
            var policia = Factoria <Policia> .Get();

            policia.Id = 2;
            target.Create(policia);
            policia.NumeroPlaca = 1234;

            var result = target.Update(policia);
        }
Example #5
0
        public void TestFind()
        {
            var target  = new MemoryRepository();
            var persona = Factoria <Persona> .Get();

            persona.Id = 1;
            target.Create(persona);
            var policia = Factoria <Policia> .Get();

            policia.Id = 2;
            target.Create(policia);
            var result = target.Find(c => c.Id == 2);

            Assert.AreEqual(2, result.Id);
        }