comparison Agendas/trunk/src/Agendas.Tests/Cruds/EventoCrudMemoryTests.cs @ 137:2d1adbaf0373

CRUD de Patrocinador
author nelopauselli
date Thu, 28 Jul 2011 09:26:24 -0300
parents Agendas/trunk/src/Agendas.Tests/Cruds/EventoTests.cs@db4b1e2cae49
children 3639803112c6
comparison
equal deleted inserted replaced
136:462a78196d11 137:2d1adbaf0373
1 using System;
2 using AltNetHispano.Agendas.Domain;
3 using AltNetHispano.Agendas.Repositories.Memory;
4 using Moq;
5 using NUnit.Framework;
6
7 namespace AltNetHispano.Agendas.Tests.Cruds
8 {
9 [TestFixture]
10 public class EventoCrudMemoryTests
11 {
12 private EventoCrud _eventoCrud;
13
14 #region SetUp
15
16 [SetUp]
17 public void BorrarRepositorios()
18 {
19 EventoRepository.Clear();
20 PersonaRepository.Clear();
21 }
22
23 [SetUp]
24 public void SetearUsuario()
25 {
26 var seguridad = new Mock<ISeguridad>();
27 seguridad.Setup(s => s.GetUserName()).Returns("neluz");
28 IdentityContext.Init(seguridad.Object, new PersonaRepository());
29 }
30
31 [SetUp]
32 public void CreateCrud()
33 {
34 _eventoCrud = new EventoCrud(() => new EventoRepository(), ()=>new PersonaRepository(), () => new Mock<IDisposable>().Object);
35 }
36
37 #endregion
38
39 [Test]
40 public void Create()
41 {
42 _eventoCrud.Create();
43 }
44
45 [Test]
46 public void Read()
47 {
48 _eventoCrud.Read();
49 }
50
51 [Test]
52 public void Update()
53 {
54 _eventoCrud.Update();
55 }
56
57 [Test]
58 public void Delete()
59 {
60 _eventoCrud.Delete();
61 }
62
63 }
64 }